← Back to team overview

enterprise-support team mailing list archive

[Bug 1490026] [NEW] utf8 on master and utf8mb4 on slave leads to "cannot be converted from type" error

 

Public bug reported:

Description:
Similar to MySQL bug #71111 (https://bugs.mysql.com/bug.php?id=71111), but test case is simpler, so reported as new bug

If a table has utf8 character set on master and utf8mb4 on slave
replication fails with error " Column 1 of table 'test.t1' cannot be
converted from type 'varchar(765)' to type 'varchar(255)'"

Workaround:

--slave-type-conversions=ALL_NON_LOSSY

or use statement-based replication

How to repeat:
$cat rpl_bug-master.opt
--innodb-file-per-table=1 --binlog-format=row 

$cat rpl_bug-slave.opt
--innodb-file-per-table=1 --binlog-format=row 

$cat rpl_bug.test
--source include/master-slave.inc

CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT primary key,
`bug` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

insert into t1 values(1, 'Света тестирует баг');

--sync_slave_with_master

ALTER TABLE t1 CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE t1 MODIFY COLUMN `bug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL;
show create table t1;

connection master;

insert into t1 values(2, 'Света тестирует баг');

--sync_slave_with_master

** Affects: mysql-server
     Importance: Unknown
         Status: Unknown

** Affects: percona-server
     Importance: Undecided
         Status: Confirmed

** Affects: percona-server/5.6
     Importance: Undecided
         Status: Confirmed

** Affects: percona-server/5.7
     Importance: Undecided
         Status: Confirmed


** Tags: i58746

** Also affects: percona-server/5.6
   Importance: Undecided
       Status: Confirmed

** Also affects: percona-server/5.5
   Importance: Undecided
       Status: New

** Also affects: percona-server/5.7
   Importance: Undecided
       Status: New

** No longer affects: percona-server/5.5

** Changed in: percona-server/5.7
       Status: New => Confirmed

** Bug watch added: MySQL Bug System #78265
   http://bugs.mysql.com/bug.php?id=78265

** Also affects: mysql-server via
   http://bugs.mysql.com/bug.php?id=78265
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server/Client Support Team, which is subscribed to MySQL.
Matching subscriptions: Ubuntu Server/Client Support Team
https://bugs.launchpad.net/bugs/1490026

Title:
  utf8 on master and utf8mb4 on slave leads to "cannot be converted from
  type" error

To manage notifications about this bug go to:
https://bugs.launchpad.net/mysql-server/+bug/1490026/+subscriptions


Follow ups