Merge 10.2 into 10.3
This commit is contained in:
commit
1b8749f73b
@ -3207,6 +3207,38 @@ a
|
|||||||
1
|
1
|
||||||
3
|
3
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-16086: tmp table for CTE is created as ARIA tables
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
Id int(11) not null AUTO_INCREMENT,
|
||||||
|
Parent varchar(15) not null,
|
||||||
|
Child varchar(15) not null,
|
||||||
|
PRIMARY KEY (Id)
|
||||||
|
) ENGINE = MyISAM;
|
||||||
|
INSERT INTO t1 (Parent, Child) VALUES
|
||||||
|
('123', '456'),('456', '789'),('321', '654'),('654', '987');
|
||||||
|
WITH RECURSIVE cte AS
|
||||||
|
( SELECT b.Parent,
|
||||||
|
b.Child,
|
||||||
|
CAST(CONCAT(b.Child,',') AS CHAR(513)) Path
|
||||||
|
FROM t1 b
|
||||||
|
LEFT OUTER JOIN t1 bc ON b.Child = bc.Parent
|
||||||
|
WHERE bc.Id IS NULL
|
||||||
|
UNION ALL SELECT c.Parent,
|
||||||
|
c.Child,
|
||||||
|
CONCAT(p.Path,c.Child,',') Path
|
||||||
|
FROM t1 c
|
||||||
|
INNER JOIN cte p ON c.Child = p.Parent)
|
||||||
|
SELECT *
|
||||||
|
FROM cte
|
||||||
|
ORDER BY Path;
|
||||||
|
Parent Child Path
|
||||||
|
456 789 789,
|
||||||
|
123 456 789,456,
|
||||||
|
654 987 987,
|
||||||
|
321 654 987,654,
|
||||||
|
DROP TABLE t1;
|
||||||
# Start of 10.3 tests
|
# Start of 10.3 tests
|
||||||
#
|
#
|
||||||
# MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
|
# MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
|
||||||
|
@ -2215,6 +2215,38 @@ select * from qn;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-16086: tmp table for CTE is created as ARIA tables
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
Id int(11) not null AUTO_INCREMENT,
|
||||||
|
Parent varchar(15) not null,
|
||||||
|
Child varchar(15) not null,
|
||||||
|
PRIMARY KEY (Id)
|
||||||
|
) ENGINE = MyISAM;
|
||||||
|
|
||||||
|
INSERT INTO t1 (Parent, Child) VALUES
|
||||||
|
('123', '456'),('456', '789'),('321', '654'),('654', '987');
|
||||||
|
|
||||||
|
WITH RECURSIVE cte AS
|
||||||
|
( SELECT b.Parent,
|
||||||
|
b.Child,
|
||||||
|
CAST(CONCAT(b.Child,',') AS CHAR(513)) Path
|
||||||
|
FROM t1 b
|
||||||
|
LEFT OUTER JOIN t1 bc ON b.Child = bc.Parent
|
||||||
|
WHERE bc.Id IS NULL
|
||||||
|
UNION ALL SELECT c.Parent,
|
||||||
|
c.Child,
|
||||||
|
CONCAT(p.Path,c.Child,',') Path
|
||||||
|
FROM t1 c
|
||||||
|
INNER JOIN cte p ON c.Child = p.Parent)
|
||||||
|
SELECT *
|
||||||
|
FROM cte
|
||||||
|
ORDER BY Path;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo # Start of 10.3 tests
|
--echo # Start of 10.3 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
@ -638,3 +638,15 @@ t1 CREATE TEMPORARY TABLE `t1` (
|
|||||||
`j` int(11) DEFAULT NULL,
|
`j` int(11) DEFAULT NULL,
|
||||||
PRIMARY KEY (`i`) KEY_BLOCK_SIZE=8
|
PRIMARY KEY (`i`) KEY_BLOCK_SIZE=8
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TEMPORARY TABLE t1(f1 INT, KEY(f1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(NULL);
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
START TRANSACTION;
|
||||||
|
UPDATE t1 SET f1 = 4;
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
ROLLBACK;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
f1
|
||||||
|
0
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -464,3 +464,14 @@ ALTER TABLE t1 ROW_FORMAT = DYNAMIC;
|
|||||||
set innodb_strict_mode = ON;
|
set innodb_strict_mode = ON;
|
||||||
ALTER TABLE t1 ADD COLUMN j INT;
|
ALTER TABLE t1 ADD COLUMN j INT;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TEMPORARY TABLE t1(f1 INT, KEY(f1)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(NULL);
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
START TRANSACTION;
|
||||||
|
UPDATE t1 SET f1 = 4;
|
||||||
|
UPDATE t1 SET f1 = 0;
|
||||||
|
ROLLBACK;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -540,8 +540,8 @@ row_undo_mod_del_mark_or_remove_sec_low(
|
|||||||
|
|
||||||
/* For temporary table, we can skip to check older version of
|
/* For temporary table, we can skip to check older version of
|
||||||
clustered index entry, because there is no MVCC or purge. */
|
clustered index entry, because there is no MVCC or purge. */
|
||||||
if (!node->table->is_temporary()
|
if (node->table->is_temporary()
|
||||||
&& row_vers_old_has_index_entry(
|
|| row_vers_old_has_index_entry(
|
||||||
FALSE, btr_pcur_get_rec(&node->pcur),
|
FALSE, btr_pcur_get_rec(&node->pcur),
|
||||||
&mtr_vers, index, entry, 0, 0)) {
|
&mtr_vers, index, entry, 0, 0)) {
|
||||||
err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
|
err = btr_cur_del_mark_set_sec_rec(BTR_NO_LOCKING_FLAG,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user