Skip to content

Commit

Permalink
MDEV-12874 UPDATE statements with the same source and target
Browse files Browse the repository at this point in the history
update engine tests
  • Loading branch information
vuvova committed Oct 4, 2017
1 parent 61b2618 commit 9584c67
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
8 changes: 0 additions & 8 deletions mysql-test/suite/engines/funcs/r/sq_error.result
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARCHAR(100),c3 FLOAT);
Expand All @@ -34,8 +32,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 BINARY(100),c3 FLOAT);
Expand All @@ -53,8 +49,6 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARBINARY(100),c3 FLOAT);
Expand All @@ -72,7 +66,5 @@ ERROR 42000: This version of MariaDB doesn't yet support 'LIMIT & IN/ALL/ANY/SOM
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
ERROR 21000: Subquery returns more than 1 row
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
ERROR HY000: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
DROP TABLE t1;
DROP TABLE t2;
8 changes: 0 additions & 8 deletions mysql-test/suite/engines/funcs/t/sq_error.test
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
--error 1093
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARCHAR(100),c3 FLOAT);
Expand All @@ -38,8 +36,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
--error 1093
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 BINARY(100),c3 FLOAT);
Expand All @@ -57,8 +53,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
--error 1093
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (c1 INT, c2 VARBINARY(100),c3 FLOAT);
Expand All @@ -76,8 +70,6 @@ SELECT (SELECT c1, c2 FROM t2) FROM t1;
--error 1242
SELECT * FROM t1 WHERE c1 = (SELECT c1 FROM t2);
UPDATE t1 SET c2 = (SELECT MAX(c1) FROM t2);
--error 1093
UPDATE t1 SET c1 = (SELECT MAX(c1) FROM t1);
DROP TABLE t1;
DROP TABLE t2;

Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ drop table mt1, mt2, mt3;
create table mt1 (col1 int);
create table mt2 (col1 int);
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
ERROR HY000: Table 'mt1' is specified twice, both as a target for 'UPDATE' and as a separate source for data
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
ERROR HY000: Table 'mt1' is specified twice, both as a target for 'DELETE' and as a separate source for data
drop table mt1,mt2;
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/engines/iuds/t/update_delete_number.test
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ drop table mt1, mt2, mt3;
# multi* unique updating table check
create table mt1 (col1 int);
create table mt2 (col1 int);
-- error ER_UPDATE_TABLE_USED
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
-- error ER_UPDATE_TABLE_USED
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
Expand Down

0 comments on commit 9584c67

Please sign in to comment.