SQL: Change in QSqlResultPrivate::positionalToNamedBinding()
authorCaroline Chao <caroline.chao@digia.com>
Fri, 16 Nov 2012 14:41:16 +0000 (15:41 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 10 Dec 2012 20:23:35 +0000 (21:23 +0100)
commita5bca210965fb31e998477c15fb0b1f41ee1ca18
tree0e96cffcb90aada749ff22455ee7502a58b805f4
parent2a9144541577d24ca010fe6a219f514a2cf208dc
SQL: Change in QSqlResultPrivate::positionalToNamedBinding()

With the change cff46983a, prepared queries can now store a
named paramater to be used more than once.

When using ?, thus positional binding, there is no named
parameter, thus there is no need to store it.

When prepare is called from a query with ?, it currently
causes an error when the feature QSqlDriver::NamedPlaceholders
is true. Because holders values are called while holders is
actually empty.

QSqlDriver::NamedPlaceholders is true for QOCI plugin only
but the problem is independant of the plugin used.

Adding a test case with a test driver to make the test runnable
without Oracle installed.

Change-Id: I6d7491f7e09a7b62d2d4d216b40fedd67e927e27
Reviewed-by: Matt Newell <newellm@blur.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
src/sql/kernel/qsqlresult.cpp
tests/auto/sql/kernel/kernel.pro
tests/auto/sql/kernel/qsqlresult/qsqlresult.pro [new file with mode: 0644]
tests/auto/sql/kernel/qsqlresult/testsqldriver.h [new file with mode: 0644]
tests/auto/sql/kernel/qsqlresult/tst_qsqlresult.cpp [new file with mode: 0644]