@@ -583,7 +583,7 @@ show create table t1;
583
583
Table Create Table
584
584
t1 CREATE TABLE `t1` (
585
585
`cast(1 as unsigned)` int(1) unsigned NOT NULL,
586
- `cast(1 as signed)` int(1 ) NOT NULL,
586
+ `cast(1 as signed)` int(2 ) NOT NULL,
587
587
`cast(1 as double(5,2))` double(5,2) DEFAULT NULL,
588
588
`cast(1 as decimal(5,3))` decimal(5,3) NOT NULL,
589
589
`cast("A" as binary)` varbinary(1) NOT NULL,
@@ -819,3 +819,74 @@ utf8_bin
819
819
select collation(cast("a" as char(10) binary ascii));
820
820
collation(cast("a" as char(10) binary ascii))
821
821
latin1_bin
822
+ #
823
+ # MDEV-11030 Assertion `precision > 0' failed in decimal_bin_size
824
+ #
825
+ SELECT * FROM (SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL)) sq;
826
+ IFNULL(CONVERT(NULL, UNSIGNED), NULL)
827
+ NULL
828
+ CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL, UNSIGNED), NULL);
829
+ SHOW CREATE TABLE t1;
830
+ Table Create Table
831
+ t1 CREATE TABLE `t1` (
832
+ `IFNULL(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
833
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
834
+ DROP TABLE t1;
835
+ CREATE TABLE t1 AS SELECT COALESCE(CONVERT(NULL, UNSIGNED), NULL);
836
+ SHOW CREATE TABLE t1;
837
+ Table Create Table
838
+ t1 CREATE TABLE `t1` (
839
+ `COALESCE(CONVERT(NULL, UNSIGNED), NULL)` decimal(1,0) DEFAULT NULL
840
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
841
+ DROP TABLE t1;
842
+ CREATE TABLE t1 AS SELECT CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END;
843
+ SHOW CREATE TABLE t1;
844
+ Table Create Table
845
+ t1 CREATE TABLE `t1` (
846
+ `CASE WHEN TRUE THEN CONVERT(NULL, UNSIGNED) ELSE NULL END` decimal(1,0) DEFAULT NULL
847
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
848
+ DROP TABLE t1;
849
+ CREATE TABLE t1 AS SELECT IFNULL(CONVERT(NULL,SIGNED),CONVERT(NULL,UNSIGNED)) AS a;
850
+ SHOW CREATE TABLE t1;
851
+ Table Create Table
852
+ t1 CREATE TABLE `t1` (
853
+ `a` decimal(1,0) DEFAULT NULL
854
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
855
+ DROP TABLE t1;
856
+ CREATE TABLE t1 AS SELECT
857
+ -1,
858
+ CONVERT(NULL,SIGNED),
859
+ CONCAT(CONVERT(NULL,SIGNED)),
860
+ 1,
861
+ CONVERT(NULL,UNSIGNED),
862
+ CONCAT(CONVERT(NULL,UNSIGNED));
863
+ SHOW CREATE TABLE t1;
864
+ Table Create Table
865
+ t1 CREATE TABLE `t1` (
866
+ `-1` int(2) NOT NULL,
867
+ `CONVERT(NULL,SIGNED)` int(2) DEFAULT NULL,
868
+ `CONCAT(CONVERT(NULL,SIGNED))` varchar(2) DEFAULT NULL,
869
+ `1` int(1) NOT NULL,
870
+ `CONVERT(NULL,UNSIGNED)` int(1) unsigned DEFAULT NULL,
871
+ `CONCAT(CONVERT(NULL,UNSIGNED))` varchar(1) DEFAULT NULL
872
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
873
+ DROP TABLE t1;
874
+ CREATE TABLE t1 AS SELECT
875
+ CONVERT('',SIGNED),
876
+ CONCAT(CONVERT('',SIGNED)),
877
+ CONVERT('',UNSIGNED),
878
+ CONCAT(CONVERT('',UNSIGNED));
879
+ Warnings:
880
+ Warning 1292 Truncated incorrect INTEGER value: ''
881
+ Warning 1292 Truncated incorrect INTEGER value: ''
882
+ Warning 1292 Truncated incorrect INTEGER value: ''
883
+ Warning 1292 Truncated incorrect INTEGER value: ''
884
+ SHOW CREATE TABLE t1;
885
+ Table Create Table
886
+ t1 CREATE TABLE `t1` (
887
+ `CONVERT('',SIGNED)` int(2) NOT NULL,
888
+ `CONCAT(CONVERT('',SIGNED))` varchar(2) NOT NULL,
889
+ `CONVERT('',UNSIGNED)` int(1) unsigned NOT NULL,
890
+ `CONCAT(CONVERT('',UNSIGNED))` varchar(1) NOT NULL
891
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
892
+ DROP TABLE t1;
0 commit comments