From 6c31098eb0195c024f6eaf468ac918cc7ce37cf3 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 17 Sep 2017 19:32:57 +0200 Subject: Pass the correct types and sizes to the StmtBind functions Fixes #1531 (and other similar issues) Signed-off-by: Haru --- src/common/sql.c | 8 ++++++++ src/common/sql.h | 2 ++ 2 files changed, 10 insertions(+) (limited to 'src/common') diff --git a/src/common/sql.c b/src/common/sql.c index 235be3aca..a4b413e64 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -473,6 +473,14 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type, case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int64)); buffer_len = sizeof(int64); break; + case SQLDT_BOOL: + bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(bool)); + buffer_len = sizeof(bool); + break; + case SQLDT_TIME: + bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(time_t)); + buffer_len = sizeof(time_t); + break; // floating point case SQLDT_FLOAT: bind->buffer_type = MYSQL_TYPE_FLOAT; buffer_len = 4; diff --git a/src/common/sql.h b/src/common/sql.h index 4d9a12cc1..11127c66c 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -59,6 +59,8 @@ enum SqlDataType { SQLDT_UINT, SQLDT_ULONG, SQLDT_ULONGLONG, + SQLDT_BOOL, + SQLDT_TIME, // floating point SQLDT_FLOAT, SQLDT_DOUBLE, -- cgit v1.2.3-60-g2f50