Skip to content

Commit 95cdc1c

Browse files
committed
Merge commit '43882e764d6867c6855b1ff057758a3f08b25c55' into 10.4
2 parents ae1d17f + 43882e7 commit 95cdc1c

File tree

67 files changed

+984
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+984
-392
lines changed

mysql-test/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ options with which the server is started, restart the server during
5151
execution, etc.)
5252

5353
You can create your own test cases. To create a test case, create a new
54-
file in the t subdirectory using a text editor. The file should have a .test
54+
file in the main subdirectory using a text editor. The file should have a .test
5555
extension. For example:
5656

5757
# xemacs t/test_case_name.test
@@ -60,7 +60,7 @@ In the file, put a set of SQL statements that create some tables,
6060
load test data, and run some queries to manipulate it.
6161

6262
Your test should begin by dropping the tables you are going to create and
63-
end by dropping them again. This ensures that you can run the test over
63+
end by dropping them again. This ensures that you can run the test over
6464
and over again.
6565

6666
If you are using mysqltest commands in your test case, you should create
@@ -81,7 +81,7 @@ comments, you can create the result file in one of the following ways:
8181

8282
# mysqltest --record --database test --result-file=r/test_case_name.result < t/test_case_name.test
8383

84-
When this is done, take a look at r/test_case_name.result .
84+
When this is done, take a look at r/test_case_name.result.
8585
If the result is incorrect, you have found a bug. In this case, you should
8686
edit the test result to the correct results so that we can verify that
8787
the bug is corrected in future releases.

mysql-test/include/switch_to_mysql_user.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ CREATE TABLE mysql.user (
4848
is_role enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
4949
default_role char(80) binary DEFAULT '' NOT NULL,
5050
max_statement_time decimal(12,6) DEFAULT 0 NOT NULL,
51-
PRIMARY KEY Host (Host,User)
51+
PRIMARY KEY (Host,User)
5252
) engine=Aria transactional=1 CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges';
5353
insert mysql.user select * from mysql.user_bak;
5454
rename table mysql.global_priv to mysql.global_priv_bak;

mysql-test/main/create.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,3 +2008,7 @@ create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j;
20082008
Warnings:
20092009
Note 1831 Duplicate index `i_2`. This is deprecated and will be disallowed in a future release
20102010
drop table t1;
2011+
CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2));
2012+
Warnings:
2013+
Warning 1280 Name 'foo' ignored for PRIMARY key.
2014+
DROP TABLE t1;

mysql-test/main/create.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,3 +1864,10 @@ create table t1;
18641864
#
18651865
create table t1 (i int, j int, key(i), key(i)) as select 1 as i, 2 as j;
18661866
drop table t1;
1867+
1868+
#
1869+
# MDEV-17544 No warning when trying to name a primary key constraint.
1870+
#
1871+
CREATE TABLE t1 ( id1 INT, id2 INT, CONSTRAINT `foo` PRIMARY KEY (id1), CONSTRAINT `bar` UNIQUE KEY(id2));
1872+
DROP TABLE t1;
1873+

mysql-test/main/ctype_collate.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ CREATE TABLE t1 (
732732
b LONGTEXT CHARACTER SET "latin1" COLLATE "latin1_bin",
733733
PRIMARY KEY b (b(32))
734734
);
735+
Warnings:
736+
Warning 1280 Name 'b' ignored for PRIMARY key.
735737
INSERT INTO t1 (b) VALUES ('a'), (_binary 0x1), (_binary 0x0), ('');
736738
explain
737739
select hex(b) from t1 force index (PRIMARY) where b<'zzz';

mysql-test/main/ctype_latin2_ch.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ tt char(255) not null
1010
insert into t1 values (1,'Aa');
1111
insert into t1 values (2,'Aas');
1212
alter table t1 add primary key aaa(tt);
13+
Warnings:
14+
Warning 1280 Name 'aaa' ignored for PRIMARY key.
1315
select * from t1 where tt like 'Aa%';
1416
id tt
1517
1 Aa

mysql-test/main/func_hybrid_type.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3915,6 +3915,21 @@ t1 CREATE TABLE `t1` (
39153915
DROP TABLE t1;
39163916
SET sql_mode=DEFAULT;
39173917
#
3918+
# MDEV-18456 Assertion `item->maybe_null' failed in Type_handler_temporal_result::make_sort_key
3919+
#
3920+
CREATE TABLE t1 (t TIME NOT NULL);
3921+
INSERT INTO t1 VALUES ('00:20:11'),('14:52:05');
3922+
SELECT GREATEST('9999', t) FROM t1 ORDER BY 1;
3923+
GREATEST('9999', t)
3924+
NULL
3925+
NULL
3926+
Warnings:
3927+
Warning 1292 Incorrect time value: '9999'
3928+
Warning 1292 Incorrect time value: '9999'
3929+
Warning 1292 Incorrect time value: '9999'
3930+
Warning 1292 Incorrect time value: '9999'
3931+
DROP TABLE t1;
3932+
#
39183933
# End of 10.3 tests
39193934
#
39203935
#

mysql-test/main/func_hybrid_type.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,16 @@ SHOW CREATE TABLE t1;
710710
DROP TABLE t1;
711711
SET sql_mode=DEFAULT;
712712

713+
--echo #
714+
--echo # MDEV-18456 Assertion `item->maybe_null' failed in Type_handler_temporal_result::make_sort_key
715+
--echo #
716+
717+
CREATE TABLE t1 (t TIME NOT NULL);
718+
INSERT INTO t1 VALUES ('00:20:11'),('14:52:05');
719+
SELECT GREATEST('9999', t) FROM t1 ORDER BY 1;
720+
DROP TABLE t1;
721+
722+
713723
--echo #
714724
--echo # End of 10.3 tests
715725
--echo #

mysql-test/main/func_str.result

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,6 +5068,90 @@ NULL
50685068

50695069
DROP TABLE t1;
50705070
#
5071+
# MDEV-20292 REPEAT(x,-1) returns a wrong data type
5072+
#
5073+
CREATE OR REPLACE TABLE t1 (i BIGINT);
5074+
INSERT INTO t1 VALUES (42);
5075+
CREATE OR REPLACE TABLE t2 AS SELECT
5076+
REPEAT(i,NULL) AS cn,
5077+
REPEAT(i,0) AS c0,
5078+
REPEAT(i,-1) AS c1
5079+
FROM t1;
5080+
SHOW CREATE TABLE t2;
5081+
Table Create Table
5082+
t2 CREATE TABLE `t2` (
5083+
`cn` char(0) CHARACTER SET utf8 DEFAULT NULL,
5084+
`c0` char(0) CHARACTER SET utf8 DEFAULT NULL,
5085+
`c1` char(0) CHARACTER SET utf8 DEFAULT NULL
5086+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
5087+
DROP TABLE t1, t2;
5088+
#
5089+
# MDEV-20303 SPACE(-1) returns a wrong data type
5090+
#
5091+
CREATE TABLE t1 (i BIGINT);
5092+
INSERT INTO t1 VALUES (42);
5093+
CREATE TABLE t2 AS SELECT
5094+
SPACE(NULL) AS cn,
5095+
SPACE(0) AS c0,
5096+
SPACE(-1) AS c1
5097+
FROM t1;
5098+
SHOW CREATE TABLE t2;
5099+
Table Create Table
5100+
t2 CREATE TABLE `t2` (
5101+
`cn` char(0) CHARACTER SET utf8 DEFAULT NULL,
5102+
`c0` char(0) CHARACTER SET utf8 DEFAULT NULL,
5103+
`c1` char(0) CHARACTER SET utf8 DEFAULT NULL
5104+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
5105+
DROP TABLE t1, t2;
5106+
CREATE TABLE t1 (i BIGINT);
5107+
INSERT INTO t1 VALUES (42);
5108+
CREATE TABLE t2 AS SELECT
5109+
LPAD(i,NULL,'a') AS cn,
5110+
LPAD(i,0,'a') AS c0,
5111+
LPAD(i,-1,'a') AS c1
5112+
FROM t1;
5113+
SHOW CREATE TABLE t2;
5114+
Table Create Table
5115+
t2 CREATE TABLE `t2` (
5116+
`cn` char(0) CHARACTER SET utf8 DEFAULT NULL,
5117+
`c0` char(0) CHARACTER SET utf8 DEFAULT NULL,
5118+
`c1` char(0) CHARACTER SET utf8 DEFAULT NULL
5119+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
5120+
DROP TABLE t1, t2;
5121+
CREATE TABLE t1 (i BIGINT);
5122+
INSERT INTO t1 VALUES (42);
5123+
CREATE TABLE t2 AS SELECT
5124+
RPAD(i,NULL,'a') AS cn,
5125+
RPAD(i,0,'a') AS c0,
5126+
RPAD(i,-1,'a') AS c1
5127+
FROM t1;
5128+
SHOW CREATE TABLE t2;
5129+
Table Create Table
5130+
t2 CREATE TABLE `t2` (
5131+
`cn` char(0) CHARACTER SET utf8 DEFAULT NULL,
5132+
`c0` char(0) CHARACTER SET utf8 DEFAULT NULL,
5133+
`c1` char(0) CHARACTER SET utf8 DEFAULT NULL
5134+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
5135+
DROP TABLE t1, t2;
5136+
CREATE TABLE t1 (i BIGINT);
5137+
INSERT INTO t1 VALUES (42);
5138+
CREATE TABLE t2 AS SELECT
5139+
LEFT(i,NULL) AS cn,
5140+
LEFT(i,0) AS c0,
5141+
LEFT(i,18446744073709551615) AS c1
5142+
FROM t1;
5143+
SHOW CREATE TABLE t2;
5144+
Table Create Table
5145+
t2 CREATE TABLE `t2` (
5146+
`cn` char(0) CHARACTER SET utf8 DEFAULT NULL,
5147+
`c0` char(0) CHARACTER SET utf8 DEFAULT NULL,
5148+
`c1` varchar(20) CHARACTER SET utf8 DEFAULT NULL
5149+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
5150+
SELECT c1 FROM t2;
5151+
c1
5152+
42
5153+
DROP TABLE t1, t2;
5154+
#
50715155
# End of 10.3 tests
50725156
#
50735157
#

mysql-test/main/func_str.test

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,66 @@ SELECT LPAD( c, 0, '?' ) FROM t1;
20282028
SELECT RPAD( c, 0, '?' ) FROM t1;
20292029
DROP TABLE t1;
20302030

2031+
--echo #
2032+
--echo # MDEV-20292 REPEAT(x,-1) returns a wrong data type
2033+
--echo #
2034+
2035+
CREATE OR REPLACE TABLE t1 (i BIGINT);
2036+
INSERT INTO t1 VALUES (42);
2037+
CREATE OR REPLACE TABLE t2 AS SELECT
2038+
REPEAT(i,NULL) AS cn,
2039+
REPEAT(i,0) AS c0,
2040+
REPEAT(i,-1) AS c1
2041+
FROM t1;
2042+
SHOW CREATE TABLE t2;
2043+
DROP TABLE t1, t2;
2044+
2045+
2046+
--echo #
2047+
--echo # MDEV-20303 SPACE(-1) returns a wrong data type
2048+
--echo #
2049+
2050+
CREATE TABLE t1 (i BIGINT);
2051+
INSERT INTO t1 VALUES (42);
2052+
CREATE TABLE t2 AS SELECT
2053+
SPACE(NULL) AS cn,
2054+
SPACE(0) AS c0,
2055+
SPACE(-1) AS c1
2056+
FROM t1;
2057+
SHOW CREATE TABLE t2;
2058+
DROP TABLE t1, t2;
2059+
2060+
CREATE TABLE t1 (i BIGINT);
2061+
INSERT INTO t1 VALUES (42);
2062+
CREATE TABLE t2 AS SELECT
2063+
LPAD(i,NULL,'a') AS cn,
2064+
LPAD(i,0,'a') AS c0,
2065+
LPAD(i,-1,'a') AS c1
2066+
FROM t1;
2067+
SHOW CREATE TABLE t2;
2068+
DROP TABLE t1, t2;
2069+
2070+
CREATE TABLE t1 (i BIGINT);
2071+
INSERT INTO t1 VALUES (42);
2072+
CREATE TABLE t2 AS SELECT
2073+
RPAD(i,NULL,'a') AS cn,
2074+
RPAD(i,0,'a') AS c0,
2075+
RPAD(i,-1,'a') AS c1
2076+
FROM t1;
2077+
SHOW CREATE TABLE t2;
2078+
DROP TABLE t1, t2;
2079+
2080+
CREATE TABLE t1 (i BIGINT);
2081+
INSERT INTO t1 VALUES (42);
2082+
CREATE TABLE t2 AS SELECT
2083+
LEFT(i,NULL) AS cn,
2084+
LEFT(i,0) AS c0,
2085+
LEFT(i,18446744073709551615) AS c1
2086+
FROM t1;
2087+
SHOW CREATE TABLE t2;
2088+
SELECT c1 FROM t2;
2089+
DROP TABLE t1, t2;
2090+
20312091

20322092
--echo #
20332093
--echo # End of 10.3 tests

0 commit comments

Comments
 (0)