summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-11-02 13:44:58 -0800
committerunknown <igor@rurik.mysql.com>2005-11-02 13:44:58 -0800
commit8a80936517515360c432312a05db232a5e4c5dba (patch)
treee01d228045f0098813aa9d95c0580a3a9bf7f8c6 /mysql-test
parent02ac7bef876ba51f13c09174da7a706ea35b6613 (diff)
downloadmariadb-git-8a80936517515360c432312a05db232a5e4c5dba.tar.gz
#view.test#:
new file sql_table.cc, handler.h: Fixed bug #14540. Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE to report that an operation cannot be applied for views. view.test, view.result: Added a test case for bug #14540. errmsg.txt: Fixed bug #14540. Added error ER_CHECK_NOT_BASE_TABLE. mysql-test/r/view.result: Added a test case for bug #14540. mysql-test/t/view.test: Added a test case for bug #14540. sql/handler.h: Fixed bug #14540. Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE to report that an operation cannot be applied for views. sql/share/errmsg.txt: Added error ER_CHECK_NOT_BASE_TABLE. sql/sql_table.cc: Fixed bug #14540. Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE to report that an operation cannot be applied for views.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/view.result19
-rw-r--r--mysql-test/t/view.test15
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 6f15e7af399..cd35cf4382f 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2323,3 +2323,22 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3;
+CREATE TABLE t1(id INT) ENGINE=MyISAM;
+CREATE VIEW v1 AS SELECT id FROM t1;
+OPTIMIZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 optimize note You cannot apply optimize to a view
+ANALYZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 analyze note You cannot apply analyze to a view
+REPAIR TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 repair note You cannot apply repair to a view
+DROP TABLE t1;
+OPTIMIZE TABLE v1;
+Table Op Msg_type Msg_text
+test.v1 optimize note You cannot apply optimize to a view
+Warnings:
+Error 1146 Table 'test.t1' doesn't exist
+Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+DROP VIEW v1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index aa3189bad69..2a941027d63 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2189,4 +2189,19 @@ EXPLAIN SELECT * FROM v2 WHERE a=1;
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3;
+#
+# Bug #14540: OPTIMIZE, ANALYZE, REPAIR applied to not a view
+#
+
+CREATE TABLE t1(id INT) ENGINE=MyISAM;
+CREATE VIEW v1 AS SELECT id FROM t1;
+
+OPTIMIZE TABLE v1;
+ANALYZE TABLE v1;
+REPAIR TABLE v1;
+
+DROP TABLE t1;
+OPTIMIZE TABLE v1;
+
+DROP VIEW v1;