|
| 1 | +drop database if exists test2; |
| 2 | +drop database if exists test3; |
| 3 | +drop database if exists test4; |
| 4 | +drop database if exists test5; |
| 5 | +drop database if exists test6; |
| 6 | +drop database if exists test7; |
| 7 | +drop database if exists test8; |
| 8 | +drop database if exists test9; |
| 9 | +create database test2; |
| 10 | +show create database test2; |
| 11 | +Database Create Database |
| 12 | +test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin1 */ |
| 13 | +default-character-set=latin1 |
| 14 | +default-collation=latin1_swedish_ci |
| 15 | +db-read-only=0 |
| 16 | +db-metadata= |
| 17 | +create database test3 character set utf8; |
| 18 | +show create database test3; |
| 19 | +Database Create Database |
| 20 | +test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET utf8 */ |
| 21 | +default-character-set=utf8 |
| 22 | +default-collation=utf8_general_ci |
| 23 | +db-read-only=0 |
| 24 | +db-metadata= |
| 25 | +create database test4 read_only = true; |
| 26 | +show create database test4; |
| 27 | +Database Create Database |
| 28 | +test4 CREATE DATABASE `test4` /*!40100 DEFAULT CHARACTER SET latin1 READ_ONLY */ |
| 29 | +default-character-set=latin1 |
| 30 | +default-collation=latin1_swedish_ci |
| 31 | +db-read-only=1 |
| 32 | +db-metadata= |
| 33 | +create database test5 db_metadata = "{\"shard\":\"test5_shard\"}"; |
| 34 | +show create database test5; |
| 35 | +Database Create Database |
| 36 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET latin1 DB_METADATA {"shard":"test5_shard"} */ |
| 37 | +default-character-set=latin1 |
| 38 | +default-collation=latin1_swedish_ci |
| 39 | +db-read-only=0 |
| 40 | +db-metadata={"shard":"test5_shard"} |
| 41 | +create database test6 character set utf8 db_metadata = "{\"shard\":\"test6_shard\"}"; |
| 42 | +show create database test6; |
| 43 | +Database Create Database |
| 44 | +test6 CREATE DATABASE `test6` /*!40100 DEFAULT CHARACTER SET utf8 DB_METADATA {"shard":"test6_shard"} */ |
| 45 | +default-character-set=utf8 |
| 46 | +default-collation=utf8_general_ci |
| 47 | +db-read-only=0 |
| 48 | +db-metadata={"shard":"test6_shard"} |
| 49 | +create database test7 read_only = true db_metadata = "{\"shard\":\"test7_shard\"}"; |
| 50 | +show create database test7; |
| 51 | +Database Create Database |
| 52 | +test7 CREATE DATABASE `test7` /*!40100 DEFAULT CHARACTER SET latin1 READ_ONLY DB_METADATA {"shard":"test7_shard"} */ |
| 53 | +default-character-set=latin1 |
| 54 | +default-collation=latin1_swedish_ci |
| 55 | +db-read-only=1 |
| 56 | +db-metadata={"shard":"test7_shard"} |
| 57 | +create database test8 character set utf8 read_only = true; |
| 58 | +show create database test8; |
| 59 | +Database Create Database |
| 60 | +test8 CREATE DATABASE `test8` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY */ |
| 61 | +default-character-set=utf8 |
| 62 | +default-collation=utf8_general_ci |
| 63 | +db-read-only=1 |
| 64 | +db-metadata= |
| 65 | +create database test9 character set utf8 read_only = true db_metadata = "{\"shard\":\"test9_shard\"}"; |
| 66 | +show create database test9; |
| 67 | +Database Create Database |
| 68 | +test9 CREATE DATABASE `test9` /*!40100 DEFAULT CHARACTER SET utf8 READ_ONLY DB_METADATA {"shard":"test9_shard"} */ |
| 69 | +default-character-set=utf8 |
| 70 | +default-collation=utf8_general_ci |
| 71 | +db-read-only=1 |
| 72 | +db-metadata={"shard":"test9_shard"} |
| 73 | +alter database test3 character set ascii; |
| 74 | +show create database test3; |
| 75 | +Database Create Database |
| 76 | +test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET ascii */ |
| 77 | +default-character-set=ascii |
| 78 | +default-collation=ascii_general_ci |
| 79 | +db-read-only=0 |
| 80 | +db-metadata= |
| 81 | +alter database test4 read_only = true; |
| 82 | +show create database test4; |
| 83 | +Database Create Database |
| 84 | +test4 CREATE DATABASE `test4` /*!40100 DEFAULT CHARACTER SET latin1 READ_ONLY */ |
| 85 | +default-character-set=latin1 |
| 86 | +default-collation=latin1_swedish_ci |
| 87 | +db-read-only=1 |
| 88 | +db-metadata= |
| 89 | +alter database test5 db_metadata = "{\"shard\":\"test5_shard_altered\"}"; |
| 90 | +show create database test5; |
| 91 | +Database Create Database |
| 92 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET latin1 DB_METADATA {"shard":"test5_shard_altered"} */ |
| 93 | +default-character-set=latin1 |
| 94 | +default-collation=latin1_swedish_ci |
| 95 | +db-read-only=0 |
| 96 | +db-metadata={"shard":"test5_shard_altered"} |
| 97 | +alter database test5 character set ascii; |
| 98 | +show create database test5; |
| 99 | +Database Create Database |
| 100 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET ascii DB_METADATA {"shard":"test5_shard_altered"} */ |
| 101 | +default-character-set=ascii |
| 102 | +default-collation=ascii_general_ci |
| 103 | +db-read-only=0 |
| 104 | +db-metadata={"shard":"test5_shard_altered"} |
| 105 | +alter database test5 read_only = true; |
| 106 | +show create database test5; |
| 107 | +Database Create Database |
| 108 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET ascii READ_ONLY DB_METADATA {"shard":"test5_shard_altered"} */ |
| 109 | +default-character-set=ascii |
| 110 | +default-collation=ascii_general_ci |
| 111 | +db-read-only=1 |
| 112 | +db-metadata={"shard":"test5_shard_altered"} |
| 113 | +alter database test5 character set utf8 read_only = false; |
| 114 | +show create database test5; |
| 115 | +Database Create Database |
| 116 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET utf8 DB_METADATA {"shard":"test5_shard_altered"} */ |
| 117 | +default-character-set=utf8 |
| 118 | +default-collation=utf8_general_ci |
| 119 | +db-read-only=0 |
| 120 | +db-metadata={"shard":"test5_shard_altered"} |
| 121 | +alter database test5 db_metadata ""; |
| 122 | +show create database test5; |
| 123 | +Database Create Database |
| 124 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET utf8 */ |
| 125 | +default-character-set=utf8 |
| 126 | +default-collation=utf8_general_ci |
| 127 | +db-read-only=0 |
| 128 | +db-metadata= |
| 129 | +alter database test5 db_metadata "{\"shard\":\"Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Fin\"}"; |
| 130 | +show create database test5; |
| 131 | +Database Create Database |
| 132 | +test5 CREATE DATABASE `test5` /*!40100 DEFAULT CHARACTER SET utf8 DB_METADATA {"shard":"Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Fin"} */ |
| 133 | +default-character-set=utf8 |
| 134 | +default-collation=utf8_general_ci |
| 135 | +db-read-only=0 |
| 136 | +db-metadata={"shard":"Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Fin"} |
| 137 | +alter database test5 db_metadata "{\"shard\":\"Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Really long shard name. Fin\"}";; |
| 138 | +ERROR HY000: Metadata for the database is too long. Max length is 1024 bytes |
| 139 | +alter database test6 character set ascii db_metadata = "{\"shard\":\"test6_shard_altered\"}"; |
| 140 | +show create database test6; |
| 141 | +Database Create Database |
| 142 | +test6 CREATE DATABASE `test6` /*!40100 DEFAULT CHARACTER SET ascii DB_METADATA {"shard":"test6_shard_altered"} */ |
| 143 | +default-character-set=ascii |
| 144 | +default-collation=ascii_general_ci |
| 145 | +db-read-only=0 |
| 146 | +db-metadata={"shard":"test6_shard_altered"} |
| 147 | +alter database test7 read_only = true db_metadata = "{\"shard\":\"test7_shard_altered\"}"; |
| 148 | +show create database test7; |
| 149 | +Database Create Database |
| 150 | +test7 CREATE DATABASE `test7` /*!40100 DEFAULT CHARACTER SET latin1 READ_ONLY DB_METADATA {"shard":"test7_shard_altered"} */ |
| 151 | +default-character-set=latin1 |
| 152 | +default-collation=latin1_swedish_ci |
| 153 | +db-read-only=1 |
| 154 | +db-metadata={"shard":"test7_shard_altered"} |
| 155 | +alter database test8 character set ascii read_only = true; |
| 156 | +show create database test8; |
| 157 | +Database Create Database |
| 158 | +test8 CREATE DATABASE `test8` /*!40100 DEFAULT CHARACTER SET ascii READ_ONLY */ |
| 159 | +default-character-set=ascii |
| 160 | +default-collation=ascii_general_ci |
| 161 | +db-read-only=1 |
| 162 | +db-metadata= |
| 163 | +alter database test9 character set ascii read_only = true db_metadata = "{\"shard\":\"test9_shard_altered\"}"; |
| 164 | +show create database test9; |
| 165 | +Database Create Database |
| 166 | +test9 CREATE DATABASE `test9` /*!40100 DEFAULT CHARACTER SET ascii READ_ONLY DB_METADATA {"shard":"test9_shard_altered"} */ |
| 167 | +default-character-set=ascii |
| 168 | +default-collation=ascii_general_ci |
| 169 | +db-read-only=1 |
| 170 | +db-metadata={"shard":"test9_shard_altered"} |
| 171 | +show create database information_schema; |
| 172 | +Database Create Database |
| 173 | +information_schema CREATE DATABASE `information_schema` /*!40100 DEFAULT CHARACTER SET utf8 */ |
| 174 | +show create database mysql; |
| 175 | +Database Create Database |
| 176 | +mysql CREATE DATABASE `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */ |
| 177 | +alter database information_schema db_metadata "{\"shard\":\"is_shard\"}";; |
| 178 | +ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' |
| 179 | +drop database if exists test2; |
| 180 | +drop database if exists test3; |
| 181 | +drop database if exists test4; |
| 182 | +drop database if exists test5; |
| 183 | +drop database if exists test6; |
| 184 | +drop database if exists test7; |
| 185 | +drop database if exists test8; |
| 186 | +drop database if exists test9; |
0 commit comments