PGSQL: Escaping ? as ??

git-svn-id: svn://ultimatepp.org/upp/trunk@13737 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-12-05 18:15:00 +00:00
parent 3706baffdb
commit 24628d4632

View file

@ -513,11 +513,17 @@ bool PostgreSQLConnection::Execute()
s = PostgreSQLReadString(s, query);
else {
if(*s == '?' && !noquestionparams) {
if(pi >= param.GetCount()) {
session.SetError("Invalid number of parameters", statement);
return false;
if(s[1] == '?') {
query.Cat('?');
s++;
}
else {
if(pi >= param.GetCount()) {
session.SetError("Invalid number of parameters", statement);
return false;
}
query.Cat(param[pi++]);
}
query.Cat(param[pi++]);
}
else
query.Cat(*s);