[MDEV-24291] Replication stops with "Column cannot be converted from type 'bigint(11)' to type 'int(11)'" Created: 2020-11-26  Updated: 2022-08-23

Status: Open
Project: MariaDB Server
Component/s: Replication
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.2

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

create table t1 (i int);
create table t2  SELECT (SELECT i FROM  t1) FROM t1;
show create table t2;

on 5.5-10.2

MariaDB [test]> show create table t2;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                               |
+-------+------------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `(SELECT i FROM  t1)` bigint(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

on 10.3-10.5

+-------+---------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                            |
+-------+---------------------------------------------------------------------------------------------------------+
| t2    | CREATE TABLE `t2` (
  `(SELECT i FROM  t1)` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------+
1 row in set (0.009 sec)

Then if I use row replication between versions e.g. 10.2 and 10.3, it stops with an error:

    Last_SQL_Errno: 1677
    Last_SQL_Error: Column 0 of table 'test.t2' cannot be converted from type 'bigint' to type 'int(11)'


Generated at Thu Feb 08 09:28:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.