Skip to content

Commit 0a359d7

Browse files
committed
Merge remote-tracking branch 'origin/10.1' into 10.2
2 parents fa9e012 + 5f118b2 commit 0a359d7

33 files changed

+257
-44
lines changed

cmake/os/Linux.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE=1)
2626

2727
# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
2828
FOREACH(LANG C CXX)
29-
STRING(REPLACE "-rdynamic" ""
29+
STRING(REPLACE "-rdynamic" ""
3030
CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
31-
${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}
31+
"${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}"
3232
)
3333
ENDFOREACH()
3434

mysql-test/r/ctype_binary.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ create table t1 as select concat(1 % 2) as c1;
102102
show create table t1;
103103
Table Create Table
104104
t1 CREATE TABLE `t1` (
105-
`c1` varbinary(1) DEFAULT NULL
105+
`c1` varbinary(2) DEFAULT NULL
106106
) ENGINE=MyISAM DEFAULT CHARSET=latin1
107107
drop table t1;
108108
select hex(concat(-1));

mysql-test/r/ctype_cp1251.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ create table t1 as select concat(1 % 2) as c1;
511511
show create table t1;
512512
Table Create Table
513513
t1 CREATE TABLE `t1` (
514-
`c1` varchar(1) CHARACTER SET cp1251 DEFAULT NULL
514+
`c1` varchar(2) CHARACTER SET cp1251 DEFAULT NULL
515515
) ENGINE=MyISAM DEFAULT CHARSET=latin1
516516
drop table t1;
517517
select hex(concat(-1));

mysql-test/r/ctype_latin1.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ create table t1 as select concat(1 % 2) as c1;
820820
show create table t1;
821821
Table Create Table
822822
t1 CREATE TABLE `t1` (
823-
`c1` varchar(1) DEFAULT NULL
823+
`c1` varchar(2) DEFAULT NULL
824824
) ENGINE=MyISAM DEFAULT CHARSET=latin1
825825
drop table t1;
826826
select hex(concat(-1));

mysql-test/r/ctype_ucs.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ create table t1 as select concat(1 % 2) as c1;
17001700
show create table t1;
17011701
Table Create Table
17021702
t1 CREATE TABLE `t1` (
1703-
`c1` varchar(1) CHARACTER SET ucs2 DEFAULT NULL
1703+
`c1` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
17041704
) ENGINE=MyISAM DEFAULT CHARSET=latin1
17051705
drop table t1;
17061706
select hex(concat(-1));

mysql-test/r/ctype_utf8.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ create table t1 as select concat(1 % 2) as c1;
25712571
show create table t1;
25722572
Table Create Table
25732573
t1 CREATE TABLE `t1` (
2574-
`c1` varchar(1) CHARACTER SET utf8 DEFAULT NULL
2574+
`c1` varchar(2) CHARACTER SET utf8 DEFAULT NULL
25752575
) ENGINE=MyISAM DEFAULT CHARSET=latin1
25762576
drop table t1;
25772577
select hex(concat(-1));

mysql-test/r/func_math.result

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,64 @@ STDDEV_SAMP(ROUND('0', 309))
817817
0
818818
DROP TABLE t1;
819819
#
820+
# MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal
821+
#
822+
# Testing that dyadic arithmetic operations are symmetric
823+
# for (+1) and (-1) and produce the same length in CONCAT(),
824+
# because (+1) and (-1) have the same data type: signed int.
825+
CREATE TABLE t1 AS SELECT
826+
CONCAT(+1%2.0),
827+
CONCAT(-1%2.0),
828+
CONCAT(+1/2.0),
829+
CONCAT(-1/2.0),
830+
CONCAT(+1*2.0),
831+
CONCAT(-1*2.0),
832+
CONCAT(+1+2.0),
833+
CONCAT(-1+2.0),
834+
CONCAT(+1-2.0),
835+
CONCAT(-1-2.0);
836+
SHOW CREATE TABLE t1;
837+
Table Create Table
838+
t1 CREATE TABLE `t1` (
839+
`CONCAT(+1%2.0)` varchar(4) DEFAULT NULL,
840+
`CONCAT(-1%2.0)` varchar(4) DEFAULT NULL,
841+
`CONCAT(+1/2.0)` varchar(8) DEFAULT NULL,
842+
`CONCAT(-1/2.0)` varchar(8) DEFAULT NULL,
843+
`CONCAT(+1*2.0)` varchar(5) DEFAULT NULL,
844+
`CONCAT(-1*2.0)` varchar(5) DEFAULT NULL,
845+
`CONCAT(+1+2.0)` varchar(5) DEFAULT NULL,
846+
`CONCAT(-1+2.0)` varchar(5) DEFAULT NULL,
847+
`CONCAT(+1-2.0)` varchar(5) DEFAULT NULL,
848+
`CONCAT(-1-2.0)` varchar(5) DEFAULT NULL
849+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
850+
DROP TABLE t1;
851+
CREATE TABLE t1 AS SELECT
852+
CONCAT(+1%2),
853+
CONCAT(-1%2),
854+
CONCAT(+1/2),
855+
CONCAT(-1/2),
856+
CONCAT(+1*2),
857+
CONCAT(-1*2),
858+
CONCAT(+1+2),
859+
CONCAT(-1+2),
860+
CONCAT(+1-2),
861+
CONCAT(-1-2);
862+
SHOW CREATE TABLE t1;
863+
Table Create Table
864+
t1 CREATE TABLE `t1` (
865+
`CONCAT(+1%2)` varchar(2) DEFAULT NULL,
866+
`CONCAT(-1%2)` varchar(2) DEFAULT NULL,
867+
`CONCAT(+1/2)` varchar(7) DEFAULT NULL,
868+
`CONCAT(-1/2)` varchar(7) DEFAULT NULL,
869+
`CONCAT(+1*2)` varchar(3) DEFAULT NULL,
870+
`CONCAT(-1*2)` varchar(3) DEFAULT NULL,
871+
`CONCAT(+1+2)` varchar(3) DEFAULT NULL,
872+
`CONCAT(-1+2)` varchar(3) DEFAULT NULL,
873+
`CONCAT(+1-2)` varchar(3) DEFAULT NULL,
874+
`CONCAT(-1-2)` varchar(3) DEFAULT NULL
875+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
876+
DROP TABLE t1;
877+
#
820878
# End of 5.5 tests
821879
#
822880
#

mysql-test/r/func_time.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ Warning 1292 Truncated incorrect DECIMAL value: '2005-05-0410'
21532153
SHOW CREATE TABLE t2;
21542154
Table Create Table
21552155
t2 CREATE TABLE `t2` (
2156-
`f2` varchar(26) DEFAULT NULL
2156+
`f2` varchar(28) DEFAULT NULL
21572157
) ENGINE=MyISAM DEFAULT CHARSET=latin1
21582158
SELECT * FROM t2;
21592159
f2

mysql-test/r/type_newdecimal.result

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,70 @@ t1 CREATE TABLE `t1` (
20382038
) ENGINE=MyISAM DEFAULT CHARSET=latin1
20392039
DROP TABLE t1;
20402040
#
2041+
# MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal
2042+
#
2043+
CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL);
2044+
CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1;
2045+
SHOW CREATE TABLE t2;
2046+
Table Create Table
2047+
t2 CREATE TABLE `t2` (
2048+
`f` decimal(1,0) DEFAULT NULL
2049+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2050+
DROP TABLE t1, t2;
2051+
CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED);
2052+
CREATE TABLE t2 AS SELECT 0 MOD d AS f FROM t1;
2053+
SHOW CREATE TABLE t2;
2054+
Table Create Table
2055+
t2 CREATE TABLE `t2` (
2056+
`f` decimal(1,0) DEFAULT NULL
2057+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2058+
DROP TABLE IF EXISTS t1,t2;
2059+
CREATE TABLE t1 (d DECIMAL(1,0) ZEROFILL);
2060+
CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1;
2061+
SHOW CREATE TABLE t2;
2062+
Table Create Table
2063+
t2 CREATE TABLE `t2` (
2064+
`f` decimal(1,0) unsigned DEFAULT NULL
2065+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2066+
DROP TABLE t1, t2;
2067+
CREATE TABLE t1 (d DECIMAL(1,0) UNSIGNED);
2068+
CREATE TABLE t2 AS SELECT CAST(0 AS UNSIGNED) MOD d AS f FROM t1;
2069+
SHOW CREATE TABLE t2;
2070+
Table Create Table
2071+
t2 CREATE TABLE `t2` (
2072+
`f` decimal(1,0) unsigned DEFAULT NULL
2073+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2074+
DROP TABLE t1,t2;
2075+
#
2076+
# MDEV-20560 Assertion `precision > 0' failed in decimal_bin_size upon SELECT with MOD short unsigned decimal
2077+
#
2078+
CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED);
2079+
INSERT INTO t1 VALUES (1.0),(2.0);
2080+
SELECT DISTINCT 1 MOD a FROM t1;
2081+
1 MOD a
2082+
0
2083+
1
2084+
CREATE TABLE t2 AS SELECT DISTINCT 1 MOD a AS f FROM t1;
2085+
SHOW CREATE TABLE t2;
2086+
Table Create Table
2087+
t2 CREATE TABLE `t2` (
2088+
`f` decimal(1,0) DEFAULT NULL
2089+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2090+
DROP TABLE t1, t2;
2091+
CREATE TABLE t1 (a DECIMAL(1,0) UNSIGNED);
2092+
INSERT INTO t1 VALUES (1.0),(2.0);
2093+
SELECT DISTINCT 1 MOD a FROM t1;
2094+
1 MOD a
2095+
0
2096+
1
2097+
CREATE TABLE t2 AS SELECT DISTINCT CAST(1 AS UNSIGNED) MOD a AS f FROM t1;
2098+
SHOW CREATE TABLE t2;
2099+
Table Create Table
2100+
t2 CREATE TABLE `t2` (
2101+
`f` decimal(1,0) unsigned DEFAULT NULL
2102+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
2103+
DROP TABLE t1, t2;
2104+
#
20412105
# End of 5.5 tests
20422106
#
20432107
#

mysql-test/t/func_math.test

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,44 @@ INSERT INTO t1 VALUES (1),(2);
589589
SELECT STDDEV_SAMP(ROUND('0', 309)) FROM t1;
590590
DROP TABLE t1;
591591

592+
593+
--echo #
594+
--echo # MDEV-20495 Assertion `precision > 0' failed in decimal_bin_size upon CREATE .. SELECT with zerofilled decimal
595+
--echo #
596+
597+
--echo # Testing that dyadic arithmetic operations are symmetric
598+
--echo # for (+1) and (-1) and produce the same length in CONCAT(),
599+
--echo # because (+1) and (-1) have the same data type: signed int.
600+
601+
CREATE TABLE t1 AS SELECT
602+
CONCAT(+1%2.0),
603+
CONCAT(-1%2.0),
604+
CONCAT(+1/2.0),
605+
CONCAT(-1/2.0),
606+
CONCAT(+1*2.0),
607+
CONCAT(-1*2.0),
608+
CONCAT(+1+2.0),
609+
CONCAT(-1+2.0),
610+
CONCAT(+1-2.0),
611+
CONCAT(-1-2.0);
612+
SHOW CREATE TABLE t1;
613+
DROP TABLE t1;
614+
615+
CREATE TABLE t1 AS SELECT
616+
CONCAT(+1%2),
617+
CONCAT(-1%2),
618+
CONCAT(+1/2),
619+
CONCAT(-1/2),
620+
CONCAT(+1*2),
621+
CONCAT(-1*2),
622+
CONCAT(+1+2),
623+
CONCAT(-1+2),
624+
CONCAT(+1-2),
625+
CONCAT(-1-2);
626+
SHOW CREATE TABLE t1;
627+
DROP TABLE t1;
628+
629+
592630
--echo #
593631
--echo # End of 5.5 tests
594632
--echo #

0 commit comments

Comments
 (0)