#1 2020-10-28 00:47:47

profh
Member
Registered: 2010-07-02
Posts: 159

about TJSONWriter...

hi,ab:

    1. i call as follow under win10 with delphi10.4, it worked correct at all .
       

rtnjson := mySQLRestServerDB.DB.ExecuteJSON(asql,true,@rc);

    2. the same call above under win10 with lazarus1.9, it worked correct when i fetch less than about 100 records.
    3. the same call above under win10 with lazarus1.9, it worked discorrect when i fetch more than about 100 or 500 records. the issue in the return json is about like that:

        ..."recommand":0null,"recommand_unit":...
    or
        ...,"sex":1,"subjection":500111,"0000","rootc":"500100",...
    or other unusual pattern
     
    4. i debugged in TSQLRequest.FieldsToJSON, everything in "Request" is correct.

thank you very much!

Last edited by profh (2020-10-28 01:03:50)

Offline

#2 2020-10-28 06:54:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: about TJSONWriter...

Are you sure you used the latest version of mORMot?
Current revision is 1.18.6152.

Offline

#3 2020-10-28 07:15:25

profh
Member
Registered: 2010-07-02
Posts: 159

Re: about TJSONWriter...

i used 1.18.6150, and i will try 1.18.6152.

Offline

#4 2020-10-28 07:38:53

profh
Member
Registered: 2010-07-02
Posts: 159

Re: about TJSONWriter...

i just tried 1.18.6152, the issue remained.

Offline

#5 2020-10-28 07:58:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: about TJSONWriter...

Which SynDB* unit do you use?

I am not able to reproduce here.
Could you try to debug a bit more on your side?

Offline

#6 2020-10-28 09:40:56

profh
Member
Registered: 2010-07-02
Posts: 159

Re: about TJSONWriter...

i used SQLite3 version 3.33.0 without dll.

in TSQLRequest.FieldsToJSON procedure, sqlite3.column_int64(Request,i)   and  sqlite3.column_text(Request,i) can get correct values,

procedure TSQLRequest.FieldsToJSON(WR: TJSONWriter; DoNotFetchBlobs: boolean);
var i: integer;
begin
......
      SQLITE_NULL:
        WR.AddShort('null'); // returned also for ""
      SQLITE_INTEGER:
        WR.Add(sqlite3.column_int64(Request,i));                     <----perhaps Add? each sqlite3.column_int64(Request,i) is very correct
      SQLITE_FLOAT:
        WR.AddDouble(sqlite3.column_double(Request,i));
      SQLITE_TEXT: begin
        WR.Add('"');
        WR.AddJSONEscape(sqlite3.column_text(Request,i),0);     <----perhaps AddJSONEscape? each sqlite3.column_text(Request,i) is very correct
        WR.Add('"');
       end;
    end; // case ColTypes[]
    WR.Add(',');
  end;
......
end;

Offline

#7 2020-10-28 15:19:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: about TJSONWriter...

Check further inside AddJsonEscape() for instance.

Offline

Board footer

Powered by FluxBB