summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-05-21 14:27:27 +1000
committerBill King <bill.king@nokia.com>2009-05-21 14:29:01 +1000
commit7383e03bfd473f6e79718f3da7d504977a677541 (patch)
tree9935f00930da3275a1584425d0998fc95381e5f8
parent2cb36aed053147ecc91f72ed76074962a66b76f0 (diff)
Fixes one of the fields of mysql bound params not initialised.
Found by valgrind, value isn't set but is used, fixes this. Reviewed-by: Justin McPherson
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index 51fc30605b..53645c9b8d 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -927,6 +927,7 @@ bool QMYSQLResult::exec()
nullVector[i] = static_cast<my_bool>(val.isNull());
currBind->is_null = &nullVector[i];
currBind->length = 0;
+ currBind->is_unsigned = 0;
switch (val.type()) {
case QVariant::ByteArray:
@@ -973,7 +974,6 @@ bool QMYSQLResult::exec()
currBind->buffer_type = MYSQL_TYPE_DOUBLE;
currBind->buffer = data;
currBind->buffer_length = sizeof(double);
- currBind->is_unsigned = 0;
break;
case QVariant::LongLong:
case QVariant::ULongLong:
@@ -989,7 +989,6 @@ bool QMYSQLResult::exec()
currBind->buffer_type = MYSQL_TYPE_STRING;
currBind->buffer = const_cast<char *>(ba.constData());
currBind->buffer_length = ba.length();
- currBind->is_unsigned = 0;
break; }
}
}