summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorgluh@gluh.mysql.r18.ru <>2004-12-16 16:31:36 +0300
committergluh@gluh.mysql.r18.ru <>2004-12-16 16:31:36 +0300
commit6372efa7da86ff4475df0580c69c729dfa52d7cc (patch)
tree9092e19720261600bd1d7610193da9f4fcd1781a /mysql-test
parent7216594f4f20b4f1df625cfd0f08a99d61486cc6 (diff)
downloadmariadb-git-6372efa7da86ff4475df0580c69c729dfa52d7cc.tar.gz
Fix for bug#7212: information_schema: "Can't find file" errors if storage engine gone(after review)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/information_schema.result25
-rw-r--r--mysql-test/r/view.result10
-rw-r--r--mysql-test/t/information_schema.test21
-rw-r--r--mysql-test/t/view.test2
4 files changed, 52 insertions, 6 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 6c427f7fe1d..660c0e7b1bb 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -590,3 +590,28 @@ TABLES
TABLE_PRIVILEGES
TABLE_CONSTRAINTS
TABLE_NAMES
+use test;
+create function sub1(i int) returns int
+return i+1;
+create table t1(f1 int);
+create view t2 (c) as select f1 from t1;
+create view t3 (c) as select sub1(1);
+create table t4(f1 int, KEY f1_key (f1));
+drop table t1;
+drop function sub1;
+select column_name from information_schema.columns
+where table_schema='test';
+column_name
+f1
+Warnings:
+Warning 1356 View 'test.t2' references invalid table(s) or column(s) or function(s)
+Warning 1356 View 'test.t3' references invalid table(s) or column(s) or function(s)
+select index_name from information_schema.statistics where table_schema='test';
+index_name
+f1_key
+select constraint_name from information_schema.table_constraints
+where table_schema='test';
+constraint_name
+drop view t2;
+drop view t3;
+drop table t4;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 41de883a4d6..366d799fde3 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -983,10 +983,10 @@ create view v1 as select * from t1;
drop table t1;
create table t1 (col1 char(5),newcol2 char(5));
insert into v1 values('a','aa');
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
drop table t1;
select * from v1;
-ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
@@ -1217,11 +1217,11 @@ create table t1 (s1 int);
create view v1 as select x1() from t1;
drop function x1;
select * from v1;
-ERROR 42000: FUNCTION test.x1 does not exist
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s)
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
-v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL FUNCTION test.x1 does not exist
+v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
drop table t1;
create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1;
@@ -1655,7 +1655,7 @@ test.t1 check status OK
drop table t1;
check table v1;
Table Op Msg_type Msg_text
-test.v1 check error View 'test.v1' references invalid table(s) or column(s)
+test.v1 check error View 'test.v1' references invalid table(s) or column(s) or function(s)
drop view v1;
create table t1 (a int);
create table t2 (a int);
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index b909e8b8e53..b5570851c0f 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -292,3 +292,24 @@ use test;
show tables;
use information_schema;
show tables like "T%";
+
+#
+# Bug#7212: information_schema: "Can't find file" errors if storage engine gone
+#
+use test;
+create function sub1(i int) returns int
+ return i+1;
+create table t1(f1 int);
+create view t2 (c) as select f1 from t1;
+create view t3 (c) as select sub1(1);
+create table t4(f1 int, KEY f1_key (f1));
+drop table t1;
+drop function sub1;
+select column_name from information_schema.columns
+where table_schema='test';
+select index_name from information_schema.statistics where table_schema='test';
+select constraint_name from information_schema.table_constraints
+where table_schema='test';
+drop view t2;
+drop view t3;
+drop table t4;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 65f464fc77b..cb398fed856 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1169,7 +1169,7 @@ create function x1 () returns int return 5;
create table t1 (s1 int);
create view v1 as select x1() from t1;
drop function x1;
--- error 1305
+-- error 1356
select * from v1;
--replace_column 12 # 13 #
--replace_result "2147483647 " "21474836479 "