diff options
author | Gagan Goel <gagan.nith@gmail.com> | 2018-08-26 00:25:52 -0400 |
---|---|---|
committer | Robert Bindar <robert@mariadb.org> | 2019-05-21 09:33:17 +0300 |
commit | e9c6d5a1e862c8fe26adf6fcd9b40386edd8404a (patch) | |
tree | 21c4846b5451c52646e6aaed68f2f1181b90e511 /mysql-test | |
parent | 9a8d1d84f8cc64db10bec79dffe813348c98545f (diff) | |
download | mariadb-git-e9c6d5a1e862c8fe26adf6fcd9b40386edd8404a.tar.gz |
MDEV-307 Add functionality for database comments
This commit adds a new feature to the server to add comments at the database
level. 1024 bytes is the maximum comment length allowed. If the comment length
exceeds this limit, a new error/warning code 4144 is thrown, based on whether
thd->is_strict_mode() is true/false. The database comment is also added to the
db.opt file, as well as to the information_schema.schemata table.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/comment_database.result | 78 | ||||
-rw-r--r-- | mysql-test/main/comment_database.test | 63 | ||||
-rw-r--r-- | mysql-test/main/information_schema.result | 20 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_columns_is.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_schemata.result | 29 | ||||
-rw-r--r-- | mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result | 14 |
6 files changed, 176 insertions, 30 deletions
diff --git a/mysql-test/main/comment_database.result b/mysql-test/main/comment_database.result new file mode 100644 index 00000000000..02dd24574db --- /dev/null +++ b/mysql-test/main/comment_database.result @@ -0,0 +1,78 @@ +# +# MDEV-307: Add functionality for database comments +# +CREATE DATABASE db1 COMMENT=; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd'; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */ COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd' +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; +schema_comment char_length(schema_comment) +abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd 1024 +DROP DATABASE db1; +SET SQL_MODE=''; +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde'; +Warnings: +Warning 4144 Comment for database 'db1' is too long (max = 1024) +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */ COMMENT 'abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd' +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; +schema_comment char_length(schema_comment) +abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd 1024 +DROP DATABASE db1; +SET SQL_MODE='TRADITIONAL'; +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde'; +ERROR HY000: Comment for database 'db1' is too long (max = 1024) +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; +schema_comment char_length(schema_comment) +CREATE DATABASE db1 COMMENT 'db1'; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */ COMMENT 'db1' +ALTER DATABASE db1 COMMENT = "db1 comment"; +SELECT * FROM information_schema.schemata +WHERE schema_name='db1'; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def db1 latin1 latin1_swedish_ci NULL db1 comment +DROP DATABASE db1; +CREATE DATABASE db1; +USE db1; +ALTER DATABASE COMMENT 'db1 comment' CHARACTER SET 'utf8'; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */ COMMENT 'db1 comment' +ALTER DATABASE db1 COMMENT 'this is db1 comment'; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8 */ COMMENT 'this is db1 comment' +ALTER DATABASE CHARACTER SET 'latin1'; +SHOW CREATE DATABASE db1; +Database Create Database +db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */ COMMENT 'this is db1 comment' +DROP DATABASE db1; +CREATE DATABASE comment COMMENT 'comment' CHARACTER SET 'latin2'; +SHOW CREATE DATABASE comment; +Database Create Database +comment CREATE DATABASE `comment` /*!40100 DEFAULT CHARACTER SET latin2 */ COMMENT 'comment' +ALTER DATABASE comment COMMENT 'comment comment'; +SHOW CREATE DATABASE comment; +Database Create Database +comment CREATE DATABASE `comment` /*!40100 DEFAULT CHARACTER SET latin2 */ COMMENT 'comment comment' +USE comment; +ALTER DATABASE COMMENT 'comment'; +SELECT * FROM information_schema.schemata +WHERE schema_name='comment'; +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def comment latin2 latin2_general_ci NULL comment +DROP DATABASE comment; diff --git a/mysql-test/main/comment_database.test b/mysql-test/main/comment_database.test new file mode 100644 index 00000000000..3fe1c7b205c --- /dev/null +++ b/mysql-test/main/comment_database.test @@ -0,0 +1,63 @@ +--echo # +--echo # MDEV-307: Add functionality for database comments +--echo # + +# Check an error state +--error ER_PARSE_ERROR +CREATE DATABASE db1 COMMENT=; + +# 1024 bytes +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd'; +SHOW CREATE DATABASE db1; +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; +DROP DATABASE db1; + +# 1025 bytes (warning) +SET SQL_MODE=''; +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde'; +SHOW CREATE DATABASE db1; +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; +DROP DATABASE db1; +SET SQL_MODE='TRADITIONAL'; + +# 1025 bytes (error) +--error ER_TOO_LONG_DATABASE_COMMENT +CREATE DATABASE db1 +COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde'; +SELECT schema_comment, char_length(schema_comment) +FROM information_schema.schemata +WHERE schema_name='db1'; + +CREATE DATABASE db1 COMMENT 'db1'; +SHOW CREATE DATABASE db1; +ALTER DATABASE db1 COMMENT = "db1 comment"; +SELECT * FROM information_schema.schemata +WHERE schema_name='db1'; +DROP DATABASE db1; + +CREATE DATABASE db1; +USE db1; +ALTER DATABASE COMMENT 'db1 comment' CHARACTER SET 'utf8'; +SHOW CREATE DATABASE db1; +ALTER DATABASE db1 COMMENT 'this is db1 comment'; +SHOW CREATE DATABASE db1; +ALTER DATABASE CHARACTER SET 'latin1'; +SHOW CREATE DATABASE db1; +DROP DATABASE db1; + +# Test the case when the database is named 'comment' +CREATE DATABASE comment COMMENT 'comment' CHARACTER SET 'latin2'; +SHOW CREATE DATABASE comment; +ALTER DATABASE comment COMMENT 'comment comment'; +SHOW CREATE DATABASE comment; +USE comment; +ALTER DATABASE COMMENT 'comment'; +SELECT * FROM information_schema.schemata +WHERE schema_name='comment'; +DROP DATABASE comment; diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index b4d2d065d4a..9e9c92e31be 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -10,11 +10,11 @@ grant select, update on test.* to mysqltest_1@localhost; create user mysqltest_3@localhost; create user mysqltest_3; select * from information_schema.SCHEMATA where schema_name > 'm'; -CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH -def mtr latin1 latin1_swedish_ci NULL -def mysql latin1 latin1_swedish_ci NULL -def performance_schema utf8 utf8_general_ci NULL -def test latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def mtr latin1 latin1_swedish_ci NULL +def mysql latin1 latin1_swedish_ci NULL +def performance_schema utf8 utf8_general_ci NULL +def test latin1 latin1_swedish_ci NULL select schema_name from information_schema.schemata; schema_name information_schema @@ -1575,14 +1575,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE b ALL NULL NULL NULL NULL NULL Using where; Open_frm_only; Scanned all databases; Using join buffer (flat, BNL join) SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'mysqltest'; -CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ''; -CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'test'; -CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH -def test latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def test latin1 latin1_swedish_ci NULL select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting'; count(*) 0 @@ -1627,7 +1627,7 @@ CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG U select * from `information_schema`.`REFERENTIAL_CONSTRAINTS` where `TABLE_NAME` = NULL; CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME UNIQUE_CONSTRAINT_CATALOG UNIQUE_CONSTRAINT_SCHEMA UNIQUE_CONSTRAINT_NAME MATCH_OPTION UPDATE_RULE DELETE_RULE TABLE_NAME REFERENCED_TABLE_NAME select * from information_schema.schemata where schema_name = NULL; -CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT select * from `information_schema`.`STATISTICS` where `TABLE_SCHEMA` = NULL; 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 INDEX_COMMENT select * from `information_schema`.`STATISTICS` where `TABLE_NAME` = NULL; diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result index 386b0f07f98..00f9f347067 100644 --- a/mysql-test/suite/funcs_1/r/is_columns_is.result +++ b/mysql-test/suite/funcs_1/r/is_columns_is.result @@ -326,6 +326,7 @@ def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NU def information_schema SCHEMATA CATALOG_NAME 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL +def information_schema SCHEMATA SCHEMA_COMMENT 6 '' NO varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select NEVER NULL def information_schema SCHEMATA SCHEMA_NAME 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL def information_schema SCHEMA_PRIVILEGES GRANTEE 1 '' NO varchar 190 570 NULL NULL NULL utf8 utf8_general_ci varchar(190) select NEVER NULL @@ -870,6 +871,7 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet 3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512) +3.0000 information_schema SCHEMATA SCHEMA_COMMENT varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 190 570 utf8 utf8_general_ci varchar(190) 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) diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result index 6db6ac8f150..18ee8d01147 100644 --- a/mysql-test/suite/funcs_1/r/is_schemata.result +++ b/mysql-test/suite/funcs_1/r/is_schemata.result @@ -33,6 +33,7 @@ SCHEMA_NAME varchar(64) NO DEFAULT_CHARACTER_SET_NAME varchar(32) NO DEFAULT_COLLATION_NAME varchar(32) NO SQL_PATH varchar(512) YES NULL +SCHEMA_COMMENT varchar(1024) NO SHOW CREATE TABLE information_schema.SCHEMATA; Table Create Table SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` ( @@ -40,7 +41,8 @@ SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` ( `SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '', `DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '', `DEFAULT_COLLATION_NAME` varchar(32) NOT NULL DEFAULT '', - `SQL_PATH` varchar(512) DEFAULT NULL + `SQL_PATH` varchar(512) DEFAULT NULL, + `SCHEMA_COMMENT` varchar(1024) NOT NULL DEFAULT '' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 SHOW COLUMNS FROM information_schema.SCHEMATA; Field Type Null Key Default Extra @@ -49,6 +51,7 @@ SCHEMA_NAME varchar(64) NO DEFAULT_CHARACTER_SET_NAME varchar(32) NO DEFAULT_COLLATION_NAME varchar(32) NO SQL_PATH varchar(512) YES NULL +SCHEMA_COMMENT varchar(1024) NO SELECT catalog_name, schema_name, sql_path FROM information_schema.schemata WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL @@ -77,9 +80,9 @@ 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 -def db_datadict_1 latin1 latin1_swedish_ci NULL -def db_datadict_2 latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def db_datadict_1 latin1 latin1_swedish_ci NULL +def db_datadict_2 latin1 latin1_swedish_ci NULL SHOW DATABASES LIKE 'db_datadict_%'; Database (db_datadict_%) db_datadict_1 @@ -87,17 +90,17 @@ db_datadict_2 connect testuser1, localhost, testuser1, , db_datadict_1; 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 -def db_datadict_1 latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def db_datadict_1 latin1 latin1_swedish_ci NULL SHOW DATABASES LIKE 'db_datadict_%'; Database (db_datadict_%) db_datadict_1 connect testuser2, localhost, testuser2, , db_datadict_2; 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 -def db_datadict_1 latin1 latin1_swedish_ci NULL -def db_datadict_2 latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def db_datadict_1 latin1 latin1_swedish_ci NULL +def db_datadict_2 latin1 latin1_swedish_ci NULL SHOW DATABASES LIKE 'db_datadict_%'; Database (db_datadict_%) db_datadict_1 @@ -105,7 +108,7 @@ db_datadict_2 connect testuser3, localhost, testuser3, , test; 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 +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT SHOW DATABASES LIKE 'db_datadict_%'; Database (db_datadict_%) connection default; @@ -122,11 +125,11 @@ DROP DATABASE db_datadict_2; ################################################################################# 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 +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT 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 -def db_datadict latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def 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 diff --git a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result index 0679142bd82..ccf0e513d88 100644 --- a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result +++ b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result @@ -9,10 +9,10 @@ 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 -def information_schema utf8 utf8_general_ci NULL -def mysql latin1 latin1_swedish_ci NULL -def test latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def information_schema utf8 utf8_general_ci NULL +def mysql latin1 latin1_swedish_ci NULL +def test latin1 latin1_swedish_ci NULL SHOW DATABASES LIKE 'information_schema'; Database (information_schema) information_schema @@ -26,9 +26,9 @@ connect testuser1, localhost, testuser1, , db_datadict; 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 -def information_schema utf8 utf8_general_ci NULL -def test latin1 latin1_swedish_ci NULL +CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH SCHEMA_COMMENT +def information_schema utf8 utf8_general_ci NULL +def test latin1 latin1_swedish_ci NULL SHOW DATABASES LIKE 'information_schema'; Database (information_schema) information_schema |