PGSQL: NoQuestionParams

git-svn-id: svn://ultimatepp.org/upp/trunk@13736 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-12-05 18:10:15 +00:00
parent c9930e79c8
commit 3706baffdb
2 changed files with 3 additions and 1 deletions

View file

@ -512,7 +512,7 @@ bool PostgreSQLConnection::Execute()
if(*s == '\'' || *s == '\"')
s = PostgreSQLReadString(s, query);
else {
if(*s == '?') {
if(*s == '?' && !noquestionparams) {
if(pi >= param.GetCount()) {
session.SetError("Invalid number of parameters", statement);
return false;

View file

@ -59,6 +59,7 @@ private:
String conns;
bool keepalive;
bool hex_blobs;
bool noquestionparams = false;
VectorMap<String, String> pkache;
@ -86,6 +87,7 @@ public:
void SetCharset(byte chrset) { charset = chrset; }
void KeepAlive(bool b = true) { keepalive = b; DoKeepAlive(); }
void NoQuestionParams(bool b = true) { noquestionparams = b; }
String GetUser() { return PQuser(conn); }
operator PGconn * () { return conn; }