You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
4.6 KiB

  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. if (`SELECT VERSION() LIKE '%embedded%'`)
  18. {
  19. --skip Bug#37456 funcs_1: Several tests crash when used with embedded server
  20. }
  21. let $engine_type = MEMORY;
  22. let $other_engine_type = MyISAM;
  23. let $is_table = ENGINES;
  24. # The table INFORMATION_SCHEMA.ENGINES must exist
  25. eval SHOW TABLES FROM information_schema LIKE '$is_table';
  26. --echo #######################################################################
  27. --echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
  28. --echo #######################################################################
  29. # Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
  30. # statement, just as if it were an ordinary user-defined table.
  31. #
  32. --source suite/funcs_1/datadict/is_table_query.inc
  33. --echo #########################################################################
  34. --echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.ENGINES layout
  35. --echo #########################################################################
  36. # Ensure that the INFORMATION_SCHEMA.ENGINES table has the following columns,
  37. # in the following order:
  38. #
  39. # ENGINE
  40. # SUPPORT
  41. # COMMENT
  42. # TRANSACTIONS
  43. # XA
  44. # SAVEPOINTS
  45. #
  46. # Value Meaning
  47. # YES The feature is supported and is active.
  48. # NO The feature is not supported = The server was compiled without
  49. # support for the feature.
  50. # DISABLED The feature is supported but has been disabled.
  51. #
  52. eval DESCRIBE information_schema.$is_table;
  53. eval SHOW CREATE TABLE information_schema.$is_table;
  54. eval SHOW COLUMNS FROM information_schema.$is_table;
  55. # Note: Retrieval of information within information_schema.columns about
  56. # information_schema.engines is in is_columns_is.test.
  57. # FIXME: Check the regression tests and implement tests checking the
  58. # functionality if missing.
  59. --echo ########################################################################
  60. --echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
  61. --echo # DDL on INFORMATION_SCHEMA tables are not supported
  62. --echo ########################################################################
  63. # 3.2.1.3: Ensure that no user may execute an INSERT statement on any
  64. # INFORMATION_SCHEMA table.
  65. # 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
  66. # INFORMATION_SCHEMA table.
  67. # 3.2.1.5: Ensure that no user may execute a DELETE statement on any
  68. # INFORMATION_SCHEMA table.
  69. # 3.2.1.8: Ensure that no user may create an index on an
  70. # INFORMATION_SCHEMA table.
  71. # 3.2.1.9: Ensure that no user may alter the definition of an
  72. # INFORMATION_SCHEMA table.
  73. # 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
  74. # 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
  75. # other database.
  76. # 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
  77. # in an INFORMATION_SCHEMA table.
  78. #
  79. --disable_warnings
  80. DROP DATABASE IF EXISTS db_datadict;
  81. --enable_warnings
  82. CREATE DATABASE db_datadict;
  83. --replace_result $engine_type <engine_type>
  84. eval
  85. CREATE TABLE db_datadict.t1 (f1 BIGINT)
  86. ENGINE = $engine_type;
  87. --error ER_DBACCESS_DENIED_ERROR
  88. INSERT INTO information_schema.engines
  89. SELECT * FROM information_schema.engines;
  90. --error ER_DBACCESS_DENIED_ERROR
  91. UPDATE information_schema.engines SET engine = '1234567';
  92. --error ER_DBACCESS_DENIED_ERROR
  93. DELETE FROM information_schema.engines WHERE support IN ('DEFAULT','YES');
  94. --error ER_DBACCESS_DENIED_ERROR
  95. TRUNCATE information_schema.engines;
  96. --error ER_DBACCESS_DENIED_ERROR
  97. CREATE INDEX my_idx_on_engines ON information_schema.engines(engine);
  98. --error ER_DBACCESS_DENIED_ERROR
  99. ALTER TABLE information_schema.engines DROP PRIMARY KEY;
  100. --error ER_DBACCESS_DENIED_ERROR
  101. ALTER TABLE information_schema.engines ADD f1 INT;
  102. --error ER_DBACCESS_DENIED_ERROR
  103. DROP TABLE information_schema.engines;
  104. --error ER_DBACCESS_DENIED_ERROR
  105. ALTER TABLE information_schema.engines RENAME db_datadict.engines;
  106. --error ER_DBACCESS_DENIED_ERROR
  107. ALTER TABLE information_schema.engines RENAME information_schema.xengines;
  108. # Cleanup
  109. DROP DATABASE db_datadict;