summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2019-09-03 15:29:55 +0200
committerTamás Bunth <btomi96@gmail.com>2019-09-03 19:59:17 +0200
commit91a97c5e0b7b760ec0b46ad38b28ec1419c7d48f (patch)
tree567f9abcd00bacb825490abd66ab29691c6e0e8c
parentd783017c1ccb4e62e99f26b42250ac4e15780cff (diff)
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 <btomi96@gmail.com>
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_connection.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 193cc1c6ffe2..a9d4438dfa97 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" });
}