• mleich@five.local.lan's avatar
    WL#4203 Reorganize and fix the data dictionary tests of · 30091e23
    mleich@five.local.lan authored
            testsuite funcs_1
    1. Fix the following bugs
       Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration
          Solution: Test variants charset_collation_* adjusted to different builds
       Bug#32603 "datadict" tests (all engines) fail in "community" tree: "PROFILING" table
          Solution: Excluding "PROFILING" table from queries
       Bug#33654 "slow log" is missing a line
          Solution: Unify the content of the fields TABLES.TABLE_ROWS and
                    STATISTICS.CARDINALITY within result sets
       Bug#34532 Some funcs_1 tests do not clean up at end of testing
          Solution: DROP objects/reset global server variables modified during testing
                    + let tests missing implementation end before loading of tables
       Bug#31421 funcs_1: ndb__datadict fails, discrepancy between scripts and expected results
          Solution: Cut <engine>__datadict tests into smaller tests + generate new results.
       Bug#33599 INFORMATION_SCHEMA.STATISTICS got a new column INDEX_COMMENT: tests fail (2)
          Generation of new results during post merge fix
       Bug#33600 CHARACTER_OCTET_LENGTH is now CHARACTER_MAXIMUM_LENGTH * 4
          Generation of new results during post merge fix
       Bug#33631 Platform-specific replace of CHARACTER_MAXIMUM_LENGTH broken by 4-byte encoding
          Generation of new results during post merge fix
          + removal of platform-specific replace routine (no more needed)
    2. Restructure the tests
       - Test not more than one INFORMATION_SCHEMA view per testscript
       - Separate tests of I_S view layout+functionality from content related to the
         all time existing databases "information_schema", "mysql" and "test"
       - Avoid storage engine related variants of tests which are not sensible to
         storage engines at all.
    3. Reimplement or add some subtests + cleanup
       There is a some probability that even the reviewed changeset
       - does not fix all bugs from above   or
       - contains new bugs which show up on some platforms <> Linux or on one of
         the various build types
    4. The changeset contains fixes according to
       - one code review
       - minor bugs within testing code found after code review (accepted by reviewer)
       - problems found during tests with 5.0.56 in build environment
    30091e23
is_tables_mysql.result 9.27 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0
AND INSTR(table_comment,'number_of_replicas') = 0,
LENGTH(table_comment),
INSTR(table_comment,'InnoDB free')
+ INSTR(table_comment,'number_of_replicas') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	columns_priv
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Column privileges
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	db
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Database privileges
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	func
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	User defined functions
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	help_category
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	help categories
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	help_keyword
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	help keywords
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	help_relation
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	keyword-topic relation
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	help_topic
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Dynamic
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	help topics
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	host
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Host privileges;  Merged with database privileges
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	proc
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Dynamic
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Stored Procedures
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	procs_priv
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Procedure privileges
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	tables_priv
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Table privileges
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	time_zone
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	6
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Time zones
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	time_zone_leap_second
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Leap seconds information for time zones
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	time_zone_name
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Time zone names
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	time_zone_transition
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Time zone transitions
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	time_zone_transition_type
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Fixed
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_general_ci
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Time zone transition types
Separator	-----------------------------------------------------
TABLE_CATALOG	NULL
TABLE_SCHEMA	mysql
TABLE_NAME	user
TABLE_TYPE	BASE TABLE
ENGINE	MyISAM
VERSION	10
ROW_FORMAT	Dynamic
TABLE_ROWS	#TBLR#
AVG_ROW_LENGTH	#ARL#
DATA_LENGTH	#DL#
MAX_DATA_LENGTH	#MDL#
INDEX_LENGTH	#IL#
DATA_FREE	#DF#
AUTO_INCREMENT	NULL
CREATE_TIME	#CRT#
UPDATE_TIME	#UT#
CHECK_TIME	#CT#
TABLE_COLLATION	utf8_bin
CHECKSUM	NULL
CREATE_OPTIONS	#CO#
TABLE_COMMENT	#TC#
user_comment	Users and global privileges
Separator	-----------------------------------------------------
DROP   USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
# Establish connection testuser1 (user=testuser1)
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0
AND INSTR(table_comment,'number_of_replicas') = 0,
LENGTH(table_comment),
INSTR(table_comment,'InnoDB free')
+ INSTR(table_comment,'number_of_replicas') - 1))
AS "user_comment",
'-----------------------------------------------------' AS "Separator"
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
# Switch to connection default and close connection testuser1
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;