Commit 434e2835 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-13685 Can not replay binary log due to Illegal mix of collations...

MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
parent 65c94238
......@@ -1390,3 +1390,20 @@ DROP TABLE t2;
# -- Done.
#
# MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
#
SET NAMES utf8;
SELECT COERCIBILITY(NAME_CONST('name','test'));
COERCIBILITY(NAME_CONST('name','test'))
2
SELECT COERCIBILITY(NAME_CONST('name',TIME'00:00:00'));
COERCIBILITY(NAME_CONST('name',TIME'00:00:00'))
5
SELECT COERCIBILITY(NAME_CONST('name',15));
COERCIBILITY(NAME_CONST('name',15))
5
SELECT CONCAT(NAME_CONST('name',15),'오');
CONCAT(NAME_CONST('name',15),'오')
15오
SET NAMES latin1;
include/master-slave.inc
[connection master]
#
# MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
#
SET NAMES utf8;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
CREATE PROCEDURE p1()
BEGIN
DECLARE v_id INT DEFAULT 2017;
INSERT INTO test.t1 SELECT CONCAT(v_id, '오');
END;
$$
CALL p1;
SELECT * FROM t1;
a
2017오
SET NAMES utf8;
SELECT * FROM t1;
a
2017오
DROP PROCEDURE p1;
DROP TABLE t1;
include/rpl_end.inc
source include/master-slave.inc;
--echo #
--echo # MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
--echo #
connection master;
SET NAMES utf8;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
DELIMITER $$;
CREATE PROCEDURE p1()
BEGIN
DECLARE v_id INT DEFAULT 2017;
INSERT INTO test.t1 SELECT CONCAT(v_id, '오');
END;
$$
DELIMITER ;$$
CALL p1;
SELECT * FROM t1;
sync_slave_with_master;
SET NAMES utf8;
SELECT * FROM t1;
connection master;
DROP PROCEDURE p1;
DROP TABLE t1;
sync_slave_with_master;
--source include/rpl_end.inc
......@@ -1080,3 +1080,14 @@ DROP TABLE t2;
--echo
--echo # -- Done.
--echo
--echo #
--echo # MDEV-13685 Can not replay binary log due to Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
--echo #
SET NAMES utf8;
SELECT COERCIBILITY(NAME_CONST('name','test'));
SELECT COERCIBILITY(NAME_CONST('name',TIME'00:00:00'));
SELECT COERCIBILITY(NAME_CONST('name',15));
SELECT CONCAT(NAME_CONST('name',15),'오');
SET NAMES latin1;
......@@ -1796,7 +1796,10 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
{
set_name(item_name->ptr(), (uint) item_name->length(), system_charset_info);
}
collation.set(value_item->collation.collation, DERIVATION_IMPLICIT);
if (value_item->collation.derivation == DERIVATION_NUMERIC)
collation.set_numeric();
else
collation.set(value_item->collation.collation, DERIVATION_IMPLICIT);
max_length= value_item->max_length;
decimals= value_item->decimals;
fixed= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment