⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 information_schema.test

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 TEST
📖 第 1 页 / 共 2 页
字号:
table_schema="information_schema" and table_name="COLUMNS";select table_type from information_schema.tableswhere table_schema="mysql" and table_name="user";# test for 'show open tables ... where'show open tables where `table` like "user";# test for 'show status ... where'show status where variable_name like "%database%";# test for 'show variables ... where'show variables where variable_name like "skip_show_databas";## Bug #7981:SHOW GLOBAL STATUS crashes server## We don't actually care about the value, just that it doesn't crash.--replace_column 2 #show global status like "Threads_running";## Bug #7915  crash,JOIN VIEW, subquery, # SELECT .. FROM INFORMATION_SCHEMA.COLUMNS#create table t1(f1 int);create table t2(f2 int);create view v1 as select * from t1, t2;set @got_val= (select count(*) from information_schema.columns);drop view v1;drop table t1, t2;## Bug #7476: crash on SELECT * FROM INFORMATION_SCHEMA.TABLES#CREATE TABLE t_crashme ( f1 BIGINT);CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;let $tab_count= 65;--disable_query_logwhile ($tab_count){     EVAL CREATE TABLE t_$tab_count (f1 BIGINT);     dec $tab_count ;}--disable_result_logSELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES;--enable_result_logSELECT count(*) FROM INFORMATION_SCHEMA.TABLES;let $tab_count= 65;while ($tab_count){     EVAL DROP TABLE t_$tab_count;     dec $tab_count ;}--enable_query_logdrop view a2, a1;drop table t_crashme;## Bug #7215  information_schema: columns are longtext instead of varchar# Bug #7217  information_schema: columns are varbinary() instead of timestamp#select table_schema,table_name, column_name frominformation_schema.columns where data_type = 'longtext';select table_name, column_name, data_type from information_schema.columnswhere data_type = 'datetime';## Bug #8164  subquery with INFORMATION_SCHEMA.COLUMNS, 100 % CPU#SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES AWHERE NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS B  WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA  AND A.TABLE_NAME = B.TABLE_NAME);## Bug #9344  INFORMATION_SCHEMA, wrong content, numeric columns#create table t1( x_bigint BIGINT,  x_integer INTEGER,  x_smallint SMALLINT,  x_decimal DECIMAL(5,3),  x_numeric NUMERIC(5,3),  x_real REAL,  x_float FLOAT,  x_double_precision DOUBLE PRECISION );SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTHFROM INFORMATION_SCHEMA.COLUMNSWHERE TABLE_NAME= 't1';drop table t1;## Bug#10261  INFORMATION_SCHEMA.COLUMNS, incomplete result for non root user#grant select on test.* to mysqltest_4@localhost;connect (user10261,localhost,mysqltest_4,,);connection user10261;SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='TABLE_NAME';connection default;delete from mysql.user where user='mysqltest_4';delete from mysql.db where user='mysqltest_4';flush privileges;## Bug #9404  information_schema: Weird error messages# with SELECT SUM() ... GROUP BY queries#SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;## TRIGGERS table test#create table t1 (i int, j int);delimiter |;create trigger trg1 before insert on t1 for each rowbegin  if new.j > 10 then    set new.j := 10;  end if;end|create trigger trg2 before update on t1 for each rowbegin  if old.i % 2 = 0 then    set new.j := -1;  end if;end|create trigger trg3 after update on t1 for each rowbegin  if new.j = -1 then    set @fired:= "Yes";  end if;end|delimiter ;|show triggers;select * from information_schema.triggers;drop trigger trg1;drop trigger trg2;drop trigger trg3;drop table t1;## Bug #10964  Information Schema:Authorization check on privilege tables is improper#create database mysqltest;create table mysqltest.t1 (f1 int, f2 int);create table mysqltest.t2 (f1 int);grant select (f1) on mysqltest.t1 to user1@localhost;grant select on mysqltest.t2 to user2@localhost;grant select on mysqltest.* to user3@localhost;grant select on *.* to user4@localhost;connect (con1,localhost,user1,,mysqltest);connect (con2,localhost,user2,,mysqltest);connect (con3,localhost,user3,,mysqltest);connect (con4,localhost,user4,,);connection con1;select * from information_schema.column_privileges;select * from information_schema.table_privileges;select * from information_schema.schema_privileges;select * from information_schema.user_privileges;show grants;connection con2;select * from information_schema.column_privileges;select * from information_schema.table_privileges;select * from information_schema.schema_privileges;select * from information_schema.user_privileges;show grants;connection con3;select * from information_schema.column_privileges;select * from information_schema.table_privileges;select * from information_schema.schema_privileges;select * from information_schema.user_privileges;show grants;connection con4;select * from information_schema.column_privileges where grantee like '%user%';select * from information_schema.table_privileges where grantee like '%user%';select * from information_schema.schema_privileges where grantee like '%user%';select * from information_schema.user_privileges where grantee like '%user%';show grants;connection default;drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;use test;drop database mysqltest;## Bug #11055 information_schema: routines.sql_data_access has wrong value#--disable_warningsdrop procedure if exists p1;drop procedure if exists p2;--enable_warningscreate procedure p1 () modifies sql data set @a = 5;create procedure p2 () set @a = 5;select sql_data_access from information_schema.routineswhere specific_name like 'p%';drop procedure p1;drop procedure p2;## Bug #9434 SHOW CREATE DATABASE information_schema;#show create database information_schema;## Bug #11057 information_schema: columns table has some questionable contents# Bug #12301 information_schema: NUMERIC_SCALE must be 0 for integer columns#create table t1(f1 LONGBLOB, f2 LONGTEXT);select column_name,data_type,CHARACTER_OCTET_LENGTH,       CHARACTER_MAXIMUM_LENGTHfrom information_schema.columnswhere table_name='t1';drop table t1;create table t1(f1 tinyint, f2 SMALLINT, f3 mediumint, f4 int,                f5 BIGINT, f6 BIT, f7 bit(64));select column_name, NUMERIC_PRECISION, NUMERIC_SCALEfrom information_schema.columnswhere table_name='t1';drop table t1;## Bug #12127 triggers do not show in info_schema before they are used if set to the database#create table t1 (f1 integer);create trigger tr1 after insert on t1 for each row set @test_var=42;use information_schema;select trigger_schema, trigger_name from triggers wheretrigger_name='tr1';use test;drop table t1;## Bug#12518 COLUMN_DEFAULT has wrong value if NOT NULL is set#create table t1 (a int not null, b int);use information_schema;select column_name, column_default from columns  where table_schema='test' and table_name='t1';use test;show columns from t1;drop table t1;## Bug #12636: SHOW TABLE STATUS with where condition containing a subquery#             over information schema#CREATE TABLE t1 (a int);CREATE TABLE t2 (b int);--replace_column 8 # 12 # 13 #SHOW TABLE STATUS FROM test  WHERE name IN ( SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES                    WHERE TABLE_SCHEMA='test' AND TABLE_TYPE='BASE TABLE');DROP TABLE t1,t2;## Bug #12905 show fields from view behaving erratically with current database#create table t1(f1 int);create view v1 (c) as select f1 from t1;connect (con5,localhost,root,,*NO-ONE*);select database();show fields from test.v1;connection default;drop view v1;drop table t1;## Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA'#--error 1044alter database information_schema;--error 1044drop database information_schema;--error 1044drop table information_schema.tables;--error 1044alter table information_schema.tables;## Bug #9683 INFORMATION_SCH: Creation of temporary table allowed in Information_schema DB#use information_schema;--error 1044create temporary table schemata(f1 char(10));## Bug #10708 SP's can use INFORMATION_SCHEMA as ROUTINE_SCHEMA#delimiter |;--error 1044CREATE PROCEDURE p1 ()BEGIN  SELECT 'foo' FROM DUAL;END |delimiter ;|select  ROUTINE_NAME from routines;## Bug #10734 Grant of privileges other than 'select' and 'create view' should fail on schema#--error 1044grant all on information_schema.* to 'user1'@'localhost';--error 1044grant select on information_schema.* to 'user1'@'localhost';## Bug#14089 FROM list subquery always fails when information_schema is current database#use test;create table t1(id int);insert into t1(id) values (1);select 1 from (select 1 from test.t1) a;use information_schema;select 1 from (select 1 from test.t1) a;use test;drop table t1;## Bug #14290: character_maximum_length for text fields#create table t1(a blob, b text charset utf8, c text charset ucs2);select data_type, character_octet_length, character_maximum_length   from information_schema.columns where table_name='t1';drop table t1;## Bug#14476 `information_schema`.`TABLES`.`TABLE_TYPE` with empty value#create table t1 (f1 int(11));create view v1 as select * from t1;drop table t1;select table_type from information_schema.tableswhere table_name="v1";drop view v1;## Bug #14387 SHOW COLUMNS doesn't work on temporary tables# Bug #15224 SHOW INDEX from temporary table doesn't work# Bug #12770 DESC cannot display the info. about temporary table#create temporary table t1(f1 int, index(f1));show columns from t1;describe t1;show indexes from t1;drop table t1;## Bug#14271 I_S: columns has no size for (var)binary columns#create table t1(f1 binary(32), f2 varbinary(64));select character_maximum_length, character_octet_lengthfrom information_schema.columns where table_name='t1';drop table t1;## Bug#15533 crash, information_schema, function, view#CREATE TABLE t1 (f1 BIGINT, f2 VARCHAR(20), f3 BIGINT);INSERT INTO t1 SET f1 = 1, f2 = 'Schoenenbourg', f3 = 1;CREATE FUNCTION func2() RETURNS BIGINT RETURN 1;delimiter //;CREATE FUNCTION func1() RETURNS BIGINTBEGIN  RETURN ( SELECT COUNT(*) FROM INFORMATION_SCHEMA.VIEWS);END//delimiter ;//CREATE VIEW v1 AS SELECT 1 FROM t1                    WHERE f3 = (SELECT func2 ());SELECT func1();DROP TABLE t1;DROP VIEW v1;DROP FUNCTION func1;DROP FUNCTION func2;## Bug #15851 Unlistable directories yield no info from information_schema#create database mysqltest;create table mysqltest.t1(a int);--exec chmod -r $MYSQLTEST_VARDIR/master-data/mysqltestselect table_schema from information_schema.tables where table_schema='mysqltest';--exec chmod +r $MYSQLTEST_VARDIR/master-data/mysqltestdrop database mysqltest;## Bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema#select column_type, group_concat(table_schema, '.', table_name), count(*) as numfrom information_schema.columns wheretable_schema='information_schema' and(column_type = 'varchar(7)' or column_type = 'varchar(20)')group by column_type order by num;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -