summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-11-18 10:50:07 +0200
committerQt by Nokia <qt-info@nokia.com>2011-11-23 08:36:14 +0100
commit1d3cfdbfa18585901c214a035d270baacc61048e (patch)
treef1e4ec035e9adae782491cf8d92d59c19e0d11b1 /src/sql/kernel
parentd1e7294cd2c99a0de5bb838cc6acd106ec52f76e (diff)
SQLite support only one statement at a time
SQLite driver support only one statement at a time. This fix makes the exec and prepare call failed if more than one statements are given. This is bug fix for QTBUG-21884. Also the behaviour is documented in the API specification. Task-number: QTBUG-21884 Change-Id: If1e25a0dd9f9ee38961ef478fc7909f6b05e360a Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Diffstat (limited to 'src/sql/kernel')
-rw-r--r--src/sql/kernel/qsqlquery.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index 4eb46f1790..fda6301bc0 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -338,6 +338,9 @@ bool QSqlQuery::isNull(int field) const
Note that the last error for this query is reset when exec() is
called.
+ For SQLite, the query string can contain only one statement at a time.
+ If more than one statements is give, the function returns false.
+
Example:
\snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 34
@@ -887,6 +890,9 @@ void QSqlQuery::clear()
syntactically wrong query succeeds, but every consecutive exec()
will fail.
+ For SQLite, the query string can contain only one statement at a time.
+ If more than one statements are give, the function returns false.
+
Example:
\snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 9