diff options
author | unknown <serg@serg.mylan> | 2005-12-05 12:08:30 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-12-05 12:08:30 +0100 |
commit | 8cf0316339b908bfb1ce37a57f3bbb8b4c84cdc9 (patch) | |
tree | 8e12dae38ac33ec0336037f0ccc121148608cab0 | |
parent | 6506ce3bcba9a6c53a760e380b2f544738fc0d0d (diff) | |
download | mariadb-git-8cf0316339b908bfb1ce37a57f3bbb8b4c84cdc9.tar.gz |
better error for optimize/repair/etc a view
-rw-r--r-- | mysql-test/r/sp.result | 24 | ||||
-rw-r--r-- | mysql-test/r/view.result | 17 | ||||
-rw-r--r-- | sql/sql_table.cc | 11 |
3 files changed, 25 insertions, 27 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index bfc16c826a5..e8f8439927e 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -4180,55 +4180,55 @@ Table Op Msg_type Msg_text test.t1 repair status OK test.t2 repair status OK test.t3 repair error Table 'test.t3' doesn't exist -test.v1 repair note Unknown table 'test.v1' +test.v1 repair error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize error Table 'test.t3' doesn't exist -test.v1 optimize note Unknown table 'test.v1' +test.v1 optimize error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze error Table 'test.t3' doesn't exist -test.v1 analyze note Unknown table 'test.v1' +test.v1 analyze error 'test.v1' is not BASE TABLE Warnings: -Error 1146 Table 'test.t3' doesn't exist +Error 1347 'test.v1' is not BASE TABLE call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK test.t2 repair status OK test.t3 repair error Table 'test.t3' doesn't exist -test.v1 repair note Unknown table 'test.v1' +test.v1 repair error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize error Table 'test.t3' doesn't exist -test.v1 optimize note Unknown table 'test.v1' +test.v1 optimize error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze error Table 'test.t3' doesn't exist -test.v1 analyze note Unknown table 'test.v1' +test.v1 analyze error 'test.v1' is not BASE TABLE Warnings: -Error 1146 Table 'test.t3' doesn't exist +Error 1347 'test.v1' is not BASE TABLE call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK test.t2 repair status OK test.t3 repair error Table 'test.t3' doesn't exist -test.v1 repair note Unknown table 'test.v1' +test.v1 repair error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize error Table 'test.t3' doesn't exist -test.v1 optimize note Unknown table 'test.v1' +test.v1 optimize error 'test.v1' is not BASE TABLE Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze error Table 'test.t3' doesn't exist -test.v1 analyze note Unknown table 'test.v1' +test.v1 analyze error 'test.v1' is not BASE TABLE Warnings: -Error 1146 Table 'test.t3' doesn't exist +Error 1347 'test.v1' is not BASE TABLE drop procedure bug13012| drop view v1; select * from t1| diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index ebb2c190eb1..315744c6878 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2383,20 +2383,25 @@ CREATE TABLE t1(id INT); CREATE VIEW v1 AS SELECT id FROM t1; OPTIMIZE TABLE v1; Table Op Msg_type Msg_text -test.v1 optimize note Unknown table 'test.v1' +test.v1 optimize error 'test.v1' is not BASE TABLE +Warnings: +Error 1347 'test.v1' is not BASE TABLE ANALYZE TABLE v1; Table Op Msg_type Msg_text -test.v1 analyze note Unknown table 'test.v1' +test.v1 analyze error 'test.v1' is not BASE TABLE +Warnings: +Error 1347 'test.v1' is not BASE TABLE REPAIR TABLE v1; Table Op Msg_type Msg_text -test.v1 repair note Unknown table 'test.v1' +test.v1 repair error 'test.v1' is not BASE TABLE +Warnings: +Error 1347 'test.v1' is not BASE TABLE DROP TABLE t1; OPTIMIZE TABLE v1; Table Op Msg_type Msg_text -test.v1 optimize note Unknown table 'test.v1' +test.v1 optimize error 'test.v1' is not BASE TABLE 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 +Error 1347 'test.v1' is not BASE TABLE DROP VIEW v1; create definer = current_user() sql security invoker view v1 as select 1; show create view v1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 20186d781f9..ba4a606537f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2225,18 +2225,11 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, lex->query_tables_own_last= 0; thd->no_warnings_for_error= no_warnings_for_error; if (view_operator_func == NULL) - simple_open_n_lock_tables(thd, table); - else - open_and_lock_tables(thd, table); + table->required_type=FRMTYPE_TABLE; + open_and_lock_tables(thd, table); thd->no_warnings_for_error= 0; table->next_global= save_next_global; table->next_local= save_next_local; - /* if view are unsupported */ - if (table->view && view_operator_func == NULL) - { - result_code= HA_ADMIN_NOT_BASE_TABLE; - goto send_result; - } thd->open_options&= ~extra_open_options; if (prepare_func) |