diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-11-27 18:11:54 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-11-27 18:11:54 +0400 |
commit | 9ac57f01d717e8eeccf29e7163f0108e5deaaeab (patch) | |
tree | 34b2b9c95681505dbe0699e29a4b1efb5fe48abc /mysql-test | |
parent | 910d41725dcbf6e54a1d07370949e6da2b9535ca (diff) | |
parent | 89d044062c1daa3f12358b003478cbaa5df91e3b (diff) | |
download | mariadb-git-9ac57f01d717e8eeccf29e7163f0108e5deaaeab.tar.gz |
5.0-bugteam->5.1-bugteam merge
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect.result | 30 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 36 |
2 files changed, 66 insertions, 0 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 5f84259ac29..c1c81847b13 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4448,4 +4448,34 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT a incorrect 1 1 DROP TABLE t1,t2,t3; +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +CREATE VIEW v1 AS +SELECT t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; +CREATE VIEW v2 (a,b) AS +SELECT t2.id, t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +INSERT INTO v2(a,b) VALUES (2,2); +ERROR HY000: CHECK OPTION failed 'test.v2' +INSERT INTO v2(a,b) VALUES (1,2); +SELECT * FROM v1; +c +1 +1 +1 +1 +2 +2 +CREATE VIEW v3 AS +SELECT t2.c AS c FROM t2 +WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +DELETE FROM v3; +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; End of 5.1 tests. diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 5a79c937dd6..493857fb463 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3355,4 +3355,40 @@ SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT SELECT t1.a, (SELECT 1 FROM t2 WHERE t2.b=t3.c AND t2.c=t1.a ORDER BY t2.d LIMIT 1) AS incorrect FROM t1, t3 WHERE t3.b=t1.a; DROP TABLE t1,t2,t3; + +# +# Bug#37460 Assertion failed: +# !table->file || table->file->inited == handler::NONE +# +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int); + +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); + +CREATE VIEW v1 AS + SELECT t2.c AS c FROM t1, t2 + WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; + +CREATE VIEW v2 (a,b) AS + SELECT t2.id, t2.c AS c FROM t1, t2 + WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; + +--error 1369 +INSERT INTO v2(a,b) VALUES (2,2); +INSERT INTO v2(a,b) VALUES (1,2); +SELECT * FROM v1; + +CREATE VIEW v3 AS + SELECT t2.c AS c FROM t2 + WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION; + +DELETE FROM v3; + +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; + --echo End of 5.1 tests. |