#1 2020-03-23 14:25:55

Márcio Baroni
Member
From: Brasil
Registered: 2015-10-07
Posts: 34

Modification TJSONObjectDecoder.EncodeAsSQLPrepared broke my system

@ab commit https://github.com/synopse/mORMot/commi … b9d01eb74b "small comments / error message enhancement - no functional change"

error: EORMException with message 'Invalid EncodeAsSQLPrepared(1)'

-      if FieldCount=0 then
-        raise EORMException.Create('Invalid EncodeAsSQLPrepared(0)');
+      if FieldCount<2 then
+        raise EORMException.CreateUTF8('Invalid EncodeAsSQLPrepared(%)',[FieldCount]);

it doesn't work with that anymore if you only have 1 column:

   update table set col1 = 'test' where id = 1;

Offline

#2 2020-03-23 14:49:30

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

Re: Modification TJSONObjectDecoder.EncodeAsSQLPrepared broke my system

You are right!
I forgot that ID was not part of FieldCount.

Reverted by https://synopse.info/fossil/info/b4af70dcdc

Offline

#3 2020-03-23 16:49:04

Márcio Baroni
Member
From: Brasil
Registered: 2015-10-07
Posts: 34

Re: Modification TJSONObjectDecoder.EncodeAsSQLPrepared broke my system

thanks

Offline

Board footer

Powered by FluxBB