[MDEV-5462] CREATE AS SELECT produces invalid table structure (with NULL type) and causes replication failure Created: 2013-12-18  Updated: 2013-12-18  Resolved: 2013-12-18

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.34
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: upstream


 Description   

The bug exists in 5.1-5.5, but is fixed in 5.6 some time between 5.6.7 and 5.6.10. I presume the bugfix was merged into 10.0, since it's not reproducible on current 10.0 tree. Apparently it was not important enough to fix it in MySQL 5.5, and no need to fix it in MariaDB 5.5 either, but I want it to be filed for the record so that it could be possible to find it next time.

--source include/master-slave.inc
--source include/have_binlog_format_row.inc
 
CREATE TABLE t1 SELECT CASE 1 WHEN 0 THEN NULL END AS f; 
SHOW CREATE TABLE t1;
 
--sync_slave_with_master

Result:

SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `f` null DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Replication failure:

Last_Errno	1064
Last_Error	Error 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'null DEFAULT NULL
)' at line 2' on query. Default database: 'test'. Query: 'CREATE TABLE `t1` (
  `f` null DEFAULT NULL
)'



 Comments   
Comment by Elena Stepanova [ 2013-12-18 ]

Closing right away as "Won't fix", if somebody thinks differently and wants to fix it in 5.5, please feel free to re-open.

Generated at Thu Feb 08 07:04:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.