From 7e8c66f1d608546c432dcd160f6a3f6b068b9a9f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 15:40:06 +0200 Subject: Merging debian version 1:10.11.7-2. Signed-off-by: Daniel Baumann --- .../MDEV-32975-chartset-collation-fix-php.patch | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 debian/patches/MDEV-32975-chartset-collation-fix-php.patch (limited to 'debian/patches/MDEV-32975-chartset-collation-fix-php.patch') diff --git a/debian/patches/MDEV-32975-chartset-collation-fix-php.patch b/debian/patches/MDEV-32975-chartset-collation-fix-php.patch new file mode 100644 index 00000000..4fa54955 --- /dev/null +++ b/debian/patches/MDEV-32975-chartset-collation-fix-php.patch @@ -0,0 +1,45 @@ +Origin: https://github.com/MariaDB/server/commit/1b37cb71f44549c94acf8914cf93d43a4293a449 +Bug: https://jira.mariadb.org/browse/MDEV-32975 +From: Alexander Barkov +Date: Fri, 26 Jan 2024 13:12:03 +0400 +Subject: [PATCH] MDEV-32975 Default charset doesn't work with PHP MySQLi + extension + +When sending the server default collation ID to the client +in the handshake packet, translate a 2-byte collation ID +to the ID of the default collation for the character set. +--- + sql/sql_acl.cc | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +--- a/sql/sql_acl.cc ++++ b/sql/sql_acl.cc +@@ -13354,8 +13354,27 @@ static bool send_server_handshake_packet + *end++= 0; + + int2store(end, thd->client_capabilities); ++ ++ CHARSET_INFO *handshake_cs= default_charset_info; ++ if (handshake_cs->number > 0xFF) ++ { ++ /* ++ A workaround for a 2-byte collation ID: translate it into ++ the ID of the primary collation of this character set. ++ */ ++ CHARSET_INFO *cs= get_charset_by_csname(handshake_cs->cs_name.str, ++ MY_CS_PRIMARY, MYF(MY_WME)); ++ /* ++ cs should not normally be NULL, however it may be possible ++ with a dynamic character set incorrectly defined in Index.xml. ++ For safety let's fallback to latin1 in case cs is NULL. ++ */ ++ handshake_cs= cs ? cs : &my_charset_latin1; ++ } ++ + /* write server characteristics: up to 16 bytes allowed */ +- end[2]= (char) default_charset_info->number; ++ end[2]= (char) handshake_cs->number; ++ + int2store(end+3, mpvio->auth_info.thd->server_status); + int2store(end+5, thd->client_capabilities >> 16); + end[7]= data_len; -- cgit v1.2.3