WL#4203 Reorganize and fix the data dictionary tests of
testsuite funcs_1 1. Fix the following bugs Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration Solution: Test variants charset_collation_* adjusted to different builds Bug#32603 "datadict" tests (all engines) fail in "community" tree: "PROFILING" table Solution: Excluding "PROFILING" table from queries Bug#33654 "slow log" is missing a line Solution: Unify the content of the fields TABLES.TABLE_ROWS and STATISTICS.CARDINALITY within result sets Bug#34532 Some funcs_1 tests do not clean up at end of testing Solution: DROP objects/reset global server variables modified during testing + let tests missing implementation end before loading of tables Bug#31421 funcs_1: ndb__datadict fails, discrepancy between scripts and expected results Solution: Cut <engine>__datadict tests into smaller tests + generate new results. Bug#33599 INFORMATION_SCHEMA.STATISTICS got a new column INDEX_COMMENT: tests fail (2) Generation of new results during post merge fix Bug#33600 CHARACTER_OCTET_LENGTH is now CHARACTER_MAXIMUM_LENGTH * 4 Generation of new results during post merge fix Bug#33631 Platform-specific replace of CHARACTER_MAXIMUM_LENGTH broken by 4-byte encoding Generation of new results during post merge fix + removal of platform-specific replace routine (no more needed) 2. Restructure the tests - Test not more than one INFORMATION_SCHEMA view per testscript - Separate tests of I_S view layout+functionality from content related to the all time existing databases "information_schema", "mysql" and "test" - Avoid storage engine related variants of tests which are not sensible to storage engines at all. 3. Reimplement or add some subtests + cleanup There is a some probability that even the reviewed changeset - does not fix all bugs from above or - contains new bugs which show up on some platforms <> Linux or on one of the various build types 4. The changeset contains fixes according to - one code review - minor bugs within testing code found after code review (accepted by reviewer) - problems found during tests with 5.0.56 in build environment
This commit is contained in:
parent
9ea63c2782
commit
30091e23f9
@ -1,134 +1,46 @@
|
||||
Matthias 17.06.2005
|
||||
-------------------
|
||||
1. I changed the database test1 (dropped + created in SP test)
|
||||
to test4.
|
||||
Please adjust the SP test cases.
|
||||
2. There is a difference between my definition of
|
||||
innodb_tb4 + memory_tb4
|
||||
to the latest table definition used by disha.
|
||||
Please adjust the table definition if needed.
|
||||
3. The data load files are product of the Disha data generation script
|
||||
(downloaded ~20 May ?) + modified by Omer
|
||||
These load data fit fairly to the table definitions.
|
||||
2008-02-29 Matthias Leich
|
||||
=========================
|
||||
|
||||
4. How to execute the "small" test with 10 rows per table.
|
||||
Do NOT set the environment variable NO_REFRESH to a
|
||||
value <> ''.
|
||||
Start the test for example by
|
||||
./mysql-test-run.pl --vardir=/dev/shm/var \
|
||||
--force --suite=funcs_1 --do-test=myisam
|
||||
The "result" files fit mostly to this variant.
|
||||
1. The testsuite "funcs_1" is mostly intended for additional (compared
|
||||
to the common regression tests stored in mysql-test/t) checks
|
||||
of features (VIEWS, INFORMATION_SCHEMA, STORED PROCEDURES,...)
|
||||
introduced with MySQL 5.0.
|
||||
|
||||
Any database not in ('mysql','test') and any tables
|
||||
needed within a testcase ( t/<storage engine>_<test filed>.test )
|
||||
will be (re)created at the beginning of the test.
|
||||
2. There were some extensions of this suite when new information_schema
|
||||
views were introduced. But in most cases the tests for these views
|
||||
were stored within the regression testsuite (mysql-test/t).
|
||||
|
||||
5. How to execute the "big" test with many rows per table.
|
||||
Replace the directories
|
||||
suite/funcs_1/data and
|
||||
suite/funcs_1/r
|
||||
with the appropriate ones for the "big" test.
|
||||
Set the environment variable NO_REFRESH to a value <> ''.
|
||||
Start the test for example by
|
||||
./mysql-test-run.pl --vardir=/dev/shm/var \
|
||||
--force --suite=funcs_1 --do-test=myisam
|
||||
INFORMATION_SCHEMA views introduced with MySQL 5.1
|
||||
==================================================
|
||||
ENGINES (partially tested here)
|
||||
EVENTS (partially tested here)
|
||||
FILES
|
||||
GLOBAL_STATUS
|
||||
GLOBAL_VARIABLES
|
||||
PARTITIONS
|
||||
PLUGINS
|
||||
PROCESSLIST (full tested here)
|
||||
PROFILING
|
||||
REFERENTIAL_CONSTRAINTS
|
||||
SESSION_STATUS
|
||||
SESSION_VARIABLES
|
||||
|
||||
All databases and tables will be (re)created by the script
|
||||
<storage engine>__load.test .
|
||||
3. Some hints:
|
||||
- SHOW TABLES ... LIKE '<pattern>'
|
||||
does a case sensitive comparison between the tablename and
|
||||
the pattern.
|
||||
The names of the tables within the informationschema are in uppercase.
|
||||
So please use something like
|
||||
SHOW TABLES FOR information_schema LIKE 'TABLES'
|
||||
when you intend to get the same non empty result set on OS with and
|
||||
without case sensitive filesystems and default configuration.
|
||||
- The name of the data dictionary is 'information_schema' (lowercase).
|
||||
- Server on OS with filesystem with case sensitive filenames
|
||||
(= The files 'abc' and 'Abc' can coexist.)
|
||||
+ default configuration
|
||||
Example of behaviour:
|
||||
DROP DATABASE information_schema;
|
||||
ERROR 42000: Access denied for user ... to database 'information_schema'
|
||||
DROP DATABASE INFORMATION_SCHEMA;
|
||||
ERROR 42000: Access denied for user ... to database 'INFORMATION_SCHEMA'
|
||||
|
||||
6. I am not sure of the files
|
||||
./funcs_1/include/create_<whatever>.inc
|
||||
are in the moment needed. I included them, because I
|
||||
guess my VIEW testcase example needs them.
|
||||
|
||||
I guess the pushed files are far away from being perfect.
|
||||
It is a 8 hours hack.
|
||||
Please try them, create missing files and come up with improvements.
|
||||
|
||||
Good luck !
|
||||
|
||||
Matthias 17.06.2005
|
||||
===================================================================
|
||||
Omer 19.06.2005
|
||||
---------------
|
||||
1. Changed the structure of the memory_tb3 table to include two
|
||||
additional column f121, f122. These columns exist for the table in
|
||||
the other storage engines as TEXT. Since memory does not support
|
||||
TEXT, Disha did not include them. How ever I am using them in the
|
||||
Trigger tests so added them to the memory definition as CHAR(50);.
|
||||
Also modifyed the DataGen_modiy.pl file to account for these two
|
||||
column when generating the data.
|
||||
- checked in a new DataGen_modify.pl (create a 'lib' directory
|
||||
under 'funcs_1').
|
||||
- checked in a new memory_tb3.txt
|
||||
2. Added three <storage>_triggers.test files based on Matthias's
|
||||
structure above.
|
||||
3. Added three <storage>__triggers.result files
|
||||
4. Added the Trigger_master.test file in the trigger dierctory
|
||||
Note: This is not complete and is still under work
|
||||
5. Created a 'lib' directory and added the DataGen*.pl scripts to it
|
||||
(exists under the disha suite) but should be here as well).
|
||||
Omer 19.06.2005
|
||||
===================================================================
|
||||
Matthias 12.09.2005
|
||||
-------------------
|
||||
Replace the geometry data types by VARBINARY
|
||||
The removal of the geometry data types was necessary, because the
|
||||
execution of the funcs_1 testsuite should not depend on the
|
||||
availability of the geometry feature.
|
||||
Note: There are servers compiled without the geometry feature.
|
||||
|
||||
The columns are not removed, but their data type was changed
|
||||
VARBINARY. This allows us to omit any changes within the loader
|
||||
input files or data generation scripts.
|
||||
The replacement of geometry by VARCHAR allows us to use our
|
||||
|
||||
Matthias 12.09.2005
|
||||
===================================================================
|
||||
Matthias 14.09.2005
|
||||
-------------------
|
||||
The results of the <storage_engine>_views testcases suffer when
|
||||
executed in "--ps-protocol" mode from the open
|
||||
Bug#11589: mysqltest, --ps-protocol, strange output,
|
||||
float/double/real with zerofill .
|
||||
Implementation of a workaround:
|
||||
At the beginning of views_master.inc is a variable $have_bug_11589 .
|
||||
If this varable is set to 1, the ps-protocol will be switched
|
||||
of for the critical statements.
|
||||
Matthias 14.09.2005
|
||||
===================================================================
|
||||
Carsten 16.09.2005
|
||||
------------------
|
||||
1. The results of the datadict_<engine> testcases have been changed in nearly
|
||||
all occurrencies of --error <n> because now for the INFORMATION_SCHEMA only
|
||||
the --error 1044 (ERROR 42000: Access denied for user '..' to database
|
||||
'information_schema') seems to be used.
|
||||
2. To get identical results when using "--ps-protocol" some SELECTs FROM
|
||||
information_schema has been wrapped to suppress using ps-protocol because
|
||||
there are differences.
|
||||
3. The test using SELECT .. OUTFILE has been disabled due to bug #13202.
|
||||
4. Fixed datadict_<engine>.result files after the change that added 2 columns to
|
||||
the VIEWS table (DEFINER varchar(77), SECURITY_TYPE varchar(7)).
|
||||
===================================================================
|
||||
Matthias 25.08.2007
|
||||
-------------------
|
||||
Fixes for Bugs 30418,30420,30438,30440
|
||||
1. Replace error numbers with error names
|
||||
2. Replace static "InnoDB" (not all time available) used within an
|
||||
"alter table" by $OTHER_ENGINE_TYPE (set to MEMORY or MyISAM).
|
||||
Minor adjustment of column data type.
|
||||
3. Use mysqltest result set sorting in several cases.
|
||||
4. Avoid any statistics about help tables, because their content
|
||||
depends on configuration:
|
||||
developer release - help tables are empty
|
||||
build release - help tables have content + growing with version
|
||||
5. Add two help table related tests (one for build, one for developer)
|
||||
to ensure that informations about help tables within
|
||||
INFORMATION_SCHEMA.TABLES/STATISTICS are checked.
|
||||
General note:
|
||||
Most INFORMATION_SCHEMA properties (table layout, permissions etc.)
|
||||
are not affected by our variation of the storage engines except
|
||||
that some properties of our tables using a specific storage
|
||||
engine become visible. So it makes sense to decompose
|
||||
this test into a storage engine specific part and a non
|
||||
storage engine specific part in future.
|
||||
|
53
mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
Normal file
53
mysql-test/suite/funcs_1/datadict/basics_mixed1.inc
Normal file
@ -0,0 +1,53 @@
|
||||
# suite/funcs_1/datadict/basics_mixed1.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by suite/funcs_1/t/is_basics_mixed.test
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
# 1 Attempt to create tables and views when residing in information_schema
|
||||
# 1.1 CREATE TABLE
|
||||
USE information_schema;
|
||||
let $message= root: create a table with a name of an IS table directly in IS;
|
||||
let $dd_part1= CREATE TABLE;
|
||||
let $dd_part2= ( c1 INT );
|
||||
--source suite/funcs_1/datadict/basics_mixed2.inc
|
||||
# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
|
||||
--error ER_UNKNOWN_TABLE
|
||||
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
|
||||
#
|
||||
# 1.2 CREATE VIEW
|
||||
# 1.2.1 Hit on existing INFORMATION_SCHEMA table
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE VIEW tables AS SELECT 'garbage';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
|
||||
# 1.2.2 New view
|
||||
# ER_DBACCESS_DENIED_ERROR would be better.
|
||||
--error ER_UNKNOWN_TABLE
|
||||
CREATE VIEW v1 AS SELECT 'garbage';
|
||||
|
||||
# 2 Attempt to create tables and views when residing in information_schema
|
||||
# 1.1 CREATE TABLE
|
||||
USE test;
|
||||
let $message= root: create a table with a name of an IS table from other db;
|
||||
let $dd_part1= CREATE TABLE information_schema.;
|
||||
let $dd_part2= ( c1 INT );
|
||||
--source suite/funcs_1/datadict/basics_mixed2.inc
|
||||
# FIXME 3.2.1.6: error message ER_UNKNOWN_TABLE is misleading
|
||||
--error ER_UNKNOWN_TABLE
|
||||
CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
|
||||
#
|
||||
# Hit on existing INFORMATION_SCHEMA table
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE VIEW information_schema.tables AS SELECT 'garbage';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE VIEW information_schema.tables AS
|
||||
SELECT * FROM information_schema.tables;
|
||||
# New table
|
||||
# ER_DBACCESS_DENIED_ERROR would be better.
|
||||
--error ER_UNKNOWN_TABLE
|
||||
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
|
55
mysql-test/suite/funcs_1/datadict/basics_mixed2.inc
Normal file
55
mysql-test/suite/funcs_1/datadict/basics_mixed2.inc
Normal file
@ -0,0 +1,55 @@
|
||||
#### suite/funcs_1/datadict/basics_mixed2.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by suite/funcs_1/datadict/is_basics_mixed1.inc
|
||||
#
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
#
|
||||
# Usage example(snip of script):
|
||||
# let $dd_part1= CREATE TABLE information_schema.;
|
||||
# let $dd_part2= ( c1 INT );
|
||||
# --source suite/funcs_1/datadict/basics_mixed2.inc
|
||||
#
|
||||
# We expect to get
|
||||
# ERROR 42000: Access denied for user 'root'@'localhost'
|
||||
# to database 'information_schema'
|
||||
# for every statement.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
eval $dd_part1 triggers $dd_part2;
|
||||
|
42
mysql-test/suite/funcs_1/datadict/basics_mixed3.inc
Normal file
42
mysql-test/suite/funcs_1/datadict/basics_mixed3.inc
Normal file
@ -0,0 +1,42 @@
|
||||
#### suite/funcs_1/datadict/basics_mixed3.inc
|
||||
#
|
||||
# Auxiliary routine to be sourced by suite/funcs_1/t/is_basics_mixed.test
|
||||
#
|
||||
# Check if INFORMATION_SCHEMA tables contain a schema_name like 'db_data%'.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
# No column with the name of a database contained in:
|
||||
# character_sets collations collation_character_set_applicability
|
||||
# user_privileges
|
||||
SELECT DISTINCT table_schema FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema FROM information_schema.column_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT routine_schema FROM information_schema.routines
|
||||
WHERE routine_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT schema_name FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema,index_schema FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_data%' OR index_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.table_constraints
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema FROM information_schema.table_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT trigger_schema,event_object_schema
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_schema LIKE 'db_data%' OR event_object_schema LIKE 'db_data%';
|
||||
SELECT DISTINCT table_schema FROM information_schema.views
|
||||
WHERE table_schema LIKE 'db_data%';
|
122
mysql-test/suite/funcs_1/datadict/charset_collation.inc
Normal file
122
mysql-test/suite/funcs_1/datadict/charset_collation.inc
Normal file
@ -0,0 +1,122 @@
|
||||
# suite/funcs_1/datadict/charset_collation.inc
|
||||
#
|
||||
# Tests checking the content of the information_schema tables
|
||||
# character_sets
|
||||
# collations
|
||||
# collation_character_set_applicability
|
||||
#
|
||||
#
|
||||
# The amount and properties of character_sets/collations depend on the
|
||||
# build type
|
||||
# 2007-12 MySQL 5.0
|
||||
# ---------------------------------------------------------------------
|
||||
#
|
||||
# Variant 1 fits to
|
||||
# version_comment MySQL Enterprise Server (Commercial)
|
||||
# version_comment MySQL Enterprise Server (GPL)
|
||||
# version_comment MySQL Classic Server (Commercial)
|
||||
# version_comment MySQL Pushbuild Edition, build <number>
|
||||
# (version_comment Source distribution
|
||||
# and
|
||||
# compile was without "max" - > no collation 'utf8_general_ci')
|
||||
#
|
||||
# Variant 2 fits to
|
||||
# version_comment MySQL Enterprise Server (GPL)
|
||||
# version_comment MySQL Classic Server (Commercial)
|
||||
# version_comment MySQL Pushbuild Edition, build <number>
|
||||
# (version_comment Source distribution
|
||||
# and
|
||||
# compile was without "max" - > collation 'utf8_general_ci' exists)
|
||||
#
|
||||
# Difference between variant 1 and 2 is the collation 'utf8_general_ci'.
|
||||
#
|
||||
# Variant 3 fits to
|
||||
# version_comment MySQL Community Server (GPL)
|
||||
# version_comment MySQL Cluster Server (Commercial)
|
||||
#
|
||||
# Difference between variant 3 and 2 is within the collation properties
|
||||
# IS_COMPILED and SORTLEN.
|
||||
#
|
||||
# Created:
|
||||
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
|
||||
# from include/datadict-master.inc
|
||||
# - create this new test
|
||||
#
|
||||
|
||||
# Create a low privileged user.
|
||||
--error 0, ER_CANNOT_USER
|
||||
DROP USER dbdict_test@localhost;
|
||||
CREATE USER dbdict_test@localhost;
|
||||
|
||||
--echo # Establish connection con (user=dbdict_test)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (con,localhost,dbdict_test,,);
|
||||
################################################################################
|
||||
#
|
||||
# The original requirements for the following tests were:
|
||||
#
|
||||
# 3.2.2.2: Ensure that the table (information_schema.character_sets) shows the
|
||||
# relevant information on every character set for which the current
|
||||
# user or PUBLIC have the USAGE privilege.
|
||||
#
|
||||
# 3.2.2.3: Ensure that the table (information_schema.character_sets) does not
|
||||
# show any information on any character set for which the current user
|
||||
# or PUBLIC have no USAGE privilege.
|
||||
#
|
||||
#
|
||||
# 3.2.3.2: Ensure that the table (information_schema.collations) shows the
|
||||
# relevant information on every collation for which the current user
|
||||
# or PUBLIC have the USAGE privilege.
|
||||
#
|
||||
# 3.2.3.3: Ensure that the table (information_schema.collations) does not show
|
||||
# any information on any collations for which the current user and
|
||||
# PUBLIC have no USAGE privilege.
|
||||
#
|
||||
#
|
||||
# 3.2.4.2: Ensure that the table
|
||||
# information_schema.collation_character_set_applicability
|
||||
# shows the relevant information on every collation/character set
|
||||
# combination for which the current user or PUBLIC have the USAGE
|
||||
# privilege.
|
||||
#
|
||||
# 3.2.4.3: Ensure that the table
|
||||
# information_schema.collation_character_set_applicability
|
||||
# does not show any information on any collation/character set
|
||||
# combinations for which the current user and PUBLIC have no
|
||||
# USAGE privilege.
|
||||
#
|
||||
# Notes (2007-12-19 mleich):
|
||||
# - The requirements are outdated because grant/revoke privilege for using a
|
||||
# characterset/collation were never implemented.
|
||||
# Therefore the tests should simply check the content of these tables.
|
||||
#
|
||||
# - The amount of collations/character sets grows with new MySQL releases.
|
||||
#
|
||||
# - Even within the same release the amount of records within these tables
|
||||
# can differ between different build types (community, enterprise, source,...)
|
||||
#
|
||||
#
|
||||
################################################################################
|
||||
--echo
|
||||
SELECT *
|
||||
FROM information_schema.character_sets
|
||||
ORDER BY character_set_name;
|
||||
|
||||
--echo
|
||||
SELECT *
|
||||
FROM information_schema.collations
|
||||
ORDER BY collation_name;
|
||||
|
||||
echo;
|
||||
--echo
|
||||
SELECT *
|
||||
FROM information_schema.collation_character_set_applicability
|
||||
ORDER BY collation_name, character_set_name;
|
||||
|
||||
|
||||
# Cleanup
|
||||
--echo # Switch to connection default + disconnect con
|
||||
connection default;
|
||||
disconnect con;
|
||||
DROP USER dbdict_test@localhost;
|
||||
|
87
mysql-test/suite/funcs_1/datadict/columns.inc
Normal file
87
mysql-test/suite/funcs_1/datadict/columns.inc
Normal file
@ -0,0 +1,87 @@
|
||||
# suite/funcs_1/datadict/is_columns.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# is_columns_is
|
||||
# is_columns_mysql
|
||||
# is_columns_<engine>
|
||||
#
|
||||
# Purpose:
|
||||
# Check the content of information_schema.columns about tables within certain
|
||||
# database/s.
|
||||
#
|
||||
# Usage:
|
||||
# The variable $my_where has to
|
||||
# - be set before sourcing this script.
|
||||
# - contain the first part of the WHERE qualification
|
||||
# Example:
|
||||
# let $my_where = WHERE table_schema = 'information_schema'
|
||||
# AND table_name <> 'profiling';
|
||||
# --source suite/funcs_1/datadict/is_columns.inc
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval
|
||||
SELECT * FROM information_schema.columns
|
||||
$my_where
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
|
||||
--echo ##########################################################################
|
||||
--echo # Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
--echo ##########################################################################
|
||||
eval
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
$my_where
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
|
||||
#FIXME 3.2.6.2: check the value 2.0079 tinytext ucs2 ucs2_general_ci
|
||||
eval
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
$my_where
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
|
||||
eval
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
$my_where
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
|
||||
echo --> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values;
|
||||
echo --> are 0, which is intended behavior, and the result of 0 / 0 IS NULL;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
$my_where
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
|
54
mysql-test/suite/funcs_1/datadict/datadict.pre
Normal file
54
mysql-test/suite/funcs_1/datadict/datadict.pre
Normal file
@ -0,0 +1,54 @@
|
||||
#### suite/funcs_1/datadict/datadict.pre
|
||||
#
|
||||
# Auxiliary script which loads prerequisites
|
||||
# (variables needed for --replace_result ...)
|
||||
# in datadictionary tests.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
--disable_query_log
|
||||
|
||||
# Bug#12777 Different size shown for VARCHAR(n) columns (with n> 64)
|
||||
# in INFORMATION_SCHEMA
|
||||
# This bug was unfortunately (for testers) declared to be no bug.
|
||||
# So CHARACTER_MAXIMUM_LENGTH of several <whatever>_CATALOG columns within
|
||||
# the INFORMATION_SCHEMA depends on PATH_MAX of the operating system.
|
||||
# Workaround for this problem:
|
||||
# Get the size of ONE known colum and check the size against some values to
|
||||
# be able to use the correct --replace_result statement. Using this only the
|
||||
# one pair of 'wrong' values is replaced and not all occurrencies of all
|
||||
# possible pairs of values. See bug #12777 for details.
|
||||
SELECT character_maximum_length INTO @CML
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name = 'columns'
|
||||
AND column_name = 'table_catalog';
|
||||
|
||||
let $bug_12777_0512= `SELECT @CML = 512`;
|
||||
let $bug_12777_1023= `SELECT @CML = 1023`;
|
||||
let $bug_12777_1024= `SELECT @CML = 1024`;
|
||||
let $bug_12777_2048= `SELECT @CML = 2048`;
|
||||
# 4096 is the value used in the files with expected results.
|
||||
let $bug_12777_4095= `SELECT @CML = 4095`;
|
||||
if (0)
|
||||
{
|
||||
# enable this for debugging only, but NOT in a pushed version, as then the
|
||||
# result changes from OS to OS ...
|
||||
eval SELECT @CML AS 'CML',
|
||||
$bug_12777_0512 AS '512',
|
||||
$bug_12777_1023 AS '1023',
|
||||
$bug_12777_1024 AS '1024',
|
||||
$bug_12777_2048 AS '2048',
|
||||
$bug_12777_4095 AS '4095';
|
||||
}
|
||||
|
||||
|
||||
# Prepare a variable to be able to suppress machine dependant diffs
|
||||
# this can be used in: --replace_result $SERVER_NAME <SERVER_NAME>
|
||||
let $SERVER_NAME= `SELECT DISTINCT host FROM mysql.user
|
||||
WHERE host NOT In ("localhost", "127.0.0.1", "%")`;
|
||||
--enable_query_log
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,57 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_show_schema.test
|
||||
|
||||
# shows content of tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# let $message= <a message for the .result file>;
|
||||
# let $dbname= <prefix_of_a_cb_name>;
|
||||
# --source suite/funcs_1/datadict/datadict_show_schema.test
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
eval select *
|
||||
from information_schema.schemata
|
||||
where schema_name like '$dbname%';
|
||||
|
||||
eval select table_catalog, table_schema, engine
|
||||
from information_schema.tables
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval select *
|
||||
from information_schema.columns
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval select table_schema, table_name, is_updatable
|
||||
from information_schema.views
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval select routine_name, routine_type, security_type, sql_mode
|
||||
from information_schema.routines
|
||||
where routine_schema like '$dbname%';
|
||||
|
||||
eval select table_name, index_schema, index_name, index_type
|
||||
from information_schema.statistics
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
--replace_result $SERVER_NAME <SERVER_NAME>
|
||||
--sorted_result
|
||||
eval select *
|
||||
from information_schema.user_privileges;
|
||||
# where grantee="'u_6_401013'@'%'";
|
||||
|
||||
eval select *
|
||||
from information_schema.column_privileges
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval select *
|
||||
from information_schema.table_privileges
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval select *
|
||||
from information_schema.key_column_usage
|
||||
where table_schema like '$dbname%';
|
||||
|
||||
eval SELECT *
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_schema LIKE '$dbname%';
|
@ -1,28 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_show_table_design.test
|
||||
#
|
||||
# - shows design of *one* table from INFORMATION_SCHEMA
|
||||
# - used to have identical 'view' on all tested tables
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# let $is_table= <name of one of the tables>;
|
||||
# --source suite/funcs_1/datadict/datadict_show_table_design.test
|
||||
|
||||
USE information_schema;
|
||||
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESC $is_table;
|
||||
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE $is_table;
|
||||
|
||||
eval SELECT COUNT(*) FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name = '$is_table'
|
||||
ORDER BY ordinal_position;
|
||||
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name = '$is_table'
|
||||
ORDER BY ordinal_position;
|
@ -1,62 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
|
||||
#FIXME: splitting the "SELECT * FROM tables" in two parts until
|
||||
#FIXME: Bug #12397: wrong values shown in column CREATE_OPTIONS of INFORMATION_SCHEMA.TABLES
|
||||
#FIXME: is solved, like done in the _master.test, cannot be done here, so we replace here
|
||||
#FIXME: the result for ALL rows.
|
||||
# 9 AVG_ROW_LENGTH
|
||||
# 10 DATA_LENGTH
|
||||
# 11 MAX_DATA_LENGTH
|
||||
## 12 INDEX_LENGTH
|
||||
# 13 DATA_FREE
|
||||
# 15 CREATE_TIME
|
||||
# 16 UPDATE_TIME
|
||||
# 20 CREATE_OPTIONS
|
||||
--replace_column 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "YYYY-MM-DD hh:mm:ss" 16 "YYYY-MM-DD hh:mm:ss" 20 "#CO#"
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
eval $dd_part1 collations where collation_name <> 'utf8_general_cs' $dd_part2;
|
||||
eval $dd_part1 collation_character_set_applicability where collation_name <> 'utf8_general_cs' $dd_part2;
|
||||
--replace_column 16 <Created> 17 <Last_Altered>
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
eval $dd_part1 views $dd_part2;
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
eval $dd_part1 triggers $dd_part2;
|
||||
|
||||
# later planned new tables for INFORMATION_SCHEMA (not before version 5.0.11)
|
||||
#
|
||||
# (see Reference Manual: 22.1.16. Other INFORMATION_SCHEMA Tables):
|
||||
#
|
||||
# parameters
|
||||
# referential_constraints
|
||||
#
|
||||
# check them here although they currently does not exist, but using this we
|
||||
# immedeatly get notice when they are implemented
|
||||
|
||||
#### DON'T FORGET TO ADD THE NEW TABLES TO THE CORRESPONDING FILES
|
||||
#### datadict_tables_error_<errno>.test !
|
||||
|
||||
--error 1109
|
||||
eval $dd_part1 parameters $dd_part2;
|
||||
|
||||
--error 1109
|
||||
eval $dd_part1 referential_constraints $dd_part2;
|
@ -1,33 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
|
||||
#--disable_query_log
|
||||
#eval SET @aux= 'This testcase shows the error number $error_no';
|
||||
#let $message= `SELECT @aux`;
|
||||
#--enable_query_log
|
||||
--source include/show_msg.inc
|
||||
|
||||
--disable_abort_on_error
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
eval $dd_part1 views $dd_part2;
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
eval $dd_part1 triggers $dd_part2;
|
||||
--enable_abort_on_error
|
@ -1,80 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
let $message= known error 1 (Can_t create/write to file ...):;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 views $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
|
||||
--replace_result '\\' '/'
|
||||
--error 1
|
||||
eval $dd_part1 triggers $dd_part2;
|
@ -1,51 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables_error_1044.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
# e.g.: ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
|
||||
let $message= known error 1044 (ERROR 42000: Access denied for user ... to database ...):;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--error 1044
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error 1044
|
||||
eval $dd_part1 triggers $dd_part2;
|
@ -1,49 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
let $message= known error 1049 (ERROR 42000: Unknown database ...):;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--error 1049
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error 1049
|
||||
eval $dd_part1 triggers $dd_part2;
|
@ -1,49 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
let $message= known error 1051:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--error 1051
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error 1051
|
||||
eval $dd_part1 triggers $dd_part2;
|
@ -1,49 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
let $message= known error 1146:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--error 1146
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error 1146
|
||||
eval $dd_part1 triggers $dd_part2;
|
@ -1,49 +0,0 @@
|
||||
#### suite/funcs_1/datadict/datadict_tables.inc
|
||||
|
||||
# contains all tables from INFORMATION_SCHEMA
|
||||
|
||||
# usage:
|
||||
|
||||
# --source suite/funcs_1/datadict/datadict_tables_err_<no>.inc
|
||||
#
|
||||
# up to a change of "mysqltest", which makes lines like "eval --error $err_no"
|
||||
# possible we will have some different files with the same content except the
|
||||
# error numbers.
|
||||
|
||||
--source include/show_msg.inc
|
||||
|
||||
let $message= known error 1288:;
|
||||
--source include/show_msg.inc
|
||||
|
||||
--error 1288
|
||||
eval $dd_part1 schemata $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 tables $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 columns $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 character_sets $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 collations $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 collation_character_set_applicability $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 routines $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 statistics $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 views $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 user_privileges $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 schema_privileges $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 table_privileges $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 column_privileges $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 table_constraints $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 key_column_usage $dd_part2;
|
||||
--error 1288
|
||||
eval $dd_part1 triggers $dd_part2;
|
42
mysql-test/suite/funcs_1/datadict/is_table_query.inc
Normal file
42
mysql-test/suite/funcs_1/datadict/is_table_query.inc
Normal file
@ -0,0 +1,42 @@
|
||||
# suite/funcs_1/datadict/is_table_query.inc
|
||||
#
|
||||
# Check that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
# (Requirement 3.2.1.1)
|
||||
#
|
||||
# The variable $is_table must be set before sourcing this script.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
--enable_warnings
|
||||
eval CREATE VIEW test.v1 AS SELECT * FROM information_schema.$is_table;
|
||||
eval CREATE PROCEDURE test.p1() SELECT * FROM information_schema.$is_table;
|
||||
delimiter //;
|
||||
eval CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.$is_table;
|
||||
RETURN counter;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
|
||||
# We are not interested to check the content here.
|
||||
--echo # Attention: The printing of the next result sets is disabled.
|
||||
--disable_result_log
|
||||
eval SELECT * FROM information_schema.$is_table;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
--enable_result_log
|
||||
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
55
mysql-test/suite/funcs_1/datadict/statistics.inc
Normal file
55
mysql-test/suite/funcs_1/datadict/statistics.inc
Normal file
@ -0,0 +1,55 @@
|
||||
# suite/funcs_1/datadict/statistics.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# is_statistics_is
|
||||
# is_statistics_mysql
|
||||
# is_statistics_<engine>
|
||||
#
|
||||
# Purpose:
|
||||
# Check the content of information_schema.statistics about tables within the
|
||||
# database '$database'.
|
||||
#
|
||||
# Usage:
|
||||
# The variable $database has to be set before sourcing this script.
|
||||
# Example:
|
||||
# let $database = db_data;
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
--source suite/funcs_1/datadict/datadict.pre
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
# Create a low privileged user.
|
||||
# Note: The database db_datadict is just a "home" for the low privileged user
|
||||
# and not in the focus of testing.
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
|
||||
let $my_select = SELECT * FROM information_schema.statistics
|
||||
$my_where
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
--replace_column 10 #CARD#
|
||||
eval $my_select;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1,localhost,testuser1,,db_datadict);
|
||||
--replace_column 10 #CARD#
|
||||
eval $my_select;
|
||||
|
||||
--echo # Switch to connection default and close connection testuser1
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
|
45
mysql-test/suite/funcs_1/datadict/table_constraints.inc
Normal file
45
mysql-test/suite/funcs_1/datadict/table_constraints.inc
Normal file
@ -0,0 +1,45 @@
|
||||
# suite/funcs_1/datadict/table_constraints.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# suite/funcs_1/t/is_table_constraints_mysql.test
|
||||
# suite/funcs_1/t/is_table_constraints_is.test
|
||||
#
|
||||
# The variable
|
||||
# $table_schema database to be inspected
|
||||
# has to be set before sourcing this script.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
# Create a low privileged user.
|
||||
# Note: The database db_datadict is just a "home" for the low privileged user
|
||||
# and not in the focus of testing.
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
|
||||
let $my_select = SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = '$table_schema'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
eval $my_select;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1,localhost,testuser1,,db_datadict);
|
||||
eval $my_select;
|
||||
|
||||
--echo # Switch to connection default and close connection testuser1
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
|
39
mysql-test/suite/funcs_1/datadict/tables1.inc
Normal file
39
mysql-test/suite/funcs_1/datadict/tables1.inc
Normal file
@ -0,0 +1,39 @@
|
||||
# suite/funcs_1/datadict/tables1.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# is_tables_mysql.test
|
||||
# is_tables_is.test
|
||||
# is_tables_<engine>.test
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
|
||||
# Create a low privileged user.
|
||||
# Note: The database db_datadict is just a "home" for the low privileged user
|
||||
# and not in the focus of testing.
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1,localhost,testuser1,,db_datadict);
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
|
||||
--echo # Switch to connection default and close connection testuser1
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
|
47
mysql-test/suite/funcs_1/datadict/tables2.inc
Normal file
47
mysql-test/suite/funcs_1/datadict/tables2.inc
Normal file
@ -0,0 +1,47 @@
|
||||
# suite/funcs_1/datadict/tables2.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by suite/funcs_1/datadict/tables1.inc.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# 8 TABLE_ROWS
|
||||
# 9 AVG_ROW_LENGTH
|
||||
# 10 DATA_LENGTH
|
||||
# 11 MAX_DATA_LENGTH
|
||||
# 12 INDEX_LENGTH
|
||||
# 13 DATA_FREE
|
||||
# 15 CREATE_TIME
|
||||
# 16 UPDATE_TIME
|
||||
# 17 CHECK_TIME
|
||||
# 20 CREATE_OPTIONS
|
||||
# 21 TABLE_COMMENT User defined comment
|
||||
# + InnoDB
|
||||
# + NDB: "number_of_replicas: <number>" appended
|
||||
# + InnoDB: "InnoDB free: <number_kB> kB" appended
|
||||
# <number_kB> depends on tablespace history!
|
||||
# The LEFT/INSTR/IF/LENGTH stuff should remove these
|
||||
# storage engine specific part.
|
||||
let $innodb_pattern = 'InnoDB free';
|
||||
let $ndb_pattern = 'number_of_replicas';
|
||||
--vertical_results
|
||||
--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
|
||||
eval
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,$innodb_pattern) = 0
|
||||
AND INSTR(table_comment,$ndb_pattern) = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,$innodb_pattern)
|
||||
+ INSTR(table_comment,$ndb_pattern) - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
$my_where
|
||||
ORDER BY table_schema,table_name;
|
||||
--horizontal_results
|
||||
|
21
mysql-test/suite/funcs_1/include/cleanup.inc
Normal file
21
mysql-test/suite/funcs_1/include/cleanup.inc
Normal file
@ -0,0 +1,21 @@
|
||||
# suite/funcs_1/include/cleanup.inc
|
||||
#
|
||||
# Remove all objects created by sourcing
|
||||
# suite/funcs_1/datadict/datadict_load.inc
|
||||
#
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test4;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
DROP TABLE test.t3;
|
||||
DROP TABLE test.t4;
|
||||
DROP TABLE test.t7;
|
||||
DROP TABLE test.t8;
|
||||
DROP TABLE test.t9;
|
||||
DROP TABLE test.t10;
|
||||
DROP TABLE test.t11;
|
||||
DROP TABLE test.tb1;
|
||||
DROP TABLE test.tb2;
|
||||
DROP TABLE test.tb3;
|
||||
DROP TABLE test.tb4;
|
||||
|
@ -1,6 +0,0 @@
|
||||
##### suite/funcs_1/include/create_database.inc
|
||||
|
||||
--disable_warnings
|
||||
eval DROP DATABASE IF EXISTS $new_database;
|
||||
--enable_warnings
|
||||
eval CREATE DATABASE $new_database;
|
@ -1,10 +0,0 @@
|
||||
##### suite/funcs_1/include/create_user_no_priv.inc
|
||||
#
|
||||
# $new_user must contain the name (with @<host> if necessary)
|
||||
#
|
||||
|
||||
--error 0,1396
|
||||
eval DROP USER $new_user;
|
||||
eval CREATE USER $new_user identified by 'PWD';
|
||||
# Just to be sure
|
||||
eval REVOKE ALL PRIVILEGES, GRANT OPTION FROM $new_user;
|
@ -1,11 +0,0 @@
|
||||
##### suite/funcs_1/include/create_user_no_super.inc
|
||||
#
|
||||
# $new_user must contain the name (with @<host> if necessary)
|
||||
# of the user to be created
|
||||
|
||||
--error 0,1396
|
||||
eval DROP USER $new_user;
|
||||
eval CREATE USER $new_user identified by 'PWD';
|
||||
|
||||
eval GRANT ALL ON *.* TO $new_user WITH GRANT OPTION;
|
||||
eval REVOKE SUPER ON *.* FROM $new_user;
|
@ -1,8 +1,5 @@
|
||||
##### suite/funcs_1/include/memory_tb1.inc
|
||||
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists tb1 ;
|
||||
--enable_warnings
|
||||
|
@ -1,8 +1,5 @@
|
||||
##### suite/funcs_1/include/memory_tb2.inc
|
||||
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists tb2 ;
|
||||
--enable_warnings
|
||||
|
@ -1,8 +1,5 @@
|
||||
##### suite/funcs_1/include/memory_tb3.inc
|
||||
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists tb3;
|
||||
--enable_warnings
|
||||
|
@ -1,8 +1,5 @@
|
||||
##### suite/funcs_1/include/memory_tb4.inc
|
||||
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists tb4 ;
|
||||
--enable_warnings
|
||||
|
@ -1,9 +1,5 @@
|
||||
--disable_abort_on_error
|
||||
|
||||
# ML: Should be set outside when memory
|
||||
# set @@global.max_heap_table_size=4294967295;
|
||||
# set @@session.max_heap_table_size=4294967295;
|
||||
|
||||
USE test;
|
||||
|
||||
--disable_warnings
|
||||
|
309
mysql-test/suite/funcs_1/r/charset_collation_1.result
Normal file
309
mysql-test/suite/funcs_1/r/charset_collation_1.result
Normal file
@ -0,0 +1,309 @@
|
||||
DROP USER dbdict_test@localhost;
|
||||
CREATE USER dbdict_test@localhost;
|
||||
# Establish connection con (user=dbdict_test)
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.character_sets
|
||||
ORDER BY character_set_name;
|
||||
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
||||
armscii8 armscii8_general_ci ARMSCII-8 Armenian 1
|
||||
ascii ascii_general_ci US ASCII 1
|
||||
big5 big5_chinese_ci Big5 Traditional Chinese 2
|
||||
binary binary Binary pseudo charset 1
|
||||
cp1250 cp1250_general_ci Windows Central European 1
|
||||
cp1251 cp1251_general_ci Windows Cyrillic 1
|
||||
cp1256 cp1256_general_ci Windows Arabic 1
|
||||
cp1257 cp1257_general_ci Windows Baltic 1
|
||||
cp850 cp850_general_ci DOS West European 1
|
||||
cp852 cp852_general_ci DOS Central European 1
|
||||
cp866 cp866_general_ci DOS Russian 1
|
||||
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
|
||||
dec8 dec8_swedish_ci DEC West European 1
|
||||
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
|
||||
euckr euckr_korean_ci EUC-KR Korean 2
|
||||
gb2312 gb2312_chinese_ci GB2312 Simplified Chinese 2
|
||||
gbk gbk_chinese_ci GBK Simplified Chinese 2
|
||||
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
|
||||
greek greek_general_ci ISO 8859-7 Greek 1
|
||||
hebrew hebrew_general_ci ISO 8859-8 Hebrew 1
|
||||
hp8 hp8_english_ci HP West European 1
|
||||
keybcs2 keybcs2_general_ci DOS Kamenicky Czech-Slovak 1
|
||||
koi8r koi8r_general_ci KOI8-R Relcom Russian 1
|
||||
koi8u koi8u_general_ci KOI8-U Ukrainian 1
|
||||
latin1 latin1_swedish_ci cp1252 West European 1
|
||||
latin2 latin2_general_ci ISO 8859-2 Central European 1
|
||||
latin5 latin5_turkish_ci ISO 8859-9 Turkish 1
|
||||
latin7 latin7_general_ci ISO 8859-13 Baltic 1
|
||||
macce macce_general_ci Mac Central European 1
|
||||
macroman macroman_general_ci Mac West European 1
|
||||
sjis sjis_japanese_ci Shift-JIS Japanese 2
|
||||
swe7 swe7_swedish_ci 7bit Swedish 1
|
||||
tis620 tis620_thai_ci TIS620 Thai 1
|
||||
ucs2 ucs2_general_ci UCS-2 Unicode 2
|
||||
ujis ujis_japanese_ci EUC-JP Japanese 3
|
||||
utf8 utf8_general_ci UTF-8 Unicode 3
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collations
|
||||
ORDER BY collation_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
|
||||
armscii8_bin armscii8 64 0
|
||||
armscii8_general_ci armscii8 32 Yes 0
|
||||
ascii_bin ascii 65 0
|
||||
ascii_general_ci ascii 11 Yes 0
|
||||
big5_bin big5 84 Yes 1
|
||||
big5_chinese_ci big5 1 Yes Yes 1
|
||||
binary binary 63 Yes Yes 1
|
||||
cp1250_bin cp1250 66 Yes 1
|
||||
cp1250_croatian_ci cp1250 44 Yes 1
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
cp1250_general_ci cp1250 26 Yes Yes 1
|
||||
cp1251_bin cp1251 50 0
|
||||
cp1251_bulgarian_ci cp1251 14 0
|
||||
cp1251_general_ci cp1251 51 Yes 0
|
||||
cp1251_general_cs cp1251 52 0
|
||||
cp1251_ukrainian_ci cp1251 23 0
|
||||
cp1256_bin cp1256 67 0
|
||||
cp1256_general_ci cp1256 57 Yes 0
|
||||
cp1257_bin cp1257 58 0
|
||||
cp1257_general_ci cp1257 59 Yes 0
|
||||
cp1257_lithuanian_ci cp1257 29 0
|
||||
cp850_bin cp850 80 0
|
||||
cp850_general_ci cp850 4 Yes 0
|
||||
cp852_bin cp852 81 0
|
||||
cp852_general_ci cp852 40 Yes 0
|
||||
cp866_bin cp866 68 0
|
||||
cp866_general_ci cp866 36 Yes 0
|
||||
cp932_bin cp932 96 Yes 1
|
||||
cp932_japanese_ci cp932 95 Yes Yes 1
|
||||
dec8_bin dec8 69 0
|
||||
dec8_swedish_ci dec8 3 Yes 0
|
||||
eucjpms_bin eucjpms 98 Yes 1
|
||||
eucjpms_japanese_ci eucjpms 97 Yes Yes 1
|
||||
euckr_bin euckr 85 Yes 1
|
||||
euckr_korean_ci euckr 19 Yes Yes 1
|
||||
gb2312_bin gb2312 86 Yes 1
|
||||
gb2312_chinese_ci gb2312 24 Yes Yes 1
|
||||
gbk_bin gbk 87 Yes 1
|
||||
gbk_chinese_ci gbk 28 Yes Yes 1
|
||||
geostd8_bin geostd8 93 0
|
||||
geostd8_general_ci geostd8 92 Yes 0
|
||||
greek_bin greek 70 0
|
||||
greek_general_ci greek 25 Yes 0
|
||||
hebrew_bin hebrew 71 0
|
||||
hebrew_general_ci hebrew 16 Yes 0
|
||||
hp8_bin hp8 72 0
|
||||
hp8_english_ci hp8 6 Yes 0
|
||||
keybcs2_bin keybcs2 73 0
|
||||
keybcs2_general_ci keybcs2 37 Yes 0
|
||||
koi8r_bin koi8r 74 0
|
||||
koi8r_general_ci koi8r 7 Yes 0
|
||||
koi8u_bin koi8u 75 0
|
||||
koi8u_general_ci koi8u 22 Yes 0
|
||||
latin1_bin latin1 47 Yes 1
|
||||
latin1_danish_ci latin1 15 Yes 1
|
||||
latin1_general_ci latin1 48 Yes 1
|
||||
latin1_general_cs latin1 49 Yes 1
|
||||
latin1_german1_ci latin1 5 Yes 1
|
||||
latin1_german2_ci latin1 31 Yes 2
|
||||
latin1_spanish_ci latin1 94 Yes 1
|
||||
latin1_swedish_ci latin1 8 Yes Yes 1
|
||||
latin2_bin latin2 77 Yes 1
|
||||
latin2_croatian_ci latin2 27 Yes 1
|
||||
latin2_czech_cs latin2 2 Yes 4
|
||||
latin2_general_ci latin2 9 Yes Yes 1
|
||||
latin2_hungarian_ci latin2 21 Yes 1
|
||||
latin5_bin latin5 78 0
|
||||
latin5_turkish_ci latin5 30 Yes 0
|
||||
latin7_bin latin7 79 0
|
||||
latin7_estonian_cs latin7 20 0
|
||||
latin7_general_ci latin7 41 Yes 0
|
||||
latin7_general_cs latin7 42 0
|
||||
macce_bin macce 43 0
|
||||
macce_general_ci macce 38 Yes 0
|
||||
macroman_bin macroman 53 0
|
||||
macroman_general_ci macroman 39 Yes 0
|
||||
sjis_bin sjis 88 Yes 1
|
||||
sjis_japanese_ci sjis 13 Yes Yes 1
|
||||
swe7_bin swe7 82 0
|
||||
swe7_swedish_ci swe7 10 Yes 0
|
||||
tis620_bin tis620 89 Yes 1
|
||||
tis620_thai_ci tis620 18 Yes Yes 4
|
||||
ucs2_bin ucs2 90 Yes 1
|
||||
ucs2_czech_ci ucs2 138 Yes 8
|
||||
ucs2_danish_ci ucs2 139 Yes 8
|
||||
ucs2_esperanto_ci ucs2 145 Yes 8
|
||||
ucs2_estonian_ci ucs2 134 Yes 8
|
||||
ucs2_general_ci ucs2 35 Yes Yes 1
|
||||
ucs2_hungarian_ci ucs2 146 Yes 8
|
||||
ucs2_icelandic_ci ucs2 129 Yes 8
|
||||
ucs2_latvian_ci ucs2 130 Yes 8
|
||||
ucs2_lithuanian_ci ucs2 140 Yes 8
|
||||
ucs2_persian_ci ucs2 144 Yes 8
|
||||
ucs2_polish_ci ucs2 133 Yes 8
|
||||
ucs2_romanian_ci ucs2 131 Yes 8
|
||||
ucs2_roman_ci ucs2 143 Yes 8
|
||||
ucs2_slovak_ci ucs2 141 Yes 8
|
||||
ucs2_slovenian_ci ucs2 132 Yes 8
|
||||
ucs2_spanish2_ci ucs2 142 Yes 8
|
||||
ucs2_spanish_ci ucs2 135 Yes 8
|
||||
ucs2_swedish_ci ucs2 136 Yes 8
|
||||
ucs2_turkish_ci ucs2 137 Yes 8
|
||||
ucs2_unicode_ci ucs2 128 Yes 8
|
||||
ujis_bin ujis 91 Yes 1
|
||||
ujis_japanese_ci ujis 12 Yes Yes 1
|
||||
utf8_bin utf8 83 Yes 1
|
||||
utf8_czech_ci utf8 202 Yes 8
|
||||
utf8_danish_ci utf8 203 Yes 8
|
||||
utf8_esperanto_ci utf8 209 Yes 8
|
||||
utf8_estonian_ci utf8 198 Yes 8
|
||||
utf8_general_ci utf8 33 Yes Yes 1
|
||||
utf8_hungarian_ci utf8 210 Yes 8
|
||||
utf8_icelandic_ci utf8 193 Yes 8
|
||||
utf8_latvian_ci utf8 194 Yes 8
|
||||
utf8_lithuanian_ci utf8 204 Yes 8
|
||||
utf8_persian_ci utf8 208 Yes 8
|
||||
utf8_polish_ci utf8 197 Yes 8
|
||||
utf8_romanian_ci utf8 195 Yes 8
|
||||
utf8_roman_ci utf8 207 Yes 8
|
||||
utf8_slovak_ci utf8 205 Yes 8
|
||||
utf8_slovenian_ci utf8 196 Yes 8
|
||||
utf8_spanish2_ci utf8 206 Yes 8
|
||||
utf8_spanish_ci utf8 199 Yes 8
|
||||
utf8_swedish_ci utf8 200 Yes 8
|
||||
utf8_turkish_ci utf8 201 Yes 8
|
||||
utf8_unicode_ci utf8 192 Yes 8
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collation_character_set_applicability
|
||||
ORDER BY collation_name, character_set_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME
|
||||
armscii8_bin armscii8
|
||||
armscii8_general_ci armscii8
|
||||
ascii_bin ascii
|
||||
ascii_general_ci ascii
|
||||
big5_bin big5
|
||||
big5_chinese_ci big5
|
||||
binary binary
|
||||
cp1250_bin cp1250
|
||||
cp1250_croatian_ci cp1250
|
||||
cp1250_czech_cs cp1250
|
||||
cp1250_general_ci cp1250
|
||||
cp1251_bin cp1251
|
||||
cp1251_bulgarian_ci cp1251
|
||||
cp1251_general_ci cp1251
|
||||
cp1251_general_cs cp1251
|
||||
cp1251_ukrainian_ci cp1251
|
||||
cp1256_bin cp1256
|
||||
cp1256_general_ci cp1256
|
||||
cp1257_bin cp1257
|
||||
cp1257_general_ci cp1257
|
||||
cp1257_lithuanian_ci cp1257
|
||||
cp850_bin cp850
|
||||
cp850_general_ci cp850
|
||||
cp852_bin cp852
|
||||
cp852_general_ci cp852
|
||||
cp866_bin cp866
|
||||
cp866_general_ci cp866
|
||||
cp932_bin cp932
|
||||
cp932_japanese_ci cp932
|
||||
dec8_bin dec8
|
||||
dec8_swedish_ci dec8
|
||||
eucjpms_bin eucjpms
|
||||
eucjpms_japanese_ci eucjpms
|
||||
euckr_bin euckr
|
||||
euckr_korean_ci euckr
|
||||
gb2312_bin gb2312
|
||||
gb2312_chinese_ci gb2312
|
||||
gbk_bin gbk
|
||||
gbk_chinese_ci gbk
|
||||
geostd8_bin geostd8
|
||||
geostd8_general_ci geostd8
|
||||
greek_bin greek
|
||||
greek_general_ci greek
|
||||
hebrew_bin hebrew
|
||||
hebrew_general_ci hebrew
|
||||
hp8_bin hp8
|
||||
hp8_english_ci hp8
|
||||
keybcs2_bin keybcs2
|
||||
keybcs2_general_ci keybcs2
|
||||
koi8r_bin koi8r
|
||||
koi8r_general_ci koi8r
|
||||
koi8u_bin koi8u
|
||||
koi8u_general_ci koi8u
|
||||
latin1_bin latin1
|
||||
latin1_danish_ci latin1
|
||||
latin1_general_ci latin1
|
||||
latin1_general_cs latin1
|
||||
latin1_german1_ci latin1
|
||||
latin1_german2_ci latin1
|
||||
latin1_spanish_ci latin1
|
||||
latin1_swedish_ci latin1
|
||||
latin2_bin latin2
|
||||
latin2_croatian_ci latin2
|
||||
latin2_czech_cs latin2
|
||||
latin2_general_ci latin2
|
||||
latin2_hungarian_ci latin2
|
||||
latin5_bin latin5
|
||||
latin5_turkish_ci latin5
|
||||
latin7_bin latin7
|
||||
latin7_estonian_cs latin7
|
||||
latin7_general_ci latin7
|
||||
latin7_general_cs latin7
|
||||
macce_bin macce
|
||||
macce_general_ci macce
|
||||
macroman_bin macroman
|
||||
macroman_general_ci macroman
|
||||
sjis_bin sjis
|
||||
sjis_japanese_ci sjis
|
||||
swe7_bin swe7
|
||||
swe7_swedish_ci swe7
|
||||
tis620_bin tis620
|
||||
tis620_thai_ci tis620
|
||||
ucs2_bin ucs2
|
||||
ucs2_czech_ci ucs2
|
||||
ucs2_danish_ci ucs2
|
||||
ucs2_esperanto_ci ucs2
|
||||
ucs2_estonian_ci ucs2
|
||||
ucs2_general_ci ucs2
|
||||
ucs2_hungarian_ci ucs2
|
||||
ucs2_icelandic_ci ucs2
|
||||
ucs2_latvian_ci ucs2
|
||||
ucs2_lithuanian_ci ucs2
|
||||
ucs2_persian_ci ucs2
|
||||
ucs2_polish_ci ucs2
|
||||
ucs2_romanian_ci ucs2
|
||||
ucs2_roman_ci ucs2
|
||||
ucs2_slovak_ci ucs2
|
||||
ucs2_slovenian_ci ucs2
|
||||
ucs2_spanish2_ci ucs2
|
||||
ucs2_spanish_ci ucs2
|
||||
ucs2_swedish_ci ucs2
|
||||
ucs2_turkish_ci ucs2
|
||||
ucs2_unicode_ci ucs2
|
||||
ujis_bin ujis
|
||||
ujis_japanese_ci ujis
|
||||
utf8_bin utf8
|
||||
utf8_czech_ci utf8
|
||||
utf8_danish_ci utf8
|
||||
utf8_esperanto_ci utf8
|
||||
utf8_estonian_ci utf8
|
||||
utf8_general_ci utf8
|
||||
utf8_hungarian_ci utf8
|
||||
utf8_icelandic_ci utf8
|
||||
utf8_latvian_ci utf8
|
||||
utf8_lithuanian_ci utf8
|
||||
utf8_persian_ci utf8
|
||||
utf8_polish_ci utf8
|
||||
utf8_romanian_ci utf8
|
||||
utf8_roman_ci utf8
|
||||
utf8_slovak_ci utf8
|
||||
utf8_slovenian_ci utf8
|
||||
utf8_spanish2_ci utf8
|
||||
utf8_spanish_ci utf8
|
||||
utf8_swedish_ci utf8
|
||||
utf8_turkish_ci utf8
|
||||
utf8_unicode_ci utf8
|
||||
# Switch to connection default + disconnect con
|
||||
DROP USER dbdict_test@localhost;
|
311
mysql-test/suite/funcs_1/r/charset_collation_2.result
Normal file
311
mysql-test/suite/funcs_1/r/charset_collation_2.result
Normal file
@ -0,0 +1,311 @@
|
||||
DROP USER dbdict_test@localhost;
|
||||
CREATE USER dbdict_test@localhost;
|
||||
# Establish connection con (user=dbdict_test)
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.character_sets
|
||||
ORDER BY character_set_name;
|
||||
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
||||
armscii8 armscii8_general_ci ARMSCII-8 Armenian 1
|
||||
ascii ascii_general_ci US ASCII 1
|
||||
big5 big5_chinese_ci Big5 Traditional Chinese 2
|
||||
binary binary Binary pseudo charset 1
|
||||
cp1250 cp1250_general_ci Windows Central European 1
|
||||
cp1251 cp1251_general_ci Windows Cyrillic 1
|
||||
cp1256 cp1256_general_ci Windows Arabic 1
|
||||
cp1257 cp1257_general_ci Windows Baltic 1
|
||||
cp850 cp850_general_ci DOS West European 1
|
||||
cp852 cp852_general_ci DOS Central European 1
|
||||
cp866 cp866_general_ci DOS Russian 1
|
||||
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
|
||||
dec8 dec8_swedish_ci DEC West European 1
|
||||
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
|
||||
euckr euckr_korean_ci EUC-KR Korean 2
|
||||
gb2312 gb2312_chinese_ci GB2312 Simplified Chinese 2
|
||||
gbk gbk_chinese_ci GBK Simplified Chinese 2
|
||||
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
|
||||
greek greek_general_ci ISO 8859-7 Greek 1
|
||||
hebrew hebrew_general_ci ISO 8859-8 Hebrew 1
|
||||
hp8 hp8_english_ci HP West European 1
|
||||
keybcs2 keybcs2_general_ci DOS Kamenicky Czech-Slovak 1
|
||||
koi8r koi8r_general_ci KOI8-R Relcom Russian 1
|
||||
koi8u koi8u_general_ci KOI8-U Ukrainian 1
|
||||
latin1 latin1_swedish_ci cp1252 West European 1
|
||||
latin2 latin2_general_ci ISO 8859-2 Central European 1
|
||||
latin5 latin5_turkish_ci ISO 8859-9 Turkish 1
|
||||
latin7 latin7_general_ci ISO 8859-13 Baltic 1
|
||||
macce macce_general_ci Mac Central European 1
|
||||
macroman macroman_general_ci Mac West European 1
|
||||
sjis sjis_japanese_ci Shift-JIS Japanese 2
|
||||
swe7 swe7_swedish_ci 7bit Swedish 1
|
||||
tis620 tis620_thai_ci TIS620 Thai 1
|
||||
ucs2 ucs2_general_ci UCS-2 Unicode 2
|
||||
ujis ujis_japanese_ci EUC-JP Japanese 3
|
||||
utf8 utf8_general_ci UTF-8 Unicode 3
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collations
|
||||
ORDER BY collation_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
|
||||
armscii8_bin armscii8 64 0
|
||||
armscii8_general_ci armscii8 32 Yes 0
|
||||
ascii_bin ascii 65 0
|
||||
ascii_general_ci ascii 11 Yes 0
|
||||
big5_bin big5 84 Yes 1
|
||||
big5_chinese_ci big5 1 Yes Yes 1
|
||||
binary binary 63 Yes Yes 1
|
||||
cp1250_bin cp1250 66 Yes 1
|
||||
cp1250_croatian_ci cp1250 44 Yes 1
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
cp1250_general_ci cp1250 26 Yes Yes 1
|
||||
cp1251_bin cp1251 50 0
|
||||
cp1251_bulgarian_ci cp1251 14 0
|
||||
cp1251_general_ci cp1251 51 Yes 0
|
||||
cp1251_general_cs cp1251 52 0
|
||||
cp1251_ukrainian_ci cp1251 23 0
|
||||
cp1256_bin cp1256 67 0
|
||||
cp1256_general_ci cp1256 57 Yes 0
|
||||
cp1257_bin cp1257 58 0
|
||||
cp1257_general_ci cp1257 59 Yes 0
|
||||
cp1257_lithuanian_ci cp1257 29 0
|
||||
cp850_bin cp850 80 0
|
||||
cp850_general_ci cp850 4 Yes 0
|
||||
cp852_bin cp852 81 0
|
||||
cp852_general_ci cp852 40 Yes 0
|
||||
cp866_bin cp866 68 0
|
||||
cp866_general_ci cp866 36 Yes 0
|
||||
cp932_bin cp932 96 Yes 1
|
||||
cp932_japanese_ci cp932 95 Yes Yes 1
|
||||
dec8_bin dec8 69 0
|
||||
dec8_swedish_ci dec8 3 Yes 0
|
||||
eucjpms_bin eucjpms 98 Yes 1
|
||||
eucjpms_japanese_ci eucjpms 97 Yes Yes 1
|
||||
euckr_bin euckr 85 Yes 1
|
||||
euckr_korean_ci euckr 19 Yes Yes 1
|
||||
gb2312_bin gb2312 86 Yes 1
|
||||
gb2312_chinese_ci gb2312 24 Yes Yes 1
|
||||
gbk_bin gbk 87 Yes 1
|
||||
gbk_chinese_ci gbk 28 Yes Yes 1
|
||||
geostd8_bin geostd8 93 0
|
||||
geostd8_general_ci geostd8 92 Yes 0
|
||||
greek_bin greek 70 0
|
||||
greek_general_ci greek 25 Yes 0
|
||||
hebrew_bin hebrew 71 0
|
||||
hebrew_general_ci hebrew 16 Yes 0
|
||||
hp8_bin hp8 72 0
|
||||
hp8_english_ci hp8 6 Yes 0
|
||||
keybcs2_bin keybcs2 73 0
|
||||
keybcs2_general_ci keybcs2 37 Yes 0
|
||||
koi8r_bin koi8r 74 0
|
||||
koi8r_general_ci koi8r 7 Yes 0
|
||||
koi8u_bin koi8u 75 0
|
||||
koi8u_general_ci koi8u 22 Yes 0
|
||||
latin1_bin latin1 47 Yes 1
|
||||
latin1_danish_ci latin1 15 Yes 1
|
||||
latin1_general_ci latin1 48 Yes 1
|
||||
latin1_general_cs latin1 49 Yes 1
|
||||
latin1_german1_ci latin1 5 Yes 1
|
||||
latin1_german2_ci latin1 31 Yes 2
|
||||
latin1_spanish_ci latin1 94 Yes 1
|
||||
latin1_swedish_ci latin1 8 Yes Yes 1
|
||||
latin2_bin latin2 77 Yes 1
|
||||
latin2_croatian_ci latin2 27 Yes 1
|
||||
latin2_czech_cs latin2 2 Yes 4
|
||||
latin2_general_ci latin2 9 Yes Yes 1
|
||||
latin2_hungarian_ci latin2 21 Yes 1
|
||||
latin5_bin latin5 78 0
|
||||
latin5_turkish_ci latin5 30 Yes 0
|
||||
latin7_bin latin7 79 0
|
||||
latin7_estonian_cs latin7 20 0
|
||||
latin7_general_ci latin7 41 Yes 0
|
||||
latin7_general_cs latin7 42 0
|
||||
macce_bin macce 43 0
|
||||
macce_general_ci macce 38 Yes 0
|
||||
macroman_bin macroman 53 0
|
||||
macroman_general_ci macroman 39 Yes 0
|
||||
sjis_bin sjis 88 Yes 1
|
||||
sjis_japanese_ci sjis 13 Yes Yes 1
|
||||
swe7_bin swe7 82 0
|
||||
swe7_swedish_ci swe7 10 Yes 0
|
||||
tis620_bin tis620 89 Yes 1
|
||||
tis620_thai_ci tis620 18 Yes Yes 4
|
||||
ucs2_bin ucs2 90 Yes 1
|
||||
ucs2_czech_ci ucs2 138 Yes 8
|
||||
ucs2_danish_ci ucs2 139 Yes 8
|
||||
ucs2_esperanto_ci ucs2 145 Yes 8
|
||||
ucs2_estonian_ci ucs2 134 Yes 8
|
||||
ucs2_general_ci ucs2 35 Yes Yes 1
|
||||
ucs2_hungarian_ci ucs2 146 Yes 8
|
||||
ucs2_icelandic_ci ucs2 129 Yes 8
|
||||
ucs2_latvian_ci ucs2 130 Yes 8
|
||||
ucs2_lithuanian_ci ucs2 140 Yes 8
|
||||
ucs2_persian_ci ucs2 144 Yes 8
|
||||
ucs2_polish_ci ucs2 133 Yes 8
|
||||
ucs2_romanian_ci ucs2 131 Yes 8
|
||||
ucs2_roman_ci ucs2 143 Yes 8
|
||||
ucs2_slovak_ci ucs2 141 Yes 8
|
||||
ucs2_slovenian_ci ucs2 132 Yes 8
|
||||
ucs2_spanish2_ci ucs2 142 Yes 8
|
||||
ucs2_spanish_ci ucs2 135 Yes 8
|
||||
ucs2_swedish_ci ucs2 136 Yes 8
|
||||
ucs2_turkish_ci ucs2 137 Yes 8
|
||||
ucs2_unicode_ci ucs2 128 Yes 8
|
||||
ujis_bin ujis 91 Yes 1
|
||||
ujis_japanese_ci ujis 12 Yes Yes 1
|
||||
utf8_bin utf8 83 Yes 1
|
||||
utf8_czech_ci utf8 202 Yes 8
|
||||
utf8_danish_ci utf8 203 Yes 8
|
||||
utf8_esperanto_ci utf8 209 Yes 8
|
||||
utf8_estonian_ci utf8 198 Yes 8
|
||||
utf8_general_ci utf8 33 Yes Yes 1
|
||||
utf8_general_cs utf8 254 Yes 1
|
||||
utf8_hungarian_ci utf8 210 Yes 8
|
||||
utf8_icelandic_ci utf8 193 Yes 8
|
||||
utf8_latvian_ci utf8 194 Yes 8
|
||||
utf8_lithuanian_ci utf8 204 Yes 8
|
||||
utf8_persian_ci utf8 208 Yes 8
|
||||
utf8_polish_ci utf8 197 Yes 8
|
||||
utf8_romanian_ci utf8 195 Yes 8
|
||||
utf8_roman_ci utf8 207 Yes 8
|
||||
utf8_slovak_ci utf8 205 Yes 8
|
||||
utf8_slovenian_ci utf8 196 Yes 8
|
||||
utf8_spanish2_ci utf8 206 Yes 8
|
||||
utf8_spanish_ci utf8 199 Yes 8
|
||||
utf8_swedish_ci utf8 200 Yes 8
|
||||
utf8_turkish_ci utf8 201 Yes 8
|
||||
utf8_unicode_ci utf8 192 Yes 8
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collation_character_set_applicability
|
||||
ORDER BY collation_name, character_set_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME
|
||||
armscii8_bin armscii8
|
||||
armscii8_general_ci armscii8
|
||||
ascii_bin ascii
|
||||
ascii_general_ci ascii
|
||||
big5_bin big5
|
||||
big5_chinese_ci big5
|
||||
binary binary
|
||||
cp1250_bin cp1250
|
||||
cp1250_croatian_ci cp1250
|
||||
cp1250_czech_cs cp1250
|
||||
cp1250_general_ci cp1250
|
||||
cp1251_bin cp1251
|
||||
cp1251_bulgarian_ci cp1251
|
||||
cp1251_general_ci cp1251
|
||||
cp1251_general_cs cp1251
|
||||
cp1251_ukrainian_ci cp1251
|
||||
cp1256_bin cp1256
|
||||
cp1256_general_ci cp1256
|
||||
cp1257_bin cp1257
|
||||
cp1257_general_ci cp1257
|
||||
cp1257_lithuanian_ci cp1257
|
||||
cp850_bin cp850
|
||||
cp850_general_ci cp850
|
||||
cp852_bin cp852
|
||||
cp852_general_ci cp852
|
||||
cp866_bin cp866
|
||||
cp866_general_ci cp866
|
||||
cp932_bin cp932
|
||||
cp932_japanese_ci cp932
|
||||
dec8_bin dec8
|
||||
dec8_swedish_ci dec8
|
||||
eucjpms_bin eucjpms
|
||||
eucjpms_japanese_ci eucjpms
|
||||
euckr_bin euckr
|
||||
euckr_korean_ci euckr
|
||||
gb2312_bin gb2312
|
||||
gb2312_chinese_ci gb2312
|
||||
gbk_bin gbk
|
||||
gbk_chinese_ci gbk
|
||||
geostd8_bin geostd8
|
||||
geostd8_general_ci geostd8
|
||||
greek_bin greek
|
||||
greek_general_ci greek
|
||||
hebrew_bin hebrew
|
||||
hebrew_general_ci hebrew
|
||||
hp8_bin hp8
|
||||
hp8_english_ci hp8
|
||||
keybcs2_bin keybcs2
|
||||
keybcs2_general_ci keybcs2
|
||||
koi8r_bin koi8r
|
||||
koi8r_general_ci koi8r
|
||||
koi8u_bin koi8u
|
||||
koi8u_general_ci koi8u
|
||||
latin1_bin latin1
|
||||
latin1_danish_ci latin1
|
||||
latin1_general_ci latin1
|
||||
latin1_general_cs latin1
|
||||
latin1_german1_ci latin1
|
||||
latin1_german2_ci latin1
|
||||
latin1_spanish_ci latin1
|
||||
latin1_swedish_ci latin1
|
||||
latin2_bin latin2
|
||||
latin2_croatian_ci latin2
|
||||
latin2_czech_cs latin2
|
||||
latin2_general_ci latin2
|
||||
latin2_hungarian_ci latin2
|
||||
latin5_bin latin5
|
||||
latin5_turkish_ci latin5
|
||||
latin7_bin latin7
|
||||
latin7_estonian_cs latin7
|
||||
latin7_general_ci latin7
|
||||
latin7_general_cs latin7
|
||||
macce_bin macce
|
||||
macce_general_ci macce
|
||||
macroman_bin macroman
|
||||
macroman_general_ci macroman
|
||||
sjis_bin sjis
|
||||
sjis_japanese_ci sjis
|
||||
swe7_bin swe7
|
||||
swe7_swedish_ci swe7
|
||||
tis620_bin tis620
|
||||
tis620_thai_ci tis620
|
||||
ucs2_bin ucs2
|
||||
ucs2_czech_ci ucs2
|
||||
ucs2_danish_ci ucs2
|
||||
ucs2_esperanto_ci ucs2
|
||||
ucs2_estonian_ci ucs2
|
||||
ucs2_general_ci ucs2
|
||||
ucs2_hungarian_ci ucs2
|
||||
ucs2_icelandic_ci ucs2
|
||||
ucs2_latvian_ci ucs2
|
||||
ucs2_lithuanian_ci ucs2
|
||||
ucs2_persian_ci ucs2
|
||||
ucs2_polish_ci ucs2
|
||||
ucs2_romanian_ci ucs2
|
||||
ucs2_roman_ci ucs2
|
||||
ucs2_slovak_ci ucs2
|
||||
ucs2_slovenian_ci ucs2
|
||||
ucs2_spanish2_ci ucs2
|
||||
ucs2_spanish_ci ucs2
|
||||
ucs2_swedish_ci ucs2
|
||||
ucs2_turkish_ci ucs2
|
||||
ucs2_unicode_ci ucs2
|
||||
ujis_bin ujis
|
||||
ujis_japanese_ci ujis
|
||||
utf8_bin utf8
|
||||
utf8_czech_ci utf8
|
||||
utf8_danish_ci utf8
|
||||
utf8_esperanto_ci utf8
|
||||
utf8_estonian_ci utf8
|
||||
utf8_general_ci utf8
|
||||
utf8_general_cs utf8
|
||||
utf8_hungarian_ci utf8
|
||||
utf8_icelandic_ci utf8
|
||||
utf8_latvian_ci utf8
|
||||
utf8_lithuanian_ci utf8
|
||||
utf8_persian_ci utf8
|
||||
utf8_polish_ci utf8
|
||||
utf8_romanian_ci utf8
|
||||
utf8_roman_ci utf8
|
||||
utf8_slovak_ci utf8
|
||||
utf8_slovenian_ci utf8
|
||||
utf8_spanish2_ci utf8
|
||||
utf8_spanish_ci utf8
|
||||
utf8_swedish_ci utf8
|
||||
utf8_turkish_ci utf8
|
||||
utf8_unicode_ci utf8
|
||||
# Switch to connection default + disconnect con
|
||||
DROP USER dbdict_test@localhost;
|
309
mysql-test/suite/funcs_1/r/charset_collation_3.result
Normal file
309
mysql-test/suite/funcs_1/r/charset_collation_3.result
Normal file
@ -0,0 +1,309 @@
|
||||
DROP USER dbdict_test@localhost;
|
||||
CREATE USER dbdict_test@localhost;
|
||||
# Establish connection con (user=dbdict_test)
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.character_sets
|
||||
ORDER BY character_set_name;
|
||||
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
||||
armscii8 armscii8_general_ci ARMSCII-8 Armenian 1
|
||||
ascii ascii_general_ci US ASCII 1
|
||||
big5 big5_chinese_ci Big5 Traditional Chinese 2
|
||||
binary binary Binary pseudo charset 1
|
||||
cp1250 cp1250_general_ci Windows Central European 1
|
||||
cp1251 cp1251_general_ci Windows Cyrillic 1
|
||||
cp1256 cp1256_general_ci Windows Arabic 1
|
||||
cp1257 cp1257_general_ci Windows Baltic 1
|
||||
cp850 cp850_general_ci DOS West European 1
|
||||
cp852 cp852_general_ci DOS Central European 1
|
||||
cp866 cp866_general_ci DOS Russian 1
|
||||
cp932 cp932_japanese_ci SJIS for Windows Japanese 2
|
||||
dec8 dec8_swedish_ci DEC West European 1
|
||||
eucjpms eucjpms_japanese_ci UJIS for Windows Japanese 3
|
||||
euckr euckr_korean_ci EUC-KR Korean 2
|
||||
gb2312 gb2312_chinese_ci GB2312 Simplified Chinese 2
|
||||
gbk gbk_chinese_ci GBK Simplified Chinese 2
|
||||
geostd8 geostd8_general_ci GEOSTD8 Georgian 1
|
||||
greek greek_general_ci ISO 8859-7 Greek 1
|
||||
hebrew hebrew_general_ci ISO 8859-8 Hebrew 1
|
||||
hp8 hp8_english_ci HP West European 1
|
||||
keybcs2 keybcs2_general_ci DOS Kamenicky Czech-Slovak 1
|
||||
koi8r koi8r_general_ci KOI8-R Relcom Russian 1
|
||||
koi8u koi8u_general_ci KOI8-U Ukrainian 1
|
||||
latin1 latin1_swedish_ci cp1252 West European 1
|
||||
latin2 latin2_general_ci ISO 8859-2 Central European 1
|
||||
latin5 latin5_turkish_ci ISO 8859-9 Turkish 1
|
||||
latin7 latin7_general_ci ISO 8859-13 Baltic 1
|
||||
macce macce_general_ci Mac Central European 1
|
||||
macroman macroman_general_ci Mac West European 1
|
||||
sjis sjis_japanese_ci Shift-JIS Japanese 2
|
||||
swe7 swe7_swedish_ci 7bit Swedish 1
|
||||
tis620 tis620_thai_ci TIS620 Thai 1
|
||||
ucs2 ucs2_general_ci UCS-2 Unicode 2
|
||||
ujis ujis_japanese_ci EUC-JP Japanese 3
|
||||
utf8 utf8_general_ci UTF-8 Unicode 3
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collations
|
||||
ORDER BY collation_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
|
||||
armscii8_bin armscii8 64 Yes 1
|
||||
armscii8_general_ci armscii8 32 Yes Yes 1
|
||||
ascii_bin ascii 65 Yes 1
|
||||
ascii_general_ci ascii 11 Yes Yes 1
|
||||
big5_bin big5 84 Yes 1
|
||||
big5_chinese_ci big5 1 Yes Yes 1
|
||||
binary binary 63 Yes Yes 1
|
||||
cp1250_bin cp1250 66 Yes 1
|
||||
cp1250_croatian_ci cp1250 44 Yes 1
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
cp1250_general_ci cp1250 26 Yes Yes 1
|
||||
cp1251_bin cp1251 50 Yes 1
|
||||
cp1251_bulgarian_ci cp1251 14 Yes 1
|
||||
cp1251_general_ci cp1251 51 Yes Yes 1
|
||||
cp1251_general_cs cp1251 52 Yes 1
|
||||
cp1251_ukrainian_ci cp1251 23 Yes 1
|
||||
cp1256_bin cp1256 67 Yes 1
|
||||
cp1256_general_ci cp1256 57 Yes Yes 1
|
||||
cp1257_bin cp1257 58 Yes 1
|
||||
cp1257_general_ci cp1257 59 Yes Yes 1
|
||||
cp1257_lithuanian_ci cp1257 29 Yes 1
|
||||
cp850_bin cp850 80 Yes 1
|
||||
cp850_general_ci cp850 4 Yes Yes 1
|
||||
cp852_bin cp852 81 Yes 1
|
||||
cp852_general_ci cp852 40 Yes Yes 1
|
||||
cp866_bin cp866 68 Yes 1
|
||||
cp866_general_ci cp866 36 Yes Yes 1
|
||||
cp932_bin cp932 96 Yes 1
|
||||
cp932_japanese_ci cp932 95 Yes Yes 1
|
||||
dec8_bin dec8 69 Yes 1
|
||||
dec8_swedish_ci dec8 3 Yes Yes 1
|
||||
eucjpms_bin eucjpms 98 Yes 1
|
||||
eucjpms_japanese_ci eucjpms 97 Yes Yes 1
|
||||
euckr_bin euckr 85 Yes 1
|
||||
euckr_korean_ci euckr 19 Yes Yes 1
|
||||
gb2312_bin gb2312 86 Yes 1
|
||||
gb2312_chinese_ci gb2312 24 Yes Yes 1
|
||||
gbk_bin gbk 87 Yes 1
|
||||
gbk_chinese_ci gbk 28 Yes Yes 1
|
||||
geostd8_bin geostd8 93 Yes 1
|
||||
geostd8_general_ci geostd8 92 Yes Yes 1
|
||||
greek_bin greek 70 Yes 1
|
||||
greek_general_ci greek 25 Yes Yes 1
|
||||
hebrew_bin hebrew 71 Yes 1
|
||||
hebrew_general_ci hebrew 16 Yes Yes 1
|
||||
hp8_bin hp8 72 Yes 1
|
||||
hp8_english_ci hp8 6 Yes Yes 1
|
||||
keybcs2_bin keybcs2 73 Yes 1
|
||||
keybcs2_general_ci keybcs2 37 Yes Yes 1
|
||||
koi8r_bin koi8r 74 Yes 1
|
||||
koi8r_general_ci koi8r 7 Yes Yes 1
|
||||
koi8u_bin koi8u 75 Yes 1
|
||||
koi8u_general_ci koi8u 22 Yes Yes 1
|
||||
latin1_bin latin1 47 Yes 1
|
||||
latin1_danish_ci latin1 15 Yes 1
|
||||
latin1_general_ci latin1 48 Yes 1
|
||||
latin1_general_cs latin1 49 Yes 1
|
||||
latin1_german1_ci latin1 5 Yes 1
|
||||
latin1_german2_ci latin1 31 Yes 2
|
||||
latin1_spanish_ci latin1 94 Yes 1
|
||||
latin1_swedish_ci latin1 8 Yes Yes 1
|
||||
latin2_bin latin2 77 Yes 1
|
||||
latin2_croatian_ci latin2 27 Yes 1
|
||||
latin2_czech_cs latin2 2 Yes 4
|
||||
latin2_general_ci latin2 9 Yes Yes 1
|
||||
latin2_hungarian_ci latin2 21 Yes 1
|
||||
latin5_bin latin5 78 Yes 1
|
||||
latin5_turkish_ci latin5 30 Yes Yes 1
|
||||
latin7_bin latin7 79 Yes 1
|
||||
latin7_estonian_cs latin7 20 Yes 1
|
||||
latin7_general_ci latin7 41 Yes Yes 1
|
||||
latin7_general_cs latin7 42 Yes 1
|
||||
macce_bin macce 43 Yes 1
|
||||
macce_general_ci macce 38 Yes Yes 1
|
||||
macroman_bin macroman 53 Yes 1
|
||||
macroman_general_ci macroman 39 Yes Yes 1
|
||||
sjis_bin sjis 88 Yes 1
|
||||
sjis_japanese_ci sjis 13 Yes Yes 1
|
||||
swe7_bin swe7 82 Yes 1
|
||||
swe7_swedish_ci swe7 10 Yes Yes 1
|
||||
tis620_bin tis620 89 Yes 1
|
||||
tis620_thai_ci tis620 18 Yes Yes 4
|
||||
ucs2_bin ucs2 90 Yes 1
|
||||
ucs2_czech_ci ucs2 138 Yes 8
|
||||
ucs2_danish_ci ucs2 139 Yes 8
|
||||
ucs2_esperanto_ci ucs2 145 Yes 8
|
||||
ucs2_estonian_ci ucs2 134 Yes 8
|
||||
ucs2_general_ci ucs2 35 Yes Yes 1
|
||||
ucs2_hungarian_ci ucs2 146 Yes 8
|
||||
ucs2_icelandic_ci ucs2 129 Yes 8
|
||||
ucs2_latvian_ci ucs2 130 Yes 8
|
||||
ucs2_lithuanian_ci ucs2 140 Yes 8
|
||||
ucs2_persian_ci ucs2 144 Yes 8
|
||||
ucs2_polish_ci ucs2 133 Yes 8
|
||||
ucs2_romanian_ci ucs2 131 Yes 8
|
||||
ucs2_roman_ci ucs2 143 Yes 8
|
||||
ucs2_slovak_ci ucs2 141 Yes 8
|
||||
ucs2_slovenian_ci ucs2 132 Yes 8
|
||||
ucs2_spanish2_ci ucs2 142 Yes 8
|
||||
ucs2_spanish_ci ucs2 135 Yes 8
|
||||
ucs2_swedish_ci ucs2 136 Yes 8
|
||||
ucs2_turkish_ci ucs2 137 Yes 8
|
||||
ucs2_unicode_ci ucs2 128 Yes 8
|
||||
ujis_bin ujis 91 Yes 1
|
||||
ujis_japanese_ci ujis 12 Yes Yes 1
|
||||
utf8_bin utf8 83 Yes 1
|
||||
utf8_czech_ci utf8 202 Yes 8
|
||||
utf8_danish_ci utf8 203 Yes 8
|
||||
utf8_esperanto_ci utf8 209 Yes 8
|
||||
utf8_estonian_ci utf8 198 Yes 8
|
||||
utf8_general_ci utf8 33 Yes Yes 1
|
||||
utf8_hungarian_ci utf8 210 Yes 8
|
||||
utf8_icelandic_ci utf8 193 Yes 8
|
||||
utf8_latvian_ci utf8 194 Yes 8
|
||||
utf8_lithuanian_ci utf8 204 Yes 8
|
||||
utf8_persian_ci utf8 208 Yes 8
|
||||
utf8_polish_ci utf8 197 Yes 8
|
||||
utf8_romanian_ci utf8 195 Yes 8
|
||||
utf8_roman_ci utf8 207 Yes 8
|
||||
utf8_slovak_ci utf8 205 Yes 8
|
||||
utf8_slovenian_ci utf8 196 Yes 8
|
||||
utf8_spanish2_ci utf8 206 Yes 8
|
||||
utf8_spanish_ci utf8 199 Yes 8
|
||||
utf8_swedish_ci utf8 200 Yes 8
|
||||
utf8_turkish_ci utf8 201 Yes 8
|
||||
utf8_unicode_ci utf8 192 Yes 8
|
||||
|
||||
|
||||
SELECT *
|
||||
FROM information_schema.collation_character_set_applicability
|
||||
ORDER BY collation_name, character_set_name;
|
||||
COLLATION_NAME CHARACTER_SET_NAME
|
||||
armscii8_bin armscii8
|
||||
armscii8_general_ci armscii8
|
||||
ascii_bin ascii
|
||||
ascii_general_ci ascii
|
||||
big5_bin big5
|
||||
big5_chinese_ci big5
|
||||
binary binary
|
||||
cp1250_bin cp1250
|
||||
cp1250_croatian_ci cp1250
|
||||
cp1250_czech_cs cp1250
|
||||
cp1250_general_ci cp1250
|
||||
cp1251_bin cp1251
|
||||
cp1251_bulgarian_ci cp1251
|
||||
cp1251_general_ci cp1251
|
||||
cp1251_general_cs cp1251
|
||||
cp1251_ukrainian_ci cp1251
|
||||
cp1256_bin cp1256
|
||||
cp1256_general_ci cp1256
|
||||
cp1257_bin cp1257
|
||||
cp1257_general_ci cp1257
|
||||
cp1257_lithuanian_ci cp1257
|
||||
cp850_bin cp850
|
||||
cp850_general_ci cp850
|
||||
cp852_bin cp852
|
||||
cp852_general_ci cp852
|
||||
cp866_bin cp866
|
||||
cp866_general_ci cp866
|
||||
cp932_bin cp932
|
||||
cp932_japanese_ci cp932
|
||||
dec8_bin dec8
|
||||
dec8_swedish_ci dec8
|
||||
eucjpms_bin eucjpms
|
||||
eucjpms_japanese_ci eucjpms
|
||||
euckr_bin euckr
|
||||
euckr_korean_ci euckr
|
||||
gb2312_bin gb2312
|
||||
gb2312_chinese_ci gb2312
|
||||
gbk_bin gbk
|
||||
gbk_chinese_ci gbk
|
||||
geostd8_bin geostd8
|
||||
geostd8_general_ci geostd8
|
||||
greek_bin greek
|
||||
greek_general_ci greek
|
||||
hebrew_bin hebrew
|
||||
hebrew_general_ci hebrew
|
||||
hp8_bin hp8
|
||||
hp8_english_ci hp8
|
||||
keybcs2_bin keybcs2
|
||||
keybcs2_general_ci keybcs2
|
||||
koi8r_bin koi8r
|
||||
koi8r_general_ci koi8r
|
||||
koi8u_bin koi8u
|
||||
koi8u_general_ci koi8u
|
||||
latin1_bin latin1
|
||||
latin1_danish_ci latin1
|
||||
latin1_general_ci latin1
|
||||
latin1_general_cs latin1
|
||||
latin1_german1_ci latin1
|
||||
latin1_german2_ci latin1
|
||||
latin1_spanish_ci latin1
|
||||
latin1_swedish_ci latin1
|
||||
latin2_bin latin2
|
||||
latin2_croatian_ci latin2
|
||||
latin2_czech_cs latin2
|
||||
latin2_general_ci latin2
|
||||
latin2_hungarian_ci latin2
|
||||
latin5_bin latin5
|
||||
latin5_turkish_ci latin5
|
||||
latin7_bin latin7
|
||||
latin7_estonian_cs latin7
|
||||
latin7_general_ci latin7
|
||||
latin7_general_cs latin7
|
||||
macce_bin macce
|
||||
macce_general_ci macce
|
||||
macroman_bin macroman
|
||||
macroman_general_ci macroman
|
||||
sjis_bin sjis
|
||||
sjis_japanese_ci sjis
|
||||
swe7_bin swe7
|
||||
swe7_swedish_ci swe7
|
||||
tis620_bin tis620
|
||||
tis620_thai_ci tis620
|
||||
ucs2_bin ucs2
|
||||
ucs2_czech_ci ucs2
|
||||
ucs2_danish_ci ucs2
|
||||
ucs2_esperanto_ci ucs2
|
||||
ucs2_estonian_ci ucs2
|
||||
ucs2_general_ci ucs2
|
||||
ucs2_hungarian_ci ucs2
|
||||
ucs2_icelandic_ci ucs2
|
||||
ucs2_latvian_ci ucs2
|
||||
ucs2_lithuanian_ci ucs2
|
||||
ucs2_persian_ci ucs2
|
||||
ucs2_polish_ci ucs2
|
||||
ucs2_romanian_ci ucs2
|
||||
ucs2_roman_ci ucs2
|
||||
ucs2_slovak_ci ucs2
|
||||
ucs2_slovenian_ci ucs2
|
||||
ucs2_spanish2_ci ucs2
|
||||
ucs2_spanish_ci ucs2
|
||||
ucs2_swedish_ci ucs2
|
||||
ucs2_turkish_ci ucs2
|
||||
ucs2_unicode_ci ucs2
|
||||
ujis_bin ujis
|
||||
ujis_japanese_ci ujis
|
||||
utf8_bin utf8
|
||||
utf8_czech_ci utf8
|
||||
utf8_danish_ci utf8
|
||||
utf8_esperanto_ci utf8
|
||||
utf8_estonian_ci utf8
|
||||
utf8_general_ci utf8
|
||||
utf8_hungarian_ci utf8
|
||||
utf8_icelandic_ci utf8
|
||||
utf8_latvian_ci utf8
|
||||
utf8_lithuanian_ci utf8
|
||||
utf8_persian_ci utf8
|
||||
utf8_polish_ci utf8
|
||||
utf8_romanian_ci utf8
|
||||
utf8_roman_ci utf8
|
||||
utf8_slovak_ci utf8
|
||||
utf8_slovenian_ci utf8
|
||||
utf8_spanish2_ci utf8
|
||||
utf8_spanish_ci utf8
|
||||
utf8_swedish_ci utf8
|
||||
utf8_turkish_ci utf8
|
||||
utf8_unicode_ci utf8
|
||||
# Switch to connection default + disconnect con
|
||||
DROP USER dbdict_test@localhost;
|
@ -1,22 +0,0 @@
|
||||
DELETE FROM mysql.help_category LIMIT <number>;
|
||||
DELETE FROM mysql.help_keyword LIMIT <number>;
|
||||
DELETE FROM mysql.help_relation LIMIT <number>;
|
||||
DELETE FROM mysql.help_topic LIMIT <number>;
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL mysql help_category BASE TABLE MyISAM 10 Fixed 30 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
|
||||
NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 320 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
|
||||
NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 640 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
|
||||
NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 380 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
|
||||
SELECT * FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 30 NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql name 1 name A 30 NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 320 NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql name 1 name A 320 NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 640 NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 380 NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql name 1 name A 380 NULL NULL BTREE
|
@ -1,18 +0,0 @@
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL mysql help_category BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help categories
|
||||
NULL mysql help_keyword BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help keywords
|
||||
NULL mysql help_relation BASE TABLE MyISAM 10 Fixed 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL keyword-topic relation
|
||||
NULL mysql help_topic BASE TABLE MyISAM 10 Dynamic 0 #ARL# #DL# #MDL# #IL# #DF# NULL YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss utf8_general_ci NULL help topics
|
||||
SELECT * FROM INFORMATION_SCHEMA.STATISTICS
|
||||
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME LIKE 'help_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A 0 NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql name 1 name A 0 NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A 0 NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql name 1 name A 0 NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A NULL NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A 0 NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A 0 NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql name 1 name A 0 NULL NULL BTREE
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
@ -1,67 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb4;
|
||||
create table tb4 (
|
||||
f176 numeric (0) unsigned not null DEFAULT 9,
|
||||
f177 numeric (64) unsigned not null DEFAULT 9,
|
||||
f178 numeric (0) zerofill not null DEFAULT 9,
|
||||
f179 numeric (64) zerofill not null DEFAULT 9,
|
||||
f180 numeric (0) unsigned zerofill not null DEFAULT 9,
|
||||
f181 numeric (64) unsigned zerofill not null DEFAULT 9,
|
||||
f182 numeric (0,0) not null DEFAULT 9,
|
||||
f183 numeric (63,30) not null DEFAULT 9,
|
||||
f184 numeric (0,0) unsigned not null DEFAULT 9,
|
||||
f185 numeric (63,30) unsigned not null DEFAULT 9,
|
||||
f186 numeric (0,0) zerofill not null DEFAULT 9,
|
||||
f187 numeric (63,30) zerofill not null DEFAULT 9,
|
||||
f188 numeric (0,0) unsigned zerofill not null DEFAULT 9,
|
||||
f189 numeric (63,30) unsigned zerofill not null DEFAULT 9,
|
||||
f190 real not null DEFAULT 88.8,
|
||||
f191 real unsigned not null DEFAULT 88.8,
|
||||
f192 real zerofill not null DEFAULT 88.8,
|
||||
f193 real unsigned zerofill not null DEFAULT 88.8,
|
||||
f194 double not null DEFAULT 55.5,
|
||||
f195 double unsigned not null DEFAULT 55.5,
|
||||
f196 double zerofill not null DEFAULT 55.5,
|
||||
f197 double unsigned zerofill not null DEFAULT 55.5,
|
||||
f198 float,
|
||||
f199 float unsigned,
|
||||
f200 float zerofill,
|
||||
f201 float unsigned zerofill,
|
||||
f202 float(0),
|
||||
f203 float(23),
|
||||
f204 float(0) unsigned,
|
||||
f205 float(23) unsigned,
|
||||
f206 float(0) zerofill,
|
||||
f207 float(23) zerofill,
|
||||
f208 float(0) unsigned zerofill,
|
||||
f209 float(23) unsigned zerofill,
|
||||
f210 float(24),
|
||||
f211 float(53),
|
||||
f212 float(24) unsigned,
|
||||
f213 float(53) unsigned,
|
||||
f214 float(24) zerofill,
|
||||
f215 float(53) zerofill,
|
||||
f216 float(24) unsigned zerofill,
|
||||
f217 float(53) unsigned zerofill,
|
||||
f218 date,
|
||||
f219 time,
|
||||
f220 datetime,
|
||||
f221 timestamp,
|
||||
f222 year,
|
||||
f223 year(3),
|
||||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f235 char(0) unicode,
|
||||
f236 char(90),
|
||||
f237 char(255) ascii,
|
||||
f238 varchar(0),
|
||||
f239 varchar(20000) binary,
|
||||
f240 varchar(2000) unicode,
|
||||
f241 char(100) unicode
|
||||
) engine = innodb;
|
||||
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb4.txt' into table tb4 ;
|
||||
|
||||
NOT YET IMPLEMENTED: bitdata tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,81 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb1 ;
|
||||
create table tb1 (
|
||||
f1 char(0),
|
||||
f2 char(0) binary,
|
||||
f3 char(0) ascii,
|
||||
f4 tinytext unicode,
|
||||
f5 text,
|
||||
f6 mediumtext,
|
||||
f7 longtext,
|
||||
f8 tinyblob,
|
||||
f9 blob,
|
||||
f10 mediumblob,
|
||||
f11 longblob,
|
||||
f12 binary,
|
||||
f13 tinyint,
|
||||
f14 tinyint unsigned,
|
||||
f15 tinyint zerofill,
|
||||
f16 tinyint unsigned zerofill,
|
||||
f17 smallint,
|
||||
f18 smallint unsigned,
|
||||
f19 smallint zerofill,
|
||||
f20 smallint unsigned zerofill,
|
||||
f21 mediumint,
|
||||
f22 mediumint unsigned,
|
||||
f23 mediumint zerofill,
|
||||
f24 mediumint unsigned zerofill,
|
||||
f25 int,
|
||||
f26 int unsigned,
|
||||
f27 int zerofill,
|
||||
f28 int unsigned zerofill,
|
||||
f29 bigint,
|
||||
f30 bigint unsigned,
|
||||
f31 bigint zerofill,
|
||||
f32 bigint unsigned zerofill,
|
||||
f33 decimal,
|
||||
f34 decimal unsigned,
|
||||
f35 decimal zerofill,
|
||||
f36 decimal unsigned zerofill not null DEFAULT 9.9,
|
||||
f37 decimal (0) not null DEFAULT 9.9,
|
||||
f38 decimal (64) not null DEFAULT 9.9,
|
||||
f39 decimal (0) unsigned not null DEFAULT 9.9,
|
||||
f40 decimal (64) unsigned not null DEFAULT 9.9,
|
||||
f41 decimal (0) zerofill not null DEFAULT 9.9,
|
||||
f42 decimal (64) zerofill not null DEFAULT 9.9,
|
||||
f43 decimal (0) unsigned zerofill not null DEFAULT 9.9,
|
||||
f44 decimal (64) unsigned zerofill not null DEFAULT 9.9,
|
||||
f45 decimal (0,0) not null DEFAULT 9.9,
|
||||
f46 decimal (63,30) not null DEFAULT 9.9,
|
||||
f47 decimal (0,0) unsigned not null DEFAULT 9.9,
|
||||
f48 decimal (63,30) unsigned not null DEFAULT 9.9,
|
||||
f49 decimal (0,0) zerofill not null DEFAULT 9.9,
|
||||
f50 decimal (63,30) zerofill not null DEFAULT 9.9,
|
||||
f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9,
|
||||
f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9,
|
||||
f53 numeric not null DEFAULT 99,
|
||||
f54 numeric unsigned not null DEFAULT 99,
|
||||
f55 numeric zerofill not null DEFAULT 99,
|
||||
f56 numeric unsigned zerofill not null DEFAULT 99,
|
||||
f57 numeric (0) not null DEFAULT 99,
|
||||
f58 numeric (64) not null DEFAULT 99
|
||||
) engine = innodb;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f36' at row 1
|
||||
Note 1265 Data truncated for column 'f37' at row 1
|
||||
Note 1265 Data truncated for column 'f38' at row 1
|
||||
Note 1265 Data truncated for column 'f39' at row 1
|
||||
Note 1265 Data truncated for column 'f40' at row 1
|
||||
Note 1265 Data truncated for column 'f41' at row 1
|
||||
Note 1265 Data truncated for column 'f42' at row 1
|
||||
Note 1265 Data truncated for column 'f43' at row 1
|
||||
Note 1265 Data truncated for column 'f44' at row 1
|
||||
Note 1265 Data truncated for column 'f45' at row 1
|
||||
Note 1265 Data truncated for column 'f47' at row 1
|
||||
Note 1265 Data truncated for column 'f49' at row 1
|
||||
Note 1265 Data truncated for column 'f51' at row 1
|
||||
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb1.txt' into table tb1 ;
|
||||
|
||||
NOT YET IMPLEMENTED: cursor tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -362,3 +361,4 @@ select @test_var1, @test_var2, @test_var3;
|
||||
trig1_b trig1_a trig2
|
||||
drop database trig_db1;
|
||||
drop database trig_db2;
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -749,3 +748,4 @@ drop database if exists priv_db;
|
||||
drop user test_yesprivs@localhost;
|
||||
drop user test_noprivs@localhost;
|
||||
drop user test_noprivs;
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -478,3 +477,4 @@ Testcase 3.5.7.17 (see Testcase 3.5.1.1)
|
||||
drop user test_general@localhost;
|
||||
drop user test_general;
|
||||
drop user test_super@localhost;
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -497,3 +496,4 @@ Testcase 3.5.8.7: (Disabled as a result of bug _____)
|
||||
drop user test_general@localhost;
|
||||
drop user test_general;
|
||||
drop user test_super@localhost;
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -269,3 +268,4 @@ drop trigger trg6c;
|
||||
|
||||
Testcase 3.5.9.14: (implied in previous tests)
|
||||
----------------------------------------------
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -397,3 +396,4 @@ drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop table t4;
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
@ -138,3 +137,4 @@ drop table t2, t1, t0;
|
||||
|
||||
Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test)
|
||||
-------------------------------------------------------------------
|
||||
DROP TABLE test.tb3;
|
||||
|
@ -1,4 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
drop table if exists tb2 ;
|
||||
create table tb2 (
|
||||
@ -11452,4 +11451,5 @@ DROP VIEW IF EXISTS v1_secondview;
|
||||
DROP VIEW IF EXISTS v2;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
DROP DATABASE IF EXISTS test3;
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE test1;
|
||||
DROP TABLE test.tb2;
|
||||
|
602
mysql-test/suite/funcs_1/r/is_basics_mixed.result
Normal file
602
mysql-test/suite/funcs_1/r/is_basics_mixed.result
Normal file
@ -0,0 +1,602 @@
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.20: USE INFORMATION_SCHEMA is supported
|
||||
#######################################################################
|
||||
# Switch to connection default
|
||||
USE test;
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
test
|
||||
USE information_schema;
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
information_schema
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
test
|
||||
USE information_schema;
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
information_schema
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
#######################################################################
|
||||
# Testcase TBD1: The INFORMATION_SCHEMA cannot be dropped.
|
||||
#######################################################################
|
||||
DROP DATABASE information_schema;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
#######################################################################
|
||||
# Testcase TBD2: There cannot be a second database INFORMATION_SCHEMA.
|
||||
#######################################################################
|
||||
CREATE DATABASE information_schema;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
##################################################################################
|
||||
# Testcase 3.2.1.6+3.2.1.7: No user may create an INFORMATION_SCHEMA table or view
|
||||
##################################################################################
|
||||
# Switch to connection default (user=root)
|
||||
USE information_schema;
|
||||
CREATE TABLE schemata ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE tables ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE columns ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE character_sets ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE collations ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE collation_character_set_applicability ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE routines ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE statistics ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE views ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE user_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE schema_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE table_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE column_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE table_constraints ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE key_column_usage ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE triggers ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
|
||||
ERROR 42S02: Unknown table 't1' in information_schema
|
||||
CREATE VIEW tables AS SELECT 'garbage';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW v1 AS SELECT 'garbage';
|
||||
ERROR 42S02: Unknown table 'v1' in information_schema
|
||||
USE test;
|
||||
CREATE TABLE information_schema. schemata ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. tables ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. columns ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. character_sets ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. collations ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. collation_character_set_applicability ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. routines ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. statistics ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. views ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. user_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. schema_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. table_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. column_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. table_constraints ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. key_column_usage ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. triggers ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema.t1 (f1 INT, f2 INT, f3 INT);
|
||||
ERROR 42S02: Unknown table 't1' in information_schema
|
||||
CREATE VIEW information_schema.tables AS SELECT 'garbage';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW information_schema.tables AS
|
||||
SELECT * FROM information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
|
||||
ERROR 42S02: Unknown table 'v1' in information_schema
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT ALL ON *.* TO testuser1@localhost;
|
||||
SHOW GRANTS FOR testuser1@localhost;
|
||||
Grants for testuser1@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'testuser1'@'localhost'
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
USE information_schema;
|
||||
CREATE TABLE schemata ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE tables ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE columns ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE character_sets ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE collations ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE collation_character_set_applicability ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE routines ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE statistics ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE views ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE user_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE schema_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE table_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE column_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE table_constraints ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE key_column_usage ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE triggers ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT);
|
||||
ERROR 42S02: Unknown table 't1' in information_schema
|
||||
CREATE VIEW tables AS SELECT 'garbage';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW tables AS SELECT * FROM information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW v1 AS SELECT 'garbage';
|
||||
ERROR 42S02: Unknown table 'v1' in information_schema
|
||||
USE test;
|
||||
CREATE TABLE information_schema. schemata ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. tables ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. columns ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. character_sets ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. collations ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. collation_character_set_applicability ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. routines ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. statistics ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. views ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. user_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. schema_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. table_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. column_privileges ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE TABLE information_schema. table_constraints ( c1 INT );
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
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_schema
|
||||
CREATE VIEW information_schema.tables AS SELECT 'garbage';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
|
||||
CREATE VIEW information_schema.tables AS
|
||||
SELECT * 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 testuser1
|
||||
DROP 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.tables
|
||||
WHERE table_schema = 'db_datadict';
|
||||
table_name
|
||||
t1_first
|
||||
t1_second
|
||||
SELECT LENGTH(table_name) FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
LENGTH(table_name)
|
||||
8
|
||||
9
|
||||
SELECT count(table_name) FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'db_datadic%';
|
||||
count(table_name)
|
||||
2
|
||||
SELECT CAST((LENGTH(table_schema) + LENGTH(table_name)) AS DECIMAL(15,1))
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict';
|
||||
CAST((LENGTH(table_schema) + LENGTH(table_name)) AS DECIMAL(15,1))
|
||||
19.0
|
||||
20.0
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name IN ('t1_first','t1_second') ORDER BY table_name LIMIT 1;
|
||||
table_name
|
||||
t1_first
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name IN ('t1_first','t1_second') ORDER BY table_name LIMIT 1,1;
|
||||
table_name
|
||||
t1_second
|
||||
SELECT table_name,table_schema AS my_col FROM information_schema.tables
|
||||
WHERE table_name = 't1_first' AND table_schema = 'db_datadict';
|
||||
table_name my_col
|
||||
t1_first db_datadict
|
||||
SELECT HIGH_PRIORITY table_name AS my_col FROM information_schema.tables
|
||||
WHERE table_name = 't1_first' OR table_name = 't1_second';
|
||||
my_col
|
||||
t1_first
|
||||
t1_second
|
||||
SELECT 1 AS my_col FROM information_schema.tables
|
||||
WHERE table_name = 't1_third';
|
||||
my_col
|
||||
SELECT table_name,table_schema INTO @table_name,@table_schema
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name LIMIT 1;
|
||||
SELECT @table_name,@table_schema;
|
||||
@table_name @table_schema
|
||||
t1_first db_datadict
|
||||
SELECT table_name,table_schema
|
||||
INTO OUTFILE '<OUTFILE>'
|
||||
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
|
||||
LINES TERMINATED BY '\n'
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
"t1_first","db_datadict"
|
||||
"t1_second","db_datadict"
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_first'
|
||||
UNION ALL
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_second';
|
||||
table_name
|
||||
t1_first
|
||||
t1_second
|
||||
SELECT DISTINCT table_schema FROM information_schema.tables
|
||||
WHERE table_name IN (SELECT table_name FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict')
|
||||
ORDER BY table_name;
|
||||
table_schema
|
||||
db_datadict
|
||||
SELECT table_name FROM information_schema.tables t1
|
||||
LEFT JOIN information_schema.tables t2 USING(table_name,table_schema)
|
||||
WHERE t2.table_schema = 'db_datadict'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_first
|
||||
t1_second
|
||||
USE 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 f2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
GRANT CREATE VIEW,SELECT ON db_datadict.* TO testuser1@localhost
|
||||
WITH 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.tables
|
||||
WHERE table_schema = 'information_schema' AND table_name = 'tables';
|
||||
table_schema table_name
|
||||
information_schema TABLES
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
CREATE VIEW db_datadict.v2 AS
|
||||
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
|
||||
FROM information_schema.tables WHERE table_schema = 'db_datadict';
|
||||
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
|
||||
FROM db_datadict.v2;
|
||||
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
||||
db_datadict t1 BASE TABLE
|
||||
db_datadict v2 VIEW
|
||||
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
|
||||
FROM information_schema.tables WHERE table_schema = 'db_datadict';
|
||||
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
||||
db_datadict t1 BASE TABLE
|
||||
db_datadict v2 VIEW
|
||||
GRANT SELECT ON db_datadict.v2 to testuser2@localhost;
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
|
||||
FROM db_datadict.v2;
|
||||
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
||||
db_datadict v2 VIEW
|
||||
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
|
||||
FROM information_schema.tables WHERE table_schema = 'db_datadict';
|
||||
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
|
||||
db_datadict v2 VIEW
|
||||
# Switch to connection default and close connections testuser1 and testuser2
|
||||
DROP 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_col
|
||||
FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
SELECT 'empty result set was expected' AS my_col
|
||||
FROM information_schema.table_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
SELECT 'empty result set was expected' AS my_col
|
||||
FROM information_schema.column_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
GRANT 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'
|
||||
GRANT EXECUTE ON information_schema.*
|
||||
TO 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
GRANT INDEX ON information_schema.*
|
||||
TO 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
GRANT INSERT ON information_schema.*
|
||||
TO 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
GRANT LOCK TABLES ON information_schema.*
|
||||
TO 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
GRANT UPDATE ON information_schema.*
|
||||
TO 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
SELECT 'empty result set was expected' AS my_col
|
||||
FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
SELECT 'empty result set was expected' AS my_col
|
||||
FROM information_schema.table_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
SELECT 'empty result set was expected' AS my_col
|
||||
FROM information_schema.column_privileges
|
||||
WHERE table_schema = 'information_schema';
|
||||
my_col
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
#########################################################################
|
||||
# Testcase 3.2.1.16
|
||||
#########################################################################
|
||||
SELECT DISTINCT table_schema FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.column_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
SELECT DISTINCT routine_schema FROM information_schema.routines
|
||||
WHERE routine_schema LIKE 'db_data%';
|
||||
routine_schema
|
||||
SELECT DISTINCT schema_name FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_data%';
|
||||
schema_name
|
||||
SELECT DISTINCT table_schema FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT table_schema,index_schema FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_data%' OR index_schema LIKE 'db_data%';
|
||||
table_schema index_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.table_constraints
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.table_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT trigger_schema,event_object_schema
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_schema LIKE 'db_data%' OR event_object_schema LIKE 'db_data%';
|
||||
trigger_schema event_object_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.views
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, f2 BIGINT NOT NULL, f3 BIGINT,
|
||||
PRIMARY KEY(f1))
|
||||
ENGINE = <some_engine>;
|
||||
CREATE UNIQUE INDEX UIDX ON db_datadict.t1(f3);
|
||||
CREATE PROCEDURE db_datadict.sproc1() SELECT 'db_datadict';
|
||||
CREATE FUNCTION db_datadict.func1() RETURNS INT RETURN 0;
|
||||
CREATE TRIGGER db_datadict.trig1 BEFORE INSERT ON db_datadict.t1
|
||||
FOR EACH ROW SET @aux = 1;
|
||||
CREATE VIEW db_datadict.v1 AS SELECT * FROM db_datadict.t1;
|
||||
CREATE VIEW db_datadict.v2 AS SELECT * FROM information_schema.tables;
|
||||
SELECT DISTINCT table_schema FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
db_datadict
|
||||
SELECT DISTINCT table_schema FROM information_schema.column_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
db_datadict db_datadict
|
||||
SELECT DISTINCT routine_schema FROM information_schema.routines
|
||||
WHERE routine_schema LIKE 'db_data%';
|
||||
routine_schema
|
||||
db_datadict
|
||||
SELECT DISTINCT schema_name FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_data%';
|
||||
schema_name
|
||||
db_datadict
|
||||
SELECT DISTINCT table_schema FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT table_schema,index_schema FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_data%' OR index_schema LIKE 'db_data%';
|
||||
table_schema index_schema
|
||||
db_datadict db_datadict
|
||||
SELECT DISTINCT table_schema FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
db_datadict
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.table_constraints
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
db_datadict db_datadict
|
||||
SELECT DISTINCT table_schema FROM information_schema.table_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT trigger_schema,event_object_schema
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_schema LIKE 'db_data%' OR event_object_schema LIKE 'db_data%';
|
||||
trigger_schema event_object_schema
|
||||
db_datadict db_datadict
|
||||
SELECT DISTINCT table_schema FROM information_schema.views
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
db_datadict
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT ALL ON test.* TO 'testuser1'@'localhost';
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT DISTINCT table_schema FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.column_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
SELECT DISTINCT routine_schema FROM information_schema.routines
|
||||
WHERE routine_schema LIKE 'db_data%';
|
||||
routine_schema
|
||||
SELECT DISTINCT schema_name FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_data%';
|
||||
schema_name
|
||||
SELECT DISTINCT table_schema FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT table_schema,index_schema FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_data%' OR index_schema LIKE 'db_data%';
|
||||
table_schema index_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT constraint_schema,table_schema
|
||||
FROM information_schema.table_constraints
|
||||
WHERE constraint_schema LIKE 'db_data%' OR table_schema LIKE 'db_data%';
|
||||
constraint_schema table_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.table_privileges
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
SELECT DISTINCT trigger_schema,event_object_schema
|
||||
FROM information_schema.triggers
|
||||
WHERE trigger_schema LIKE 'db_data%' OR event_object_schema LIKE 'db_data%';
|
||||
trigger_schema event_object_schema
|
||||
SELECT DISTINCT table_schema FROM information_schema.views
|
||||
WHERE table_schema LIKE 'db_data%';
|
||||
table_schema
|
||||
# Switch to connection default and close connections testuser1 and testuser2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
CREATE PROCEDURE test.p1()
|
||||
INSERT INTO information_schema.tables
|
||||
SELECT * FROM information_schema.tables LIMIT 1;
|
||||
CALL test.p1();
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP PROCEDURE test.p1;
|
||||
CREATE PROCEDURE test.p1()
|
||||
UPDATE information_schema.columns SET table_schema = 'garbage';
|
||||
CALL test.p1();
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP PROCEDURE test.p1;
|
||||
CREATE PROCEDURE test.p1()
|
||||
DELETE FROM information_schema.schemata;
|
||||
CALL test.p1();
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP PROCEDURE test.p1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.17.1+3.2.17.2: To be implemented outside of this script
|
||||
#########################################################################
|
78
mysql-test/suite/funcs_1/r/is_character_sets.result
Normal file
78
mysql-test/suite/funcs_1/r/is_character_sets.result
Normal file
@ -0,0 +1,78 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'CHARACTER_SETS';
|
||||
Tables_in_information_schema (CHARACTER_SETS)
|
||||
CHARACTER_SETS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.CHARACTER_SETS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.CHARACTER_SETS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.CHARACTER_SETS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.CHARACTER_SETS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.2.1: INFORMATION_SCHEMA.CHARACTER_SETS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.CHARACTER_SETS;
|
||||
Field Type Null Key Default Extra
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATE_NAME varchar(64) NO
|
||||
DESCRIPTION varchar(60) NO
|
||||
MAXLEN bigint(3) NO 0
|
||||
SHOW CREATE TABLE information_schema.CHARACTER_SETS;
|
||||
Table Create Table
|
||||
CHARACTER_SETS CREATE TEMPORARY TABLE `CHARACTER_SETS` (
|
||||
`CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
|
||||
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL default '',
|
||||
`DESCRIPTION` varchar(60) NOT NULL default '',
|
||||
`MAXLEN` bigint(3) NOT NULL default '0'
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.CHARACTER_SETS;
|
||||
Field Type Null Key Default Extra
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATE_NAME varchar(64) NO
|
||||
DESCRIPTION varchar(60) NO
|
||||
MAXLEN bigint(3) NO 0
|
||||
# Testcases 3.2.2.2 and 3.2.2.3 are checked in suite/funcs_1/t/charset_collation*.test
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
INSERT INTO information_schema.character_sets
|
||||
SELECT * FROM information_schema.character_sets;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.character_sets SET description = 'just updated';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.character_sets WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.character_sets;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx ON information_schema.character_sets(character_set_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.character_sets DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.character_sets ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.character_sets;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.character_sets RENAME db_datadict.character_sets;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.character_sets
|
||||
RENAME information_schema.xcharacter_sets;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
@ -0,0 +1,76 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'COLLATION_CHARACTER_SET_APPLICABILITY';
|
||||
Tables_in_information_schema (COLLATION_CHARACTER_SET_APPLICABILITY)
|
||||
COLLATION_CHARACTER_SET_APPLICABILITY
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.4.1: INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
Field Type Null Key Default Extra
|
||||
COLLATION_NAME varchar(64) NO
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
SHOW CREATE TABLE information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
Table Create Table
|
||||
COLLATION_CHARACTER_SET_APPLICABILITY CREATE TEMPORARY TABLE `COLLATION_CHARACTER_SET_APPLICABILITY` (
|
||||
`COLLATION_NAME` varchar(64) NOT NULL default '',
|
||||
`CHARACTER_SET_NAME` varchar(64) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.COLLATION_CHARACTER_SET_APPLICABILITY;
|
||||
Field Type Null Key Default Extra
|
||||
COLLATION_NAME varchar(64) NO
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
# Testcases 3.2.4.2 and 3.2.4.3 are checked in suite/funcs_1/t/charset_collation*.test
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
INSERT INTO information_schema.collation_character_set_applicability
|
||||
SELECT * FROM information_schema.collation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.collation_character_set_applicability
|
||||
SET collation_name = 'big6_chinese_ci' WHERE character_set_name = 'big6';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.collation_character_set_applicability
|
||||
SET character_set_name = 't_4711';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.collation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.collation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx
|
||||
ON information_schema.collation_character_set_applicability(collation_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collation_character_set_applicability ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.collation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collation_character_set_applicability
|
||||
RENAME db_datadict.collation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collation_character_set_applicability
|
||||
RENAME information_schema.xcollation_character_set_applicability;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
90
mysql-test/suite/funcs_1/r/is_collations.result
Normal file
90
mysql-test/suite/funcs_1/r/is_collations.result
Normal file
@ -0,0 +1,90 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'COLLATIONS';
|
||||
Tables_in_information_schema (COLLATIONS)
|
||||
COLLATIONS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.COLLATIONS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.COLLATIONS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.COLLATIONS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.COLLATIONS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.3.1: INFORMATION_SCHEMA.COLLATIONS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.COLLATIONS;
|
||||
Field Type Null Key Default Extra
|
||||
COLLATION_NAME varchar(64) NO
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
ID bigint(11) NO 0
|
||||
IS_DEFAULT varchar(3) NO
|
||||
IS_COMPILED varchar(3) NO
|
||||
SORTLEN bigint(3) NO 0
|
||||
SHOW CREATE TABLE information_schema.COLLATIONS;
|
||||
Table Create Table
|
||||
COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` (
|
||||
`COLLATION_NAME` varchar(64) NOT NULL default '',
|
||||
`CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
|
||||
`ID` bigint(11) NOT NULL default '0',
|
||||
`IS_DEFAULT` varchar(3) NOT NULL default '',
|
||||
`IS_COMPILED` varchar(3) NOT NULL default '',
|
||||
`SORTLEN` bigint(3) NOT NULL default '0'
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.COLLATIONS;
|
||||
Field Type Null Key Default Extra
|
||||
COLLATION_NAME varchar(64) NO
|
||||
CHARACTER_SET_NAME varchar(64) NO
|
||||
ID bigint(11) NO 0
|
||||
IS_DEFAULT varchar(3) NO
|
||||
IS_COMPILED varchar(3) NO
|
||||
SORTLEN bigint(3) NO 0
|
||||
# Testcases 3.2.3.2 and 3.2.3.3 are checked in suite/funcs_1/t/charset_collation*.test
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
INSERT INTO information_schema.collations
|
||||
SELECT * FROM information_schema.collations;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.collations
|
||||
(collation_name,character_set_name,id,is_default,is_compiled,sortlen)
|
||||
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.collations SET description = 'just updated';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.collations WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.collations;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx ON information_schema.collations(character_set_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collations DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collations ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collations ENABLE KEYS;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.collations;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collations RENAME db_datadict.collations;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.collations
|
||||
RENAME information_schema.xcollations;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
370
mysql-test/suite/funcs_1/r/is_column_privileges.result
Normal file
370
mysql-test/suite/funcs_1/r/is_column_privileges.result
Normal file
@ -0,0 +1,370 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'COLUMN_PRIVILEGES';
|
||||
Tables_in_information_schema (COLUMN_PRIVILEGES)
|
||||
COLUMN_PRIVILEGES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.COLUMN_PRIVILEGES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.COLUMN_PRIVILEGES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.COLUMN_PRIVILEGES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.COLUMN_PRIVILEGES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.5.1: INFORMATION_SCHEMA.COLUMN_PRIVILEGES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.COLUMN_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SHOW CREATE TABLE information_schema.COLUMN_PRIVILEGES;
|
||||
Table Create Table
|
||||
COLUMN_PRIVILEGES CREATE TEMPORARY TABLE `COLUMN_PRIVILEGES` (
|
||||
`GRANTEE` varchar(81) NOT NULL default '',
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`COLUMN_NAME` varchar(64) NOT NULL default '',
|
||||
`PRIVILEGE_TYPE` varchar(64) NOT NULL default '',
|
||||
`IS_GRANTABLE` varchar(3) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.COLUMN_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SELECT table_catalog, table_schema, table_name, column_name, privilege_type
|
||||
FROM information_schema.column_privileges WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name column_name privilege_type
|
||||
######################################################################
|
||||
# Testcase 3.2.5.2+3.2.5.3+3.2.5.4:
|
||||
# INFORMATION_SCHEMA.COLUMN_PRIVILEGES accessible information
|
||||
######################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 INT, f2 DECIMAL, f3 TEXT)
|
||||
ENGINE = <other_engine_type>;
|
||||
USE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT(f1, f3) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT INSERT(f1) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT UPDATE(f2) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT(f2) ON db_datadict.t1 TO 'testuser2'@'localhost';
|
||||
GRANT INSERT, SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
|
||||
GRANT SELECT(f3) ON db_datadict.t1 TO 'testuser3'@'localhost';
|
||||
GRANT INSERT, SELECT ON db_datadict.t1 TO 'testuser3'@'localhost'
|
||||
WITH GRANT OPTION;
|
||||
GRANT ALL ON db_datadict.* TO 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT NO
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
|
||||
'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
GRANT UPDATE(f3) ON db_datadict.t1 TO 'testuser1'@'localhost'
|
||||
WITH GRANT OPTION;
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f3 UPDATE YES
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
|
||||
'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 INSERT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f1 SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f2 UPDATE YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict t1 f3 UPDATE YES
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
# FIXME: Is it correct that granted TABLES do not occur in COLUMN_PRIVILEGES?
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee,table_schema,table_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL db_datadict t1 INSERT YES
|
||||
'testuser3'@'localhost' NULL db_datadict t1 SELECT YES
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL db_datadict ALTER NO
|
||||
'testuser3'@'localhost' NULL db_datadict ALTER ROUTINE NO
|
||||
'testuser3'@'localhost' NULL db_datadict CREATE NO
|
||||
'testuser3'@'localhost' NULL db_datadict CREATE ROUTINE NO
|
||||
'testuser3'@'localhost' NULL db_datadict CREATE TEMPORARY TABLES NO
|
||||
'testuser3'@'localhost' NULL db_datadict CREATE VIEW NO
|
||||
'testuser3'@'localhost' NULL db_datadict DELETE NO
|
||||
'testuser3'@'localhost' NULL db_datadict DROP NO
|
||||
'testuser3'@'localhost' NULL db_datadict EXECUTE NO
|
||||
'testuser3'@'localhost' NULL db_datadict INDEX NO
|
||||
'testuser3'@'localhost' NULL db_datadict INSERT NO
|
||||
'testuser3'@'localhost' NULL db_datadict LOCK TABLES NO
|
||||
'testuser3'@'localhost' NULL db_datadict REFERENCES NO
|
||||
'testuser3'@'localhost' NULL db_datadict SELECT NO
|
||||
'testuser3'@'localhost' NULL db_datadict SHOW VIEW NO
|
||||
'testuser3'@'localhost' NULL db_datadict UPDATE NO
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
GRANT SELECT(f1, f3) ON db_datadict.t1 TO 'testuser2'@'localhost';
|
||||
# FIXME: Is it intended that *my* grants to others are *NOT* shown here?
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL db_datadict t1 f3 SELECT YES
|
||||
# Switch to connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f1 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f2 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict t1 f3 SELECT NO
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
################################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.COLUMN_PRIVILEGES modifications
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.my_table (f1 BIGINT, f2 CHAR(10), f3 DATE)
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT ALL ON test.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
# Switch to connection default
|
||||
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection default
|
||||
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
|
||||
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
SELECT f1, f3 FROM db_datadict.my_table;
|
||||
ERROR 42S22: Unknown column 'f3' in 'field list'
|
||||
# Switch to connection default
|
||||
ALTER TABLE db_datadict.my_table CHANGE COLUMN f1 my_col BIGINT;
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection default
|
||||
DROP TABLE db_datadict.my_table;
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f1 UPDATE NO
|
||||
'testuser1'@'localhost' NULL db_datadict my_table f3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
|
||||
# Switch to connection default
|
||||
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_name = 'my_table'
|
||||
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, f2 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT (f1) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
INSERT INTO information_schema.column_privileges
|
||||
SELECT * FROM information_schema.column_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.column_privileges SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.column_privileges WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.column_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_tables
|
||||
ON information_schema.column_privileges(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.column_privileges ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.column_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.column_privileges
|
||||
RENAME db_datadict.column_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.column_privileges
|
||||
RENAME information_schema.xcolumn_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
@ -0,0 +1,37 @@
|
||||
##############################################################################
|
||||
# Testcases 3.2.9.2+3.2.9.3 INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
##############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_schema IN ('information_schema','mysql','test')
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
mysql
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.column_privileges
|
||||
WHERE table_schema IN ('information_schema','mysql','test')
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
486
mysql-test/suite/funcs_1/r/is_columns.result
Normal file
486
mysql-test/suite/funcs_1/r/is_columns.result
Normal file
@ -0,0 +1,486 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'COLUMNS';
|
||||
Tables_in_information_schema (COLUMNS)
|
||||
COLUMNS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.COLUMNS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.COLUMNS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.COLUMNS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.COLUMNS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.6.1: INFORMATION_SCHEMA.COLUMNS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.COLUMNS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(21) NO 0
|
||||
COLUMN_DEFAULT longtext YES NULL
|
||||
IS_NULLABLE varchar(3) NO
|
||||
DATA_TYPE varchar(64) NO
|
||||
CHARACTER_MAXIMUM_LENGTH bigint(21) YES NULL
|
||||
CHARACTER_OCTET_LENGTH bigint(21) YES NULL
|
||||
NUMERIC_PRECISION bigint(21) YES NULL
|
||||
NUMERIC_SCALE bigint(21) YES NULL
|
||||
CHARACTER_SET_NAME varchar(64) YES NULL
|
||||
COLLATION_NAME varchar(64) YES NULL
|
||||
COLUMN_TYPE longtext NO NULL
|
||||
COLUMN_KEY varchar(3) NO
|
||||
EXTRA varchar(20) NO
|
||||
PRIVILEGES varchar(80) NO
|
||||
COLUMN_COMMENT varchar(255) NO
|
||||
SHOW CREATE TABLE information_schema.COLUMNS;
|
||||
Table Create Table
|
||||
COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`COLUMN_NAME` varchar(64) NOT NULL default '',
|
||||
`ORDINAL_POSITION` bigint(21) NOT NULL default '0',
|
||||
`COLUMN_DEFAULT` longtext,
|
||||
`IS_NULLABLE` varchar(3) NOT NULL default '',
|
||||
`DATA_TYPE` varchar(64) NOT NULL default '',
|
||||
`CHARACTER_MAXIMUM_LENGTH` bigint(21) default NULL,
|
||||
`CHARACTER_OCTET_LENGTH` bigint(21) default NULL,
|
||||
`NUMERIC_PRECISION` bigint(21) default NULL,
|
||||
`NUMERIC_SCALE` bigint(21) default NULL,
|
||||
`CHARACTER_SET_NAME` varchar(64) default NULL,
|
||||
`COLLATION_NAME` varchar(64) default NULL,
|
||||
`COLUMN_TYPE` longtext NOT NULL,
|
||||
`COLUMN_KEY` varchar(3) NOT NULL default '',
|
||||
`EXTRA` varchar(20) NOT NULL default '',
|
||||
`PRIVILEGES` varchar(80) NOT NULL default '',
|
||||
`COLUMN_COMMENT` varchar(255) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.COLUMNS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(21) NO 0
|
||||
COLUMN_DEFAULT longtext YES NULL
|
||||
IS_NULLABLE varchar(3) NO
|
||||
DATA_TYPE varchar(64) NO
|
||||
CHARACTER_MAXIMUM_LENGTH bigint(21) YES NULL
|
||||
CHARACTER_OCTET_LENGTH bigint(21) YES NULL
|
||||
NUMERIC_PRECISION bigint(21) YES NULL
|
||||
NUMERIC_SCALE bigint(21) YES NULL
|
||||
CHARACTER_SET_NAME varchar(64) YES NULL
|
||||
COLLATION_NAME varchar(64) YES NULL
|
||||
COLUMN_TYPE longtext NO NULL
|
||||
COLUMN_KEY varchar(3) NO
|
||||
EXTRA varchar(20) NO
|
||||
PRIVILEGES varchar(80) NO
|
||||
COLUMN_COMMENT varchar(255) NO
|
||||
SELECT table_catalog, table_schema, table_name, column_name
|
||||
FROM information_schema.columns WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name column_name
|
||||
###############################################################################
|
||||
# Testcase 3.2.6.2 + 3.2.6.3: INFORMATION_SCHEMA.COLUMNS accessible information
|
||||
###############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
CREATE TABLE db_datadict.t1
|
||||
(f1 CHAR(10), f2 TEXT, f3 DATE, f4 INT AUTO_INCREMENT,
|
||||
UNIQUE INDEX MUL_IDX(f1,f3), PRIMARY KEY (f4))
|
||||
ENGINE = <other_engine_type>;
|
||||
CREATE VIEW db_datadict.v1 AS SELECT 1 AS f1, 1 AS f2;
|
||||
GRANT SELECT(f1, f2) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT(f2) ON db_datadict.v1 TO 'testuser1'@'localhost';
|
||||
CREATE TABLE db_datadict.t2
|
||||
(f1 CHAR(10), f2 TEXT, f3 DATE, f4 INT, PRIMARY KEY (f1,f4))
|
||||
ENGINE = <other_engine_type>;
|
||||
GRANT INSERT(f1, f2) ON db_datadict.t2 TO 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY table_schema, table_name, ordinal_position;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references
|
||||
NULL db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
|
||||
NULL db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL int(11) PRI auto_increment select,insert,update,references
|
||||
NULL db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references
|
||||
NULL db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
|
||||
NULL db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL db_datadict t2 f4 4 0 NO int NULL NULL 10 0 NULL NULL int(11) PRI select,insert,update,references
|
||||
NULL db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
|
||||
NULL db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select,insert,update,references
|
||||
SHOW COLUMNS FROM db_datadict.t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES MUL NULL
|
||||
f2 text YES NULL
|
||||
f3 date YES NULL
|
||||
f4 int(11) NO PRI NULL auto_increment
|
||||
SHOW COLUMNS FROM db_datadict.t2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) NO PRI
|
||||
f2 text YES NULL
|
||||
f3 date YES NULL
|
||||
f4 int(11) NO PRI 0
|
||||
SHOW COLUMNS FROM db_datadict.v1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 int(1) NO 0
|
||||
f2 int(1) NO 0
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY table_schema, table_name, ordinal_position;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) MUL select
|
||||
NULL db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select
|
||||
NULL db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL int(1) select
|
||||
SHOW COLUMNS FROM db_datadict.t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) YES MUL NULL
|
||||
f2 text YES NULL
|
||||
SHOW COLUMNS FROM db_datadict.t2;
|
||||
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 't2'
|
||||
SHOW COLUMNS FROM db_datadict.v1;
|
||||
Field Type Null Key Default Extra
|
||||
f2 int(1) NO 0
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY table_schema, table_name, ordinal_position;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL db_datadict t2 f1 1 NO char 10 10 NULL NULL latin1 latin1_swedish_ci char(10) PRI insert
|
||||
NULL db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text insert
|
||||
SHOW COLUMNS FROM db_datadict.t1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 't1'
|
||||
SHOW COLUMNS FROM db_datadict.t2;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(10) NO PRI
|
||||
f2 text YES NULL
|
||||
SHOW COLUMNS FROM db_datadict.v1;
|
||||
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'v1'
|
||||
# Switch to connection default and close connections testuser1, testuser2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
###############################################################################
|
||||
# Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.COLUMNS modifications
|
||||
###############################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table (f1 CHAR(12))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_table';
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
COLUMN_NAME f1
|
||||
ORDINAL_POSITION 1
|
||||
COLUMN_DEFAULT NULL
|
||||
IS_NULLABLE YES
|
||||
DATA_TYPE char
|
||||
CHARACTER_MAXIMUM_LENGTH 12
|
||||
CHARACTER_OCTET_LENGTH 12
|
||||
NUMERIC_PRECISION NULL
|
||||
NUMERIC_SCALE NULL
|
||||
CHARACTER_SET_NAME latin1
|
||||
COLLATION_NAME latin1_swedish_ci
|
||||
COLUMN_TYPE char(12)
|
||||
COLUMN_KEY
|
||||
EXTRA
|
||||
PRIVILEGES select,insert,update,references
|
||||
COLUMN_COMMENT
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_schema,table_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT table_schema,table_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT table_name, column_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex f1
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12);
|
||||
SELECT table_name, column_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex first_col
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, column_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length column_type
|
||||
t1_my_tablex first_col 12 12 char(12)
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(20);
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, column_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length column_type
|
||||
t1_my_tablex first_col 20 20 char(20)
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, column_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length column_type
|
||||
t1_my_tablex first_col 20 20 char(20)
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col VARCHAR(20);
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, column_type
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length column_type
|
||||
t1_my_tablex first_col 20 20 varchar(20)
|
||||
SELECT table_name, column_name, column_default
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_default
|
||||
t1_my_tablex first_col NULL
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(10) DEFAULT 'hello';
|
||||
SELECT table_name, column_name, column_default
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_default
|
||||
t1_my_tablex first_col hello
|
||||
SELECT table_name, column_name, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name is_nullable
|
||||
t1_my_tablex first_col YES
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(10) NOT NULL;
|
||||
SELECT table_name, column_name, is_nullable
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name is_nullable
|
||||
t1_my_tablex first_col NO
|
||||
SELECT table_name, column_name, collation_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name collation_name
|
||||
t1_my_tablex first_col latin1_swedish_ci
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(10) COLLATE 'latin1_general_cs';
|
||||
SELECT table_name, column_name, collation_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name collation_name
|
||||
t1_my_tablex first_col latin1_general_cs
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, character_set_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length character_set_name
|
||||
t1_my_tablex first_col 10 10 latin1
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(10) CHARACTER SET utf8;
|
||||
SELECT table_name, column_name, character_maximum_length,
|
||||
character_octet_length, character_set_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name character_maximum_length character_octet_length character_set_name
|
||||
t1_my_tablex first_col 10 30 utf8
|
||||
SELECT table_name, column_name, column_comment
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_comment
|
||||
t1_my_tablex first_col
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN first_col CHAR(10) COMMENT 'Hello';
|
||||
SELECT table_name, column_name, column_comment
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_comment
|
||||
t1_my_tablex first_col Hello
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex first_col
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ADD COLUMN second_col CHAR(10);
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex first_col
|
||||
t1_my_tablex second_col
|
||||
SELECT table_name, column_name, ordinal_position
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name ordinal_position
|
||||
t1_my_tablex first_col 1
|
||||
t1_my_tablex second_col 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
MODIFY COLUMN second_col CHAR(10) FIRST;
|
||||
SELECT table_name, column_name, ordinal_position
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name ordinal_position
|
||||
t1_my_tablex first_col 2
|
||||
t1_my_tablex second_col 1
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex second_col
|
||||
t1_my_tablex first_col
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DROP COLUMN first_col;
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex second_col
|
||||
SELECT table_name, column_name, column_key
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_key
|
||||
t1_my_tablex second_col
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ADD UNIQUE INDEX IDX(second_col);
|
||||
SELECT table_name, column_name, column_key
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name column_key
|
||||
t1_my_tablex second_col UNI
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
t1_my_tablex second_col
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
CREATE VIEW test.t1_my_tablex
|
||||
AS SELECT 1 AS "col1", 'A' collate latin1_german1_ci AS "col2";
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_tablex
|
||||
COLUMN_NAME col1
|
||||
ORDINAL_POSITION 1
|
||||
COLUMN_DEFAULT 0
|
||||
IS_NULLABLE NO
|
||||
DATA_TYPE int
|
||||
CHARACTER_MAXIMUM_LENGTH NULL
|
||||
CHARACTER_OCTET_LENGTH NULL
|
||||
NUMERIC_PRECISION 10
|
||||
NUMERIC_SCALE 0
|
||||
CHARACTER_SET_NAME NULL
|
||||
COLLATION_NAME NULL
|
||||
COLUMN_TYPE int(1)
|
||||
COLUMN_KEY
|
||||
EXTRA
|
||||
PRIVILEGES select,insert,update,references
|
||||
COLUMN_COMMENT
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_tablex
|
||||
COLUMN_NAME col2
|
||||
ORDINAL_POSITION 2
|
||||
COLUMN_DEFAULT
|
||||
IS_NULLABLE NO
|
||||
DATA_TYPE varchar
|
||||
CHARACTER_MAXIMUM_LENGTH 1
|
||||
CHARACTER_OCTET_LENGTH 1
|
||||
NUMERIC_PRECISION NULL
|
||||
NUMERIC_SCALE NULL
|
||||
CHARACTER_SET_NAME latin1
|
||||
COLLATION_NAME latin1_german1_ci
|
||||
COLUMN_TYPE varchar(1)
|
||||
COLUMN_KEY
|
||||
EXTRA
|
||||
PRIVILEGES select,insert,update,references
|
||||
COLUMN_COMMENT
|
||||
DROP VIEW test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1;
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.columns
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS test.t1;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE test.t1 (f1 BIGINT);
|
||||
INSERT INTO information_schema.columns (table_schema,table_name,column_name)
|
||||
VALUES('test','t1', 'f2');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.columns (table_schema,table_name,column_name)
|
||||
VALUES('test','t2', 'f1');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.columns SET table_name = 't4' WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.columns WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.columns;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i3 ON information_schema.columns(table_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.columns ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.columns;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.columns RENAME db_datadict.columns;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.columns RENAME information_schema.xcolumns;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE test.t1;
|
||||
DROP DATABASE db_datadict;
|
1130
mysql-test/suite/funcs_1/r/is_columns_innodb.result
Normal file
1130
mysql-test/suite/funcs_1/r/is_columns_innodb.result
Normal file
File diff suppressed because it is too large
Load Diff
380
mysql-test/suite/funcs_1/r/is_columns_is.result
Normal file
380
mysql-test/suite/funcs_1/r/is_columns_is.result
Normal file
@ -0,0 +1,380 @@
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60) select
|
||||
NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
|
||||
NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11) select
|
||||
NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
|
||||
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
|
||||
NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS EXTRA 17 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
|
||||
NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
|
||||
NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
|
||||
NULL information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
|
||||
NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10) select
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
|
||||
NULL information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
|
||||
NULL information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
|
||||
NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
|
||||
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
|
||||
NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
|
||||
NULL information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1) select
|
||||
NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
|
||||
NULL information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16) select
|
||||
NULL information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1) select
|
||||
NULL information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
|
||||
NULL information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2) select
|
||||
NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3) select
|
||||
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
|
||||
NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
|
||||
NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
|
||||
NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) select
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
|
||||
NULL information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
|
||||
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9) select
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
|
||||
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
|
||||
NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81) select
|
||||
NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
|
||||
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
|
||||
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
|
||||
NULL information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7) select
|
||||
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 longtext utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 varchar utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL bigint NULL NULL
|
||||
NULL datetime NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
|
||||
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATIONS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
|
||||
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema COLUMNS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21)
|
||||
1.0000 information_schema COLUMNS COLUMN_DEFAULT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema COLUMNS IS_NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLUMNS DATA_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema COLUMNS NUMERIC_PRECISION bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(21)
|
||||
3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLUMNS EXTRA varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(10)
|
||||
NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NULL NULL NULL NULL bigint(10)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SPECIFIC_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema ROUTINES ROUTINE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9)
|
||||
3.0000 information_schema ROUTINES DTD_IDENTIFIER varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_BODY varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
1.0000 information_schema ROUTINES ROUTINE_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema ROUTINES EXTERNAL_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES EXTERNAL_LANGUAGE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES PARAMETER_STYLE varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
3.0000 information_schema ROUTINES IS_DETERMINISTIC varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema ROUTINES SQL_DATA_ACCESS varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SQL_PATH varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
|
||||
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
|
||||
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS NON_UNIQUE bigint NULL NULL NULL NULL bigint(1)
|
||||
3.0000 information_schema STATISTICS INDEX_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS INDEX_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS SEQ_IN_INDEX bigint NULL NULL NULL NULL bigint(2)
|
||||
3.0000 information_schema STATISTICS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS COLLATION varchar 1 3 utf8 utf8_general_ci varchar(1)
|
||||
NULL information_schema STATISTICS CARDINALITY bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema STATISTICS PACKED varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
3.0000 information_schema STATISTICS NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES TABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES VERSION bigint NULL NULL NULL NULL bigint(21)
|
||||
3.0000 information_schema TABLES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema TABLES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES MAX_DATA_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES DATA_FREE bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES AUTO_INCREMENT bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema TABLES CREATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema TABLES TABLE_COLLATION varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21)
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS EVENT_MANIPULATION varchar 6 18 utf8 utf8_general_ci varchar(6)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(4)
|
||||
1.0000 information_schema TRIGGERS ACTION_CONDITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema TRIGGERS ACTION_STATEMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema TRIGGERS ACTION_ORIENTATION varchar 9 27 utf8 utf8_general_ci varchar(9)
|
||||
3.0000 information_schema TRIGGERS ACTION_TIMING varchar 6 18 utf8 utf8_general_ci varchar(6)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
|
||||
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema USER_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema VIEWS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema VIEWS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema VIEWS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
|
1076
mysql-test/suite/funcs_1/r/is_columns_memory.result
Normal file
1076
mysql-test/suite/funcs_1/r/is_columns_memory.result
Normal file
File diff suppressed because it is too large
Load Diff
1207
mysql-test/suite/funcs_1/r/is_columns_myisam.result
Normal file
1207
mysql-test/suite/funcs_1/r/is_columns_myisam.result
Normal file
File diff suppressed because it is too large
Load Diff
361
mysql-test/suite/funcs_1/r/is_columns_mysql.result
Normal file
361
mysql-test/suite/funcs_1/r/is_columns_mysql.result
Normal file
@ -0,0 +1,361 @@
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
|
||||
NULL mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
NULL mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
NULL mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
|
||||
NULL mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1) select,insert,update,references
|
||||
NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate') select,insert,update,references
|
||||
NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI select,insert,update,references
|
||||
NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
|
||||
NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
|
||||
NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
|
||||
NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
|
||||
NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
|
||||
NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text select,insert,update,references
|
||||
NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned select,insert,update,references
|
||||
NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI select,insert,update,references
|
||||
NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128) select,insert,update,references
|
||||
NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
|
||||
NULL mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
|
||||
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77) select,insert,update,references
|
||||
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references
|
||||
NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL') select,insert,update,references
|
||||
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
|
||||
NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
NULL mysql proc returns 10 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
||||
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER') select,insert,update,references
|
||||
NULL mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
|
||||
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references
|
||||
NULL mysql proc sql_mode 15 NO set 431 1293 NULL NULL utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') select,insert,update,references
|
||||
NULL mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
|
||||
NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
|
||||
NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references
|
||||
NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI select,insert,update,references
|
||||
NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
NULL mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References') select,insert,update,references
|
||||
NULL mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL select,insert,update,references
|
||||
NULL mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
NULL mysql tables_priv Table_priv 7 NO set 90 270 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') select,insert,update,references
|
||||
NULL mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp select,insert,update,references
|
||||
NULL mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
NULL mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references
|
||||
NULL mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N') select,insert,update,references
|
||||
NULL mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
|
||||
NULL mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI select,insert,update,references
|
||||
NULL mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
|
||||
NULL mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI select,insert,update,references
|
||||
NULL mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned select,insert,update,references
|
||||
NULL mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8) select,insert,update,references
|
||||
NULL mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned select,insert,update,references
|
||||
NULL mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI select,insert,update,references
|
||||
NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI select,insert,update,references
|
||||
NULL mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user max_connections 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
NULL mysql user max_questions 34 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
NULL mysql user max_updates 35 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
NULL mysql user max_user_connections 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
|
||||
NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user ssl_cipher 31 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
NULL mysql user ssl_type 30 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references
|
||||
NULL mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
NULL mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
NULL mysql user x509_issuer 32 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
NULL mysql user x509_subject 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 blob NULL NULL
|
||||
1.0000 longblob NULL NULL
|
||||
1.0000 char latin1 latin1_bin
|
||||
1.0000 text utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 char utf8 utf8_bin
|
||||
3.0000 enum utf8 utf8_bin
|
||||
3.0000 char utf8 utf8_general_ci
|
||||
3.0000 enum utf8 utf8_general_ci
|
||||
3.0000 set utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL bigint NULL NULL
|
||||
NULL int NULL NULL
|
||||
NULL smallint NULL NULL
|
||||
NULL timestamp NULL NULL
|
||||
NULL tinyint NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql columns_priv Table_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql columns_priv Column_name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql columns_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql columns_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql db Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql db Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql db User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql db Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
|
||||
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
|
||||
3.0000 mysql func type enum 9 27 utf8 utf8_general_ci enum('function','aggregate')
|
||||
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128)
|
||||
NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql help_relation help_keyword_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql help_topic name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text
|
||||
1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text
|
||||
3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128)
|
||||
3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
|
||||
3.0000 mysql proc specific_name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql proc language enum 3 9 utf8 utf8_general_ci enum('SQL')
|
||||
3.0000 mysql proc sql_data_access enum 17 51 utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
|
||||
3.0000 mysql proc is_deterministic enum 3 9 utf8 utf8_general_ci enum('YES','NO')
|
||||
3.0000 mysql proc security_type enum 7 21 utf8 utf8_general_ci enum('INVOKER','DEFINER')
|
||||
1.0000 mysql proc param_list blob 65535 65535 NULL NULL blob
|
||||
3.0000 mysql proc returns char 64 192 utf8 utf8_general_ci char(64)
|
||||
1.0000 mysql proc body longblob 4294967295 4294967295 NULL NULL longblob
|
||||
3.0000 mysql proc definer char 77 231 utf8 utf8_bin char(77)
|
||||
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
|
||||
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql proc sql_mode set 431 1293 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE')
|
||||
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE')
|
||||
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
||||
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql tables_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql tables_priv Table_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql tables_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql tables_priv Table_priv set 90 270 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view')
|
||||
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
NULL mysql time_zone Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql time_zone Use_leap_seconds enum 1 3 utf8 utf8_general_ci enum('Y','N')
|
||||
NULL mysql time_zone_leap_second Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
NULL mysql time_zone_leap_second Correction int NULL NULL NULL NULL int(11)
|
||||
3.0000 mysql time_zone_name Name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql time_zone_name Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
NULL mysql time_zone_transition Transition_type_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Transition_type_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Offset int NULL NULL NULL NULL int(11)
|
||||
NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(3) unsigned
|
||||
3.0000 mysql time_zone_transition_type Abbreviation char 8 24 utf8 utf8_general_ci char(8)
|
||||
3.0000 mysql user Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql user User char 16 48 utf8 utf8_bin char(16)
|
||||
1.0000 mysql user Password char 41 41 latin1 latin1_bin char(41)
|
||||
3.0000 mysql user Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Reload_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Shutdown_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Process_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user File_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Show_db_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Super_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Repl_slave_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Repl_client_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_user_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
|
||||
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql user x509_subject blob 65535 65535 NULL NULL blob
|
||||
NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
|
223
mysql-test/suite/funcs_1/r/is_columns_ndb.result
Normal file
223
mysql-test/suite/funcs_1/r/is_columns_ndb.result
Normal file
@ -0,0 +1,223 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
CREATE DATABASE test1;
|
||||
USE test;
|
||||
USE test;
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
|
||||
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
|
||||
drop TABLE if exists t3;
|
||||
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = ndb;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
|
||||
drop database if exists test4;
|
||||
CREATE database test4;
|
||||
use test4;
|
||||
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
|
||||
use test;
|
||||
drop TABLE if exists t7, t8;
|
||||
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = ndb;
|
||||
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = ndb;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
drop TABLE if exists t9;
|
||||
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = ndb;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t1 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t1 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t10 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t10 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t10 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t11 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t11 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t11 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t2 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t2 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t2 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t3 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t3 f2 2 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t4 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t4 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t4 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t7 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t7 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t8 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test t8 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test t9 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test4 t6 f1 1 NULL YES char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references
|
||||
NULL test4 t6 f2 2 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
NULL test4 t6 f5 5 NULL YES char 25 25 NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references
|
||||
NULL test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 char latin1 latin1_swedish_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL date NULL NULL
|
||||
NULL int NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
1.0000 test t1 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t1 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t1 f3 date NULL NULL NULL NULL date
|
||||
NULL test t1 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t1 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t1 f6 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t10 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t10 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t10 f3 date NULL NULL NULL NULL date
|
||||
NULL test t10 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t10 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t10 f6 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t11 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t11 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t11 f3 date NULL NULL NULL NULL date
|
||||
NULL test t11 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t11 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t11 f6 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t2 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t2 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t2 f3 date NULL NULL NULL NULL date
|
||||
NULL test t2 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t2 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t2 f6 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t3 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t3 f2 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
NULL test t3 f3 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t4 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t4 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t4 f3 date NULL NULL NULL NULL date
|
||||
NULL test t4 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t4 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t4 f6 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t7 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t7 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t7 f3 date NULL NULL NULL NULL date
|
||||
NULL test t7 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t8 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test t8 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t8 f3 date NULL NULL NULL NULL date
|
||||
NULL test t8 f4 int NULL NULL NULL NULL int(11)
|
||||
NULL test t9 f1 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test t9 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test t9 f3 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test4 t6 f1 char 20 20 latin1 latin1_swedish_ci char(20)
|
||||
1.0000 test4 t6 f2 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test4 t6 f3 date NULL NULL NULL NULL date
|
||||
NULL test4 t6 f4 int NULL NULL NULL NULL int(11)
|
||||
1.0000 test4 t6 f5 char 25 25 latin1 latin1_swedish_ci char(25)
|
||||
NULL test4 t6 f6 int NULL NULL NULL NULL int(11)
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test4;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
DROP TABLE test.t3;
|
||||
DROP TABLE test.t4;
|
||||
DROP TABLE test.t7;
|
||||
DROP TABLE test.t8;
|
||||
DROP TABLE test.t9;
|
||||
DROP TABLE test.t10;
|
||||
DROP TABLE test.t11;
|
370
mysql-test/suite/funcs_1/r/is_key_column_usage.result
Normal file
370
mysql-test/suite/funcs_1/r/is_key_column_usage.result
Normal file
@ -0,0 +1,370 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'KEY_COLUMN_USAGE';
|
||||
Tables_in_information_schema (KEY_COLUMN_USAGE)
|
||||
KEY_COLUMN_USAGE
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.KEY_COLUMN_USAGE;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.KEY_COLUMN_USAGE;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(10) NO 0
|
||||
POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL
|
||||
REFERENCED_TABLE_SCHEMA varchar(64) YES NULL
|
||||
REFERENCED_TABLE_NAME varchar(64) YES NULL
|
||||
REFERENCED_COLUMN_NAME varchar(64) YES NULL
|
||||
SHOW CREATE TABLE information_schema.KEY_COLUMN_USAGE;
|
||||
Table Create Table
|
||||
KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` (
|
||||
`CONSTRAINT_CATALOG` varchar(512) default NULL,
|
||||
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`CONSTRAINT_NAME` varchar(64) NOT NULL default '',
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`COLUMN_NAME` varchar(64) NOT NULL default '',
|
||||
`ORDINAL_POSITION` bigint(10) NOT NULL default '0',
|
||||
`POSITION_IN_UNIQUE_CONSTRAINT` bigint(10) default NULL,
|
||||
`REFERENCED_TABLE_SCHEMA` varchar(64) default NULL,
|
||||
`REFERENCED_TABLE_NAME` varchar(64) default NULL,
|
||||
`REFERENCED_COLUMN_NAME` varchar(64) default NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(10) NO 0
|
||||
POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL
|
||||
REFERENCED_TABLE_SCHEMA varchar(64) YES NULL
|
||||
REFERENCED_TABLE_NAME varchar(64) YES NULL
|
||||
REFERENCED_COLUMN_NAME varchar(64) YES NULL
|
||||
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
|
||||
table_schema, table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
|
||||
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
|
||||
########################################################################################
|
||||
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information
|
||||
########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
USE db_datadict;
|
||||
CREATE TABLE t1_1
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON t1_1 to 'testuser1'@'localhost';
|
||||
CREATE TABLE t1_2
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON t1_2 to 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
|
||||
# Switch to connection default and close connections testuser1, testuser2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP TABLE t1_1;
|
||||
DROP TABLE t1_2;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
########################################################################################
|
||||
# Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications
|
||||
########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table
|
||||
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_table';
|
||||
CONSTRAINT_CATALOG NULL
|
||||
CONSTRAINT_SCHEMA test
|
||||
CONSTRAINT_NAME PRIMARY
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
COLUMN_NAME f1
|
||||
ORDINAL_POSITION 1
|
||||
POSITION_IN_UNIQUE_CONSTRAINT NULL
|
||||
REFERENCED_TABLE_SCHEMA NULL
|
||||
REFERENCED_TABLE_NAME NULL
|
||||
REFERENCED_COLUMN_NAME NULL
|
||||
CONSTRAINT_CATALOG NULL
|
||||
CONSTRAINT_SCHEMA test
|
||||
CONSTRAINT_NAME PRIMARY
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
COLUMN_NAME f2
|
||||
ORDINAL_POSITION 2
|
||||
POSITION_IN_UNIQUE_CONSTRAINT NULL
|
||||
REFERENCED_TABLE_SCHEMA NULL
|
||||
REFERENCED_TABLE_NAME NULL
|
||||
REFERENCED_COLUMN_NAME NULL
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f1
|
||||
t1_my_tablex f2
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12);
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f2
|
||||
t1_my_tablex first_col
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict f2 db_datadict t1_my_tablex f2 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f2 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX my_idx ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict my_idx db_datadict t1_my_tablex first_col 2
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict my_idx db_datadict t1_my_tablex first_col 2
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DROP COLUMN first_col;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 1
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f2
|
||||
t1_my_tablex f4
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1 AS f1;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1);
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS db_datadict.t1;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
(constraint_schema, constraint_name, table_name)
|
||||
VALUES ( 'mysql', 'primary', 'db');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
SELECT * FROM information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.key_column_usage
|
||||
SET table_name = 'db1' WHERE constraint_name = 'primary';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.key_column_usage WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i3 ON information_schema.key_column_usage(table_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME db_datadict.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME information_schema.xkey_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE db_datadict.t1;
|
||||
DROP DATABASE db_datadict;
|
605
mysql-test/suite/funcs_1/r/is_routines.result
Normal file
605
mysql-test/suite/funcs_1/r/is_routines.result
Normal file
@ -0,0 +1,605 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'ROUTINES';
|
||||
Tables_in_information_schema (ROUTINES)
|
||||
ROUTINES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.ROUTINES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.ROUTINES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.ROUTINES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.ROUTINES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.ROUTINES;
|
||||
Field Type Null Key Default Extra
|
||||
SPECIFIC_NAME varchar(64) NO
|
||||
ROUTINE_CATALOG varchar(512) YES NULL
|
||||
ROUTINE_SCHEMA varchar(64) NO
|
||||
ROUTINE_NAME varchar(64) NO
|
||||
ROUTINE_TYPE varchar(9) NO
|
||||
DTD_IDENTIFIER varchar(64) YES NULL
|
||||
ROUTINE_BODY varchar(8) NO
|
||||
ROUTINE_DEFINITION longtext YES NULL
|
||||
EXTERNAL_NAME varchar(64) YES NULL
|
||||
EXTERNAL_LANGUAGE varchar(64) YES NULL
|
||||
PARAMETER_STYLE varchar(8) NO
|
||||
IS_DETERMINISTIC varchar(3) NO
|
||||
SQL_DATA_ACCESS varchar(64) NO
|
||||
SQL_PATH varchar(64) YES NULL
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE longtext NO NULL
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
DEFINER varchar(77) NO
|
||||
SHOW CREATE TABLE information_schema.ROUTINES;
|
||||
Table Create Table
|
||||
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
|
||||
`SPECIFIC_NAME` varchar(64) NOT NULL default '',
|
||||
`ROUTINE_CATALOG` varchar(512) default NULL,
|
||||
`ROUTINE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`ROUTINE_NAME` varchar(64) NOT NULL default '',
|
||||
`ROUTINE_TYPE` varchar(9) NOT NULL default '',
|
||||
`DTD_IDENTIFIER` varchar(64) default NULL,
|
||||
`ROUTINE_BODY` varchar(8) NOT NULL default '',
|
||||
`ROUTINE_DEFINITION` longtext,
|
||||
`EXTERNAL_NAME` varchar(64) default NULL,
|
||||
`EXTERNAL_LANGUAGE` varchar(64) default NULL,
|
||||
`PARAMETER_STYLE` varchar(8) NOT NULL default '',
|
||||
`IS_DETERMINISTIC` varchar(3) NOT NULL default '',
|
||||
`SQL_DATA_ACCESS` varchar(64) NOT NULL default '',
|
||||
`SQL_PATH` varchar(64) default NULL,
|
||||
`SECURITY_TYPE` varchar(7) NOT NULL default '',
|
||||
`CREATED` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`LAST_ALTERED` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`SQL_MODE` longtext NOT NULL,
|
||||
`ROUTINE_COMMENT` varchar(64) NOT NULL default '',
|
||||
`DEFINER` varchar(77) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.ROUTINES;
|
||||
Field Type Null Key Default Extra
|
||||
SPECIFIC_NAME varchar(64) NO
|
||||
ROUTINE_CATALOG varchar(512) YES NULL
|
||||
ROUTINE_SCHEMA varchar(64) NO
|
||||
ROUTINE_NAME varchar(64) NO
|
||||
ROUTINE_TYPE varchar(9) NO
|
||||
DTD_IDENTIFIER varchar(64) YES NULL
|
||||
ROUTINE_BODY varchar(8) NO
|
||||
ROUTINE_DEFINITION longtext YES NULL
|
||||
EXTERNAL_NAME varchar(64) YES NULL
|
||||
EXTERNAL_LANGUAGE varchar(64) YES NULL
|
||||
PARAMETER_STYLE varchar(8) NO
|
||||
IS_DETERMINISTIC varchar(3) NO
|
||||
SQL_DATA_ACCESS varchar(64) NO
|
||||
SQL_PATH varchar(64) YES NULL
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE longtext NO NULL
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
DEFINER varchar(77) NO
|
||||
USE test;
|
||||
DROP PROCEDURE IF EXISTS sp_for_routines;
|
||||
DROP FUNCTION IF EXISTS function_for_routines;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type,
|
||||
routine_body,external_name,external_language,parameter_style,sql_path
|
||||
FROM information_schema.routines
|
||||
WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL
|
||||
OR external_language IS NOT NULL OR sql_path IS NOT NULL
|
||||
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
|
||||
OR specific_name <> routine_name;
|
||||
specific_name routine_catalog routine_schema routine_name routine_type routine_body external_name external_language parameter_style sql_path
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
################################################################################
|
||||
# Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO res_6_408002_1(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1989-11-09', 0815);
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_1;
|
||||
CREATE PROCEDURE sp_6_408002_1()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END//
|
||||
CREATE DATABASE db_datadict_2;
|
||||
USE db_datadict_2;
|
||||
CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO res_6_408002_2(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1990-10-03', 4711);
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_2;
|
||||
CREATE PROCEDURE sp_6_408002_2()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END//
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2
|
||||
TO 'testuser2'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
|
||||
sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
USE test;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE db_datadict_2;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications
|
||||
#########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER;
|
||||
ALTER FUNCTION function_for_routines COMMENT 'updated comments';
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT updated comments
|
||||
DEFINER root@localhost
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE INVOKER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
use test;
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
#########################################################################
|
||||
# 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for
|
||||
# ROUTINE_DEFINITION column
|
||||
#########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE TABLE db_datadict.res_6_408004_1
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO db_datadict.res_6_408004_1
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
CREATE TABLE db_datadict.res_6_408004_2
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO db_datadict.res_6_408004_2
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
# Checking the max. possible length of (currently) 4 GByte is not
|
||||
# in this environment here.
|
||||
CREATE PROCEDURE sp_6_408004 ()
|
||||
BEGIN
|
||||
DECLARE done INTEGER DEFAULt 0;
|
||||
DECLARE variable_number_1 LONGTEXT;
|
||||
DECLARE variable_number_2 MEDIUMINT;
|
||||
DECLARE variable_number_3 LONGBLOB;
|
||||
DECLARE variable_number_4 REAL;
|
||||
DECLARE variable_number_5 YEAR;
|
||||
DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
BEGIN
|
||||
OPEN cursor_number_1;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_1
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
BEGIN
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_2;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_2
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
SET done = 0;
|
||||
OPEN cursor_number_3;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_3
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_4;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_4
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_5;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_5
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
END//
|
||||
CALL db_datadict.sp_6_408004 ();
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
SELECT * FROM db_datadict.res_6_408004_2;
|
||||
f1 f2 f3 f4 f5
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
SELECT *, LENGTH(routine_definition) FROM information_schema.routines
|
||||
WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME sp_6_408004
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_6_408004
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION BEGIN
|
||||
DECLARE done INTEGER DEFAULt 0;
|
||||
DECLARE variable_number_1 LONGTEXT;
|
||||
DECLARE variable_number_2 MEDIUMINT;
|
||||
DECLARE variable_number_3 LONGBLOB;
|
||||
DECLARE variable_number_4 REAL;
|
||||
DECLARE variable_number_5 YEAR;
|
||||
DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
BEGIN
|
||||
OPEN cursor_number_1;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_1
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
BEGIN
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_2;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_2
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
SET done = 0;
|
||||
OPEN cursor_number_3;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_3
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_4;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_4
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_5;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_5
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
END
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED YYYY-MM-DD hh:mm:ss
|
||||
LAST_ALTERED YYYY-MM-DD hh:mm:ss
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
LENGTH(routine_definition) 2549
|
||||
DROP DATABASE db_datadict;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
USE test;
|
||||
INSERT INTO information_schema.routines (routine_name, routine_type )
|
||||
VALUES ('p2', 'procedure');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.routines SET routine_name = 'p2'
|
||||
WHERE routine_body = 'sql';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i7 ON information_schema.routines (routine_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines DISCARD TABLESPACE;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines RENAME db_datadict.routines;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines RENAME information_schema.xroutines;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
304
mysql-test/suite/funcs_1/r/is_schema_privileges.result
Normal file
304
mysql-test/suite/funcs_1/r/is_schema_privileges.result
Normal file
@ -0,0 +1,304 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'SCHEMA_PRIVILEGES';
|
||||
Tables_in_information_schema (SCHEMA_PRIVILEGES)
|
||||
SCHEMA_PRIVILEGES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMA_PRIVILEGES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMA_PRIVILEGES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.SCHEMA_PRIVILEGES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.SCHEMA_PRIVILEGES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.15.1: INFORMATION_SCHEMA.SCHEMA_PRIVILEGES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.SCHEMA_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SHOW CREATE TABLE information_schema.SCHEMA_PRIVILEGES;
|
||||
Table Create Table
|
||||
SCHEMA_PRIVILEGES CREATE TEMPORARY TABLE `SCHEMA_PRIVILEGES` (
|
||||
`GRANTEE` varchar(81) NOT NULL default '',
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`PRIVILEGE_TYPE` varchar(64) NOT NULL default '',
|
||||
`IS_GRANTABLE` varchar(3) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.SCHEMA_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SELECT GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, PRIVILEGE_TYPE
|
||||
FROM information_schema.schema_privileges WHERE table_catalog IS NOT NULL;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE
|
||||
###############################################################################
|
||||
# Testcase 3.2.15.2-3.2.15.4 INFORMATION_SCHEMA.SCHEMA_PRIVILEGES accessibility
|
||||
###############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict_1;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
DROP DATABASE IF EXISTS db_datadict_3;
|
||||
CREATE DATABASE db_datadict_1;
|
||||
CREATE DATABASE db_datadict_2;
|
||||
CREATE DATABASE db_datadict_3;
|
||||
CREATE TABLE db_datadict_2.t1(f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = MEMORY;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
GRANT INSERT ON db_datadict_1.* TO 'testuser1'@'localhost';
|
||||
GRANT INSERT ON db_datadict_2.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict_4.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
GRANT SELECT ON db_datadict_3.* TO 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* TO 'testuser2'@'localhost';
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
GRANT SELECT ON db_datadict_4.* TO 'testuser2'@'localhost';
|
||||
# Root granted INSERT db_datadict_1 to me -> visible
|
||||
# Root granted SELECT db_datadict_1 to testuser2 -> invisible
|
||||
# Root granted INSERT db_datadict_2.t1 (no schema-level priv!)
|
||||
# but not db_datadict_2 to me -> invisible
|
||||
# Root granted SELECT db_datadict_3. to testuser2 but not to me -> invisible
|
||||
# Root granted SELECT db_datadict_4. to me -> visible
|
||||
# I granted SELECT db_datadict_4. to testuser2 -> invisible (reality), visible(requirement)
|
||||
# FIXME
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict_1 INSERT NO
|
||||
'testuser1'@'localhost' NULL db_datadict_4 SELECT YES
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
# Root granted SELECT db_datadict_1 to me -> visible
|
||||
# Root granted INSERT db_datadict_1 to testuser1 -> invisible
|
||||
# Root granted INSERT db_datadict_2.t1 but not db_datadict_1 to testuser1 -> invisible
|
||||
# Root granted SELECT db_datadict_3. to me -> visible
|
||||
# testuser1 granted SELECT db_datadict_4. to me -> visible
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser2'@'localhost' NULL db_datadict_1 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict_3 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict_4 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
|
||||
# Switch to connection default and close connections testuser1 and testuser2
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict_1 INSERT NO
|
||||
'testuser1'@'localhost' NULL db_datadict_4 SELECT YES
|
||||
'testuser2'@'localhost' NULL db_datadict_1 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict_3 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict_4 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT INSERT ON `db_datadict_1`.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
|
||||
GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP DATABASE db_datadict_1;
|
||||
DROP DATABASE db_datadict_2;
|
||||
DROP DATABASE db_datadict_3;
|
||||
################################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMA_PRIVILEGES modifications
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'the_user'@'localhost';
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT ON test.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
# Switch to connection default
|
||||
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE NO
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE NO
|
||||
# Switch to connection default
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE NO
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT NO
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE NO
|
||||
# Switch to connection default
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE YES
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE YES
|
||||
# Switch to connection default
|
||||
DROP SCHEMA db_datadict;
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE YES
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
'testuser1'@'localhost' NULL db_datadict UPDATE YES
|
||||
# Switch to connection default
|
||||
REVOKE UPDATE ON db_datadict.* FROM 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict SELECT YES
|
||||
# Switch to connection default
|
||||
RENAME USER 'testuser1'@'localhost' TO 'the_user'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'the_user'@'localhost' NULL db_datadict SELECT YES
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'the_user'@'localhost' NULL db_datadict SELECT YES
|
||||
# Close connection testuser1
|
||||
# Establish connection the_user (user=the_user)
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'the_user'@'localhost' NULL db_datadict SELECT YES
|
||||
# Close connection the_user
|
||||
# Switch to connection default
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'the_user'@'localhost' NULL db_datadict SELECT YES
|
||||
DROP USER 'the_user'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY grantee,table_schema,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, f2 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
INSERT INTO information_schema.schema_privileges
|
||||
SELECT * FROM information_schema.schema_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.schema_privileges SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.schema_privileges
|
||||
WHERE table_schema = 'db_datadict';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.schema_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_tables
|
||||
ON information_schema.schema_privileges(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schema_privileges ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.schema_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schema_privileges
|
||||
RENAME db_datadict.schema_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schema_privileges
|
||||
RENAME information_schema.xschema_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
@ -0,0 +1,51 @@
|
||||
##############################################################################
|
||||
# Testcases 3.2.9.2+3.2.9.3 INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
##############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema IN ('information_schema','mysql','test')
|
||||
ORDER BY grantee, table_schema, privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
''@'%' NULL test ALTER NO
|
||||
''@'%' NULL test CREATE NO
|
||||
''@'%' NULL test CREATE ROUTINE NO
|
||||
''@'%' NULL test CREATE TEMPORARY TABLES NO
|
||||
''@'%' NULL test CREATE VIEW NO
|
||||
''@'%' NULL test DELETE NO
|
||||
''@'%' NULL test DROP NO
|
||||
''@'%' NULL test INDEX NO
|
||||
''@'%' NULL test INSERT NO
|
||||
''@'%' NULL test LOCK TABLES NO
|
||||
''@'%' NULL test REFERENCES NO
|
||||
''@'%' NULL test SELECT NO
|
||||
''@'%' NULL test SHOW VIEW NO
|
||||
''@'%' NULL test UPDATE NO
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
mysql
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.schema_privileges
|
||||
WHERE table_schema IN ('information_schema','mysql','test')
|
||||
ORDER BY grantee, table_schema, privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
181
mysql-test/suite/funcs_1/r/is_schemata.result
Normal file
181
mysql-test/suite/funcs_1/r/is_schemata.result
Normal file
@ -0,0 +1,181 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'SCHEMATA';
|
||||
Tables_in_information_schema (SCHEMATA)
|
||||
SCHEMATA
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMATA;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMATA;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.SCHEMATA;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.SCHEMATA;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout;
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.SCHEMATA;
|
||||
Field Type Null Key Default Extra
|
||||
CATALOG_NAME varchar(512) YES NULL
|
||||
SCHEMA_NAME varchar(64) NO
|
||||
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATION_NAME varchar(64) NO
|
||||
SQL_PATH varchar(512) YES NULL
|
||||
SHOW CREATE TABLE information_schema.SCHEMATA;
|
||||
Table Create Table
|
||||
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
|
||||
`CATALOG_NAME` varchar(512) default NULL,
|
||||
`SCHEMA_NAME` varchar(64) NOT NULL default '',
|
||||
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL default '',
|
||||
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL default '',
|
||||
`SQL_PATH` varchar(512) default NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.SCHEMATA;
|
||||
Field Type Null Key Default Extra
|
||||
CATALOG_NAME varchar(512) YES NULL
|
||||
SCHEMA_NAME varchar(64) NO
|
||||
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATION_NAME varchar(64) NO
|
||||
SQL_PATH varchar(512) YES NULL
|
||||
SELECT catalog_name, schema_name, sql_path
|
||||
FROM information_schema.schemata
|
||||
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
|
||||
catalog_name schema_name sql_path
|
||||
###############################################################################
|
||||
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
###############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict_1;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
CREATE DATABASE db_datadict_1;
|
||||
CREATE DATABASE db_datadict_2;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict_1;
|
||||
DROP DATABASE db_datadict_2;
|
||||
#################################################################################
|
||||
# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications
|
||||
#################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict latin1 latin1_swedish_ci NULL
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name default_character_set_name
|
||||
db_datadict latin1
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'utf8';
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name default_character_set_name
|
||||
db_datadict utf8
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'latin1';
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
schema_name default_collation_name
|
||||
db_datadict latin1_swedish_ci
|
||||
ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs';
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
schema_name default_collation_name
|
||||
db_datadict latin1_general_cs
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name
|
||||
db_datadict
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
INSERT INTO information_schema.schemata
|
||||
(catalog_name, schema_name, default_character_set_name, sql_path)
|
||||
VALUES (NULL, 'db1', 'latin1', NULL);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.schemata
|
||||
SELECT * FROM information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.schemata
|
||||
SET default_character_set_name = 'utf8'
|
||||
WHERE schema_name = 'db_datadict';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.schemata SET catalog_name = 't_4711';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i1 ON information_schema.schemata(schema_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata RENAME information_schema.xschemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
42
mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
Normal file
42
mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
Normal file
@ -0,0 +1,42 @@
|
||||
#################################################################################
|
||||
# Testcases 3.2.9.2 + 3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
#################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name IN ('information_schema','mysql','test')
|
||||
ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL information_schema utf8 utf8_general_ci NULL
|
||||
NULL mysql latin1 latin1_swedish_ci NULL
|
||||
NULL test latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
mysql
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name IN ('information_schema','mysql','test')
|
||||
ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL information_schema utf8 utf8_general_ci NULL
|
||||
NULL test latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'information_schema';
|
||||
Database (information_schema)
|
||||
information_schema
|
||||
SHOW DATABASES LIKE 'mysql';
|
||||
Database (mysql)
|
||||
SHOW DATABASES LIKE 'test';
|
||||
Database (test)
|
||||
test
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
352
mysql-test/suite/funcs_1/r/is_statistics.result
Normal file
352
mysql-test/suite/funcs_1/r/is_statistics.result
Normal file
@ -0,0 +1,352 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'STATISTICS';
|
||||
Tables_in_information_schema (STATISTICS)
|
||||
STATISTICS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.STATISTICS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.STATISTICS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.STATISTICS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.STATISTICS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.14.1: INFORMATION_SCHEMA.STATISTICS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.STATISTICS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
NON_UNIQUE bigint(1) NO 0
|
||||
INDEX_SCHEMA varchar(64) NO
|
||||
INDEX_NAME varchar(64) NO
|
||||
SEQ_IN_INDEX bigint(2) NO 0
|
||||
COLUMN_NAME varchar(64) NO
|
||||
COLLATION varchar(1) YES NULL
|
||||
CARDINALITY bigint(21) YES NULL
|
||||
SUB_PART bigint(3) YES NULL
|
||||
PACKED varchar(10) YES NULL
|
||||
NULLABLE varchar(3) NO
|
||||
INDEX_TYPE varchar(16) NO
|
||||
COMMENT varchar(16) YES NULL
|
||||
SHOW CREATE TABLE information_schema.STATISTICS;
|
||||
Table Create Table
|
||||
STATISTICS CREATE TEMPORARY TABLE `STATISTICS` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`NON_UNIQUE` bigint(1) NOT NULL default '0',
|
||||
`INDEX_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`INDEX_NAME` varchar(64) NOT NULL default '',
|
||||
`SEQ_IN_INDEX` bigint(2) NOT NULL default '0',
|
||||
`COLUMN_NAME` varchar(64) NOT NULL default '',
|
||||
`COLLATION` varchar(1) default NULL,
|
||||
`CARDINALITY` bigint(21) default NULL,
|
||||
`SUB_PART` bigint(3) default NULL,
|
||||
`PACKED` varchar(10) default NULL,
|
||||
`NULLABLE` varchar(3) NOT NULL default '',
|
||||
`INDEX_TYPE` varchar(16) NOT NULL default '',
|
||||
`COMMENT` varchar(16) default NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.STATISTICS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
NON_UNIQUE bigint(1) NO 0
|
||||
INDEX_SCHEMA varchar(64) NO
|
||||
INDEX_NAME varchar(64) NO
|
||||
SEQ_IN_INDEX bigint(2) NO 0
|
||||
COLUMN_NAME varchar(64) NO
|
||||
COLLATION varchar(1) YES NULL
|
||||
CARDINALITY bigint(21) YES NULL
|
||||
SUB_PART bigint(3) YES NULL
|
||||
PACKED varchar(10) YES NULL
|
||||
NULLABLE varchar(3) NO
|
||||
INDEX_TYPE varchar(16) NO
|
||||
COMMENT varchar(16) YES NULL
|
||||
SELECT table_catalog, table_schema, table_name, index_schema, index_name
|
||||
FROM information_schema.statistics WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name index_schema index_name
|
||||
####################################################################################
|
||||
# Testcase 3.2.14.2 + 3.2.14.3: INFORMATION_SCHEMA.STATISTICS accessible information
|
||||
####################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE DATABASE db_datadict_2;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
CREATE TABLE db_datadict.t1
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TABLE db_datadict.t2
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TABLE db_datadict_2.t3
|
||||
(f1 INT NOT NULL, f2 INT, f5 DATE,
|
||||
PRIMARY KEY(f1), INDEX f2f1_ind(f2,f1), UNIQUE(f5))
|
||||
ENGINE = MEMORY;
|
||||
CREATE TABLE db_datadict_2.t4
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1), f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = MEMORY;
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
# Switch to connection default
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict t2 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict t2 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t4 1 db_datadict_2 f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t4 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL db_datadict t1 1 db_datadict f2_ind 1 f2 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict t1 0 db_datadict PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
|
||||
# Switch to connection testuser2
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
# Switch to connection default
|
||||
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema LIKE 'db_datadict%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 1 f2 NULL NULL NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 1 db_datadict_2 f2f1_ind 2 f1 NULL 0 NULL NULL HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 f5 1 f5 NULL 0 NULL NULL YES HASH
|
||||
NULL db_datadict_2 t3 0 db_datadict_2 PRIMARY 1 f1 NULL 0 NULL NULL HASH
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
|
||||
# Switch to connection default and close connections testuser1, testuser2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE db_datadict_2;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.STATISTICS modifications
|
||||
#########################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE test.t1_1 (f1 BIGINT,
|
||||
f2 TEXT, f2x TEXT, f3 CHAR(10), f3x CHAR(10), f4 BIGINT, f4x BIGINT,
|
||||
f5 POINT, f5x POINT NOT NULL)
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <other_engine_type>;
|
||||
CREATE TABLE test.t1_2 (f1 BIGINT, f2 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
SELECT table_name FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name
|
||||
ALTER TABLE test.t1_1 ADD PRIMARY KEY (f1,f3);
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL test t1_1 0 test PRIMARY 1 f1 A NULL NULL NULL BTREE
|
||||
NULL test t1_1 0 test PRIMARY 2 f3 A 0 NULL NULL BTREE
|
||||
ALTER TABLE test.t1_1 DROP PRIMARY KEY;
|
||||
SELECT table_name FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name
|
||||
ALTER TABLE test.t1_1 ADD PRIMARY KEY (f1);
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL test t1_1 0 test PRIMARY 1 f1 A 0 NULL NULL BTREE
|
||||
ALTER TABLE test.t1_1 ADD INDEX (f4);
|
||||
CREATE INDEX f3_f1 ON test.t1_1 (f3,f1);
|
||||
CREATE UNIQUE INDEX f4x_uni ON test.t1_1 (f4x);
|
||||
CREATE INDEX f2_hash USING HASH ON test.t1_2 (f2);
|
||||
CREATE INDEX f1_idx ON test.t1_2 (f1) COMMENT = 'COMMENT';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COMMENT = 'COMMENT'' at line 1
|
||||
CREATE INDEX not_null ON test.t1_1 (f3x);
|
||||
CREATE INDEX f2_prefix ON test.t1_1 (f2(20));
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_%' AND index_name <> 'PRIMARY'
|
||||
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL test t1_1 1 test f2_prefix 1 f2 A NULL 20 NULL YES BTREE
|
||||
NULL test t1_1 1 test f3_f1 1 f3 A NULL NULL NULL BTREE
|
||||
NULL test t1_1 1 test f3_f1 2 f1 A NULL NULL NULL BTREE
|
||||
NULL test t1_1 1 test f4 1 f4 A NULL NULL NULL YES BTREE
|
||||
NULL test t1_1 0 test f4x_uni 1 f4x A NULL NULL NULL YES BTREE
|
||||
NULL test t1_1 1 test not_null 1 f3x A NULL NULL NULL YES BTREE
|
||||
NULL test t1_2 1 test f2_hash 1 f2 NULL 0 NULL NULL YES HASH
|
||||
DROP TABLE test.t1_2;
|
||||
SELECT DISTINCT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1';
|
||||
table_name
|
||||
t1_1
|
||||
RENAME TABLE test.t1_1 TO test.t1_1x;
|
||||
SELECT DISTINCT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
table_name
|
||||
t1_1x
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_1%';
|
||||
table_schema table_name
|
||||
test t1_1x
|
||||
RENAME TABLE test.t1_1x TO db_datadict.t1_1x;
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.statistics
|
||||
WHERE table_name LIKE 't1_1%';
|
||||
table_schema table_name
|
||||
db_datadict t1_1x
|
||||
SELECT DISTINCT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
table_name
|
||||
t1_1x
|
||||
DROP TABLE db_datadict.t1_1x;
|
||||
SELECT DISTINCT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
table_name
|
||||
CREATE TEMPORARY TABLE test.t1_1x (PRIMARY KEY(f1,f2))
|
||||
ENGINE = <engine_type>
|
||||
AS SELECT 1 AS f1, 2 AS f2;
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
DROP TEMPORARY TABLE test.t1_1x;
|
||||
CREATE TABLE db_datadict.t1_1x (PRIMARY KEY(f1))
|
||||
ENGINE = <engine_type>
|
||||
AS SELECT 1 AS f1, 2 AS f2;
|
||||
SELECT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
table_name
|
||||
t1_1x
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.statistics
|
||||
WHERE table_name = 't1_1x';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.statistics
|
||||
SELECT * FROM information_schema.statistics;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.statistics SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.statistics WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.statistics;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_statistics
|
||||
ON information_schema.statistics(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.statistics DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.statistics ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.statistics;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.statistics RENAME db_datadict.statistics;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.statistics RENAME information_schema.xstatistics;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
17
mysql-test/suite/funcs_1/r/is_statistics_is.result
Normal file
17
mysql-test/suite/funcs_1/r/is_statistics_is.result
Normal file
@ -0,0 +1,17 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'information_schema'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'information_schema'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
60
mysql-test/suite/funcs_1/r/is_statistics_mysql.result
Normal file
60
mysql-test/suite/funcs_1/r/is_statistics_mysql.result
Normal file
@ -0,0 +1,60 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
310
mysql-test/suite/funcs_1/r/is_table_constraints.result
Normal file
310
mysql-test/suite/funcs_1/r/is_table_constraints.result
Normal file
@ -0,0 +1,310 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'TABLE_CONSTRAINTS';
|
||||
Tables_in_information_schema (TABLE_CONSTRAINTS)
|
||||
TABLE_CONSTRAINTS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TABLE_CONSTRAINTS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TABLE_CONSTRAINTS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TABLE_CONSTRAINTS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TABLE_CONSTRAINTS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.10.1: INFORMATION_SCHEMA.TABLE_CONSTRAINTS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TABLE_CONSTRAINTS;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
CONSTRAINT_TYPE varchar(64) NO
|
||||
SHOW CREATE TABLE information_schema.TABLE_CONSTRAINTS;
|
||||
Table Create Table
|
||||
TABLE_CONSTRAINTS CREATE TEMPORARY TABLE `TABLE_CONSTRAINTS` (
|
||||
`CONSTRAINT_CATALOG` varchar(512) default NULL,
|
||||
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`CONSTRAINT_NAME` varchar(64) NOT NULL default '',
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`CONSTRAINT_TYPE` varchar(64) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TABLE_CONSTRAINTS;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
CONSTRAINT_TYPE varchar(64) NO
|
||||
SELECT constraint_catalog, constraint_schema, constraint_name,
|
||||
table_schema, table_name
|
||||
FROM information_schema.table_constraints
|
||||
WHERE constraint_catalog IS NOT NULL;
|
||||
constraint_catalog constraint_schema constraint_name table_schema table_name
|
||||
#########################################################################################
|
||||
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.TABLE_CONSTRAINTS accessible information
|
||||
#########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, f2 BIGINT, f3 BIGINT, f4 BIGINT,
|
||||
f5 BIGINT, f6 BIGINT, PRIMARY KEY (f1,f2))
|
||||
ENGINE = <some_engine_type>;
|
||||
CREATE UNIQUE INDEX my_idx1 ON db_datadict.t1(f6,f1);
|
||||
CREATE UNIQUE INDEX my_idx2 ON db_datadict.t1(f3);
|
||||
CREATE TABLE db_datadict.t2 (f1 BIGINT, f2 BIGINT, f3 BIGINT, f4 BIGINT,
|
||||
f5 BIGINT, f6 BIGINT, PRIMARY KEY (f1,f2))
|
||||
ENGINE = <some_engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT(f5) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL db_datadict my_idx1 db_datadict t1 UNIQUE
|
||||
NULL db_datadict my_idx2 db_datadict t1 UNIQUE
|
||||
NULL db_datadict PRIMARY db_datadict t1 PRIMARY KEY
|
||||
NULL db_datadict PRIMARY db_datadict t2 PRIMARY KEY
|
||||
SHOW INDEXES FROM db_datadict.t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
|
||||
t1 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx1 1 f6 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx1 2 f1 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx2 1 f3 ### ### ### ### ### ### ###
|
||||
SHOW INDEXES FROM db_datadict.t2;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t2 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
|
||||
t2 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT (f5) ON `db_datadict`.`t1` TO 'testuser1'@'localhost'
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'db_datadict'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL db_datadict my_idx1 db_datadict t1 UNIQUE
|
||||
NULL db_datadict my_idx2 db_datadict t1 UNIQUE
|
||||
NULL db_datadict PRIMARY db_datadict t1 PRIMARY KEY
|
||||
SHOW INDEXES FROM db_datadict.t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
|
||||
t1 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx1 1 f6 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx1 2 f1 ### ### ### ### ### ### ###
|
||||
t1 0 my_idx2 1 f3 ### ### ### ### ### ### ###
|
||||
SHOW INDEXES FROM db_datadict.t2;
|
||||
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 't2'
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################################
|
||||
# Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLE_CONSTRAINTS modifications
|
||||
#########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table
|
||||
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
SELECT constraint_name, table_schema, table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_table';
|
||||
constraint_name table_schema table_name constraint_type
|
||||
PRIMARY test t1_my_table PRIMARY KEY
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_schema,table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT table_schema,table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict f2 db_datadict t1_my_tablex UNIQUE
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,f1);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict my_idx db_datadict t1_my_tablex UNIQUE
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
DROP INDEX my_idx ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict my_idx db_datadict t1_my_tablex UNIQUE
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict my_idx db_datadict t1_my_tablex UNIQUE
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DROP COLUMN f2;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, constraint_type
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_schema,table_name, constraint_name;
|
||||
constraint_schema constraint_name table_schema table_name constraint_type
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex PRIMARY KEY
|
||||
SELECT table_name
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name
|
||||
FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1 AS f1;
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1);
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.table_constraints
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS db_datadict.t1;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, UNIQUE(f1))
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.table_constraints
|
||||
(constraint_schema, constraint_name, table_name)
|
||||
VALUES ( 'mysql', 'primary', 'db');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.table_constraints
|
||||
SELECT * FROM information_schema.table_constraints;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.table_constraints
|
||||
SET table_name = 'db1' WHERE constraint_name = 'primary';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.table_constraints WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.table_constraints;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i3 ON information_schema.table_constraints(table_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_constraints ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.table_constraints;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_constraints
|
||||
RENAME db_datadict.table_constraints;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_constraints
|
||||
RENAME information_schema.xtable_constraints;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE db_datadict.t1;
|
||||
DROP DATABASE db_datadict;
|
17
mysql-test/suite/funcs_1/r/is_table_constraints_is.result
Normal file
17
mysql-test/suite/funcs_1/r/is_table_constraints_is.result
Normal file
@ -0,0 +1,17 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'information_schema'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'information_schema'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
37
mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
Normal file
37
mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
Normal file
@ -0,0 +1,37 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql db PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql func PRIMARY KEY
|
||||
NULL mysql name mysql help_category UNIQUE
|
||||
NULL mysql PRIMARY mysql help_category PRIMARY KEY
|
||||
NULL mysql name mysql help_keyword UNIQUE
|
||||
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
|
||||
NULL mysql name mysql help_topic UNIQUE
|
||||
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql host PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql proc PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql user PRIMARY KEY
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
332
mysql-test/suite/funcs_1/r/is_table_privileges.result
Normal file
332
mysql-test/suite/funcs_1/r/is_table_privileges.result
Normal file
@ -0,0 +1,332 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'TABLE_PRIVILEGES';
|
||||
Tables_in_information_schema (TABLE_PRIVILEGES)
|
||||
TABLE_PRIVILEGES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TABLE_PRIVILEGES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TABLE_PRIVILEGES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TABLE_PRIVILEGES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TABLE_PRIVILEGES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.11.1: INFORMATION_SCHEMA.TABLE_PRIVILEGES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TABLE_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SHOW CREATE TABLE information_schema.TABLE_PRIVILEGES;
|
||||
Table Create Table
|
||||
TABLE_PRIVILEGES CREATE TEMPORARY TABLE `TABLE_PRIVILEGES` (
|
||||
`GRANTEE` varchar(81) NOT NULL default '',
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`PRIVILEGE_TYPE` varchar(64) NOT NULL default '',
|
||||
`IS_GRANTABLE` varchar(3) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TABLE_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SELECT table_catalog, table_schema, table_name, privilege_type
|
||||
FROM information_schema.table_privileges WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name privilege_type
|
||||
######################################################################
|
||||
# Testcase 3.2.11.2+3.2.11.3+3.2.11.4:
|
||||
# INFORMATION_SCHEMA.TABLE_PRIVILEGES accessible information
|
||||
######################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.tb1(f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT CREATE, SELECT ON db_datadict.*
|
||||
TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
CREATE TABLE tb3 (f1 TEXT)
|
||||
ENGINE = <other_engine_type>;
|
||||
GRANT SELECT ON db_datadict.tb3 TO 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 'tb%'
|
||||
ORDER BY grantee,table_schema,table_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict tb1 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
|
||||
# Establish connection testuser2 (user=testuser3)
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 'tb%'
|
||||
ORDER BY grantee,table_schema,table_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 ALTER YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 CREATE YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 CREATE VIEW YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 DELETE YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 DROP YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 INDEX YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 INSERT YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 REFERENCES YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 SELECT YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 SHOW VIEW YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 UPDATE YES
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 'tb%'
|
||||
ORDER BY grantee,table_schema,table_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL db_datadict tb3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser3'@'localhost';
|
||||
Grants for testuser3@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
|
||||
# Switch to connection default and close the other connections
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 'tb%'
|
||||
ORDER BY grantee,table_schema,table_name,privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL db_datadict tb1 SELECT NO
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 ALTER YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 CREATE YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 CREATE VIEW YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 DELETE YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 DROP YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 INDEX YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 INSERT YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 REFERENCES YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 SELECT YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 SHOW VIEW YES
|
||||
'testuser2'@'localhost' NULL db_datadict tb1 UPDATE YES
|
||||
'testuser3'@'localhost' NULL db_datadict tb3 SELECT NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
|
||||
SHOW GRANTS FOR 'testuser3'@'localhost';
|
||||
Grants for testuser3@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
################################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLE_PRIVILEGES modifications
|
||||
################################################################################
|
||||
DROP TABLE IF EXISTS test.t1_table;
|
||||
DROP VIEW IF EXISTS test.t1_view;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE test.t1_table (f1 BIGINT)
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
COMMENT = 'Initial Comment' ENGINE = <engine_type>;
|
||||
CREATE VIEW test.t1_view AS SELECT 1;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'the_user'@'localhost';
|
||||
SELECT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name
|
||||
GRANT ALL ON test.t1_table TO 'testuser1'@'localhost';
|
||||
GRANT ALL ON test.t1_view TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY grantee, table_schema, table_name, privilege_type;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL test t1_table ALTER NO
|
||||
'testuser1'@'localhost' NULL test t1_table CREATE NO
|
||||
'testuser1'@'localhost' NULL test t1_table CREATE VIEW NO
|
||||
'testuser1'@'localhost' NULL test t1_table DELETE NO
|
||||
'testuser1'@'localhost' NULL test t1_table DROP NO
|
||||
'testuser1'@'localhost' NULL test t1_table INDEX NO
|
||||
'testuser1'@'localhost' NULL test t1_table INSERT NO
|
||||
'testuser1'@'localhost' NULL test t1_table REFERENCES NO
|
||||
'testuser1'@'localhost' NULL test t1_table SELECT NO
|
||||
'testuser1'@'localhost' NULL test t1_table SHOW VIEW NO
|
||||
'testuser1'@'localhost' NULL test t1_table UPDATE NO
|
||||
'testuser1'@'localhost' NULL test t1_view ALTER NO
|
||||
'testuser1'@'localhost' NULL test t1_view CREATE NO
|
||||
'testuser1'@'localhost' NULL test t1_view CREATE VIEW NO
|
||||
'testuser1'@'localhost' NULL test t1_view DELETE NO
|
||||
'testuser1'@'localhost' NULL test t1_view DROP NO
|
||||
'testuser1'@'localhost' NULL test t1_view INDEX NO
|
||||
'testuser1'@'localhost' NULL test t1_view INSERT NO
|
||||
'testuser1'@'localhost' NULL test t1_view REFERENCES NO
|
||||
'testuser1'@'localhost' NULL test t1_view SELECT NO
|
||||
'testuser1'@'localhost' NULL test t1_view SHOW VIEW NO
|
||||
'testuser1'@'localhost' NULL test t1_view UPDATE NO
|
||||
SELECT DISTINCT grantee, table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY grantee, table_name;
|
||||
grantee table_name
|
||||
'testuser1'@'localhost' t1_table
|
||||
'testuser1'@'localhost' t1_view
|
||||
RENAME USER 'testuser1'@'localhost' TO 'the_user'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
SELECT DISTINCT grantee, table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY grantee, table_name;
|
||||
grantee table_name
|
||||
'the_user'@'localhost' t1_table
|
||||
'the_user'@'localhost' t1_view
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
|
||||
SHOW GRANTS FOR 'the_user'@'localhost';
|
||||
Grants for the_user@localhost
|
||||
GRANT USAGE ON *.* TO 'the_user'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
test t1_table
|
||||
test t1_view
|
||||
RENAME TABLE test.t1_table TO db_datadict.t1_table;
|
||||
RENAME TABLE test.t1_view TO db_datadict.t1_view;
|
||||
ERROR HY000: Changing schema from 'test' to 'db_datadict' is not allowed.
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
test t1_table
|
||||
test t1_view
|
||||
SHOW GRANTS FOR 'the_user'@'localhost';
|
||||
Grants for the_user@localhost
|
||||
GRANT USAGE ON *.* TO 'the_user'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.`t1_view` TO 'the_user'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `test`.`t1_table` TO 'the_user'@'localhost'
|
||||
REVOKE ALL PRIVILEGES ON test.t1_table FROM 'the_user'@'localhost';
|
||||
REVOKE ALL PRIVILEGES ON test.t1_view FROM 'the_user'@'localhost';
|
||||
DROP VIEW test.t1_view;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT 1;
|
||||
GRANT ALL ON db_datadict.t1_table TO 'the_user'@'localhost';
|
||||
GRANT ALL ON db_datadict.t1_view TO 'the_user'@'localhost';
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
RENAME TABLE db_datadict.t1_table TO db_datadict.t1_tablex;
|
||||
RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx;
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
RENAME TABLE db_datadict.t1_tablex TO db_datadict.t1_table;
|
||||
RENAME TABLE db_datadict.t1_viewx TO db_datadict.t1_view;
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
DROP TABLE db_datadict.t1_table;
|
||||
DROP VIEW db_datadict.t1_view;
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
CREATE TABLE db_datadict.t1_table
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT 1;
|
||||
GRANT ALL ON db_datadict.t1_table TO 'the_user'@'localhost';
|
||||
GRANT ALL ON db_datadict.t1_view TO 'the_user'@'localhost';
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT DISTINCT table_name FROM information_schema.table_privileges
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_table
|
||||
t1_view
|
||||
DROP USER 'the_user'@'localhost';
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT, f2 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT SELECT (f1) ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
INSERT INTO information_schema.table_privileges
|
||||
SELECT * FROM information_schema.table_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.table_privileges SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.table_privileges WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.table_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_tables
|
||||
ON information_schema.table_privileges(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_privileges ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.table_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_privileges
|
||||
RENAME db_datadict.table_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.table_privileges
|
||||
RENAME information_schema.xtable_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
419
mysql-test/suite/funcs_1/r/is_tables.result
Normal file
419
mysql-test/suite/funcs_1/r/is_tables.result
Normal file
@ -0,0 +1,419 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'TABLES';
|
||||
Tables_in_information_schema (TABLES)
|
||||
TABLES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TABLES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TABLES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TABLES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TABLES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TABLES;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
TABLE_TYPE varchar(64) NO
|
||||
ENGINE varchar(64) YES NULL
|
||||
VERSION bigint(21) YES NULL
|
||||
ROW_FORMAT varchar(10) YES NULL
|
||||
TABLE_ROWS bigint(21) YES NULL
|
||||
AVG_ROW_LENGTH bigint(21) YES NULL
|
||||
DATA_LENGTH bigint(21) YES NULL
|
||||
MAX_DATA_LENGTH bigint(21) YES NULL
|
||||
INDEX_LENGTH bigint(21) YES NULL
|
||||
DATA_FREE bigint(21) YES NULL
|
||||
AUTO_INCREMENT bigint(21) YES NULL
|
||||
CREATE_TIME datetime YES NULL
|
||||
UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(64) YES NULL
|
||||
CHECKSUM bigint(21) YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
TABLE_COMMENT varchar(80) NO
|
||||
SHOW CREATE TABLE information_schema.TABLES;
|
||||
Table Create Table
|
||||
TABLES CREATE TEMPORARY TABLE `TABLES` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`TABLE_TYPE` varchar(64) NOT NULL default '',
|
||||
`ENGINE` varchar(64) default NULL,
|
||||
`VERSION` bigint(21) default NULL,
|
||||
`ROW_FORMAT` varchar(10) default NULL,
|
||||
`TABLE_ROWS` bigint(21) default NULL,
|
||||
`AVG_ROW_LENGTH` bigint(21) default NULL,
|
||||
`DATA_LENGTH` bigint(21) default NULL,
|
||||
`MAX_DATA_LENGTH` bigint(21) default NULL,
|
||||
`INDEX_LENGTH` bigint(21) default NULL,
|
||||
`DATA_FREE` bigint(21) default NULL,
|
||||
`AUTO_INCREMENT` bigint(21) default NULL,
|
||||
`CREATE_TIME` datetime default NULL,
|
||||
`UPDATE_TIME` datetime default NULL,
|
||||
`CHECK_TIME` datetime default NULL,
|
||||
`TABLE_COLLATION` varchar(64) default NULL,
|
||||
`CHECKSUM` bigint(21) default NULL,
|
||||
`CREATE_OPTIONS` varchar(255) default NULL,
|
||||
`TABLE_COMMENT` varchar(80) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TABLES;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
TABLE_TYPE varchar(64) NO
|
||||
ENGINE varchar(64) YES NULL
|
||||
VERSION bigint(21) YES NULL
|
||||
ROW_FORMAT varchar(10) YES NULL
|
||||
TABLE_ROWS bigint(21) YES NULL
|
||||
AVG_ROW_LENGTH bigint(21) YES NULL
|
||||
DATA_LENGTH bigint(21) YES NULL
|
||||
MAX_DATA_LENGTH bigint(21) YES NULL
|
||||
INDEX_LENGTH bigint(21) YES NULL
|
||||
DATA_FREE bigint(21) YES NULL
|
||||
AUTO_INCREMENT bigint(21) YES NULL
|
||||
CREATE_TIME datetime YES NULL
|
||||
UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(64) YES NULL
|
||||
CHECKSUM bigint(21) YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
TABLE_COMMENT varchar(80) NO
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.tables WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name
|
||||
################################################################################
|
||||
# Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.*
|
||||
TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost';
|
||||
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
CREATE TABLE tb2 (f1 DECIMAL)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TABLE tb3 (f1 VARCHAR(200))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost';
|
||||
GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost';
|
||||
CREATE VIEW v3 AS SELECT * FROM tb3;
|
||||
GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb3
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb3
|
||||
v3
|
||||
# Switch to connection default (user=root)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Close connection testuser1, testuser2, testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications
|
||||
#########################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table (f1 BIGINT)
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
COMMENT = 'Initial Comment' ENGINE = <engine_type>;
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_table';
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE #ENG#
|
||||
VERSION 10
|
||||
ROW_FORMAT #RF#
|
||||
TABLE_ROWS 0
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM #CS#
|
||||
CREATE_OPTIONS
|
||||
TABLE_COMMENT Initial Comment
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name engine
|
||||
t1_my_tablex <engine_type>
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <other_engine_type>;
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name engine
|
||||
t1_my_tablex <other_engine_type>
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_rows
|
||||
t1_my_tablex 0
|
||||
INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2);
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_rows
|
||||
t1_my_tablex 2
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex latin1_swedish_ci
|
||||
ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex utf8_general_ci
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex utf8_general_ci
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex latin1_german1_ci
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name TABLE_COMMENT
|
||||
t1_my_tablex Initial Comment
|
||||
ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment';
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name TABLE_COMMENT
|
||||
t1_my_tablex Changed Comment
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name AUTO_INCREMENT
|
||||
t1_my_tablex NULL
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2);
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name AUTO_INCREMENT
|
||||
t1_my_tablex 3
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name ROW_FORMAT
|
||||
t1_my_tablex Fixed
|
||||
ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic;
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name ROW_FORMAT
|
||||
t1_my_tablex Dynamic
|
||||
SELECT table_name, checksum FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name checksum
|
||||
t1_my_tablex NULL
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1;
|
||||
SELECT table_name, checksum IS NOT NULL FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name checksum IS NOT NULL
|
||||
t1_my_tablex 1
|
||||
SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
|
||||
SELECT UPDATE_TIME > @UPDATE_TIME
|
||||
AS "Is current UPDATE_TIME bigger than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current UPDATE_TIME bigger than before last INSERT?
|
||||
1
|
||||
SELECT checksum <> @checksum
|
||||
AS "Is current CHECKSUM different than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current CHECKSUM different than before last INSERT?
|
||||
1
|
||||
SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_tablex (f1 BIGINT)
|
||||
ENGINE = <other_engine_type>;
|
||||
SELECT CREATE_TIME > @CREATE_TIME
|
||||
AS "Is current CREATE_TIME bigger than for the old dropped table?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current CREATE_TIME bigger than for the old dropped table?
|
||||
1
|
||||
DROP TABLE test.t1_my_tablex;
|
||||
CREATE VIEW test.t1_my_tablex AS SELECT 1;
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_tablex
|
||||
TABLE_TYPE VIEW
|
||||
ENGINE NULL
|
||||
VERSION NULL
|
||||
ROW_FORMAT NULL
|
||||
TABLE_ROWS NULL
|
||||
AVG_ROW_LENGTH NULL
|
||||
DATA_LENGTH NULL
|
||||
MAX_DATA_LENGTH NULL
|
||||
INDEX_LENGTH NULL
|
||||
DATA_FREE NULL
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME NULL
|
||||
UPDATE_TIME NULL
|
||||
CHECK_TIME NULL
|
||||
TABLE_COLLATION NULL
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS NULL
|
||||
TABLE_COMMENT VIEW
|
||||
DROP VIEW test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TEMPORARY TABLE test.t1_my_tablex
|
||||
ENGINE = <other_engine_type>
|
||||
AS SELECT 1;
|
||||
SELECT table_name, table_type FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
DROP TEMPORARY TABLE test.t1_my_tablex;
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.tables
|
||||
SELECT * FROM information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.tables SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.tables WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables RENAME db_datadict.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables RENAME information_schema.xtables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
1063
mysql-test/suite/funcs_1/r/is_tables_innodb.result
Normal file
1063
mysql-test/suite/funcs_1/r/is_tables_innodb.result
Normal file
File diff suppressed because it is too large
Load Diff
771
mysql-test/suite/funcs_1/r/is_tables_is.result
Normal file
771
mysql-test/suite/funcs_1/r/is_tables_is.result
Normal file
@ -0,0 +1,771 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHARACTER_SETS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLLATIONS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLUMNS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLUMN_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME KEY_COLUMN_USAGE
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME ROUTINES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME SCHEMATA
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME SCHEMA_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME STATISTICS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLE_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLE_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TRIGGERS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME USER_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME VIEWS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME CHARACTER_SETS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLLATIONS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLLATION_CHARACTER_SET_APPLICABILITY
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLUMNS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME COLUMN_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME KEY_COLUMN_USAGE
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME ROUTINES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME SCHEMATA
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME SCHEMA_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME STATISTICS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLE_CONSTRAINTS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TABLE_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME TRIGGERS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME USER_PRIVILEGES
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MEMORY
|
||||
VERSION 0
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA information_schema
|
||||
TABLE_NAME VIEWS
|
||||
TABLE_TYPE SYSTEM VIEW
|
||||
ENGINE MyISAM
|
||||
VERSION 0
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
1052
mysql-test/suite/funcs_1/r/is_tables_memory.result
Normal file
1052
mysql-test/suite/funcs_1/r/is_tables_memory.result
Normal file
File diff suppressed because it is too large
Load Diff
1092
mysql-test/suite/funcs_1/r/is_tables_myisam.result
Normal file
1092
mysql-test/suite/funcs_1/r/is_tables_myisam.result
Normal file
File diff suppressed because it is too large
Load Diff
424
mysql-test/suite/funcs_1/r/is_tables_mysql.result
Normal file
424
mysql-test/suite/funcs_1/r/is_tables_mysql.result
Normal file
@ -0,0 +1,424 @@
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME columns_priv
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Column privileges
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME db
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Database privileges
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME func
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment User defined functions
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME help_category
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment help categories
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME help_keyword
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment help keywords
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME help_relation
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment keyword-topic relation
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME help_topic
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment help topics
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME host
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Host privileges; Merged with database privileges
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME proc
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Stored Procedures
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME procs_priv
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Procedure privileges
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME tables_priv
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Table privileges
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME time_zone
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT 6
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Time zones
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME time_zone_leap_second
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Leap seconds information for time zones
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME time_zone_name
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Time zone names
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME time_zone_transition
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Time zone transitions
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME time_zone_transition_type
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_general_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Time zone transition types
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA mysql
|
||||
TABLE_NAME user
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION utf8_bin
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment Users and global privileges
|
||||
Separator -----------------------------------------------------
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name;
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
560
mysql-test/suite/funcs_1/r/is_tables_ndb.result
Normal file
560
mysql-test/suite/funcs_1/r/is_tables_ndb.result
Normal file
@ -0,0 +1,560 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
CREATE DATABASE test1;
|
||||
USE test;
|
||||
USE test;
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
|
||||
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
|
||||
drop TABLE if exists t3;
|
||||
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = NDB;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
|
||||
drop database if exists test4;
|
||||
CREATE database test4;
|
||||
use test4;
|
||||
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
|
||||
use test;
|
||||
drop TABLE if exists t7, t8;
|
||||
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = NDB;
|
||||
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
drop TABLE if exists t9;
|
||||
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t10
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t11
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t3
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t4
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t7
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t8
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t9
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test4
|
||||
TABLE_NAME t6
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t10
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t11
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t3
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t4
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t7
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t8
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t9
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test4
|
||||
TABLE_NAME t6
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test4;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
DROP TABLE test.t3;
|
||||
DROP TABLE test.t4;
|
||||
DROP TABLE test.t7;
|
||||
DROP TABLE test.t8;
|
||||
DROP TABLE test.t9;
|
||||
DROP TABLE test.t10;
|
||||
DROP TABLE test.t11;
|
212
mysql-test/suite/funcs_1/r/is_triggers.result
Normal file
212
mysql-test/suite/funcs_1/r/is_triggers.result
Normal file
@ -0,0 +1,212 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'TRIGGERS';
|
||||
Tables_in_information_schema (TRIGGERS)
|
||||
TRIGGERS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TRIGGERS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TRIGGERS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TRIGGERS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TRIGGERS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TRIGGERS;
|
||||
Field Type Null Key Default Extra
|
||||
TRIGGER_CATALOG varchar(512) YES NULL
|
||||
TRIGGER_SCHEMA varchar(64) NO
|
||||
TRIGGER_NAME varchar(64) NO
|
||||
EVENT_MANIPULATION varchar(6) NO
|
||||
EVENT_OBJECT_CATALOG varchar(512) YES NULL
|
||||
EVENT_OBJECT_SCHEMA varchar(64) NO
|
||||
EVENT_OBJECT_TABLE varchar(64) NO
|
||||
ACTION_ORDER bigint(4) NO 0
|
||||
ACTION_CONDITION longtext YES NULL
|
||||
ACTION_STATEMENT longtext NO NULL
|
||||
ACTION_ORIENTATION varchar(9) NO
|
||||
ACTION_TIMING varchar(6) NO
|
||||
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_OLD_ROW varchar(3) NO
|
||||
ACTION_REFERENCE_NEW_ROW varchar(3) NO
|
||||
CREATED datetime YES NULL
|
||||
SQL_MODE longtext NO NULL
|
||||
DEFINER longtext NO NULL
|
||||
SHOW CREATE TABLE information_schema.TRIGGERS;
|
||||
Table Create Table
|
||||
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
|
||||
`TRIGGER_CATALOG` varchar(512) default NULL,
|
||||
`TRIGGER_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TRIGGER_NAME` varchar(64) NOT NULL default '',
|
||||
`EVENT_MANIPULATION` varchar(6) NOT NULL default '',
|
||||
`EVENT_OBJECT_CATALOG` varchar(512) default NULL,
|
||||
`EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`EVENT_OBJECT_TABLE` varchar(64) NOT NULL default '',
|
||||
`ACTION_ORDER` bigint(4) NOT NULL default '0',
|
||||
`ACTION_CONDITION` longtext,
|
||||
`ACTION_STATEMENT` longtext NOT NULL,
|
||||
`ACTION_ORIENTATION` varchar(9) NOT NULL default '',
|
||||
`ACTION_TIMING` varchar(6) NOT NULL default '',
|
||||
`ACTION_REFERENCE_OLD_TABLE` varchar(64) default NULL,
|
||||
`ACTION_REFERENCE_NEW_TABLE` varchar(64) default NULL,
|
||||
`ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL default '',
|
||||
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL default '',
|
||||
`CREATED` datetime default NULL,
|
||||
`SQL_MODE` longtext NOT NULL,
|
||||
`DEFINER` longtext NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TRIGGERS;
|
||||
Field Type Null Key Default Extra
|
||||
TRIGGER_CATALOG varchar(512) YES NULL
|
||||
TRIGGER_SCHEMA varchar(64) NO
|
||||
TRIGGER_NAME varchar(64) NO
|
||||
EVENT_MANIPULATION varchar(6) NO
|
||||
EVENT_OBJECT_CATALOG varchar(512) YES NULL
|
||||
EVENT_OBJECT_SCHEMA varchar(64) NO
|
||||
EVENT_OBJECT_TABLE varchar(64) NO
|
||||
ACTION_ORDER bigint(4) NO 0
|
||||
ACTION_CONDITION longtext YES NULL
|
||||
ACTION_STATEMENT longtext NO NULL
|
||||
ACTION_ORIENTATION varchar(9) NO
|
||||
ACTION_TIMING varchar(6) NO
|
||||
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_OLD_ROW varchar(3) NO
|
||||
ACTION_REFERENCE_NEW_ROW varchar(3) NO
|
||||
CREATED datetime YES NULL
|
||||
SQL_MODE longtext NO NULL
|
||||
DEFINER longtext NO NULL
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
|
||||
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
|
||||
OR action_reference_new_table IS NOT NULL;
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
##################################################################################
|
||||
# Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information
|
||||
##################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
CREATE USER 'testuser4'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser1'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser3'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser4'@'localhost';
|
||||
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TRIGGER trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
Grants for testuser2@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `db_datadict`.`t1` TO 'testuser2'@'localhost'
|
||||
# No SUPER Privilege --> no result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SHOW GRANTS FOR 'testuser3'@'localhost';
|
||||
Grants for testuser3@localhost
|
||||
GRANT SUPER ON *.* TO 'testuser3'@'localhost'
|
||||
GRANT SELECT ON `db_datadict`.`t1` TO 'testuser3'@'localhost'
|
||||
# SUPER Privilege + SELECT Privilege on t1 --> result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Establish connection testuser4 (user=testuser4)
|
||||
SHOW GRANTS FOR 'testuser4'@'localhost';
|
||||
Grants for testuser4@localhost
|
||||
GRANT SUPER ON *.* TO 'testuser4'@'localhost'
|
||||
# SUPER Privilege + no SELECT Privilege on t1 --> no result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
# Switch to connection default and close connections testuser1 - testuser4
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications
|
||||
#########################################################################
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TRIGGER db_datadict.trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
INSERT INTO information_schema.triggers
|
||||
SELECT * FROM information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.triggers SET trigger_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.triggers WHERE trigger_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers RENAME db_datadict.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
400
mysql-test/suite/funcs_1/r/is_user_privileges.result
Normal file
400
mysql-test/suite/funcs_1/r/is_user_privileges.result
Normal file
@ -0,0 +1,400 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'USER_PRIVILEGES';
|
||||
Tables_in_information_schema (USER_PRIVILEGES)
|
||||
USER_PRIVILEGES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.USER_PRIVILEGES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.USER_PRIVILEGES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.USER_PRIVILEGES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.USER_PRIVILEGES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.16.1: INFORMATION_SCHEMA.USER_PRIVILEGES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.USER_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SHOW CREATE TABLE information_schema.USER_PRIVILEGES;
|
||||
Table Create Table
|
||||
USER_PRIVILEGES CREATE TEMPORARY TABLE `USER_PRIVILEGES` (
|
||||
`GRANTEE` varchar(81) NOT NULL default '',
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`PRIVILEGE_TYPE` varchar(64) NOT NULL default '',
|
||||
`IS_GRANTABLE` varchar(3) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.USER_PRIVILEGES;
|
||||
Field Type Null Key Default Extra
|
||||
GRANTEE varchar(81) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
PRIVILEGE_TYPE varchar(64) NO
|
||||
IS_GRANTABLE varchar(3) NO
|
||||
SELECT grantee, table_catalog, privilege_type
|
||||
FROM information_schema.user_privileges
|
||||
WHERE table_catalog IS NOT NULL;
|
||||
grantee table_catalog privilege_type
|
||||
##########################################################################
|
||||
# Testcases 3.2.16.2+3.2.16.3+3.2.16.4: INFORMATION_SCHEMA.USER_PRIVILEGES
|
||||
# accessible information
|
||||
##########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
|
||||
GRANT INSERT ON *.* TO 'testuser2'@'localhost';
|
||||
GRANT UPDATE ON *.* TO 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
#
|
||||
# Add GRANT OPTION db_datadict.* to testuser1;
|
||||
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
|
||||
|
||||
# Now add SELECT on *.* to testuser1;
|
||||
# Switch to connection default
|
||||
GRANT SELECT ON *.* TO 'testuser1'@'localhost';
|
||||
#
|
||||
# Here <SELECT NO> is shown correctly for testuser1;
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL SELECT NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 Y N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
#
|
||||
# Here <SELECT YES> is shown correctly for testuser1;
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL SELECT YES
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL SELECT YES
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'user'
|
||||
SHOW GRANTS;
|
||||
Grants for testuser2@localhost
|
||||
GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
ERROR 42000: SELECT command denied to user 'testuser3'@'localhost' for table 'user'
|
||||
SHOW GRANTS;
|
||||
Grants for testuser3@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
|
||||
|
||||
# Revoke privileges from testuser1;
|
||||
# Switch to connection default
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
CREATE TABLE db_datadict.tb_55 ( c1 TEXT );
|
||||
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_55'
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
|
||||
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_66'
|
||||
|
||||
# Add ALL on db_datadict.* (and select on mysql.user) to testuser1;
|
||||
# Switch to connection default
|
||||
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
|
||||
CREATE TABLE db_datadict.tb_56 ( c1 TEXT );
|
||||
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_56'
|
||||
USE db_datadict;
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
|
||||
CREATE TABLE tb_57 ( c1 TEXT )
|
||||
ENGINE = <other_engine_type>;
|
||||
|
||||
# Revoke privileges from testuser1;
|
||||
# Switch to connection default
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
'testuser2'@'localhost' NULL INSERT NO
|
||||
'testuser2'@'localhost' NULL UPDATE NO
|
||||
'testuser3'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost testuser1 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser3 N N N N N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
ORDER BY grantee, table_catalog, privilege_type;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 'user'
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
CREATE TABLE db_datadict.tb_58 ( c1 TEXT )
|
||||
ENGINE = <other_engine_type>;
|
||||
USE db_datadict;
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'db_datadict'
|
||||
CREATE TABLE db_datadict.tb_59 ( c1 TEXT )
|
||||
ENGINE = <other_engine_type>;
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
########################################################################################
|
||||
# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.USER_PRIVILEGES modifications
|
||||
########################################################################################
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee = '''testuser1''@''localhost''';
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee = '''testuser1''@''localhost''';
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL USAGE NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee = '''testuser1''@''localhost''';
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' NULL SELECT NO
|
||||
'testuser1'@'localhost' NULL FILE NO
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
Grants for testuser1@localhost
|
||||
GRANT SELECT, FILE ON *.* TO 'testuser1'@'localhost'
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee = '''testuser1''@''localhost''';
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
SHOW GRANTS FOR 'testuser1'@'localhost';
|
||||
ERROR 42000: There is no such grant defined for user 'testuser1' on host 'localhost'
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
INSERT INTO information_schema.user_privileges
|
||||
SELECT * FROM information_schema.user_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.user_privileges
|
||||
SET PRIVILEGE_TYPE = 'gaming';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.user_privileges
|
||||
WHERE grantee = '''testuser1''@''localhost''';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.user_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i1 ON information_schema.user_privileges(grantee);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.user_privileges ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.user_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.user_privileges
|
||||
RENAME db_datadict.user_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.user_privileges
|
||||
RENAME information_schema.xuser_privileges;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP USER 'testuser1'@'localhost';
|
238
mysql-test/suite/funcs_1/r/is_views.result
Normal file
238
mysql-test/suite/funcs_1/r/is_views.result
Normal file
@ -0,0 +1,238 @@
|
||||
SHOW TABLES FROM information_schema LIKE 'VIEWS';
|
||||
Tables_in_information_schema (VIEWS)
|
||||
VIEWS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.VIEWS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.VIEWS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.VIEWS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.VIEWS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.VIEWS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
VIEW_DEFINITION longtext NO NULL
|
||||
CHECK_OPTION varchar(8) NO
|
||||
IS_UPDATABLE varchar(3) NO
|
||||
DEFINER varchar(77) NO
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
SHOW CREATE TABLE information_schema.VIEWS;
|
||||
Table Create Table
|
||||
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`VIEW_DEFINITION` longtext NOT NULL,
|
||||
`CHECK_OPTION` varchar(8) NOT NULL default '',
|
||||
`IS_UPDATABLE` varchar(3) NOT NULL default '',
|
||||
`DEFINER` varchar(77) NOT NULL default '',
|
||||
`SECURITY_TYPE` varchar(7) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.VIEWS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
VIEW_DEFINITION longtext NO NULL
|
||||
CHECK_OPTION varchar(8) NO
|
||||
IS_UPDATABLE varchar(3) NO
|
||||
DEFINER varchar(77) NO
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.views WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name
|
||||
################################################################################
|
||||
# Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
CREATE USER 'test_no_views'@'localhost';
|
||||
CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1;
|
||||
CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1;
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost';
|
||||
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
|
||||
# Establish connection test_no_views (user=test_no_views)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
# Switch to connection default and close all other connections
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications
|
||||
#########################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL test t1_view /* ALGORITHM=UNDEFINED */ select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER
|
||||
SELECT table_name,definer FROM information_schema.views
|
||||
WHERE table_name = 't1_view';
|
||||
table_name definer
|
||||
t1_view root@localhost
|
||||
ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS
|
||||
SELECT DISTINCT f1 FROM test.t1_table;
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name definer security_type
|
||||
t1_view testuser1@localhost DEFINER
|
||||
ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS
|
||||
SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION;
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name definer security_type
|
||||
t1_view root@localhost INVOKER
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
test t1_view
|
||||
RENAME TABLE test.t1_view TO db_datadict.t1_view;
|
||||
ERROR HY000: Changing schema from 'test' to 'db_datadict' is not allowed.
|
||||
DROP VIEW test.t1_view;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
db_datadict t1_view
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_viewx
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_viewx
|
||||
DROP VIEW db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
DROP TABLE test.t1_table;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
Warnings:
|
||||
Warning 1356 View 'db_datadict.t1_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment'
|
||||
ENGINE = <engine_type>;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP TABLE test.t1_table;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE VIEW db_datadict.v1 AS SELECT 1;
|
||||
INSERT INTO information_schema.views
|
||||
SELECT * FROM information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.views(table_schema, table_name)
|
||||
VALUES ('db2', 'v2');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.views SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.views WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_views ON information_schema.views(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views RENAME db_datadict.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views RENAME information_schema.xviews;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
@ -1,68 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
drop table if exists tb4 ;
|
||||
create table tb4 (
|
||||
f176 numeric (0) unsigned not null DEFAULT 9,
|
||||
f177 numeric (64) unsigned not null DEFAULT 9,
|
||||
f178 numeric (0) zerofill not null DEFAULT 9,
|
||||
f179 numeric (64) zerofill not null DEFAULT 9,
|
||||
f180 numeric (0) unsigned zerofill not null DEFAULT 9,
|
||||
f181 numeric (64) unsigned zerofill not null DEFAULT 9,
|
||||
f182 numeric (0,0) not null DEFAULT 9,
|
||||
f183 numeric (63,30) not null DEFAULT 9,
|
||||
f184 numeric (0,0) unsigned not null DEFAULT 9,
|
||||
f185 numeric (63,30) unsigned not null DEFAULT 9,
|
||||
f186 numeric (0,0) zerofill not null DEFAULT 9,
|
||||
f187 numeric (63,30) zerofill not null DEFAULT 9,
|
||||
f188 numeric (0,0) unsigned zerofill not null DEFAULT 9,
|
||||
f189 numeric (63,30) unsigned zerofill not null DEFAULT 9,
|
||||
f190 real not null DEFAULT 88.8,
|
||||
f191 real unsigned not null DEFAULT 88.8,
|
||||
f192 real zerofill not null DEFAULT 88.8,
|
||||
f193 real unsigned zerofill not null DEFAULT 88.8,
|
||||
f194 double not null DEFAULT 55.5,
|
||||
f195 double unsigned not null DEFAULT 55.5,
|
||||
f196 double zerofill not null DEFAULT 55.5,
|
||||
f197 double unsigned zerofill not null DEFAULT 55.5,
|
||||
f198 float,
|
||||
f199 float unsigned,
|
||||
f200 float zerofill,
|
||||
f201 float unsigned zerofill,
|
||||
f202 float(0),
|
||||
f203 float(23),
|
||||
f204 float(0) unsigned,
|
||||
f205 float(23) unsigned,
|
||||
f206 float(0) zerofill,
|
||||
f207 float(23) zerofill,
|
||||
f208 float(0) unsigned zerofill,
|
||||
f209 float(23) unsigned zerofill,
|
||||
f210 float(24),
|
||||
f211 float(53),
|
||||
f212 float(24) unsigned,
|
||||
f213 float(53) unsigned,
|
||||
f214 float(24) zerofill,
|
||||
f215 float(53) zerofill,
|
||||
f216 float(24) unsigned zerofill,
|
||||
f217 float(53) unsigned zerofill,
|
||||
f218 date,
|
||||
f219 time,
|
||||
f220 datetime,
|
||||
f221 timestamp,
|
||||
f222 year,
|
||||
f223 year(3),
|
||||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f236 char(95) unicode,
|
||||
f241 char(255) unicode,
|
||||
f237 char(130) binary,
|
||||
f238 varchar(25000) binary,
|
||||
f239 varbinary(0),
|
||||
f240 varchar(1200) unicode
|
||||
) engine = memory;
|
||||
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb4.txt' into table tb4 ;
|
||||
|
||||
NOT YET IMPLEMENTED: bitdata tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,78 +1,3 @@
|
||||
SET @NO_REFRESH = IF( '' = '', 0, 1);
|
||||
USE test;
|
||||
set @@global.max_heap_table_size = 4294967295;
|
||||
set @@session.max_heap_table_size = 4294967295;
|
||||
drop table if exists tb1 ;
|
||||
create table tb1 (
|
||||
f1 char,
|
||||
f2 char binary,
|
||||
f3 char ascii,
|
||||
f12 binary,
|
||||
f13 tinyint,
|
||||
f14 tinyint unsigned,
|
||||
f15 tinyint zerofill,
|
||||
f16 tinyint unsigned zerofill,
|
||||
f17 smallint,
|
||||
f18 smallint unsigned,
|
||||
f19 smallint zerofill,
|
||||
f20 smallint unsigned zerofill,
|
||||
f21 mediumint,
|
||||
f22 mediumint unsigned,
|
||||
f23 mediumint zerofill,
|
||||
f24 mediumint unsigned zerofill,
|
||||
f25 int,
|
||||
f26 int unsigned,
|
||||
f27 int zerofill,
|
||||
f28 int unsigned zerofill,
|
||||
f29 bigint,
|
||||
f30 bigint unsigned,
|
||||
f31 bigint zerofill,
|
||||
f32 bigint unsigned zerofill,
|
||||
f33 decimal not null DEFAULT 9.9,
|
||||
f34 decimal unsigned not null DEFAULT 9.9,
|
||||
f35 decimal zerofill not null DEFAULT 9.9,
|
||||
f36 decimal unsigned zerofill not null DEFAULT 9.9,
|
||||
f37 decimal (0) not null DEFAULT 9.9,
|
||||
f38 decimal (64) not null DEFAULT 9.9,
|
||||
f39 decimal (0) unsigned not null DEFAULT 9.9,
|
||||
f40 decimal (64) unsigned not null DEFAULT 9.9,
|
||||
f41 decimal (0) zerofill not null DEFAULT 9.9,
|
||||
f42 decimal (64) zerofill not null DEFAULT 9.9,
|
||||
f43 decimal (0) unsigned zerofill not null DEFAULT 9.9,
|
||||
f44 decimal (64) unsigned zerofill not null DEFAULT 9.9,
|
||||
f45 decimal (0,0) not null DEFAULT 9.9,
|
||||
f46 decimal (63,30) not null DEFAULT 9.9,
|
||||
f47 decimal (0,0) unsigned not null DEFAULT 9.9,
|
||||
f48 decimal (63,30) unsigned not null DEFAULT 9.9,
|
||||
f49 decimal (0,0) zerofill not null DEFAULT 9.9,
|
||||
f50 decimal (63,30) zerofill not null DEFAULT 9.9,
|
||||
f51 decimal (0,0) unsigned zerofill not null DEFAULT 9.9,
|
||||
f52 decimal (63,30) unsigned zerofill not null DEFAULT 9.9,
|
||||
f53 numeric not null DEFAULT 99,
|
||||
f54 numeric unsigned not null DEFAULT 99,
|
||||
f55 numeric zerofill not null DEFAULT 99,
|
||||
f56 numeric unsigned zerofill not null DEFAULT 99,
|
||||
f57 numeric (0) not null DEFAULT 99,
|
||||
f58 numeric (64) not null DEFAULT 99
|
||||
) engine = memory;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f33' at row 1
|
||||
Note 1265 Data truncated for column 'f34' at row 1
|
||||
Note 1265 Data truncated for column 'f35' at row 1
|
||||
Note 1265 Data truncated for column 'f36' at row 1
|
||||
Note 1265 Data truncated for column 'f37' at row 1
|
||||
Note 1265 Data truncated for column 'f38' at row 1
|
||||
Note 1265 Data truncated for column 'f39' at row 1
|
||||
Note 1265 Data truncated for column 'f40' at row 1
|
||||
Note 1265 Data truncated for column 'f41' at row 1
|
||||
Note 1265 Data truncated for column 'f42' at row 1
|
||||
Note 1265 Data truncated for column 'f43' at row 1
|
||||
Note 1265 Data truncated for column 'f44' at row 1
|
||||
Note 1265 Data truncated for column 'f45' at row 1
|
||||
Note 1265 Data truncated for column 'f47' at row 1
|
||||
Note 1265 Data truncated for column 'f49' at row 1
|
||||
Note 1265 Data truncated for column 'f51' at row 1
|
||||
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb1.txt' into table tb1 ;
|
||||
|
||||
NOT YET IMPLEMENTED: cursor tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
SET @@global.max_heap_table_size=4294967295;
|
||||
SET @@session.max_heap_table_size=4294967295;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user