mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#4417 binary character set breaks multi-byte table/field name.
This commit is contained in:
@ -111,3 +111,28 @@ SET character_set_connection=cp1251;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
hex('<27><><EFBFBD><EFBFBD>')
|
||||
F2E5F1F2
|
||||
USE test;
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `тест` (`тест` int);
|
||||
SHOW CREATE TABLE `тест`;
|
||||
Table Create Table
|
||||
тест CREATE TABLE `тест` (
|
||||
`тест` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SET NAMES utf8;
|
||||
SHOW CREATE TABLE `тест`;
|
||||
Table Create Table
|
||||
тест CREATE TABLE `тест` (
|
||||
`тест` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE `тест`;
|
||||
SET NAMES binary;
|
||||
SET character_set_connection=utf8;
|
||||
SELECT 'тест' as s;
|
||||
s
|
||||
тест
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=binary;
|
||||
SELECT 'тест' as s;
|
||||
s
|
||||
тест
|
||||
|
@ -78,3 +78,22 @@ SET NAMES koi8r;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
SET character_set_connection=cp1251;
|
||||
SELECT hex('<27><><EFBFBD><EFBFBD>');
|
||||
|
||||
USE test;
|
||||
|
||||
# Bug#4417
|
||||
# Check that identifiers and strings are not converted
|
||||
# when the client character set is binary.
|
||||
|
||||
SET NAMES binary;
|
||||
CREATE TABLE `тест` (`тест` int);
|
||||
SHOW CREATE TABLE `тест`;
|
||||
SET NAMES utf8;
|
||||
SHOW CREATE TABLE `тест`;
|
||||
DROP TABLE `тест`;
|
||||
SET NAMES binary;
|
||||
SET character_set_connection=utf8;
|
||||
SELECT 'тест' as s;
|
||||
SET NAMES utf8;
|
||||
SET character_set_connection=binary;
|
||||
SELECT 'тест' as s;
|
||||
|
@ -533,21 +533,23 @@ bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Update some cache variables when character set changes
|
||||
*/
|
||||
|
||||
void THD::update_charset()
|
||||
{
|
||||
charset_is_system_charset= my_charset_same(charset(),system_charset_info);
|
||||
charset_is_collation_connection= my_charset_same(charset(),
|
||||
variables.
|
||||
collation_connection);
|
||||
uint32 not_used;
|
||||
charset_is_system_charset= !String::needs_conversion(0,charset(),
|
||||
system_charset_info,
|
||||
¬_used);
|
||||
charset_is_collation_connection=
|
||||
!String::needs_conversion(0,charset(),variables.collation_connection,
|
||||
¬_used);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* routings to adding tables to list of changed in transaction tables */
|
||||
|
||||
inline static void list_include(CHANGED_TABLE_LIST** prev,
|
||||
|
Reference in New Issue
Block a user