mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-14249 Wrong character set info of Query_log_event and the query in Query_log_event constructed by different charsets cause error when slave apply the event.
This commit is contained in:
28
mysql-test/suite/rpl/r/rpl_ctype_latin1.result
Normal file
28
mysql-test/suite/rpl/r/rpl_ctype_latin1.result
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
#
|
||||||
|
# Start of 10.2 tests
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# MDEV-14249 Wrong character set info of Query_log_event and the query in Query_log_event constructed by different charsets cause error when slave apply the event.
|
||||||
|
#
|
||||||
|
SET NAMES latin1;
|
||||||
|
CREATE TABLE `tё` (`tё` INT);
|
||||||
|
CREATE VIEW `vё` AS SELECT 'vё';
|
||||||
|
CREATE PROCEDURE `pё`() SELECT 'pё';
|
||||||
|
connection slave;
|
||||||
|
SHOW TABLES LIKE 't%';
|
||||||
|
Tables_in_test (t%)
|
||||||
|
tё
|
||||||
|
SHOW TABLES LIKE 'v%';
|
||||||
|
Tables_in_test (v%)
|
||||||
|
vё
|
||||||
|
SHOW PROCEDURE STATUS LIKE 'p%';
|
||||||
|
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
|
||||||
|
test pё PROCEDURE root@localhost ts ts DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
|
||||||
|
connection master;
|
||||||
|
DROP TABLE `tё`;
|
||||||
|
DROP VIEW `vё`;
|
||||||
|
DROP PROCEDURE `pё`;
|
||||||
|
connection slave;
|
||||||
|
include/rpl_end.inc
|
40
mysql-test/suite/rpl/t/rpl_ctype_latin1.test
Normal file
40
mysql-test/suite/rpl/t/rpl_ctype_latin1.test
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
--disable_warnings
|
||||||
|
--source include/master-slave.inc
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # Start of 10.2 tests
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-14249 Wrong character set info of Query_log_event and the query in Query_log_event constructed by different charsets cause error when slave apply the event.
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
#
|
||||||
|
# The below tests uses a sequence of bytes 0xD191,
|
||||||
|
# which in a utf8 console looks like ё (CYRILIC SMALL LETTER YO).
|
||||||
|
# Don't be mislead. This sequence is used in latin1 context and
|
||||||
|
# represents a sequence of two characters:
|
||||||
|
# U+00D1 CAPITAL LATIN LETTER N WITH TILDE (_latin1 0xD1)
|
||||||
|
# U+2018 LEFT SINGLE QUOTATION MARK (_latin1 0x91)
|
||||||
|
#
|
||||||
|
|
||||||
|
SET NAMES latin1;
|
||||||
|
CREATE TABLE `tё` (`tё` INT);
|
||||||
|
CREATE VIEW `vё` AS SELECT 'vё';
|
||||||
|
CREATE PROCEDURE `pё`() SELECT 'pё';
|
||||||
|
|
||||||
|
--sync_slave_with_master
|
||||||
|
SHOW TABLES LIKE 't%';
|
||||||
|
SHOW TABLES LIKE 'v%';
|
||||||
|
--replace_column 5 ts 6 ts
|
||||||
|
SHOW PROCEDURE STATUS LIKE 'p%';
|
||||||
|
|
||||||
|
--connection master
|
||||||
|
DROP TABLE `tё`;
|
||||||
|
DROP VIEW `vё`;
|
||||||
|
DROP PROCEDURE `pё`;
|
||||||
|
--sync_slave_with_master
|
||||||
|
|
||||||
|
--source include/rpl_end.inc
|
@ -1277,8 +1277,8 @@ log:
|
|||||||
{
|
{
|
||||||
thd->clear_error();
|
thd->clear_error();
|
||||||
|
|
||||||
String log_query;
|
StringBuffer<128> log_query(thd->variables.character_set_client);
|
||||||
log_query.set_charset(system_charset_info);
|
DBUG_ASSERT(log_query.charset()->mbminlen == 1);
|
||||||
|
|
||||||
if (!show_create_sp(thd, &log_query,
|
if (!show_create_sp(thd, &log_query,
|
||||||
sp->m_type,
|
sp->m_type,
|
||||||
|
@ -643,7 +643,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
|||||||
|
|
||||||
if (!res && mysql_bin_log.is_open())
|
if (!res && mysql_bin_log.is_open())
|
||||||
{
|
{
|
||||||
String buff;
|
StringBuffer<128> buff(thd->variables.character_set_client);
|
||||||
|
DBUG_ASSERT(buff.charset()->mbminlen == 1);
|
||||||
const LEX_STRING command[3]=
|
const LEX_STRING command[3]=
|
||||||
{{ C_STRING_WITH_LEN("CREATE ") },
|
{{ C_STRING_WITH_LEN("CREATE ") },
|
||||||
{ C_STRING_WITH_LEN("ALTER ") },
|
{ C_STRING_WITH_LEN("ALTER ") },
|
||||||
|
Reference in New Issue
Block a user