summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-09-17 19:32:57 +0200
committerHaru <haru@dotalux.com>2017-11-18 19:25:36 +0100
commit6c31098eb0195c024f6eaf468ac918cc7ce37cf3 (patch)
treea38b4ecc291fe37a97f6f854ae241f32495711cb /src/common
parenta63c82c8bd29fd829a5d8cfba7d02d11cf4634c5 (diff)
downloadhercules-6c31098eb0195c024f6eaf468ac918cc7ce37cf3.tar.gz
hercules-6c31098eb0195c024f6eaf468ac918cc7ce37cf3.tar.bz2
hercules-6c31098eb0195c024f6eaf468ac918cc7ce37cf3.tar.xz
hercules-6c31098eb0195c024f6eaf468ac918cc7ce37cf3.zip
Pass the correct types and sizes to the StmtBind functions
Fixes #1531 (and other similar issues) Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/sql.c8
-rw-r--r--src/common/sql.h2
2 files changed, 10 insertions, 0 deletions
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,