diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-08-11 13:13:06 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-08-11 13:13:06 -0300 |
commit | 2a64ad4c032660657622cc2c7ff087964b38bc6d (patch) | |
tree | e2c7c1f2d6d35e4fc85dd02ce5615206916e6561 | |
parent | 3687504c7a1cdd5449fe167cc015b203cd978309 (diff) | |
download | mariadb-git-2a64ad4c032660657622cc2c7ff087964b38bc6d.tar.gz |
Update test case result due to mis-merge.
-rw-r--r-- | mysql-test/r/view.result | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index aa2294ef926..48bcfbf7975 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3659,6 +3659,51 @@ DROP TABLE t1; # -- End of test case for Bug#34337. +# ----------------------------------------------------------------- +# -- Bug#35193 VIEW query is rewritten without "FROM DUAL", +# -- causing syntax error +# ----------------------------------------------------------------- + +CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1; + +SELECT * FROM v1; +1 +1 +SHOW CREATE TABLE v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1 + +DROP VIEW v1; + +# -- End of test case for Bug#35193. + +CREATE VIEW v1 AS SELECT 1; +DROP VIEW v1; +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2)); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2; +c1 c2 +2 2 +SELECT * FROM t1 USE INDEX (c2) WHERE c2=2; +c1 c2 +2 2 +CREATE VIEW v1 AS SELECT c1, c2 FROM t1; +SHOW INDEX FROM v1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 USE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +DROP VIEW v1; +DROP TABLE t1; # # Bug #45806 crash when replacing into a view with a join! # @@ -3771,51 +3816,6 @@ DROP VIEW v2; DROP TABLE t1; # -- End of test case for Bug#45806 # ----------------------------------------------------------------- -# -- Bug#35193 VIEW query is rewritten without "FROM DUAL", -# -- causing syntax error -# ----------------------------------------------------------------- - -CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1; - -SELECT * FROM v1; -1 -1 -SHOW CREATE TABLE v1; -View Create View -v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1 - -DROP VIEW v1; - -# -- End of test case for Bug#35193. - -CREATE VIEW v1 AS SELECT 1; -DROP VIEW v1; -CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2)); -INSERT INTO t1 VALUES (1,1), (2,2), (3,3); -SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2; -c1 c2 -2 2 -SELECT * FROM t1 USE INDEX (c2) WHERE c2=2; -c1 c2 -2 2 -CREATE VIEW v1 AS SELECT c1, c2 FROM t1; -SHOW INDEX FROM v1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2; -ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' -SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2; -ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' -SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2; -ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' -SELECT * FROM v1 USE INDEX (c2) WHERE c2=2; -ERROR HY000: Key 'c2' doesn't exist in table 'v1' -SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2; -ERROR HY000: Key 'c2' doesn't exist in table 'v1' -SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; -ERROR HY000: Key 'c2' doesn't exist in table 'v1' -DROP VIEW v1; -DROP TABLE t1; -# ----------------------------------------------------------------- # -- Bug#40825: Error 1356 while selecting from a view # -- with a "HAVING" clause though query works # ----------------------------------------------------------------- |