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>
(cherry picked from commit 91a97c5e0b7b760ec0b46ad38b28ec1419c7d48f)
Reviewed-on: https://gerrit.libreoffice.org/78582
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 74613a7..4ad4d2c 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" });
}