#1 Yesterday 11:46:09

tfopc
Member
Registered: 2024-01-08
Posts: 26

Bug in db.core.SelectInClause (with TID) if Length(Values)=1

Hi ab,

found a bug in db.core
Input: SelectInClause('id'{PropName},[1]{Values: array of TID},''{suffix},10{ValuesInlinedMax}) called from
TOrm.FillPrepare(...)

if n = 1 then
problem: Missing CancelLastComma(')') or
or Remove the comma in ...
AddDirect(')', ':', ',')

result SQL-where, without fix:  'id=:(1):,'

Thanks,
Tobias

Offline

#2 Yesterday 12:06:25

tfopc
Member
Registered: 2024-01-08
Posts: 26

Re: Bug in db.core.SelectInClause (with TID) if Length(Values)=1

Problem comes from the commit
Commit b323f9a from last week / all: use new overloaded TTextWriter.AddDirect whenever possible

@@ -2548,12 +2548,12 @@ function SelectInClause(const PropName: RawUtf8; const Values: array of TID;

I didn't find any other "AddDirect" mistakes when I skimmed through it.

Offline

#3 Yesterday 17:28:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,007
Website

Re: Bug in db.core.SelectInClause (with TID) if Length(Values)=1

Offline

Board footer

Powered by FluxBB