is_basics_mixed.result
来自「这个文件是windows mysql源码」· RESULT 代码 · 共 603 行 · 第 1/3 页
RESULT
603 行
CREATE TABLE information_schema. key_column_usage ( c1 INT );ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'CREATE TABLE information_schema. triggers ( c1 INT );ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);ERROR 42S02: Unknown table 't1' in information_schemaCREATE VIEW information_schema.tables AS SELECT 'garbage';ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'CREATE VIEW information_schema.tables ASSELECT * FROM information_schema.tables;ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'CREATE VIEW information_schema.v1 AS SELECT 'garbage';ERROR 42S02: Unknown table 'v1' in information_schema# Switch to connection default (user=root) and close connection testuser1DROP USER 'testuser1'@'localhost';################################################################################ Testcase 3.2.1.1+3.2.1.2: INFORMATION_SCHEMA tables can be queried via SELECT###############################################################################DROP DATABASE IF EXISTS db_datadict;CREATE DATABASE db_datadict;CREATE TABLE db_datadict.t1_first (f1 BIGINT UNIQUE, f2 BIGINT)ENGINE = <some_engine>;CREATE TABLE db_datadict.t1_second (f1 BIGINT UNIQUE, f2 BIGINT)ENGINE = <some_engine>;# Attention: The protocolling of the next result set is disabled.SELECT * FROM information_schema.tables;SELECT table_name FROM information_schema.tablesWHERE table_schema = 'db_datadict';table_namet1_firstt1_secondSELECT LENGTH(table_name) FROM information_schema.tablesWHERE table_schema = 'db_datadict' ORDER BY table_name;LENGTH(table_name)89SELECT count(table_name) FROM information_schema.tablesWHERE table_schema LIKE 'db_datadic%';count(table_name)2SELECT CAST((LENGTH(table_schema) + LENGTH(table_name)) AS DECIMAL(15,1))FROM information_schema.tablesWHERE table_schema = 'db_datadict';CAST((LENGTH(table_schema) + LENGTH(table_name)) AS DECIMAL(15,1))19.020.0SELECT table_name FROM information_schema.tablesWHERE table_name IN ('t1_first','t1_second') ORDER BY table_name LIMIT 1;table_namet1_firstSELECT table_name FROM information_schema.tablesWHERE table_name IN ('t1_first','t1_second') ORDER BY table_name LIMIT 1,1;table_namet1_secondSELECT table_name,table_schema AS my_col FROM information_schema.tablesWHERE table_name = 't1_first' AND table_schema = 'db_datadict';table_name my_colt1_first db_datadictSELECT HIGH_PRIORITY table_name AS my_col FROM information_schema.tablesWHERE table_name = 't1_first' OR table_name = 't1_second';my_colt1_firstt1_secondSELECT 1 AS my_col FROM information_schema.tablesWHERE table_name = 't1_third';my_colSELECT table_name,table_schema INTO @table_name,@table_schemaFROM information_schema.tablesWHERE table_schema = 'db_datadict' ORDER BY table_name LIMIT 1;SELECT @table_name,@table_schema;@table_name @table_schemat1_first db_datadictSELECT table_name,table_schemaINTO OUTFILE '<OUTFILE>'FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'LINES TERMINATED BY '\n'FROM information_schema.tablesWHERE table_schema = 'db_datadict' ORDER BY table_name;"t1_first","db_datadict""t1_second","db_datadict"SELECT table_name FROM information_schema.tablesWHERE table_name = 't1_first'UNION ALLSELECT table_name FROM information_schema.tablesWHERE table_name = 't1_second';table_namet1_firstt1_secondSELECT DISTINCT table_schema FROM information_schema.tablesWHERE table_name IN (SELECT table_name FROM information_schema.tablesWHERE table_schema = 'db_datadict')ORDER BY table_name;table_schemadb_datadictSELECT table_name FROM information_schema.tables t1LEFT JOIN information_schema.tables t2 USING(table_name,table_schema)WHERE t2.table_schema = 'db_datadict'ORDER BY table_name;table_namet1_firstt1_secondUSE test;SELECT * FROM tables;ERROR 42S02: Table 'test.tables' doesn't exist########################################################################## Testcase 3.2.1.17+3.2.1.18#########################################################################DROP DATABASE IF EXISTS db_datadict;CREATE DATABASE db_datadict;CREATE TABLE db_datadict.t1 (f1 BIGINT UNIQUE, f2 BIGINT)ENGINE = <some_engine>;SELECT * FROM db_datadict.t1;f1 f2DROP USER 'testuser1'@'localhost';CREATE USER 'testuser1'@'localhost';DROP USER 'testuser2'@'localhost';CREATE USER 'testuser2'@'localhost';GRANT CREATE VIEW,SELECT ON db_datadict.* TO testuser1@localhostWITH GRANT OPTION;GRANT USAGE ON db_datadict.* TO testuser2@localhost;FLUSH PRIVILEGES;GRANT SELECT on information_schema.* TO testuser1@localhost;ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT CREATE VIEW ON information_schema.* TO 'u_6_401018'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'# Establish connection testuser1 (user=testuser1)SELECT table_schema,table_name FROM information_schema.tablesWHERE table_schema = 'information_schema' AND table_name = 'tables';table_schema table_nameinformation_schema TABLESSELECT * FROM information_schema.table_privilegesWHERE table_schema = 'information_schema';GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLESELECT * FROM information_schema.schema_privilegesWHERE table_schema = 'information_schema';GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLECREATE VIEW db_datadict.v2 ASSELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPEFROM information_schema.tables WHERE table_schema = 'db_datadict';SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPEFROM db_datadict.v2;TABLE_SCHEMA TABLE_NAME TABLE_TYPEdb_datadict t1 BASE TABLEdb_datadict v2 VIEWSELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPEFROM information_schema.tables WHERE table_schema = 'db_datadict';TABLE_SCHEMA TABLE_NAME TABLE_TYPEdb_datadict t1 BASE TABLEdb_datadict v2 VIEWGRANT SELECT ON db_datadict.v2 to testuser2@localhost;# Establish connection testuser2 (user=testuser2)SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPEFROM db_datadict.v2;TABLE_SCHEMA TABLE_NAME TABLE_TYPEdb_datadict v2 VIEWSELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPEFROM information_schema.tables WHERE table_schema = 'db_datadict';TABLE_SCHEMA TABLE_NAME TABLE_TYPEdb_datadict v2 VIEW# Switch to connection default and close connections testuser1 and testuser2DROP USER 'testuser1'@'localhost';DROP USER 'testuser2'@'localhost';DROP DATABASE db_datadict;########################################################################## Testcase 3.2.1.19#########################################################################DROP USER 'testuser1'@'localhost';CREATE USER 'testuser1'@'localhost';SELECT 'empty result set was expected' AS my_colFROM information_schema.schema_privilegesWHERE table_schema = 'information_schema';my_colSELECT 'empty result set was expected' AS my_colFROM information_schema.table_privilegesWHERE table_schema = 'information_schema';my_colSELECT 'empty result set was expected' AS my_colFROM information_schema.column_privilegesWHERE table_schema = 'information_schema';my_colGRANT ALTER ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT ALTER ROUTINE ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT CREATE ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT CREATE ROUTINE ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT CREATE TEMPORARY TABLES ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT DELETE ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'GRANT DROP ON information_schema.*TO 'testuser1'@'localhost';ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?