summaryrefslogtreecommitdiffstats
path: root/connectivity/source
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-09-12 18:08:49 +0200
committerTamás Bunth <btomi96@gmail.com>2018-09-13 20:36:31 +0200
commitf4393330b2bbebc7290b72ad2f5b81d26244ac64 (patch)
tree493fd8334bc536de6d524d24af9af2d743027924 /connectivity/source
parentmysqlc: prep stmt: check if cursor out of range (diff)
downloadcore-f4393330b2bbebc7290b72ad2f5b81d26244ac64.tar.gz
core-f4393330b2bbebc7290b72ad2f5b81d26244ac64.zip
mysqlc: fix XPreparedStatement::setTimestamp
Change-Id: Ia0d0290517fdebd9a7700d52fa0e86de0e958b2d Reviewed-on: https://gerrit.libreoffice.org/60406 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index 1aa1a337b3b7..b4a2844ce6f4 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -298,6 +298,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi
checkParameterIndex(parameter);
MYSQL_TIME my_time;
+ memset(&my_time, 0, sizeof(MYSQL_TIME));
my_time.hour = aVal.Hours;
my_time.minute = aVal.Minutes;
@@ -307,7 +308,7 @@ void SAL_CALL OPreparedStatement::setTimestamp(sal_Int32 parameter, const DateTi
my_time.day = aVal.Day;
const sal_Int32 nIndex = parameter - 1;
- m_binds[nIndex].buffer_type = MYSQL_TYPE_TIME;
+ m_binds[nIndex].buffer_type = MYSQL_TYPE_DATETIME;
mysqlc_sdbc_driver::resetSqlVar(&m_binds[nIndex].buffer, &my_time, MYSQL_TYPE_DATETIME);
m_bindMetas[nIndex].is_null = 0;
}