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

New commits:
commit 8483f48aa90d9c487320af855e333c1e6c9453c2
Author:     Tamas Bunth <tamas.bu...@collabora.co.uk>
AuthorDate: Tue Sep 3 15:29:55 2019 +0200
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Wed Sep 4 12:19:00 2019 +0200

    tdf#127093 mysqlc: set NO_AUTO_VALUE_ON_ZERO
    
    Without setting this sql_mode, NULL or 0 inserted to an auto-incremented 
column
    of a prepared statement would cause that to be auto generated.
    
    Setting NO_AUTO_VALUE_ON_ZERO allows us to copy/paste auto-incremented
    columns which may contain zero values as well.
    
    Change-Id: I9602746371c75c82c99ff63240025e8cfb03776a
    Reviewed-on: https://gerrit.libreoffice.org/78560
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btom...@gmail.com>
    (cherry picked from commit 91a97c5e0b7b760ec0b46ad38b28ec1419c7d48f)
    Reviewed-on: https://gerrit.libreoffice.org/78582
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 74613a733a3a..4ad4d2c6f29b 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
@@ -196,7 +196,8 @@ void OConnection::construct(const OUString& url, const 
Sequence<PropertyValue>&
                            *this, OUString(), 0, Any());
     }
 
-    lcl_executeUpdate(&m_mysql, OString{ "SET session sql_mode='ANSI_QUOTES'" 
});
+    lcl_executeUpdate(&m_mysql,
+                      OString{ "SET session 
sql_mode='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO'" });
     lcl_executeUpdate(&m_mysql, OString{ "SET NAMES utf8" });
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to