]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth mysql: disable automatic charset detection 9714/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 12 Nov 2020 13:55:22 +0000 (14:55 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Thu, 12 Nov 2020 14:07:38 +0000 (15:07 +0100)
.github/actions/spell-check/expect.txt
docs/upgrading.rst
modules/gmysqlbackend/smysql.cc
regression-tests/tests/8bit-txt-unescaped/skip.gmysql [new file with mode: 0644]

index 9d0bcaeab0519f175f51855edc93530489d95076..210546d26391dc51ec0765b0aef3e35ef41eb1bc 100644 (file)
@@ -114,6 +114,7 @@ autocomplete
 autoconf
 autodetect
 autodetecting
+autodetection
 autodoc
 autofilling
 autogenerated
index 9d2e66569c8925879c29390971422de41b298d40..30113df9b3c33b35bf40b075392f904edd7bca21 100644 (file)
@@ -11,6 +11,26 @@ upgrade notes if your version is older than 3.4.2.
 4.3.x to 4.4.0
 --------------
 
+MySQL character set detection
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Before 4.4.0, the gmysql backend told the MySQL (or MariaDB) client libraries to automatically detect the client character set and collation, based on the environment locale.
+(Look for 'autodetect' in https://dev.mysql.com/doc/refman/5.7/en/charset-connection.html to know more).
+On some systems, this autodetection makes choices that are incompatible with MySQL Server 8 defaults.
+On all systems, this autodetection can make choices that vary depending on how PowerDNS is started.
+In other words, the autodetection provides unpredictable results.
+
+In 4.4.0, the autodetection has been removed.
+The MySQL/MariaDB client lib will now use its default settings, unless overridden in ``my.cnf``, for example::
+
+  [client]
+  default-character-set = latin1
+
+If you have trouble connecting to your database with 4.4.0 or up, you can override the character set in ``my.cnf``.
+
+Before upgrading, please check your database for any non-ASCII content.
+The interpretation of the non-ASCII bytes in those fields might change because of a different charset suddenly being used.
+
 Record type changes on secondaries
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index d5e81995293fdf397820198ba317488377c84b00..501c4432c6c4e5e3ae6e70f5c44dbf11d4c75e2d 100644 (file)
@@ -465,10 +465,6 @@ void SMySQL::connect()
     }
 #endif
 
-#if MYSQL_VERSION_ID >= 50500
-    mysql_options(&d_db, MYSQL_SET_CHARSET_NAME, MYSQL_AUTODETECT_CHARSET_NAME);
-#endif
-
     if (d_setIsolation && (retry == 1))
       mysql_options(&d_db, MYSQL_INIT_COMMAND,"SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
 
diff --git a/regression-tests/tests/8bit-txt-unescaped/skip.gmysql b/regression-tests/tests/8bit-txt-unescaped/skip.gmysql
new file mode 100644 (file)
index 0000000..e69de29