-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
236 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE TEMPORARY TABLE t (i INT); | ||
CREATE or replace TABLE t AS SELECT * FROM t; | ||
DROP TEMPORARY TABLE t; | ||
DROP TABLE t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE TEMPORARY TABLE t (i INT); | ||
CREATE or replace TABLE t AS SELECT * FROM t; | ||
DROP TEMPORARY TABLE t; | ||
DROP TABLE t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# MDEV-15151: function with recursive CTE using no base tables | ||
# (duplicate of MDEV-16661) | ||
# | ||
connection default; | ||
CREATE TABLE t1 (id int KEY); | ||
INSERT INTO t1 VALUES (0), (1),(2); | ||
CREATE OR REPLACE FUNCTION func() RETURNS int | ||
RETURN | ||
( | ||
WITH recursive cte AS | ||
(SELECT 1 a UNION SELECT cte.* FROM cte natural join t1) | ||
SELECT * FROM cte limit 1 | ||
); | ||
connect con1,localhost,root,,test; | ||
SELECT func(); | ||
connect con2,localhost,root,,test; | ||
disconnect con2; | ||
connection con1; | ||
disconnect con1; | ||
connection default; | ||
DROP FUNCTION func; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--source include/not_embedded.inc | ||
|
||
--echo # | ||
--echo # MDEV-15151: function with recursive CTE using no base tables | ||
--echo # (duplicate of MDEV-16661) | ||
--echo # | ||
|
||
--connection default | ||
|
||
CREATE TABLE t1 (id int KEY); | ||
INSERT INTO t1 VALUES (0), (1),(2); | ||
|
||
CREATE OR REPLACE FUNCTION func() RETURNS int | ||
RETURN | ||
( | ||
WITH recursive cte AS | ||
(SELECT 1 a UNION SELECT cte.* FROM cte natural join t1) | ||
SELECT * FROM cte limit 1 | ||
); | ||
|
||
--connect (con1,localhost,root,,test) | ||
|
||
--let $conid= `SELECT CONNECTION_ID()` | ||
--send SELECT func() | ||
|
||
--connect (con2,localhost,root,,test) | ||
--disable_query_log | ||
--eval KILL QUERY $conid | ||
--enable_query_log | ||
--disconnect con2 | ||
|
||
--disable_result_log | ||
--connection con1 | ||
--error 0,ER_QUERY_INTERRUPTED | ||
--reap | ||
--disconnect con1 | ||
--enable_result_log | ||
|
||
--connection default | ||
|
||
DROP FUNCTION func; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
CREATE TEMPORARY TABLE t (i INT); | ||
CREATE TABLE t AS SELECT * FROM t; | ||
connection slave; | ||
connection master; | ||
DROP TEMPORARY TABLE t; | ||
DROP TABLE t; | ||
include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--source include/master-slave.inc | ||
CREATE TEMPORARY TABLE t (i INT); | ||
CREATE TABLE t AS SELECT * FROM t; | ||
|
||
--sync_slave_with_master | ||
|
||
# Cleanup | ||
--connection master | ||
DROP TEMPORARY TABLE t; | ||
DROP TABLE t; | ||
--source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.