#1 2013-12-17 06:37:56

pkvov
Member
Registered: 2013-12-17
Posts: 2

Bug in TSQLRestServerStaticInMemory.EngineList

i used TSQLRestServerFullMemory

and add a TSynValidateUniqueField in my Model

then i find the validation didn't work at all.

trace the code in TSQLRestServerStaticInMemory.EngineList

SQL generate by the validation   'SELECT RowID FROM PaymentCartItem WHERE bill_code=:(''CD-20131213-2''): LIMIT 1;'

        if IsZero(Fields) then
          if IsSelectCountWhere and (FoundLimit=0) and (FoundOffset=0) then
            // was "SELECT Count(*) FROM TableName WHERE ..."
            SetCount(FindWhereEqual(WhereField,WhereValue,DoNothingEvent,nil,0,0)) else
            // invalid "SELECT FROM Table" ?
            exit else begin                                                                                                                      /********  it will treat the SQL as invalid and exit with no excute **********/           
          // save rows as JSON, with appropriate search according to Where* arguments
          MS := TRawByteStringStream.Create;
          try
            ResCount := GetJSONValues(MS,ForceAJAX or (not NoAJAXJSON),
              withID,Fields,WhereField,WhereValue,FoundLimit,FoundOffset);
            result := MS.DataString;
          finally
            MS.Free;
          end;

see if someone has the same problem

Offline

#2 2013-12-17 07:40:14

pkvov
Member
Registered: 2013-12-17
Posts: 2

Re: Bug in TSQLRestServerStaticInMemory.EngineList

and i fixed with

if IsZero(Fields) and (not WithID) then

Offline

#3 2013-12-18 09:20:40

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

Re: Bug in TSQLRestServerStaticInMemory.EngineList

We have now fixed issue in TSQLRestServerStaticInMemory.EngineList() when only ID is defined.
See http://synopse.info/fossil/info/9faef05930

Thanks a lot for your feedback!

Offline

Board footer

Powered by FluxBB