| 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(64) NO NULL |
| 33 |
ID bigint unsigned NO 0 |
| 34 |
IS_DEFAULT varchar(3) NO |
| 35 |
IS_COMPILED varchar(3) NO |
| 36 |
SORTLEN int unsigned NO NULL |
| 37 |
PAD_ATTRIBUTE enum('PAD SPACE','NO PAD') NO NULL |
| 38 |
SHOW CREATE TABLE information_schema.COLLATIONS; |
| 39 |
View Create View character_set_client collation_connection |
| 40 |
COLLATIONS CREATE ALGORITHM=UNDEFINED DEFINER=`mysql.infoschema`@`localhost` SQL SECURITY DEFINER VIEW `information_schema`.`COLLATIONS` AS select `col`.`name` AS `COLLATION_NAME`,`cs`.`name` AS `CHARACTER_SET_NAME`,`col`.`id` AS `ID`,if(exists(select 1 from `mysql`.`character_sets` where (`mysql`.`character_sets`.`default_collation_id` = `col`.`id`)),'Yes','') AS `IS_DEFAULT`,if(`col`.`is_compiled`,'Yes','') AS `IS_COMPILED`,`col`.`sort_length` AS `SORTLEN`,`col`.`pad_attribute` AS `PAD_ATTRIBUTE` from (`mysql`.`collations` `col` join `mysql`.`character_sets` `cs` on((`col`.`character_set_id` = `cs`.`id`))) utf8mb3 utf8mb3_general_ci |
| 41 |
SHOW COLUMNS FROM information_schema.COLLATIONS; |
| 42 |
Field Type Null Key Default Extra |
| 43 |
COLLATION_NAME varchar(64) NO NULL |
| 44 |
CHARACTER_SET_NAME varchar(64) NO NULL |
| 45 |
ID bigint unsigned NO 0 |
| 46 |
IS_DEFAULT varchar(3) NO |
| 47 |
IS_COMPILED varchar(3) NO |
| 48 |
SORTLEN int unsigned NO NULL |
| 49 |
PAD_ATTRIBUTE enum('PAD SPACE','NO PAD') NO NULL |
| 50 |
# Testcases 3.2.3.2 and 3.2.3.3 are checked in suite/funcs_1/t/charset_collation*.test |
| 51 |
######################################################################## |
| 52 |
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and |
| 53 |
# DDL on INFORMATION_SCHEMA tables are not supported |
| 54 |
######################################################################## |
| 55 |
DROP DATABASE IF EXISTS db_datadict; |
| 56 |
CREATE DATABASE db_datadict; |
| 57 |
INSERT INTO information_schema.collations |
| 58 |
SELECT * FROM information_schema.collations; |
| 59 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 60 |
INSERT INTO information_schema.collations |
| 61 |
(collation_name,character_set_name,id,is_default,is_compiled,sortlen) |
| 62 |
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0); |
| 63 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 64 |
UPDATE information_schema.collations SET description = 'just updated'; |
| 65 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 66 |
DELETE FROM information_schema.collations WHERE table_name = 't1'; |
| 67 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 68 |
TRUNCATE information_schema.collations; |
| 69 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 70 |
CREATE INDEX my_idx ON information_schema.collations(character_set_name); |
| 71 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 72 |
ALTER TABLE information_schema.collations DROP PRIMARY KEY; |
| 73 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 74 |
ALTER TABLE information_schema.collations ADD f1 INT; |
| 75 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 76 |
ALTER TABLE information_schema.collations ENABLE KEYS; |
| 77 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 78 |
DROP TABLE information_schema.collations; |
| 79 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 80 |
ALTER TABLE information_schema.collations RENAME db_datadict.collations; |
| 81 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 82 |
ALTER TABLE information_schema.collations |
| 83 |
RENAME information_schema.xcollations; |
| 84 |
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 85 |
DROP DATABASE db_datadict; |