[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - connectivity/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 11:07:25 UTC 2018


 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8bd58609f49179dd817b3833b7f0471616a9cf2f
Author:     Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Wed Sep 12 18:08:49 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Sep 14 13:06:58 2018 +0200

    mysqlc: fix XPreparedStatement::setTimestamp
    
    Change-Id: Ia0d0290517fdebd9a7700d52fa0e86de0e958b2d
    Reviewed-on: https://gerrit.libreoffice.org/60406
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/60462
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index d26eacb7ba7c..e9bcc1f76c37 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -301,6 +301,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;
@@ -310,7 +311,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;
 }


More information about the Libreoffice-commits mailing list