From 65afcef2173cabe297778d19dda3198595820cfa Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Sat, 8 Aug 2020 23:14:13 +0200 Subject: 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. Pick-to: 5.15 Fixes: QTBUG-83152 Change-Id: Iff891207ad6dea1681a1b3a335acbbbb668b465d Reviewed-by: Christian Ehrlicher --- src/sql/kernel/qsqlresult.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sql') diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 24ca1ffeda..5b440d704b 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -112,6 +112,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; -- cgit v1.2.3