summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 21:38:55 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-10 21:38:55 +0300
commit1c587481966abc7a9ad5309d0a91ca920f7a5657 (patch)
tree28b936bd807cab0ba7b82e4cc9ec963fa6de6307 /mysql-test/main
parent17be2b47ba32535e69e28da9a444e528ba8ab155 (diff)
parenteae968f62d285de97ed607c87bc131cd863d5d03 (diff)
downloadmariadb-git-1c587481966abc7a9ad5309d0a91ca920f7a5657.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/ctype_binary.result10
-rw-r--r--mysql-test/main/ctype_cp1251.result10
-rw-r--r--mysql-test/main/ctype_filename.result7
-rw-r--r--mysql-test/main/ctype_filename.test10
-rw-r--r--mysql-test/main/ctype_latin1.result10
-rw-r--r--mysql-test/main/ctype_ucs.result10
-rw-r--r--mysql-test/main/ctype_utf8.result10
-rw-r--r--mysql-test/main/func_math.result240
-rw-r--r--mysql-test/main/func_str.result2
-rw-r--r--mysql-test/main/grant.result18
-rw-r--r--mysql-test/main/grant.test25
-rw-r--r--mysql-test/main/information_schema.result15
-rw-r--r--mysql-test/main/information_schema.test14
-rw-r--r--mysql-test/main/mysql_tzinfo_to_sql_symlink.result18
-rw-r--r--mysql-test/main/mysqld--help,win.rdiff14
-rw-r--r--mysql-test/main/mysqld--help.result4
-rw-r--r--mysql-test/main/mysqld--help.test4
-rw-r--r--mysql-test/main/parser.result7
-rw-r--r--mysql-test/main/parser.test9
-rw-r--r--mysql-test/main/subselect4.result66
-rw-r--r--mysql-test/main/subselect4.test48
-rw-r--r--mysql-test/main/type_date.result30
-rw-r--r--mysql-test/main/type_date.test22
-rw-r--r--mysql-test/main/type_float.result170
-rw-r--r--mysql-test/main/type_float.test20
-rw-r--r--mysql-test/main/type_newdecimal.result367
-rw-r--r--mysql-test/main/type_newdecimal.test93
-rw-r--r--mysql-test/main/win.result16
-rw-r--r--mysql-test/main/win.test16
29 files changed, 1125 insertions, 160 deletions
diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result
index c0bbb8ff4ff..05f31f13dc7 100644
--- a/mysql-test/main/ctype_binary.result
+++ b/mysql-test/main/ctype_binary.result
@@ -345,21 +345,23 @@ drop table t1;
select hex(concat(ceiling(0.5)));
hex(concat(ceiling(0.5)))
31
-create table t1 as select concat(ceiling(0.5)) as c1;
+create table t1 as select ceiling(0.5) as c0, concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varbinary(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
hex(concat(floor(0.5)))
30
-create table t1 as select concat(floor(0.5)) as c1;
+create table t1 as select floor(0.5) as c0, concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varbinary(4) DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varbinary(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result
index 9f11301f63b..7d9b47f1f54 100644
--- a/mysql-test/main/ctype_cp1251.result
+++ b/mysql-test/main/ctype_cp1251.result
@@ -757,21 +757,23 @@ drop table t1;
select hex(concat(ceiling(0.5)));
hex(concat(ceiling(0.5)))
31
-create table t1 as select concat(ceiling(0.5)) as c1;
+create table t1 as select ceiling(0.5) as c0, concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
hex(concat(floor(0.5)))
30
-create table t1 as select concat(floor(0.5)) as c1;
+create table t1 as select floor(0.5) as c0, concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET cp1251 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET cp1251 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
diff --git a/mysql-test/main/ctype_filename.result b/mysql-test/main/ctype_filename.result
index 1064ef95cae..2eee5d2888e 100644
--- a/mysql-test/main/ctype_filename.result
+++ b/mysql-test/main/ctype_filename.result
@@ -22,6 +22,13 @@ SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a
@a BINARY @a REVERSE(@a) HEX(@a) HEX(REVERSE(@a))
aя a@r1 яa 61407231 40723161
#
+# MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
+#
+SET CHARACTER_SET_CLIENT=17;
+SELECT doc.`Children`.0 FROM t1;
+ERROR 42000: 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 '?Children??0?FROM?t1' at line 1
+SET NAMES latin1;
+#
# Start of 10.5 tests
#
#
diff --git a/mysql-test/main/ctype_filename.test b/mysql-test/main/ctype_filename.test
index 940be6a7c24..17ab71e3985 100644
--- a/mysql-test/main/ctype_filename.test
+++ b/mysql-test/main/ctype_filename.test
@@ -30,6 +30,16 @@ SELECT @a:=CONVERT('aя' USING filename) AS `@a`, BINARY @a, REVERSE(@a), HEX(@a
--echo #
+--echo # MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
+--echo #
+
+SET CHARACTER_SET_CLIENT=17;
+--error ER_PARSE_ERROR
+SELECT doc.`Children`.0 FROM t1;
+SET NAMES latin1;
+
+
+--echo #
--echo # Start of 10.5 tests
--echo #
diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result
index 263afe4f584..68870bbeea8 100644
--- a/mysql-test/main/ctype_latin1.result
+++ b/mysql-test/main/ctype_latin1.result
@@ -1066,21 +1066,23 @@ drop table t1;
select hex(concat(ceiling(0.5)));
hex(concat(ceiling(0.5)))
31
-create table t1 as select concat(ceiling(0.5)) as c1;
+create table t1 as select ceiling(0.5) as c0, concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
hex(concat(floor(0.5)))
30
-create table t1 as select concat(floor(0.5)) as c1;
+create table t1 as select floor(0.5) as c0, concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result
index 48b866b64f5..dc3ed0cf7a9 100644
--- a/mysql-test/main/ctype_ucs.result
+++ b/mysql-test/main/ctype_ucs.result
@@ -1950,21 +1950,23 @@ drop table t1;
select hex(concat(ceiling(0.5)));
hex(concat(ceiling(0.5)))
0031
-create table t1 as select concat(ceiling(0.5)) as c1;
+create table t1 as select ceiling(0.5) as c0, concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
hex(concat(floor(0.5)))
0030
-create table t1 as select concat(floor(0.5)) as c1;
+create table t1 as select floor(0.5) as c0, concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET ucs2 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET ucs2 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result
index bc951600319..419f64d1489 100644
--- a/mysql-test/main/ctype_utf8.result
+++ b/mysql-test/main/ctype_utf8.result
@@ -2817,21 +2817,23 @@ drop table t1;
select hex(concat(ceiling(0.5)));
hex(concat(ceiling(0.5)))
31
-create table t1 as select concat(ceiling(0.5)) as c1;
+create table t1 as select ceiling(0.5) as c0, concat(ceiling(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(floor(0.5)));
hex(concat(floor(0.5)))
30
-create table t1 as select concat(floor(0.5)) as c1;
+create table t1 as select floor(0.5) as c0, concat(floor(0.5)) as c1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` varchar(4) CHARACTER SET utf8 DEFAULT NULL
+ `c0` int(3) NOT NULL,
+ `c1` varchar(3) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select hex(concat(round(0.5)));
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index 460157df263..5da1ab02159 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -1080,7 +1080,7 @@ Create Table CREATE TABLE `t2` (
`a` decimal(38,0) DEFAULT NULL,
`b` decimal(38,0) unsigned DEFAULT NULL,
`fa` decimal(38,0) DEFAULT NULL,
- `fb` decimal(38,0) DEFAULT NULL
+ `fb` decimal(38,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999999999
b 99999999999999999999999999999999999999
@@ -1090,8 +1090,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,1) DEFAULT NULL,
`b` decimal(38,1) unsigned DEFAULT NULL,
- `fa` decimal(37,0) DEFAULT NULL,
- `fb` decimal(37,0) DEFAULT NULL
+ `fa` decimal(38,0) DEFAULT NULL,
+ `fb` decimal(37,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999999999.9
b 9999999999999999999999999999999999999.9
@@ -1101,8 +1101,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,2) DEFAULT NULL,
`b` decimal(38,2) unsigned DEFAULT NULL,
- `fa` decimal(36,0) DEFAULT NULL,
- `fb` decimal(36,0) DEFAULT NULL
+ `fa` decimal(37,0) DEFAULT NULL,
+ `fb` decimal(36,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999999999.99
b 999999999999999999999999999999999999.99
@@ -1112,8 +1112,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,3) DEFAULT NULL,
`b` decimal(38,3) unsigned DEFAULT NULL,
- `fa` decimal(35,0) DEFAULT NULL,
- `fb` decimal(35,0) DEFAULT NULL
+ `fa` decimal(36,0) DEFAULT NULL,
+ `fb` decimal(35,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999999.999
b 99999999999999999999999999999999999.999
@@ -1123,8 +1123,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,4) DEFAULT NULL,
`b` decimal(38,4) unsigned DEFAULT NULL,
- `fa` decimal(34,0) DEFAULT NULL,
- `fb` decimal(34,0) DEFAULT NULL
+ `fa` decimal(35,0) DEFAULT NULL,
+ `fb` decimal(34,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999999.9999
b 9999999999999999999999999999999999.9999
@@ -1134,8 +1134,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,5) DEFAULT NULL,
`b` decimal(38,5) unsigned DEFAULT NULL,
- `fa` decimal(33,0) DEFAULT NULL,
- `fb` decimal(33,0) DEFAULT NULL
+ `fa` decimal(34,0) DEFAULT NULL,
+ `fb` decimal(33,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999999.99999
b 999999999999999999999999999999999.99999
@@ -1145,8 +1145,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,6) DEFAULT NULL,
`b` decimal(38,6) unsigned DEFAULT NULL,
- `fa` decimal(32,0) DEFAULT NULL,
- `fb` decimal(32,0) DEFAULT NULL
+ `fa` decimal(33,0) DEFAULT NULL,
+ `fb` decimal(32,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999999.999999
b 99999999999999999999999999999999.999999
@@ -1156,8 +1156,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,7) DEFAULT NULL,
`b` decimal(38,7) unsigned DEFAULT NULL,
- `fa` decimal(31,0) DEFAULT NULL,
- `fb` decimal(31,0) DEFAULT NULL
+ `fa` decimal(32,0) DEFAULT NULL,
+ `fb` decimal(31,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999999.9999999
b 9999999999999999999999999999999.9999999
@@ -1167,8 +1167,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,8) DEFAULT NULL,
`b` decimal(38,8) unsigned DEFAULT NULL,
- `fa` decimal(30,0) DEFAULT NULL,
- `fb` decimal(30,0) DEFAULT NULL
+ `fa` decimal(31,0) DEFAULT NULL,
+ `fb` decimal(30,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999.99999999
b 999999999999999999999999999999.99999999
@@ -1178,8 +1178,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,9) DEFAULT NULL,
`b` decimal(38,9) unsigned DEFAULT NULL,
- `fa` decimal(29,0) DEFAULT NULL,
- `fb` decimal(29,0) DEFAULT NULL
+ `fa` decimal(30,0) DEFAULT NULL,
+ `fb` decimal(29,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999.999999999
b 99999999999999999999999999999.999999999
@@ -1189,8 +1189,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,10) DEFAULT NULL,
`b` decimal(38,10) unsigned DEFAULT NULL,
- `fa` decimal(28,0) DEFAULT NULL,
- `fb` decimal(28,0) DEFAULT NULL
+ `fa` decimal(29,0) DEFAULT NULL,
+ `fb` decimal(28,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999.9999999999
b 9999999999999999999999999999.9999999999
@@ -1200,8 +1200,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,11) DEFAULT NULL,
`b` decimal(38,11) unsigned DEFAULT NULL,
- `fa` decimal(27,0) DEFAULT NULL,
- `fb` decimal(27,0) DEFAULT NULL
+ `fa` decimal(28,0) DEFAULT NULL,
+ `fb` decimal(27,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999.99999999999
b 999999999999999999999999999.99999999999
@@ -1211,8 +1211,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,12) DEFAULT NULL,
`b` decimal(38,12) unsigned DEFAULT NULL,
- `fa` decimal(26,0) DEFAULT NULL,
- `fb` decimal(26,0) DEFAULT NULL
+ `fa` decimal(27,0) DEFAULT NULL,
+ `fb` decimal(26,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999.999999999999
b 99999999999999999999999999.999999999999
@@ -1222,8 +1222,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,13) DEFAULT NULL,
`b` decimal(38,13) unsigned DEFAULT NULL,
- `fa` decimal(25,0) DEFAULT NULL,
- `fb` decimal(25,0) DEFAULT NULL
+ `fa` decimal(26,0) DEFAULT NULL,
+ `fb` decimal(25,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999.9999999999999
b 9999999999999999999999999.9999999999999
@@ -1233,8 +1233,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,14) DEFAULT NULL,
`b` decimal(38,14) unsigned DEFAULT NULL,
- `fa` decimal(24,0) DEFAULT NULL,
- `fb` decimal(24,0) DEFAULT NULL
+ `fa` decimal(25,0) DEFAULT NULL,
+ `fb` decimal(24,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999.99999999999999
b 999999999999999999999999.99999999999999
@@ -1244,8 +1244,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,15) DEFAULT NULL,
`b` decimal(38,15) unsigned DEFAULT NULL,
- `fa` decimal(23,0) DEFAULT NULL,
- `fb` decimal(23,0) DEFAULT NULL
+ `fa` decimal(24,0) DEFAULT NULL,
+ `fb` decimal(23,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999.999999999999999
b 99999999999999999999999.999999999999999
@@ -1255,8 +1255,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,16) DEFAULT NULL,
`b` decimal(38,16) unsigned DEFAULT NULL,
- `fa` decimal(22,0) DEFAULT NULL,
- `fb` decimal(22,0) DEFAULT NULL
+ `fa` decimal(23,0) DEFAULT NULL,
+ `fb` decimal(22,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999.9999999999999999
b 9999999999999999999999.9999999999999999
@@ -1266,8 +1266,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,17) DEFAULT NULL,
`b` decimal(38,17) unsigned DEFAULT NULL,
- `fa` decimal(21,0) DEFAULT NULL,
- `fb` decimal(21,0) DEFAULT NULL
+ `fa` decimal(22,0) DEFAULT NULL,
+ `fb` decimal(21,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999.99999999999999999
b 999999999999999999999.99999999999999999
@@ -1277,8 +1277,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,18) DEFAULT NULL,
`b` decimal(38,18) unsigned DEFAULT NULL,
- `fa` decimal(20,0) DEFAULT NULL,
- `fb` decimal(20,0) DEFAULT NULL
+ `fa` decimal(21,0) DEFAULT NULL,
+ `fb` decimal(20,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999.999999999999999999
b 99999999999999999999.999999999999999999
@@ -1288,8 +1288,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,19) DEFAULT NULL,
`b` decimal(38,19) unsigned DEFAULT NULL,
- `fa` decimal(19,0) DEFAULT NULL,
- `fb` decimal(19,0) DEFAULT NULL
+ `fa` decimal(20,0) DEFAULT NULL,
+ `fb` decimal(19,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999.9999999999999999999
b 9999999999999999999.9999999999999999999
@@ -1299,8 +1299,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,20) DEFAULT NULL,
`b` decimal(38,20) unsigned DEFAULT NULL,
- `fa` decimal(18,0) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fa` decimal(19,0) DEFAULT NULL,
+ `fb` bigint(18) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999.99999999999999999999
b 999999999999999999.99999999999999999999
@@ -1310,7 +1310,7 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,21) DEFAULT NULL,
`b` decimal(38,21) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
+ `fa` bigint(19) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999.999999999999999999999
@@ -1321,8 +1321,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,22) DEFAULT NULL,
`b` decimal(38,22) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fa` bigint(18) DEFAULT NULL,
+ `fb` bigint(16) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999.9999999999999999999999
b 9999999999999999.9999999999999999999999
@@ -1333,7 +1333,7 @@ Create Table CREATE TABLE `t2` (
`a` decimal(38,23) DEFAULT NULL,
`b` decimal(38,23) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fb` bigint(15) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999.99999999999999999999999
b 999999999999999.99999999999999999999999
@@ -1343,8 +1343,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,24) DEFAULT NULL,
`b` decimal(38,24) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
- `fb` bigint(16) unsigned DEFAULT NULL
+ `fa` bigint(16) DEFAULT NULL,
+ `fb` bigint(14) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999.999999999999999999999999
b 99999999999999.999999999999999999999999
@@ -1354,8 +1354,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,25) DEFAULT NULL,
`b` decimal(38,25) unsigned DEFAULT NULL,
- `fa` bigint(16) DEFAULT NULL,
- `fb` bigint(15) unsigned DEFAULT NULL
+ `fa` bigint(15) DEFAULT NULL,
+ `fb` bigint(13) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999.9999999999999999999999999
b 9999999999999.9999999999999999999999999
@@ -1365,8 +1365,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,26) DEFAULT NULL,
`b` decimal(38,26) unsigned DEFAULT NULL,
- `fa` bigint(15) DEFAULT NULL,
- `fb` bigint(14) unsigned DEFAULT NULL
+ `fa` bigint(14) DEFAULT NULL,
+ `fb` bigint(12) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999.99999999999999999999999999
b 999999999999.99999999999999999999999999
@@ -1376,8 +1376,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,27) DEFAULT NULL,
`b` decimal(38,27) unsigned DEFAULT NULL,
- `fa` bigint(14) DEFAULT NULL,
- `fb` bigint(13) unsigned DEFAULT NULL
+ `fa` bigint(13) DEFAULT NULL,
+ `fb` bigint(11) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999.999999999999999999999999999
b 99999999999.999999999999999999999999999
@@ -1387,8 +1387,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,28) DEFAULT NULL,
`b` decimal(38,28) unsigned DEFAULT NULL,
- `fa` bigint(13) DEFAULT NULL,
- `fb` bigint(12) unsigned DEFAULT NULL
+ `fa` bigint(12) DEFAULT NULL,
+ `fb` bigint(10) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999.9999999999999999999999999999
b 9999999999.9999999999999999999999999999
@@ -1398,8 +1398,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,29) DEFAULT NULL,
`b` decimal(38,29) unsigned DEFAULT NULL,
- `fa` bigint(12) DEFAULT NULL,
- `fb` bigint(11) unsigned DEFAULT NULL
+ `fa` bigint(11) DEFAULT NULL,
+ `fb` int(9) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999.99999999999999999999999999999
b 999999999.99999999999999999999999999999
@@ -1409,8 +1409,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(38,30) DEFAULT NULL,
`b` decimal(38,30) unsigned DEFAULT NULL,
- `fa` bigint(11) DEFAULT NULL,
- `fb` bigint(10) unsigned DEFAULT NULL
+ `fa` int(10) DEFAULT NULL,
+ `fb` int(8) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999.999999999999999999999999999999
b 99999999.999999999999999999999999999999
@@ -1422,7 +1422,7 @@ Create Table CREATE TABLE `t2` (
`a` decimal(30,0) DEFAULT NULL,
`b` decimal(30,0) unsigned DEFAULT NULL,
`fa` decimal(30,0) DEFAULT NULL,
- `fb` decimal(31,0) unsigned DEFAULT NULL
+ `fb` decimal(30,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999999
b 999999999999999999999999999999
@@ -1432,8 +1432,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,1) DEFAULT NULL,
`b` decimal(30,1) unsigned DEFAULT NULL,
- `fa` decimal(29,0) DEFAULT NULL,
- `fb` decimal(30,0) unsigned DEFAULT NULL
+ `fa` decimal(30,0) DEFAULT NULL,
+ `fb` decimal(29,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999999.9
b 99999999999999999999999999999.9
@@ -1443,8 +1443,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,2) DEFAULT NULL,
`b` decimal(30,2) unsigned DEFAULT NULL,
- `fa` decimal(28,0) DEFAULT NULL,
- `fb` decimal(29,0) unsigned DEFAULT NULL
+ `fa` decimal(29,0) DEFAULT NULL,
+ `fb` decimal(28,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999999.99
b 9999999999999999999999999999.99
@@ -1454,8 +1454,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,3) DEFAULT NULL,
`b` decimal(30,3) unsigned DEFAULT NULL,
- `fa` decimal(27,0) DEFAULT NULL,
- `fb` decimal(28,0) unsigned DEFAULT NULL
+ `fa` decimal(28,0) DEFAULT NULL,
+ `fb` decimal(27,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999999.999
b 999999999999999999999999999.999
@@ -1465,8 +1465,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,4) DEFAULT NULL,
`b` decimal(30,4) unsigned DEFAULT NULL,
- `fa` decimal(26,0) DEFAULT NULL,
- `fb` decimal(27,0) unsigned DEFAULT NULL
+ `fa` decimal(27,0) DEFAULT NULL,
+ `fb` decimal(26,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999999.9999
b 99999999999999999999999999.9999
@@ -1476,8 +1476,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,5) DEFAULT NULL,
`b` decimal(30,5) unsigned DEFAULT NULL,
- `fa` decimal(25,0) DEFAULT NULL,
- `fb` decimal(26,0) unsigned DEFAULT NULL
+ `fa` decimal(26,0) DEFAULT NULL,
+ `fb` decimal(25,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999999.99999
b 9999999999999999999999999.99999
@@ -1487,8 +1487,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,6) DEFAULT NULL,
`b` decimal(30,6) unsigned DEFAULT NULL,
- `fa` decimal(24,0) DEFAULT NULL,
- `fb` decimal(25,0) unsigned DEFAULT NULL
+ `fa` decimal(25,0) DEFAULT NULL,
+ `fb` decimal(24,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999999.999999
b 999999999999999999999999.999999
@@ -1498,8 +1498,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,7) DEFAULT NULL,
`b` decimal(30,7) unsigned DEFAULT NULL,
- `fa` decimal(23,0) DEFAULT NULL,
- `fb` decimal(24,0) unsigned DEFAULT NULL
+ `fa` decimal(24,0) DEFAULT NULL,
+ `fb` decimal(23,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999999.9999999
b 99999999999999999999999.9999999
@@ -1509,8 +1509,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,8) DEFAULT NULL,
`b` decimal(30,8) unsigned DEFAULT NULL,
- `fa` decimal(22,0) DEFAULT NULL,
- `fb` decimal(23,0) unsigned DEFAULT NULL
+ `fa` decimal(23,0) DEFAULT NULL,
+ `fb` decimal(22,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999999.99999999
b 9999999999999999999999.99999999
@@ -1520,8 +1520,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,9) DEFAULT NULL,
`b` decimal(30,9) unsigned DEFAULT NULL,
- `fa` decimal(21,0) DEFAULT NULL,
- `fb` decimal(22,0) unsigned DEFAULT NULL
+ `fa` decimal(22,0) DEFAULT NULL,
+ `fb` decimal(21,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999999.999999999
b 999999999999999999999.999999999
@@ -1531,8 +1531,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,10) DEFAULT NULL,
`b` decimal(30,10) unsigned DEFAULT NULL,
- `fa` decimal(20,0) DEFAULT NULL,
- `fb` decimal(21,0) unsigned DEFAULT NULL
+ `fa` decimal(21,0) DEFAULT NULL,
+ `fb` decimal(20,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999999.9999999999
b 99999999999999999999.9999999999
@@ -1542,8 +1542,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,11) DEFAULT NULL,
`b` decimal(30,11) unsigned DEFAULT NULL,
- `fa` decimal(19,0) DEFAULT NULL,
- `fb` decimal(20,0) unsigned DEFAULT NULL
+ `fa` decimal(20,0) DEFAULT NULL,
+ `fb` decimal(19,0) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999999.99999999999
b 9999999999999999999.99999999999
@@ -1553,8 +1553,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,12) DEFAULT NULL,
`b` decimal(30,12) unsigned DEFAULT NULL,
- `fa` decimal(18,0) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fa` decimal(19,0) DEFAULT NULL,
+ `fb` bigint(18) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999999.999999999999
b 999999999999999999.999999999999
@@ -1564,7 +1564,7 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,13) DEFAULT NULL,
`b` decimal(30,13) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
+ `fa` bigint(19) DEFAULT NULL,
`fb` bigint(17) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999999.9999999999999
@@ -1575,8 +1575,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,14) DEFAULT NULL,
`b` decimal(30,14) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fa` bigint(18) DEFAULT NULL,
+ `fb` bigint(16) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999999.99999999999999
b 9999999999999999.99999999999999
@@ -1587,7 +1587,7 @@ Create Table CREATE TABLE `t2` (
`a` decimal(30,15) DEFAULT NULL,
`b` decimal(30,15) unsigned DEFAULT NULL,
`fa` bigint(17) DEFAULT NULL,
- `fb` bigint(17) unsigned DEFAULT NULL
+ `fb` bigint(15) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999999.999999999999999
b 999999999999999.999999999999999
@@ -1597,8 +1597,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,16) DEFAULT NULL,
`b` decimal(30,16) unsigned DEFAULT NULL,
- `fa` bigint(17) DEFAULT NULL,
- `fb` bigint(16) unsigned DEFAULT NULL
+ `fa` bigint(16) DEFAULT NULL,
+ `fb` bigint(14) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999999.9999999999999999
b 99999999999999.9999999999999999
@@ -1608,8 +1608,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,17) DEFAULT NULL,
`b` decimal(30,17) unsigned DEFAULT NULL,
- `fa` bigint(16) DEFAULT NULL,
- `fb` bigint(15) unsigned DEFAULT NULL
+ `fa` bigint(15) DEFAULT NULL,
+ `fb` bigint(13) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999999.99999999999999999
b 9999999999999.99999999999999999
@@ -1619,8 +1619,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,18) DEFAULT NULL,
`b` decimal(30,18) unsigned DEFAULT NULL,
- `fa` bigint(15) DEFAULT NULL,
- `fb` bigint(14) unsigned DEFAULT NULL
+ `fa` bigint(14) DEFAULT NULL,
+ `fb` bigint(12) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999999.999999999999999999
b 999999999999.999999999999999999
@@ -1630,8 +1630,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,19) DEFAULT NULL,
`b` decimal(30,19) unsigned DEFAULT NULL,
- `fa` bigint(14) DEFAULT NULL,
- `fb` bigint(13) unsigned DEFAULT NULL
+ `fa` bigint(13) DEFAULT NULL,
+ `fb` bigint(11) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999999.9999999999999999999
b 99999999999.9999999999999999999
@@ -1641,8 +1641,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,20) DEFAULT NULL,
`b` decimal(30,20) unsigned DEFAULT NULL,
- `fa` bigint(13) DEFAULT NULL,
- `fb` bigint(12) unsigned DEFAULT NULL
+ `fa` bigint(12) DEFAULT NULL,
+ `fb` bigint(10) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999999.99999999999999999999
b 9999999999.99999999999999999999
@@ -1652,8 +1652,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,21) DEFAULT NULL,
`b` decimal(30,21) unsigned DEFAULT NULL,
- `fa` bigint(12) DEFAULT NULL,
- `fb` bigint(11) unsigned DEFAULT NULL
+ `fa` bigint(11) DEFAULT NULL,
+ `fb` int(9) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999999.999999999999999999999
b 999999999.999999999999999999999
@@ -1663,8 +1663,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,22) DEFAULT NULL,
`b` decimal(30,22) unsigned DEFAULT NULL,
- `fa` bigint(11) DEFAULT NULL,
- `fb` bigint(10) unsigned DEFAULT NULL
+ `fa` int(10) DEFAULT NULL,
+ `fb` int(8) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999999.9999999999999999999999
b 99999999.9999999999999999999999
@@ -1674,8 +1674,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,23) DEFAULT NULL,
`b` decimal(30,23) unsigned DEFAULT NULL,
- `fa` bigint(10) DEFAULT NULL,
- `fb` int(9) unsigned DEFAULT NULL
+ `fa` int(9) DEFAULT NULL,
+ `fb` int(7) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999999.99999999999999999999999
b 9999999.99999999999999999999999
@@ -1685,8 +1685,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,24) DEFAULT NULL,
`b` decimal(30,24) unsigned DEFAULT NULL,
- `fa` int(9) DEFAULT NULL,
- `fb` int(8) unsigned DEFAULT NULL
+ `fa` int(8) DEFAULT NULL,
+ `fb` int(6) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999999.999999999999999999999999
b 999999.999999999999999999999999
@@ -1696,8 +1696,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,25) DEFAULT NULL,
`b` decimal(30,25) unsigned DEFAULT NULL,
- `fa` int(8) DEFAULT NULL,
- `fb` int(7) unsigned DEFAULT NULL
+ `fa` int(7) DEFAULT NULL,
+ `fb` int(5) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99999.9999999999999999999999999
b 99999.9999999999999999999999999
@@ -1707,8 +1707,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,26) DEFAULT NULL,
`b` decimal(30,26) unsigned DEFAULT NULL,
- `fa` int(7) DEFAULT NULL,
- `fb` int(6) unsigned DEFAULT NULL
+ `fa` int(6) DEFAULT NULL,
+ `fb` int(4) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9999.99999999999999999999999999
b 9999.99999999999999999999999999
@@ -1718,8 +1718,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,27) DEFAULT NULL,
`b` decimal(30,27) unsigned DEFAULT NULL,
- `fa` int(6) DEFAULT NULL,
- `fb` int(5) unsigned DEFAULT NULL
+ `fa` int(5) DEFAULT NULL,
+ `fb` int(3) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 999.999999999999999999999999999
b 999.999999999999999999999999999
@@ -1729,8 +1729,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,28) DEFAULT NULL,
`b` decimal(30,28) unsigned DEFAULT NULL,
- `fa` int(5) DEFAULT NULL,
- `fb` int(4) unsigned DEFAULT NULL
+ `fa` int(4) DEFAULT NULL,
+ `fb` int(2) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 99.9999999999999999999999999999
b 99.9999999999999999999999999999
@@ -1740,8 +1740,8 @@ Table t2
Create Table CREATE TABLE `t2` (
`a` decimal(30,29) DEFAULT NULL,
`b` decimal(30,29) unsigned DEFAULT NULL,
- `fa` int(4) DEFAULT NULL,
- `fb` int(3) unsigned DEFAULT NULL
+ `fa` int(3) DEFAULT NULL,
+ `fb` int(1) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
a 9.99999999999999999999999999999
b 9.99999999999999999999999999999
@@ -2295,7 +2295,7 @@ FORMAT(-1e308,2)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `FORMAT(-1e308,2)` varchar(416) DEFAULT NULL
+ `FORMAT(-1e308,2)` varchar(417) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 AS SELECT FORMAT('-1e308',2);
@@ -2305,7 +2305,7 @@ FORMAT('-1e308',2)
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `FORMAT('-1e308',2)` varchar(416) DEFAULT NULL
+ `FORMAT('-1e308',2)` varchar(417) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 AS SELECT FORMAT(DATE'20191231',0),FORMAT(TIME'99:05:00',0),FORMAT(TIMESTAMP'2019-12-31 23:59:59.123456',0);
@@ -2317,7 +2317,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`FORMAT(DATE'20191231',0)` varchar(11) DEFAULT NULL,
`FORMAT(TIME'99:05:00',0)` varchar(10) DEFAULT NULL,
- `FORMAT(TIMESTAMP'2019-12-31 23:59:59.123456',0)` varchar(19) DEFAULT NULL
+ `FORMAT(TIMESTAMP'2019-12-31 23:59:59.123456',0)` varchar(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 (y YEAR);
@@ -3549,7 +3549,7 @@ FORMAT(f,0)
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
- `FORMAT(f,0)` varchar(53) DEFAULT NULL
+ `FORMAT(f,0)` varchar(54) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
#
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index 992363c6b91..0e9cebd0cb4 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -2708,7 +2708,7 @@ create table t1(a float);
insert into t1 values (1.33);
select format(a, 2) from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def format(a, 2) 253 56 4 Y 0 39 8
+def format(a, 2) 253 57 4 Y 0 39 8
format(a, 2)
1.33
drop table t1;
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index ae365ea207a..01daf027186 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -2773,6 +2773,24 @@ root@localhost
DROP TABLE t1;
DROP USER dummy@localhost;
#
+# MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
+# inaccurately
+#
+CREATE USER foo;
+CREATE DATABASE db;
+CREATE TABLE db.t (a INT);
+connect con1,localhost,foo,,;
+GRANT ALL ON db.t TO foo;
+ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
+INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;
+ERROR 42000: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW ... command denied to user 'foo'@'localhost' for table 't'
+connection default;
+disconnect con1;
+DROP USER foo;
+DROP TABLE db.t;
+DROP DATABASE db;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test
index 147fc42311c..38baf673825 100644
--- a/mysql-test/main/grant.test
+++ b/mysql-test/main/grant.test
@@ -2260,6 +2260,31 @@ DROP TABLE t1;
DROP USER dummy@localhost;
--echo #
+--echo # MDEV-23082: ER_TABLEACCESS_DENIED_ERROR error message is truncated, and
+--echo # inaccurately
+--echo #
+
+CREATE USER foo;
+CREATE DATABASE db;
+CREATE TABLE db.t (a INT);
+
+--connect (con1,localhost,foo,,)
+
+--error ER_TABLEACCESS_DENIED_ERROR
+GRANT ALL ON db.t TO foo;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, GRANT OPTION, REFERENCES,
+INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER ON db.t TO foo;
+
+--connection default
+--disconnect con1
+
+DROP USER foo;
+DROP TABLE db.t;
+DROP DATABASE db;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index fcc437f8c60..5a36daf31f9 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -2219,6 +2219,21 @@ SCHEMA_NAME
# End of 10.1 tests
#
#
+# Start of 10.2 Test
+#
+# MDEV-14836: Assertion `m_status == DA_ERROR' failed in
+# Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
+#
+SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
+ERROR HY000: Unknown error
+SHOW WARNINGS;
+Level Code Message
+Error 1105 Unknown error
+Warning 1931 Query execution was interrupted. The query examined at least 11 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete
+#
+# End of 10.2 Test
+#
+#
# MDEV-21201:No records produced in information_schema query,
# depending on projection
#
diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test
index a3231d94349..2ef86628918 100644
--- a/mysql-test/main/information_schema.test
+++ b/mysql-test/main/information_schema.test
@@ -1921,6 +1921,20 @@ SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a'
--echo # End of 10.1 tests
--echo #
+--echo #
+--echo # Start of 10.2 Test
+--echo #
+--echo # MDEV-14836: Assertion `m_status == DA_ERROR' failed in
+--echo # Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
+--echo #
+
+--error ER_UNKNOWN_ERROR
+SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
+SHOW WARNINGS;
+
+--echo #
+--echo # End of 10.2 Test
+--echo #
--echo #
--echo # MDEV-21201:No records produced in information_schema query,
diff --git a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
index 8997c404079..9de067b0e3f 100644
--- a/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
+++ b/mysql-test/main/mysql_tzinfo_to_sql_symlink.result
@@ -85,6 +85,15 @@ END IF|
#
# Testing with explicit timezonefile
#
+\d |
+IF (select count(*) from information_schema.global_variables where
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
+ALTER TABLE time_zone ENGINE=InnoDB;
+ALTER TABLE time_zone_name ENGINE=InnoDB;
+ALTER TABLE time_zone_transition ENGINE=InnoDB;
+ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
+END IF|
+\d ;
INSERT INTO time_zone (Use_leap_seconds) VALUES ('N');
SET @time_zone_id= LAST_INSERT_ID();
INSERT INTO time_zone_name (Name, Time_zone_id) VALUES ('XXX', @time_zone_id);
@@ -106,6 +115,15 @@ END IF|
\d |
IF (select count(*) from information_schema.global_variables where
variable_name='wsrep_on' and variable_value='ON') = 1 THEN
+ALTER TABLE time_zone ENGINE=InnoDB;
+ALTER TABLE time_zone_name ENGINE=InnoDB;
+ALTER TABLE time_zone_transition ENGINE=InnoDB;
+ALTER TABLE time_zone_transition_type ENGINE=InnoDB;
+END IF|
+\d ;
+\d |
+IF (select count(*) from information_schema.global_variables where
+variable_name='wsrep_on' and variable_value='ON') = 1 THEN
ALTER TABLE time_zone_leap_second ENGINE=InnoDB;
END IF|
\d ;
diff --git a/mysql-test/main/mysqld--help,win.rdiff b/mysql-test/main/mysqld--help,win.rdiff
index 91b0540c879..337755252ba 100644
--- a/mysql-test/main/mysqld--help,win.rdiff
+++ b/mysql-test/main/mysqld--help,win.rdiff
@@ -66,20 +66,6 @@
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql-safe-updates FALSE
-@@ -1741,10 +1752,10 @@
- sync-relay-log-info 10000
- sysdate-is-now FALSE
- system-versioning-alter-history ERROR
--table-cache 421
-+table-cache 2000
- table-definition-cache 400
--table-open-cache 421
--table-open-cache-instances 1
-+table-open-cache 2000
-+table-open-cache-instances 8
- tc-heuristic-recover OFF
- tcp-keepalive-interval 0
- tcp-keepalive-probes 0
@@ -1753,6 +1764,8 @@
thread-cache-size 151
thread-pool-idle-timeout 60
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index e9ea7e13c99..7671dfeef59 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -1594,7 +1594,6 @@ max-binlog-cache-size 18446744073709547520
max-binlog-size 1073741824
max-binlog-stmt-cache-size 18446744073709547520
max-connect-errors 100
-max-connections 151
max-delayed-threads 20
max-digest-length 1024
max-error-count 64
@@ -1797,10 +1796,7 @@ sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE
system-versioning-alter-history ERROR
-table-cache 421
table-definition-cache 400
-table-open-cache 421
-table-open-cache-instances 1
tc-heuristic-recover OFF
tcp-keepalive-interval 0
tcp-keepalive-probes 0
diff --git a/mysql-test/main/mysqld--help.test b/mysql-test/main/mysqld--help.test
index dcca6a75bca..f32f52c6dd0 100644
--- a/mysql-test/main/mysqld--help.test
+++ b/mysql-test/main/mysqld--help.test
@@ -23,7 +23,9 @@ perl;
log-slow-queries pid-file slow-query-log-file log-basename
datadir slave-load-tmpdir tmpdir socket thread-pool-size
large-files-support lower-case-file-system system-time-zone
- collation-server character-set-server log-tc-size tls-version version.*/;
+ collation-server character-set-server log-tc-size table-cache
+ table-open-cache table-open-cache-instances max-connections
+ tls-version version.*/;
# Plugins which may or may not be there:
@plugins=qw/innodb archive blackhole federated partition s3
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index 9483dfee9fb..d37b76e5f74 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -1801,6 +1801,13 @@ SELECT @@GLOBAL.password;
ERROR HY000: Unknown system variable 'password'
SELECT @@GLOBAL.role;
ERROR HY000: Unknown system variable 'role'
+#
+# MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
+#
+EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST';
+ERROR 42000: 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 '`systeminfo /FO LIST' at line 1
+EXECUTE IMMEDIATE 'if(`systeminfo';
+ERROR 42000: 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 '`systeminfo' at line 1
End of 10.3 tests
#
# MDEV-19540: 10.4 allow lock options with SELECT in brackets
diff --git a/mysql-test/main/parser.test b/mysql-test/main/parser.test
index 07f2d409d94..3689f38dc7f 100644
--- a/mysql-test/main/parser.test
+++ b/mysql-test/main/parser.test
@@ -1543,6 +1543,15 @@ SELECT @@GLOBAL.password;
--error ER_UNKNOWN_SYSTEM_VARIABLE
SELECT @@GLOBAL.role;
+--echo #
+--echo # MDEV-22022 Various mangled SQL statements will crash 10.3 to 10.5 debug builds
+--echo #
+
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE 'if(`systeminfo /FO LIST';
+--error ER_PARSE_ERROR
+EXECUTE IMMEDIATE 'if(`systeminfo';
+
--echo End of 10.3 tests
--echo #
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 2e60a760fd8..944515413d3 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -2609,6 +2609,47 @@ Central America and the Caribbean 442 66422
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
#
+# MDEV-9513: Assertion `join->group_list || !join->is_in_subquery()' failed in create_sort_index
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+EXPLAIN
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+a
+1
+2
+EXPLAIN
+SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+2 SUBQUERY A ALL NULL NULL NULL NULL 2
+3 UNION B ALL NULL NULL NULL NULL 2
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+a
+1
+2
+EXPLAIN
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 2 Using where
+3 DEPENDENT UNION B ALL NULL NULL NULL NULL 2 Using where
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
+a
+1
+2
+DROP TABLE t1,t2;
+# end of 10.1 tests
+#
# MDEV-22852: SIGSEGV in sortlength (optimized builds)
#
SET @save_optimizer_switch=@@optimizer_switch;
@@ -2620,6 +2661,31 @@ SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FR
0
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
+#
+# MDEV-17066: Bytes lost or Assertion `status_var.local_memory_used == 0 after DELETE
+# with subquery with ROLLUP
+#
+CREATE TABLE t1 (i INT DEFAULT 0, c VARCHAR(2048));
+INSERT INTO t1 SELECT 0, seq FROM seq_1_to_6000;
+CREATE TABLE t2 (f VARCHAR(2048) DEFAULT '');
+INSERT INTO t2 VALUES ('1'),('bar');
+EXPLAIN
+SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 6000 Using filesort
+SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
+f
+1
+SELECT * FROM t2;
+f
+1
+bar
+DELETE FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP );
+SELECT * FROM t2;
+f
+bar
+DROP TABLE t1, t2;
# End of 10.2 tests
#
# MDEV-19134: EXISTS() slower if ORDER BY is defined
diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test
index 1ed79de4598..8d2ddaab09b 100644
--- a/mysql-test/main/subselect4.test
+++ b/mysql-test/main/subselect4.test
@@ -7,6 +7,8 @@ drop table if exists t0,t1,t2,t3,t4,t5,t6;
drop view if exists v1, v2;
--enable_warnings
+--source include/have_sequence.inc
+
set @subselect4_tmp= @@optimizer_switch;
set optimizer_switch='semijoin=on,firstmatch=on,loosescan=on';
set optimizer_switch='semijoin_with_cache=on';
@@ -2142,6 +2144,31 @@ SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
--echo #
+--echo # MDEV-9513: Assertion `join->group_list || !join->is_in_subquery()' failed in create_sort_index
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+EXPLAIN
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+
+EXPLAIN
+SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+SELECT t1.a FROM t1 WHERE EXISTS (SELECT A.a FROM t1 A UNION SELECT B.a FROM t2 B ORDER BY 1);
+
+EXPLAIN
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
+SELECT t1.a FROM t1 WHERE t1.a IN ( SELECT A.a FROM t1 A UNION ALL SELECT B.a FROM t2 B ORDER BY 1);
+
+DROP TABLE t1,t2;
+
+--echo # end of 10.1 tests
+
+--echo #
--echo # MDEV-22852: SIGSEGV in sortlength (optimized builds)
--echo #
@@ -2153,6 +2180,27 @@ SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FR
SET @@optimizer_switch= @save_optimizer_switch;
DROP TABLE t1;
+--echo #
+--echo # MDEV-17066: Bytes lost or Assertion `status_var.local_memory_used == 0 after DELETE
+--echo # with subquery with ROLLUP
+--echo #
+
+CREATE TABLE t1 (i INT DEFAULT 0, c VARCHAR(2048));
+INSERT INTO t1 SELECT 0, seq FROM seq_1_to_6000;
+
+CREATE TABLE t2 (f VARCHAR(2048) DEFAULT '');
+INSERT INTO t2 VALUES ('1'),('bar');
+
+EXPLAIN
+SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
+SELECT * FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP);
+
+SELECT * FROM t2;
+DELETE FROM t2 WHERE f IN ( SELECT MAX(c) FROM t1 GROUP BY c WITH ROLLUP );
+SELECT * FROM t2;
+
+DROP TABLE t1, t2;
+
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/type_date.result b/mysql-test/main/type_date.result
index 84301a4b191..926ed1a8393 100644
--- a/mysql-test/main/type_date.result
+++ b/mysql-test/main/type_date.result
@@ -1103,5 +1103,35 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2,t1;
#
+# MDEV-23388 Assertion `args[0]->decimals == 0' failed in Item_func_round::fix_arg_int
+#
+SELECT ROUND(GREATEST('1', CAST('2020-12-12' AS DATE)));
+ROUND(GREATEST('1', CAST('2020-12-12' AS DATE)))
+20201212
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '1'
+SELECT GREATEST('1', CAST('2020-12-12' AS DATE));
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def GREATEST('1', CAST('2020-12-12' AS DATE)) 10 10 10 Y 128 0 63
+GREATEST('1', CAST('2020-12-12' AS DATE))
+2020-12-12
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '1'
+CREATE TABLE t1 (c_date DATE NOT NULL, c_int INT NOT NULL);
+CREATE TABLE t2 AS SELECT
+GREATEST(c_date,c_date),
+GREATEST(c_date,c_int),
+GREATEST(c_int,c_date)
+FROM t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `GREATEST(c_date,c_date)` date NOT NULL,
+ `GREATEST(c_date,c_int)` date DEFAULT NULL,
+ `GREATEST(c_int,c_date)` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_date.test b/mysql-test/main/type_date.test
index 33598846504..a29f78a679b 100644
--- a/mysql-test/main/type_date.test
+++ b/mysql-test/main/type_date.test
@@ -750,5 +750,27 @@ SHOW CREATE TABLE t2;
DROP TABLE t2,t1;
--echo #
+--echo # MDEV-23388 Assertion `args[0]->decimals == 0' failed in Item_func_round::fix_arg_int
+--echo #
+
+SELECT ROUND(GREATEST('1', CAST('2020-12-12' AS DATE)));
+
+--disable_ps_protocol
+--enable_metadata
+SELECT GREATEST('1', CAST('2020-12-12' AS DATE));
+--disable_metadata
+--enable_ps_protocol
+
+CREATE TABLE t1 (c_date DATE NOT NULL, c_int INT NOT NULL);
+CREATE TABLE t2 AS SELECT
+ GREATEST(c_date,c_date),
+ GREATEST(c_date,c_int),
+ GREATEST(c_int,c_date)
+FROM t1;
+SHOW CREATE TABLE t2;
+DROP TABLE t2;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_float.result b/mysql-test/main/type_float.result
index 2588481ff75..5137a8229b6 100644
--- a/mysql-test/main/type_float.result
+++ b/mysql-test/main/type_float.result
@@ -990,5 +990,175 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1
DROP TABLE t1;
#
+# MDEV-23415 Server crash or Assertion `dec_length <= str_length' failed in Item_func_format::val_str_ascii
+#
+SELECT FORMAT('0', 50, 'de_DE');
+FORMAT('0', 50, 'de_DE')
+0,00000000000000000000000000000000000000
+SELECT FORMAT(0e0, 50, 'de_DE');
+FORMAT(0e0, 50, 'de_DE')
+0,00000000000000000000000000000000000000
+FOR d IN 0..50
+DO
+SELECT
+d,
+FORMAT(123456789.123456789e0, d, 'de_DE') AS fdbl,
+FORMAT(123456789.123456789, d, 'de_DE') AS fdec;
+END FOR;
+$$
+d 0
+fdbl 123.456.789
+fdec 123.456.789
+d 1
+fdbl 123.456.789,1
+fdec 123.456.789,1
+d 2
+fdbl 123.456.789,12
+fdec 123.456.789,12
+d 3
+fdbl 123.456.789,123
+fdec 123.456.789,123
+d 4
+fdbl 123.456.789,1235
+fdec 123.456.789,1235
+d 5
+fdbl 123.456.789,12346
+fdec 123.456.789,12346
+d 6
+fdbl 123.456.789,123457
+fdec 123.456.789,123457
+d 7
+fdbl 123.456.789,1234568
+fdec 123.456.789,1234568
+d 8
+fdbl 123.456.789,12345680
+fdec 123.456.789,12345679
+d 9
+fdbl 123.456.789,123456790
+fdec 123.456.789,123456789
+d 10
+fdbl 123.456.789,1234567900
+fdec 123.456.789,1234567890
+d 11
+fdbl 123.456.789,12345680000
+fdec 123.456.789,12345678900
+d 12
+fdbl 123.456.789,123456790000
+fdec 123.456.789,123456789000
+d 13
+fdbl 123.456.789,1234568000000
+fdec 123.456.789,1234567890000
+d 14
+fdbl 123.456.789,12345679000000
+fdec 123.456.789,12345678900000
+d 15
+fdbl 123.456.789,123456790000000
+fdec 123.456.789,123456789000000
+d 16
+fdbl 123.456.789,1234567800000000
+fdec 123.456.789,1234567890000000
+d 17
+fdbl 123.456.789,12345679000000000
+fdec 123.456.789,12345678900000000
+d 18
+fdbl 123.456.789,123456790000000000
+fdec 123.456.789,123456789000000000
+d 19
+fdbl 123.456.789,1234567900000000000
+fdec 123.456.789,1234567890000000000
+d 20
+fdbl 123.456.789,12345679000000000000
+fdec 123.456.789,12345678900000000000
+d 21
+fdbl 123.456.789,123456800000000000000
+fdec 123.456.789,123456789000000000000
+d 22
+fdbl 123.456.789,1234567900000000000000
+fdec 123.456.789,1234567890000000000000
+d 23
+fdbl 123.456.789,12345680000000000000000
+fdec 123.456.789,12345678900000000000000
+d 24
+fdbl 123.456.789,123456790000000000000000
+fdec 123.456.789,123456789000000000000000
+d 25
+fdbl 123.456.789,1234567900000000000000000
+fdec 123.456.789,1234567890000000000000000
+d 26
+fdbl 123.456.789,12345679000000000000000000
+fdec 123.456.789,12345678900000000000000000
+d 27
+fdbl 123.456.789,123456780000000000000000000
+fdec 123.456.789,123456789000000000000000000
+d 28
+fdbl 123.456.789,1234567900000000000000000000
+fdec 123.456.789,1234567890000000000000000000
+d 29
+fdbl 123.456.789,12345678000000000000000000000
+fdec 123.456.789,12345678900000000000000000000
+d 30
+fdbl 123.456.789,123456790000000000000000000000
+fdec 123.456.789,123456789000000000000000000000
+d 31
+fdbl 123.456.789,1234567900000000000000000000000
+fdec 123.456.789,1234567890000000000000000000000
+d 32
+fdbl 123.456.789,12345679000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000
+d 33
+fdbl 123.456.789,123456790000000000000000000000000
+fdec 123.456.789,123456789000000000000000000000000
+d 34
+fdbl 123.456.789,1234567900000000000000000000000000
+fdec 123.456.789,1234567890000000000000000000000000
+d 35
+fdbl 123.456.789,12345679000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000
+d 36
+fdbl 123.456.789,123456790000000000000000000000000000
+fdec 123.456.789,123456789000000000000000000000000000
+d 37
+fdbl 123.456.789,1234567900000000000000000000000000000
+fdec 123.456.789,1234567890000000000000000000000000000
+d 38
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 39
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 40
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 41
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 42
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 43
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 44
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 45
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 46
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 47
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 48
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 49
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+d 50
+fdbl 123.456.789,12345678000000000000000000000000000000
+fdec 123.456.789,12345678900000000000000000000000000000
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/type_float.test b/mysql-test/main/type_float.test
index ea1829bfdaa..a12bf67a426 100644
--- a/mysql-test/main/type_float.test
+++ b/mysql-test/main/type_float.test
@@ -681,5 +681,25 @@ EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1e0+a<=>?+a' USING 1e
DROP TABLE t1;
--echo #
+--echo # MDEV-23415 Server crash or Assertion `dec_length <= str_length' failed in Item_func_format::val_str_ascii
+--echo #
+
+SELECT FORMAT('0', 50, 'de_DE');
+SELECT FORMAT(0e0, 50, 'de_DE');
+
+--vertical_results
+DELIMITER $$;
+FOR d IN 0..50
+DO
+ SELECT
+ d,
+ FORMAT(123456789.123456789e0, d, 'de_DE') AS fdbl,
+ FORMAT(123456789.123456789, d, 'de_DE') AS fdec;
+END FOR;
+$$
+DELIMITER ;$$
+--horizontal_results
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result
index 07ecef95e5d..eac263296e2 100644
--- a/mysql-test/main/type_newdecimal.result
+++ b/mysql-test/main/type_newdecimal.result
@@ -2340,6 +2340,53 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
+# MDEV-23105 Cast number string with many leading zeros to decimal gives unexpected result
+#
+SELECT CAST(0000000000000000000000000000000000000000000000000000000000000000000000000000000020.01 AS DECIMAL(15,2)) as val;
+val
+20.01
+SET sql_mode='';
+CREATE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.0'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.9'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.99'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.994'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.995'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.999'));
+CREATE TABLE t2 (a TEXT, d DECIMAL(15,2));
+INSERT IGNORE INTO t2 (a,d) SELECT a, a FROM t1;
+Warnings:
+Note 1265 Data truncated for column 'd' at row 5
+Note 1265 Data truncated for column 'd' at row 6
+Note 1265 Data truncated for column 'd' at row 7
+INSERT IGNORE INTO t2 (a,d) SELECT CONCAT('-',a), CONCAT('-',a) FROM t1;
+Warnings:
+Note 1265 Data truncated for column 'd' at row 5
+Note 1265 Data truncated for column 'd' at row 6
+Note 1265 Data truncated for column 'd' at row 7
+SELECT d, a FROM t2 ORDER BY d,a;
+d a
+-2.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.995
+-2.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.999
+-1.99 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.99
+-1.99 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.994
+-1.90 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.9
+-1.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+-1.00 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.0
+1.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+1.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.0
+1.90 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.9
+1.99 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.99
+1.99 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.994
+2.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.995
+2.00 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.999
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+#
+# End of 10.1 tests
+#
+#
# Bug#18408499 UNSIGNED BIGINT HIGH VALUES
# WRONG NUMERICAL COMPARISON RESULTS
#
@@ -2406,3 +2453,323 @@ drop table t1;
#
# End of 10.2 tests
#
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-23032 FLOOR()/CEIL() incorrectly calculate the precision of a DECIMAL(M,D) column.
+#
+CREATE PROCEDURE p1(prec INT, scale INT, suffix VARCHAR(32))
+BEGIN
+EXECUTE IMMEDIATE CONCAT('CREATE TABLE t1 (a decimal(',prec,',',scale,')',suffix,')');
+INSERT IGNORE INTO t1 VALUES (-1e100), (+1e100);
+CREATE TABLE t2 AS SELECT
+a,
+FLOOR(a) AS fa,
+CEILING(a) AS ca,
+LENGTH(FLOOR(a)),
+LENGTH(CEILING(a))
+FROM t1 ORDER BY a;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2, t1;
+END;
+$$
+CALL p1(38,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(38,10) DEFAULT NULL,
+ `fa` decimal(29,0) DEFAULT NULL,
+ `ca` decimal(29,0) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -9999999999999999999999999999.9999999999
+fa -10000000000000000000000000000
+ca -9999999999999999999999999999
+LENGTH(FLOOR(a)) 30
+LENGTH(CEILING(a)) 29
+a 9999999999999999999999999999.9999999999
+fa 9999999999999999999999999999
+ca 10000000000000000000000000000
+LENGTH(FLOOR(a)) 28
+LENGTH(CEILING(a)) 29
+CALL p1(28,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(28,10) DEFAULT NULL,
+ `fa` decimal(19,0) DEFAULT NULL,
+ `ca` decimal(19,0) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -999999999999999999.9999999999
+fa -1000000000000000000
+ca -999999999999999999
+LENGTH(FLOOR(a)) 20
+LENGTH(CEILING(a)) 19
+a 999999999999999999.9999999999
+fa 999999999999999999
+ca 1000000000000000000
+LENGTH(FLOOR(a)) 18
+LENGTH(CEILING(a)) 19
+CALL p1(27,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(27,10) DEFAULT NULL,
+ `fa` bigint(19) DEFAULT NULL,
+ `ca` bigint(19) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -99999999999999999.9999999999
+fa -100000000000000000
+ca -99999999999999999
+LENGTH(FLOOR(a)) 19
+LENGTH(CEILING(a)) 18
+a 99999999999999999.9999999999
+fa 99999999999999999
+ca 100000000000000000
+LENGTH(FLOOR(a)) 17
+LENGTH(CEILING(a)) 18
+CALL p1(20,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(20,10) DEFAULT NULL,
+ `fa` bigint(12) DEFAULT NULL,
+ `ca` bigint(12) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -9999999999.9999999999
+fa -10000000000
+ca -9999999999
+LENGTH(FLOOR(a)) 12
+LENGTH(CEILING(a)) 11
+a 9999999999.9999999999
+fa 9999999999
+ca 10000000000
+LENGTH(FLOOR(a)) 10
+LENGTH(CEILING(a)) 11
+CALL p1(19,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(19,10) DEFAULT NULL,
+ `fa` bigint(11) DEFAULT NULL,
+ `ca` bigint(11) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -999999999.9999999999
+fa -1000000000
+ca -999999999
+LENGTH(FLOOR(a)) 11
+LENGTH(CEILING(a)) 10
+a 999999999.9999999999
+fa 999999999
+ca 1000000000
+LENGTH(FLOOR(a)) 9
+LENGTH(CEILING(a)) 10
+CALL p1(18,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(18,10) DEFAULT NULL,
+ `fa` int(10) DEFAULT NULL,
+ `ca` int(10) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -99999999.9999999999
+fa -100000000
+ca -99999999
+LENGTH(FLOOR(a)) 10
+LENGTH(CEILING(a)) 9
+a 99999999.9999999999
+fa 99999999
+ca 100000000
+LENGTH(FLOOR(a)) 8
+LENGTH(CEILING(a)) 9
+CALL p1(10,10,'');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(10,10) DEFAULT NULL,
+ `fa` int(2) DEFAULT NULL,
+ `ca` int(2) DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a -0.9999999999
+fa -1
+ca 0
+LENGTH(FLOOR(a)) 2
+LENGTH(CEILING(a)) 1
+a 0.9999999999
+fa 0
+ca 1
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+CALL p1(38,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(38,10) unsigned DEFAULT NULL,
+ `fa` decimal(28,0) unsigned DEFAULT NULL,
+ `ca` decimal(29,0) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 9999999999999999999999999999.9999999999
+fa 9999999999999999999999999999
+ca 10000000000000000000000000000
+LENGTH(FLOOR(a)) 28
+LENGTH(CEILING(a)) 29
+CALL p1(28,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(28,10) unsigned DEFAULT NULL,
+ `fa` bigint(18) unsigned DEFAULT NULL,
+ `ca` decimal(19,0) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 999999999999999999.9999999999
+fa 999999999999999999
+ca 1000000000000000000
+LENGTH(FLOOR(a)) 18
+LENGTH(CEILING(a)) 19
+CALL p1(27,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(27,10) unsigned DEFAULT NULL,
+ `fa` bigint(17) unsigned DEFAULT NULL,
+ `ca` bigint(18) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 99999999999999999.9999999999
+fa 99999999999999999
+ca 100000000000000000
+LENGTH(FLOOR(a)) 17
+LENGTH(CEILING(a)) 18
+CALL p1(20,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(20,10) unsigned DEFAULT NULL,
+ `fa` bigint(10) unsigned DEFAULT NULL,
+ `ca` bigint(11) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 9999999999.9999999999
+fa 9999999999
+ca 10000000000
+LENGTH(FLOOR(a)) 10
+LENGTH(CEILING(a)) 11
+CALL p1(19,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(19,10) unsigned DEFAULT NULL,
+ `fa` int(9) unsigned DEFAULT NULL,
+ `ca` bigint(10) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 999999999.9999999999
+fa 999999999
+ca 1000000000
+LENGTH(FLOOR(a)) 9
+LENGTH(CEILING(a)) 10
+CALL p1(18,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(18,10) unsigned DEFAULT NULL,
+ `fa` int(8) unsigned DEFAULT NULL,
+ `ca` int(9) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 99999999.9999999999
+fa 99999999
+ca 100000000
+LENGTH(FLOOR(a)) 8
+LENGTH(CEILING(a)) 9
+CALL p1(10,10,' UNSIGNED');
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(10,10) unsigned DEFAULT NULL,
+ `fa` int(1) unsigned DEFAULT NULL,
+ `ca` int(1) unsigned DEFAULT NULL,
+ `LENGTH(FLOOR(a))` int(10) DEFAULT NULL,
+ `LENGTH(CEILING(a))` int(10) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+a 0.0000000000
+fa 0
+ca 0
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+a 0.9999999999
+fa 0
+ca 1
+LENGTH(FLOOR(a)) 1
+LENGTH(CEILING(a)) 1
+DROP PROCEDURE p1;
+#
+# MDEV-23118 FORMAT(d1,dec) where dec=0/38 and d1 is DECIMAL(38,38) gives incorrect results
+#
+CREATE OR REPLACE TABLE t1 (a DECIMAL(38,38));
+INSERT INTO t1 VALUES (-0.9999999999999999999999999999999999999), (0.9999999999999999999999999999999999999);
+SELECT a, FORMAT(a,0), FORMAT(a,38) FROM t1;
+a -0.99999999999999999999999999999999999990
+FORMAT(a,0) -1
+FORMAT(a,38) -0.99999999999999999999999999999999999990
+a 0.99999999999999999999999999999999999990
+FORMAT(a,0) 1
+FORMAT(a,38) 0.99999999999999999999999999999999999990
+CREATE OR REPLACE TABLE t2 AS SELECT a, FORMAT(a,0), FORMAT(a,38) FROM t1;
+SELECT * FROM t2;
+a -0.99999999999999999999999999999999999990
+FORMAT(a,0) -1
+FORMAT(a,38) -0.99999999999999999999999999999999999990
+a 0.99999999999999999999999999999999999990
+FORMAT(a,0) 1
+FORMAT(a,38) 0.99999999999999999999999999999999999990
+SHOW CREATE TABLE t2;
+Table t2
+Create Table CREATE TABLE `t2` (
+ `a` decimal(38,38) DEFAULT NULL,
+ `FORMAT(a,0)` varchar(2) DEFAULT NULL,
+ `FORMAT(a,38)` varchar(41) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2,t1;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/type_newdecimal.test b/mysql-test/main/type_newdecimal.test
index 2f3409f56e9..5b7ecf89a07 100644
--- a/mysql-test/main/type_newdecimal.test
+++ b/mysql-test/main/type_newdecimal.test
@@ -1825,6 +1825,32 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-23105 Cast number string with many leading zeros to decimal gives unexpected result
+--echo #
+
+SELECT CAST(0000000000000000000000000000000000000000000000000000000000000000000000000000000020.01 AS DECIMAL(15,2)) as val;
+
+SET sql_mode='';
+CREATE TABLE t1 (a TEXT);
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.0'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.9'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.99'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.994'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.995'));
+INSERT INTO t1 VALUES (CONCAT(REPEAT('0',100),1,'.999'));
+CREATE TABLE t2 (a TEXT, d DECIMAL(15,2));
+INSERT IGNORE INTO t2 (a,d) SELECT a, a FROM t1;
+INSERT IGNORE INTO t2 (a,d) SELECT CONCAT('-',a), CONCAT('-',a) FROM t1;
+SELECT d, a FROM t2 ORDER BY d,a;
+DROP TABLE t1, t2;
+SET sql_mode=DEFAULT;
+
+--echo #
+--echo # End of 10.1 tests
+--echo #
+
+--echo #
--echo # Bug#18408499 UNSIGNED BIGINT HIGH VALUES
--echo # WRONG NUMERICAL COMPARISON RESULTS
--echo #
@@ -1871,3 +1897,70 @@ drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+--echo #
+--echo # MDEV-23032 FLOOR()/CEIL() incorrectly calculate the precision of a DECIMAL(M,D) column.
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(prec INT, scale INT, suffix VARCHAR(32))
+BEGIN
+ EXECUTE IMMEDIATE CONCAT('CREATE TABLE t1 (a decimal(',prec,',',scale,')',suffix,')');
+ INSERT IGNORE INTO t1 VALUES (-1e100), (+1e100);
+ CREATE TABLE t2 AS SELECT
+ a,
+ FLOOR(a) AS fa,
+ CEILING(a) AS ca,
+ LENGTH(FLOOR(a)),
+ LENGTH(CEILING(a))
+ FROM t1 ORDER BY a;
+ SHOW CREATE TABLE t2;
+ SELECT * FROM t2;
+ DROP TABLE t2, t1;
+END;
+$$
+DELIMITER ;$$
+
+--vertical_results
+CALL p1(38,10,'');
+CALL p1(28,10,'');
+CALL p1(27,10,'');
+CALL p1(20,10,'');
+CALL p1(19,10,'');
+CALL p1(18,10,'');
+CALL p1(10,10,'');
+
+CALL p1(38,10,' UNSIGNED');
+CALL p1(28,10,' UNSIGNED');
+CALL p1(27,10,' UNSIGNED');
+CALL p1(20,10,' UNSIGNED');
+CALL p1(19,10,' UNSIGNED');
+CALL p1(18,10,' UNSIGNED');
+CALL p1(10,10,' UNSIGNED');
+
+--horizontal_results
+
+DROP PROCEDURE p1;
+
+
+--echo #
+--echo # MDEV-23118 FORMAT(d1,dec) where dec=0/38 and d1 is DECIMAL(38,38) gives incorrect results
+--echo #
+
+--vertical_results
+CREATE OR REPLACE TABLE t1 (a DECIMAL(38,38));
+INSERT INTO t1 VALUES (-0.9999999999999999999999999999999999999), (0.9999999999999999999999999999999999999);
+SELECT a, FORMAT(a,0), FORMAT(a,38) FROM t1;
+CREATE OR REPLACE TABLE t2 AS SELECT a, FORMAT(a,0), FORMAT(a,38) FROM t1;
+SELECT * FROM t2;
+SHOW CREATE TABLE t2;
+DROP TABLE t2,t1;
+--horizontal_results
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 441852fb362..19b162a82cb 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3851,6 +3851,22 @@ ERROR 42000: Too big scale 56 specified for 'rank() over w1'. Maximum is 38
SELECT cast((rank() over w1) as decimal (53,30));
ERROR HY000: Window specification with name 'w1' is not defined
#
+# MDEV-15180: server crashed with NTH_VALUE()
+#
+CREATE TABLE t1 (i1 int, a int);
+INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3);
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3);
+CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ;
+SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1;
+NTH_VALUE(i1, i1) OVER (PARTITION BY i1)
+1
+1
+NULL
+NULL
+DROP VIEW v1;
+DROP TABLE t1,t2;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 4b442c03ad6..d8065e15fee 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2506,6 +2506,22 @@ SELECT cast((rank() over w1) as decimal (53,56));
SELECT cast((rank() over w1) as decimal (53,30));
--echo #
+--echo # MDEV-15180: server crashed with NTH_VALUE()
+--echo #
+
+CREATE TABLE t1 (i1 int, a int);
+INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3);
+
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3);
+
+CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ;
+SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+--echo #
--echo # End of 10.2 tests
--echo #