Skip to content

Commit 042f763

Browse files
committed
Merge remote-tracking branch '5.5' into 10.0
2 parents cb121a0 + 924db8b commit 042f763

31 files changed

+420
-98
lines changed

mysql-test/r/func_set.result

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,11 @@ NULL
221221

222222
DROP TABLE t1;
223223
#
224-
# Start of 5.3 tests
225-
#
226-
#
227-
# MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types
228-
#
229-
CREATE TABLE t1 (pk INT PRIMARY KEY);
230-
INSERT INTO t1 VALUES (10),(11);
231-
SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1;
232-
INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 )
233-
8
234-
8
235-
Warnings:
236-
Warning 1292 Incorrect datetime value: '10'
237-
Warning 1292 Incorrect datetime value: '11'
238-
DROP TABLE t1;
239-
#
240-
# End of 5.3 tests
224+
# MDEV-14596 Crash in INTERVAL(ROW(..),ROW(..))
241225
#
226+
SELECT INTERVAL(ROW(1,1),ROW(1,2));
227+
ERROR 21000: Operand should contain 1 column(s)
228+
SELECT INTERVAL(1,ROW(1,2));
229+
ERROR 21000: Operand should contain 1 column(s)
230+
SELECT INTERVAL(ROW(1,2),1);
231+
ERROR 21000: Operand should contain 1 column(s)

mysql-test/r/group_by.result

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,6 +2558,31 @@ create table t2 (c1 int, c2 int);
25582558
select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group by t1.c1, t2.c2 having t1.c1 < 3;
25592559
c1 c1
25602560
drop table t1, t2;
2561+
SET @old_sort_buff_size = @@sort_buffer_size;
2562+
SET @@sort_buffer_size=256*1024;
2563+
CREATE TABLE t1 (c INT) ENGINE=MyISAM;
2564+
INSERT INTO t1 VALUES
2565+
(2011),(1977),(1982),(2027),(2023),(NULL),(NULL),(2004),(1974),(2032),
2566+
(1993),(NULL),(1995),(2034),(NULL),(2009),(1900),(NULL),(2025),(1900),
2567+
(2033),(1900),(2012),(NULL),(2009),(1992),(1974),(1974),(2012),(2028),
2568+
(2007),(2012),(1900),(1983),(1900),(2010),(1987),(1994),(1981),(2032),
2569+
(2010),(1989),(2014),(1900),(1900),(1976),(1978),(2007),(2030),(NULL),
2570+
(2002),(1997),(1900),(NULL),(2000),(2027),(1975),(2026),(1975),(2026),
2571+
(2029),(1977),(1900),(1900),(2031),(1993),(1986),(2012),(1979),(2013),
2572+
(1994),(2014),(2025),(2006),(1971),(1974),(2021),(2011),(NULL),(1991),
2573+
(2001),(1977),(2023),(2012),(1900),(1978),(1998),(NULL),(1988),(1999),
2574+
(2017),(2008),(1976),(1900),(2005),(2030),(2023),(1900),(1978),(1990),
2575+
(1978),(1987),(2030),(1900),(2034),(2006),(2015),(2001),(2019),(2024),
2576+
(2030),(1989),(1997),(2007),(2023),(1994),(1971),(2011),(2011),(2015),
2577+
(1984),(1978),(1979),(1989),(2008),(2030);
2578+
SELECT ExtractValue('<a></a>','/a') AS f1, SPACE(c) AS f2 FROM t1 GROUP BY f1, f2 WITH ROLLUP;
2579+
f1 f2
2580+
NULL
2581+
2582+
NULL
2583+
NULL NULL
2584+
SET @@sort_buffer_size = @old_sort_buff_size;
2585+
DROP TABLE t1;
25612586
#
25622587
# Bug #58782
25632588
# Missing rows with SELECT .. WHERE .. IN subquery

mysql-test/r/having.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,21 @@ id column_1
698698
expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR
699699
drop table t1;
700700
#
701+
# mdev-14368: grouping query with alias for aggregate function in HAVING
702+
# when sql_mode = 'ONLY_FULL_GROUP_BY'
703+
set @save_sql_mode= @@sql_mode;
704+
set sql_mode = 'ONLY_FULL_GROUP_BY';
705+
create table t1(a int);
706+
insert t1 values (4),(1),(2),(1), (3),(4);
707+
SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0;
708+
a ct
709+
1 2
710+
2 1
711+
3 1
712+
4 2
713+
set sql_mode=@save_sql_mode;
714+
drop table t1;
715+
#
701716
# Bug mdev-5160: two-way join with HAVING over the second table
702717
#
703718
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;

mysql-test/r/join_outer.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,5 +2342,18 @@ Warnings:
23422342
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (`f1`(`test`.`t2`.`col3`,0) = 0)
23432343
DROP FUNCTION f1;
23442344
DROP TABLE t1,t2;
2345+
#
2346+
# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
2347+
#
2348+
CREATE TABLE t1 (b1 BIT NOT NULL);
2349+
INSERT INTO t1 VALUES (0),(1);
2350+
CREATE TABLE t2 (b2 BIT NOT NULL);
2351+
INSERT INTO t2 VALUES (0),(1);
2352+
SET SESSION JOIN_CACHE_LEVEL = 3;
2353+
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
2354+
t1.b1+'0' t2.b2 + '0'
2355+
0 0
2356+
1 1
2357+
DROP TABLE t1, t2;
23452358
# end of 5.5 tests
23462359
SET optimizer_switch=@save_optimizer_switch;

mysql-test/r/join_outer_jcl6.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,6 +2353,19 @@ Warnings:
23532353
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (`f1`(`test`.`t2`.`col3`,0) = 0)
23542354
DROP FUNCTION f1;
23552355
DROP TABLE t1,t2;
2356+
#
2357+
# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
2358+
#
2359+
CREATE TABLE t1 (b1 BIT NOT NULL);
2360+
INSERT INTO t1 VALUES (0),(1);
2361+
CREATE TABLE t2 (b2 BIT NOT NULL);
2362+
INSERT INTO t2 VALUES (0),(1);
2363+
SET SESSION JOIN_CACHE_LEVEL = 3;
2364+
SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
2365+
t1.b1+'0' t2.b2 + '0'
2366+
0 0
2367+
1 1
2368+
DROP TABLE t1, t2;
23562369
# end of 5.5 tests
23572370
SET optimizer_switch=@save_optimizer_switch;
23582371
set join_cache_level=default;

mysql-test/r/view.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5630,6 +5630,20 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
56305630
ERROR HY000: Can not insert into join view 'test.v2' without fields list
56315631
drop view v1,v2;
56325632
drop table t3;
5633+
#
5634+
# MDEV-14619: VIEW and GROUP_CONCAT
5635+
#
5636+
CREATE TABLE t1 (str text);
5637+
INSERT INTO t1 VALUES ("My"),("SQL");
5638+
CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
5639+
SELECT * FROM v1;
5640+
GROUP_CONCAT(str SEPARATOR '\\')
5641+
My\SQL
5642+
SHOW CREATE VIEW v1;
5643+
View Create View character_set_client collation_connection
5644+
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
5645+
drop view v1;
5646+
drop table t1;
56335647
# -----------------------------------------------------------------
56345648
# -- End of 5.5 tests.
56355649
# -----------------------------------------------------------------
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--echo #
2+
--echo # MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
3+
--echo #
4+
5+
--eval CREATE TABLE t1 (i INT) ENGINE=$engine PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));
6+
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
7+
ALTER TABLE t1 DROP PARTITION p1;
8+
SELECT * FROM t1;
9+
10+
# Cleanup
11+
DROP TABLE t1;
12+
13+
14+
--echo #
15+
--echo # MDEV-13788 Server crash when issuing bad SQL partition syntax
16+
--echo #
17+
18+
--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE))
19+
SHOW CREATE TABLE t1;
20+
--error ER_PARTITION_REQUIRES_VALUES_ERROR
21+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
22+
(
23+
PARTITION p2, /* Notice no values */
24+
PARTITION p3 VALUES LESS THAN (MAXVALUE)
25+
);
26+
DROP TABLE t1;
27+
28+
29+
--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3))
30+
SHOW CREATE TABLE t1;
31+
--error ER_PARTITION_REQUIRES_VALUES_ERROR
32+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
33+
(
34+
PARTITION p2, /* Notice no values */
35+
PARTITION p3 VALUES IN (4,5,6)
36+
);
37+
DROP TABLE t1;
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
3+
#
4+
CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
5+
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
6+
Warnings:
7+
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
8+
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
9+
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
10+
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
11+
ALTER TABLE t1 DROP PARTITION p1;
12+
SELECT * FROM t1;
13+
i
14+
DROP TABLE t1;
15+
#
16+
# MDEV-13788 Server crash when issuing bad SQL partition syntax
17+
#
18+
CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
19+
SHOW CREATE TABLE t1;
20+
Table Create Table
21+
t1 CREATE TABLE `t1` (
22+
`id` int(11) DEFAULT NULL,
23+
`d` date DEFAULT NULL
24+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
25+
/*!50500 PARTITION BY RANGE COLUMNS(d)
26+
(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */
27+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
28+
(
29+
PARTITION p2, /* Notice no values */
30+
PARTITION p3 VALUES LESS THAN (MAXVALUE)
31+
);
32+
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
33+
DROP TABLE t1;
34+
CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
35+
SHOW CREATE TABLE t1;
36+
Table Create Table
37+
t1 CREATE TABLE `t1` (
38+
`id` int(11) DEFAULT NULL,
39+
`d` date DEFAULT NULL
40+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
41+
/*!50100 PARTITION BY LIST (id)
42+
(PARTITION p1 VALUES IN (1,2,3) ENGINE = InnoDB) */
43+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
44+
(
45+
PARTITION p2, /* Notice no values */
46+
PARTITION p3 VALUES IN (4,5,6)
47+
);
48+
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
49+
DROP TABLE t1;

mysql-test/suite/parts/r/partition_alter_maria.result

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,47 @@ select * from t1;
1616
pk dt
1717
1 2017-09-28 15:12:00
1818
drop table t1;
19+
#
20+
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
21+
#
22+
CREATE TABLE t1 (i INT) ENGINE=Aria PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
23+
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
24+
ALTER TABLE t1 DROP PARTITION p1;
25+
SELECT * FROM t1;
26+
i
27+
DROP TABLE t1;
28+
#
29+
# MDEV-13788 Server crash when issuing bad SQL partition syntax
30+
#
31+
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
32+
SHOW CREATE TABLE t1;
33+
Table Create Table
34+
t1 CREATE TABLE `t1` (
35+
`id` int(11) DEFAULT NULL,
36+
`d` date DEFAULT NULL
37+
) ENGINE=Aria DEFAULT CHARSET=latin1
38+
/*!50500 PARTITION BY RANGE COLUMNS(d)
39+
(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = Aria) */
40+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
41+
(
42+
PARTITION p2, /* Notice no values */
43+
PARTITION p3 VALUES LESS THAN (MAXVALUE)
44+
);
45+
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
46+
DROP TABLE t1;
47+
CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
48+
SHOW CREATE TABLE t1;
49+
Table Create Table
50+
t1 CREATE TABLE `t1` (
51+
`id` int(11) DEFAULT NULL,
52+
`d` date DEFAULT NULL
53+
) ENGINE=Aria DEFAULT CHARSET=latin1
54+
/*!50100 PARTITION BY LIST (id)
55+
(PARTITION p1 VALUES IN (1,2,3) ENGINE = Aria) */
56+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
57+
(
58+
PARTITION p2, /* Notice no values */
59+
PARTITION p3 VALUES IN (4,5,6)
60+
);
61+
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
62+
DROP TABLE t1;
Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
1-
CREATE TABLE t1 (i INT) ENGINE=MYISAM
2-
PARTITION BY LIST(i) (
3-
PARTITION p0 VALUES IN (1),
4-
PARTITION p1 VALUES IN (2)
5-
);
1+
#
2+
# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
3+
#
4+
CREATE TABLE t1 (i INT) ENGINE=MyISAM PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
65
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
76
ALTER TABLE t1 DROP PARTITION p1;
87
SELECT * FROM t1;
98
i
109
DROP TABLE t1;
10+
#
11+
# MDEV-13788 Server crash when issuing bad SQL partition syntax
12+
#
13+
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
14+
SHOW CREATE TABLE t1;
15+
Table Create Table
16+
t1 CREATE TABLE `t1` (
17+
`id` int(11) DEFAULT NULL,
18+
`d` date DEFAULT NULL
19+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
20+
/*!50500 PARTITION BY RANGE COLUMNS(d)
21+
(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM) */
22+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
23+
(
24+
PARTITION p2, /* Notice no values */
25+
PARTITION p3 VALUES LESS THAN (MAXVALUE)
26+
);
27+
ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
28+
DROP TABLE t1;
29+
CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
30+
SHOW CREATE TABLE t1;
31+
Table Create Table
32+
t1 CREATE TABLE `t1` (
33+
`id` int(11) DEFAULT NULL,
34+
`d` date DEFAULT NULL
35+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
36+
/*!50100 PARTITION BY LIST (id)
37+
(PARTITION p1 VALUES IN (1,2,3) ENGINE = MyISAM) */
38+
ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
39+
(
40+
PARTITION p2, /* Notice no values */
41+
PARTITION p3 VALUES IN (4,5,6)
42+
);
43+
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
44+
DROP TABLE t1;

0 commit comments

Comments
 (0)