diff options
Diffstat (limited to 'mysql-test/t/information_schema.test')
-rw-r--r-- | mysql-test/t/information_schema.test | 105 |
1 files changed, 103 insertions, 2 deletions
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index a49044e63c1..6bcc14d4e49 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -703,7 +703,7 @@ drop table t1; # # Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA' # ---error 1044 +--error ER_PARSE_ERROR alter database information_schema; --error 1044 drop database information_schema; @@ -825,7 +825,7 @@ drop table t1; use mysql; INSERT INTO `proc` VALUES ('test','','PROCEDURE','','SQL','CONTAINS_SQL', 'NO','DEFINER','','','BEGIN\r\n \r\nEND','root@%','2006-03-02 18:40:03', -'2006-03-02 18:40:03','',''); +'2006-03-02 18:40:03','','','utf8','utf8_general_ci','utf8_general_ci','n/a'); select routine_name from information_schema.routines; delete from proc where name=''; use test; @@ -1024,6 +1024,71 @@ where t.table_schema = 'information_schema' and group by c2.column_type order by num limit 1) group by t.table_name order by num1, t.table_name; +# +# Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong +# +create table t1(f1 int); +create view v1 as select f1+1 as a from t1; +create table t2 (f1 int, f2 int); +create view v2 as select f1+1 as a, f2 as b from t2; +select table_name, is_updatable from information_schema.views; +# +# Note: we can perform 'delete' for non updatable view. +# +delete from v1; +drop view v1,v2; +drop table t1,t2; + +# +# Bug#25859 ALTER DATABASE works w/o parameters +# +--error ER_PARSE_ERROR +alter database; +--error ER_PARSE_ERROR +alter database test; + +# +# Bug#27629 Possible security flaw in INFORMATION_SCHEMA and SHOW statements +# + +create database mysqltest; +create table mysqltest.t1(a int, b int, c int); +create trigger mysqltest.t1_ai after insert on mysqltest.t1 + for each row set @a = new.a + new.b + new.c; +grant select(b) on mysqltest.t1 to mysqltest_1@localhost; + +select trigger_name from information_schema.triggers +where event_object_table='t1'; +show triggers from mysqltest; + +connect (con27629,localhost,mysqltest_1,,mysqltest); +show columns from t1; +select column_name from information_schema.columns where table_name='t1'; + +show triggers; +select trigger_name from information_schema.triggers +where event_object_table='t1'; +connection default; +drop user mysqltest_1@localhost; +drop database mysqltest; + +# +# Bug#27747 database metadata doesn't return sufficient column default info +# +create table t1 ( + f1 varchar(50), + f2 varchar(50) not null, + f3 varchar(50) default '', + f4 varchar(50) default NULL, + f5 bigint not null, + f6 bigint not null default 10, + f7 datetime not null, + f8 datetime default '2006-01-01' +); +select column_default from information_schema.columns where table_name= 't1'; +show columns from t1; +drop table t1; + --echo End of 5.0 tests. # # Show engines @@ -1077,4 +1142,40 @@ SELECT variable_name FROM server_status; DROP TABLE server_status; SET GLOBAL event_scheduler=0; + +# +# WL#3732 Information schema optimization +# + +explain select table_name from information_schema.views where +table_schema='test' and table_name='v1'; + +explain select * from information_schema.tables; +explain select * from information_schema.collations; + +explain select * from information_schema.tables where +table_schema='test' and table_name= 't1'; +explain select table_name, table_type from information_schema.tables +where table_schema='test'; + +explain select b.table_name +from information_schema.tables a, information_schema.columns b +where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name; + +# +# Bug#30310 wrong result on SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE .. +# +SELECT * FROM INFORMATION_SCHEMA.SCHEMATA +WHERE SCHEMA_NAME = 'mysqltest'; + +SELECT * FROM INFORMATION_SCHEMA.SCHEMATA +WHERE SCHEMA_NAME = ''; + +SELECT * FROM INFORMATION_SCHEMA.SCHEMATA +WHERE SCHEMA_NAME = 'test'; + +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting'; +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME=''; +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME=''; +select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting'; --echo End of 5.1 tests. |