fix binding of bool type in mysql driver
authorMark Brand <mabrand@mabrand.nl>
Tue, 30 Oct 2012 09:51:25 +0000 (10:51 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 23:37:42 +0000 (00:37 +0100)
commit593b8f7f0b35ddc424d8ccbd5df11fcf2442858e
tree881067d0f230ff94da8d819e50e81a56788ee05a
parentb009ed0cc87a3b16e5c4554f07875177366d1dba
fix binding of bool type in mysql driver

MYSQL_TYPE_TINY should be used for binding bool input value.
MYSQL_TYPE_LONG might be too big for bool, resulting in bools being
saved in the database as int 127. The problem was not specific to
the vendor's BOOL column type.

http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html
http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statement-type-codes.html

Added generic autotest to make sure that binding bool works. All
drivers should pass this test.

Task-number: QTBUG-27763
Change-Id: I4e69f8e3b32fffb702ec9fa8a80ff5c50dea954b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
src/sql/drivers/mysql/qsql_mysql.cpp
tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp