summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-08-08 23:14:13 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-13 16:37:27 +0000
commite030aab963af12404c9c1d2ef0f53d3905dd590a (patch)
treef3f2a797650711945599cb18fdcc67ba40be7f53 /src
parent06e2919531b3c1207c107061780f09cf341b564c (diff)
Interbase: Handle EXECUTE BLOCK statements correctly
Since an EXECUTE BLOCK statement can have a mix of ? and :var syntax then a special case for this needs to be added so that it does not try to convert the :var parts into positional placeholders as they need to kept as-is when preparing such a statement. Fixes: QTBUG-83152 Change-Id: Iff891207ad6dea1681a1b3a335acbbbb668b465d Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 65afcef2173cabe297778d19dda3198595820cfa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/sql/kernel/qsqlresult.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 69c9dcbac9..9a580e8bae 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -126,6 +126,13 @@ QString QSqlResultPrivate::positionalToNamedBinding(const QString &query) const
QString QSqlResultPrivate::namedToPositionalBinding(const QString &query)
{
+ // In the Interbase case if it is an EXECUTE BLOCK then it is up to the
+ // caller to make sure that it is not using named bindings for the wrong
+ // parts of the query since Interbase uses them literally
+ if (sqldriver->dbmsType() == QSqlDriver::Interbase &&
+ query.trimmed().startsWith(QLatin1String("EXECUTE BLOCK"), Qt::CaseInsensitive))
+ return query;
+
int n = query.size();
QString result;