| 1 |
# suite/funcs_1/t/is_engines.test |
| 2 |
# |
| 3 |
# Check the layout of information_schema.engines |
| 4 |
# |
| 5 |
# Note: |
| 6 |
# This test is not intended |
| 7 |
# - to show information about the all time existing tables |
| 8 |
# within the databases information_schema and mysql |
| 9 |
# - for checking storage engine properties |
| 10 |
# Therefore please do not alter $engine_type and $other_engine_type. |
| 11 |
# Some results of the subtests depend on the storage engines assigned. |
| 12 |
# |
| 13 |
# Author: |
| 14 |
# 2008-02-29 mleich WL#4203 Reorganize and fix the data dictionary tests of |
| 15 |
# testsuite funcs_1 |
| 16 |
# |
| 17 |
|
| 18 |
|
| 19 |
let $engine_type = InnoDB; |
| 20 |
let $other_engine_type = InnoDB; |
| 21 |
|
| 22 |
let $is_table = ENGINES; |
| 23 |
|
| 24 |
# The table INFORMATION_SCHEMA.ENGINES must exist |
| 25 |
eval SHOW TABLES FROM information_schema LIKE '$is_table'; |
| 26 |
|
| 27 |
--echo ####################################################################### |
| 28 |
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT |
| 29 |
--echo ####################################################################### |
| 30 |
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT |
| 31 |
# statement, just as if it were an ordinary user-defined table. |
| 32 |
# |
| 33 |
--source suite/funcs_1/datadict/is_table_query.inc |
| 34 |
|
| 35 |
|
| 36 |
--echo ######################################################################### |
| 37 |
--echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.ENGINES layout |
| 38 |
--echo ######################################################################### |
| 39 |
# Ensure that the INFORMATION_SCHEMA.ENGINES table has the following columns, |
| 40 |
# in the following order: |
| 41 |
# |
| 42 |
# ENGINE |
| 43 |
# SUPPORT |
| 44 |
# COMMENT |
| 45 |
# TRANSACTIONS |
| 46 |
# XA |
| 47 |
# SAVEPOINTS |
| 48 |
# |
| 49 |
# Value Meaning |
| 50 |
# YES The feature is supported and is active. |
| 51 |
# NO The feature is not supported = The server was compiled without |
| 52 |
# support for the feature. |
| 53 |
# DISABLED The feature is supported but has been disabled. |
| 54 |
# |
| 55 |
eval DESCRIBE information_schema.$is_table; |
| 56 |
eval SHOW CREATE TABLE information_schema.$is_table; |
| 57 |
eval SHOW COLUMNS FROM information_schema.$is_table; |
| 58 |
|
| 59 |
# Note: Retrieval of information within information_schema.columns about |
| 60 |
# information_schema.engines is in is_columns_is.test. |
| 61 |
|
| 62 |
# FIXME: Check the regression tests and implement tests checking the |
| 63 |
# functionality if missing. |
| 64 |
|
| 65 |
|
| 66 |
--echo ######################################################################## |
| 67 |
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and |
| 68 |
--echo # DDL on INFORMATION_SCHEMA tables are not supported |
| 69 |
--echo ######################################################################## |
| 70 |
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any |
| 71 |
# INFORMATION_SCHEMA table. |
| 72 |
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any |
| 73 |
# INFORMATION_SCHEMA table. |
| 74 |
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any |
| 75 |
# INFORMATION_SCHEMA table. |
| 76 |
# 3.2.1.8: Ensure that no user may create an index on an |
| 77 |
# INFORMATION_SCHEMA table. |
| 78 |
# 3.2.1.9: Ensure that no user may alter the definition of an |
| 79 |
# INFORMATION_SCHEMA table. |
| 80 |
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table. |
| 81 |
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any |
| 82 |
# other database. |
| 83 |
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data |
| 84 |
# in an INFORMATION_SCHEMA table. |
| 85 |
# |
| 86 |
--disable_warnings |
| 87 |
DROP DATABASE IF EXISTS db_datadict; |
| 88 |
--enable_warnings |
| 89 |
CREATE DATABASE db_datadict; |
| 90 |
--replace_result $engine_type <engine_type> |
| 91 |
eval |
| 92 |
CREATE TABLE db_datadict.t1 (f1 BIGINT) |
| 93 |
ENGINE = $engine_type; |
| 94 |
|
| 95 |
--error ER_DBACCESS_DENIED_ERROR |
| 96 |
INSERT INTO information_schema.engines |
| 97 |
SELECT * FROM information_schema.engines; |
| 98 |
|
| 99 |
--error ER_DBACCESS_DENIED_ERROR |
| 100 |
UPDATE information_schema.engines SET engine = '1234567'; |
| 101 |
|
| 102 |
--error ER_DBACCESS_DENIED_ERROR |
| 103 |
DELETE FROM information_schema.engines WHERE support IN ('DEFAULT','YES'); |
| 104 |
--error ER_DBACCESS_DENIED_ERROR |
| 105 |
TRUNCATE information_schema.engines; |
| 106 |
|
| 107 |
--error ER_DBACCESS_DENIED_ERROR |
| 108 |
CREATE INDEX my_idx_on_engines ON information_schema.engines(engine); |
| 109 |
|
| 110 |
--error ER_DBACCESS_DENIED_ERROR |
| 111 |
ALTER TABLE information_schema.engines DROP PRIMARY KEY; |
| 112 |
--error ER_DBACCESS_DENIED_ERROR |
| 113 |
ALTER TABLE information_schema.engines ADD f1 INT; |
| 114 |
|
| 115 |
--error ER_DBACCESS_DENIED_ERROR |
| 116 |
DROP TABLE information_schema.engines; |
| 117 |
|
| 118 |
--error ER_DBACCESS_DENIED_ERROR |
| 119 |
ALTER TABLE information_schema.engines RENAME db_datadict.engines; |
| 120 |
--error ER_DBACCESS_DENIED_ERROR |
| 121 |
ALTER TABLE information_schema.engines RENAME information_schema.xengines; |
| 122 |
|
| 123 |
# Cleanup |
| 124 |
DROP DATABASE db_datadict; |
| 125 |
|