#1 Re: mORMot 1 » Bug in TSQLRestServerStaticInMemory.EngineList » 2013-12-17 07:40:14

and i fixed with

if IsZero(Fields) and (not WithID) then

#2 mORMot 1 » Bug in TSQLRestServerStaticInMemory.EngineList » 2013-12-17 06:37:56

pkvov
Replies: 2

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

Board footer

Powered by FluxBB