1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

#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.
This commit is contained in:
igor@rurik.mysql.com
2005-11-02 13:44:58 -08:00
parent 50817d304b
commit fddc99bcd8
5 changed files with 60 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;