| 1 |
SHOW TABLES FROM information_schema LIKE 'COLLATIONS'; |
| 2 |
Tables_in_information_schema (COLLATIONS) |
| 3 |
COLLATIONS |
| 4 |
####################################################################### |
| 5 |
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT |
| 6 |
####################################################################### |
| 7 |
DROP VIEW IF EXISTS test.v1; |
| 8 |
DROP PROCEDURE IF EXISTS test.p1; |
| 9 |
DROP FUNCTION IF EXISTS test.f1; |
| 10 |
CREATE VIEW test.v1 AS SELECT * FROM information_schema.COLLATIONS; |
| 11 |
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.COLLATIONS; |
| 12 |
CREATE FUNCTION test.f1() returns BIGINT |
| 13 |
BEGIN |
| 14 |
DECLARE counter BIGINT DEFAULT NULL; |
| 15 |
SELECT COUNT(*) INTO counter FROM information_schema.COLLATIONS; |
| 16 |
RETURN counter; |
| 17 |
END// |
| 18 |
# Attention: The printing of the next result sets is disabled. |
| 19 |
SELECT * FROM information_schema.COLLATIONS; |
| 20 |
SELECT * FROM test.v1; |
| 21 |
CALL test.p1; |
| 22 |
SELECT test.f1(); |
| 23 |
DROP VIEW test.v1; |
| 24 |
DROP PROCEDURE test.p1; |
| 25 |
DROP FUNCTION test.f1; |
| 26 |
######################################################################### |
| 27 |
# Testcase 3.2.3.1: INFORMATION_SCHEMA.COLLATIONS layout |
| 28 |
######################################################################### |
| 29 |
DESCRIBE information_schema.COLLATIONS; |
| 30 |
Field Type Null Key Default Extra |
| 31 |
COLLATION_NAME varchar(64) NO NULL |
| 32 |
CHARACTER_SET_NAME varchar(32) YES NULL |
| 33 |
ID bigint(11) YES NULL |
| 34 |
IS_DEFAULT varchar(3) YES NULL |
| 35 |
IS_COMPILED varchar(3) NO NULL |
| 36 |
SORTLEN bigint(3) NO NULL |
| 37 |
COMMENT varchar(80) NO NULL |
| 38 |
SHOW CREATE TABLE information_schema.COLLATIONS; |
| 39 |
Table Create Table |
| 40 |
COLLATIONS CREATE TEMPORARY TABLE `COLLATIONS` ( |
| 41 |
`COLLATION_NAME` varchar(64) NOT NULL, |
| 42 |
`CHARACTER_SET_NAME` varchar(32), |
| 43 |
`ID` bigint(11), |
| 44 |
`IS_DEFAULT` varchar(3), |
| 45 |
`IS_COMPILED` varchar(3) NOT NULL, |
| 46 |
`SORTLEN` bigint(3) NOT NULL, |
| 47 |
`COMMENT` varchar(80) NOT NULL |
| 48 |
) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci |
| 49 |
SHOW COLUMNS FROM information_schema.COLLATIONS; |
| 50 |
Field Type Null Key Default Extra |
| 51 |
COLLATION_NAME varchar(64) NO NULL |
| 52 |
CHARACTER_SET_NAME varchar(32) YES NULL |
| 53 |
ID bigint(11) YES NULL |
| 54 |
IS_DEFAULT varchar(3) YES NULL |
| 55 |
IS_COMPILED varchar(3) NO NULL |
| 56 |
SORTLEN bigint(3) NO NULL |
| 57 |
COMMENT varchar(80) NO NULL |
| 58 |
# Testcases 3.2.3.2 and 3.2.3.3 are checked in suite/funcs_1/t/charset_collation*.test |
| 59 |
######################################################################## |
| 60 |
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and |
| 61 |
# DDL on INFORMATION_SCHEMA tables are not supported |
| 62 |
######################################################################## |
| 63 |
DROP DATABASE IF EXISTS db_datadict; |
| 64 |
CREATE DATABASE db_datadict; |
| 65 |
INSERT INTO information_schema.collations |
| 66 |
SELECT * FROM information_schema.collations; |
| 67 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 68 |
INSERT INTO information_schema.collations |
| 69 |
(collation_name,character_set_name,id,is_default,is_compiled,sortlen) |
| 70 |
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0); |
| 71 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 72 |
UPDATE information_schema.collations SET collation_name = 'just updated'; |
| 73 |
Got one of the listed errors |
| 74 |
DELETE FROM information_schema.collations WHERE table_name = 't1'; |
| 75 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 76 |
TRUNCATE information_schema.collations; |
| 77 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 78 |
CREATE INDEX my_idx ON information_schema.collations(character_set_name); |
| 79 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 80 |
ALTER TABLE information_schema.collations DROP PRIMARY KEY; |
| 81 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 82 |
ALTER TABLE information_schema.collations ADD f1 INT; |
| 83 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 84 |
ALTER TABLE information_schema.collations ENABLE KEYS; |
| 85 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 86 |
DROP TABLE information_schema.collations; |
| 87 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 88 |
ALTER TABLE information_schema.collations RENAME db_datadict.collations; |
| 89 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 90 |
ALTER TABLE information_schema.collations |
| 91 |
RENAME information_schema.xcollations; |
| 92 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 93 |
DROP DATABASE db_datadict; |