| 1 |
set @orig_sql_mode= @@sql_mode; |
| 2 |
drop table if exists t1,t2; |
| 3 |
drop view if exists v1,v2; |
| 4 |
drop function if exists f1; |
| 5 |
drop function if exists f2; |
| 6 |
use INFORMATION_SCHEMA; |
| 7 |
show tables where Tables_in_information_schema NOT LIKE 'INNODB%' and Tables_in_information_schema NOT LIKE 'ndb%'; |
| 8 |
Tables_in_information_schema |
| 9 |
ADMINISTRABLE_ROLE_AUTHORIZATIONS |
| 10 |
APPLICABLE_ROLES |
| 11 |
CHARACTER_SETS |
| 12 |
CHECK_CONSTRAINTS |
| 13 |
COLLATIONS |
| 14 |
COLLATION_CHARACTER_SET_APPLICABILITY |
| 15 |
COLUMNS |
| 16 |
COLUMNS_EXTENSIONS |
| 17 |
COLUMN_PRIVILEGES |
| 18 |
COLUMN_STATISTICS |
| 19 |
ENABLED_ROLES |
| 20 |
ENGINES |
| 21 |
EVENTS |
| 22 |
FILES |
| 23 |
KEYWORDS |
| 24 |
KEY_COLUMN_USAGE |
| 25 |
OPTIMIZER_TRACE |
| 26 |
PARAMETERS |
| 27 |
PARTITIONS |
| 28 |
PLUGINS |
| 29 |
PROCESSLIST |
| 30 |
PROFILING |
| 31 |
REFERENTIAL_CONSTRAINTS |
| 32 |
RESOURCE_GROUPS |
| 33 |
ROLE_COLUMN_GRANTS |
| 34 |
ROLE_ROUTINE_GRANTS |
| 35 |
ROLE_TABLE_GRANTS |
| 36 |
ROUTINES |
| 37 |
SCHEMATA |
| 38 |
SCHEMATA_EXTENSIONS |
| 39 |
SCHEMA_PRIVILEGES |
| 40 |
STATISTICS |
| 41 |
ST_GEOMETRY_COLUMNS |
| 42 |
ST_SPATIAL_REFERENCE_SYSTEMS |
| 43 |
ST_UNITS_OF_MEASURE |
| 44 |
TABLES |
| 45 |
TABLESPACES |
| 46 |
TABLESPACES_EXTENSIONS |
| 47 |
TABLES_EXTENSIONS |
| 48 |
TABLE_CONSTRAINTS |
| 49 |
TABLE_CONSTRAINTS_EXTENSIONS |
| 50 |
TABLE_PRIVILEGES |
| 51 |
TRIGGERS |
| 52 |
USER_ATTRIBUTES |
| 53 |
USER_PRIVILEGES |
| 54 |
VIEWS |
| 55 |
VIEW_ROUTINE_USAGE |
| 56 |
VIEW_TABLE_USAGE |
| 57 |
show tables from INFORMATION_SCHEMA like 'T%'; |
| 58 |
Tables_in_information_schema (T%) |
| 59 |
TABLES |
| 60 |
TABLESPACES |
| 61 |
TABLESPACES_EXTENSIONS |
| 62 |
TABLES_EXTENSIONS |
| 63 |
TABLE_CONSTRAINTS |
| 64 |
TABLE_CONSTRAINTS_EXTENSIONS |
| 65 |
TABLE_PRIVILEGES |
| 66 |
TRIGGERS |
| 67 |
create database `inf%`; |
| 68 |
create database mbase; |
| 69 |
use `inf%`; |
| 70 |
show tables; |
| 71 |
Tables_in_inf% |
| 72 |
create user 'mysqltest_1'@'localhost'; |
| 73 |
grant all privileges on `inf%`.* to 'mysqltest_1'@'localhost'; |
| 74 |
grant all privileges on `mbase`.* to 'mysqltest_1'@'localhost'; |
| 75 |
create table t1 (f1 int); |
| 76 |
create function func1(curr_int int) returns int |
| 77 |
begin |
| 78 |
declare ret_val int; |
| 79 |
select max(f1) from t1 into ret_val; |
| 80 |
return ret_val; |
| 81 |
end| |
| 82 |
create view v1 as select f1 from t1 where f1 = func1(f1); |
| 83 |
create function func2() returns int return 1; |
| 84 |
use mbase; |
| 85 |
create procedure p1 () |
| 86 |
begin |
| 87 |
select table_name from information_schema.key_column_usage |
| 88 |
order by table_name; |
| 89 |
end| |
| 90 |
create table t1 |
| 91 |
(f1 int(10) unsigned not null, |
| 92 |
f2 varchar(100) not null, |
| 93 |
primary key (f1), unique key (f2)); |
| 94 |
Warnings: |
| 95 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 96 |
select * from information_schema.tables; |
| 97 |
call mbase.p1(); |
| 98 |
call mbase.p1(); |
| 99 |
call mbase.p1(); |
| 100 |
use `inf%`; |
| 101 |
drop user mysqltest_1@localhost; |
| 102 |
drop table t1; |
| 103 |
select table_name, table_type, table_comment from information_schema.tables |
| 104 |
where table_schema='inf%' and func2(); |
| 105 |
TABLE_NAME TABLE_TYPE TABLE_COMMENT |
| 106 |
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 107 |
Warnings: |
| 108 |
Warning 1356 View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 109 |
select table_name, table_type, table_comment from information_schema.tables |
| 110 |
where table_schema='inf%' and func2(); |
| 111 |
TABLE_NAME TABLE_TYPE TABLE_COMMENT |
| 112 |
v1 VIEW View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 113 |
Warnings: |
| 114 |
Warning 1356 View 'inf%.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 115 |
drop view v1; |
| 116 |
drop function func1; |
| 117 |
drop function func2; |
| 118 |
drop database `inf%`; |
| 119 |
drop procedure mbase.p1; |
| 120 |
drop database mbase; |
| 121 |
use test; |
| 122 |
create table t1 (i int); |
| 123 |
create function f1 () returns int return (select max(i) from t1); |
| 124 |
create view v1 as select f1(); |
| 125 |
create table t2 (id int); |
| 126 |
create function f2 () returns int return (select max(i) from t2); |
| 127 |
create view v2 as select f2(); |
| 128 |
drop table t2; |
| 129 |
select table_name, table_type, table_comment from information_schema.tables |
| 130 |
where table_schema='test'; |
| 131 |
TABLE_NAME TABLE_TYPE TABLE_COMMENT |
| 132 |
t1 BASE TABLE |
| 133 |
v1 VIEW VIEW |
| 134 |
v2 VIEW View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 135 |
Warnings: |
| 136 |
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 137 |
drop table t1; |
| 138 |
select table_name, table_type, table_comment from information_schema.tables |
| 139 |
where table_schema='test'; |
| 140 |
TABLE_NAME TABLE_TYPE TABLE_COMMENT |
| 141 |
v1 VIEW View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 142 |
v2 VIEW View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 143 |
Warnings: |
| 144 |
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 145 |
Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 146 |
drop function f1; |
| 147 |
drop function f2; |
| 148 |
drop view v1, v2; |
| 149 |
create database testdb_1; |
| 150 |
create user testdb_1@localhost; |
| 151 |
grant all on testdb_1.* to testdb_1@localhost with grant option; |
| 152 |
create user testdb_2@localhost; |
| 153 |
grant all on test.* to testdb_2@localhost with grant option; |
| 154 |
use testdb_1; |
| 155 |
create table t1 (f1 char(4)); |
| 156 |
create view v1 as select f1 from t1; |
| 157 |
grant insert on v1 to testdb_2@localhost; |
| 158 |
create view v5 as select f1 from t1; |
| 159 |
grant select, show view on v5 to testdb_2@localhost; |
| 160 |
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1; |
| 161 |
ERROR 42000: Access denied; you need (at least one of) the SUPER or SET_USER_ID privilege(s) for this operation |
| 162 |
use testdb_1; |
| 163 |
create view v6 as select f1 from t1; |
| 164 |
grant select, show view on v6 to testdb_2@localhost; |
| 165 |
create table t2 (f1 char(4)); |
| 166 |
create definer=`no_such_user`@`no_such_host` view v7 as select * from t2; |
| 167 |
Warnings: |
| 168 |
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist |
| 169 |
show fields from testdb_1.v6; |
| 170 |
Field Type Null Key Default Extra |
| 171 |
f1 char(4) YES NULL |
| 172 |
show create view testdb_1.v6; |
| 173 |
View Create View character_set_client collation_connection |
| 174 |
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v6` AS select `t1`.`f1` AS `f1` from `t1` utf8mb4 utf8mb4_0900_ai_ci |
| 175 |
show create view testdb_1.v7; |
| 176 |
View Create View character_set_client collation_connection |
| 177 |
v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `t2`.`f1` AS `f1` from `t2` utf8mb4 utf8mb4_0900_ai_ci |
| 178 |
Warnings: |
| 179 |
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist |
| 180 |
show fields from testdb_1.v7; |
| 181 |
Field Type Null Key Default Extra |
| 182 |
f1 char(4) YES NULL |
| 183 |
create table t3 (f1 char(4), f2 char(4)); |
| 184 |
create view v3 as select f1,f2 from t3; |
| 185 |
grant insert(f1), insert(f2) on v3 to testdb_2@localhost; |
| 186 |
create view v2 as select f1 from testdb_1.v1; |
| 187 |
create view v4 as select f1,f2 from testdb_1.v3; |
| 188 |
show fields from testdb_1.v5; |
| 189 |
Field Type Null Key Default Extra |
| 190 |
f1 char(4) YES NULL |
| 191 |
show create view testdb_1.v5; |
| 192 |
View Create View character_set_client collation_connection |
| 193 |
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` utf8mb4 utf8mb4_0900_ai_ci |
| 194 |
show fields from testdb_1.v6; |
| 195 |
Field Type Null Key Default Extra |
| 196 |
f1 char(4) YES NULL |
| 197 |
show create view testdb_1.v6; |
| 198 |
View Create View character_set_client collation_connection |
| 199 |
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` utf8mb4 utf8mb4_0900_ai_ci |
| 200 |
show fields from testdb_1.v7; |
| 201 |
Field Type Null Key Default Extra |
| 202 |
f1 char(4) YES NULL |
| 203 |
show create view testdb_1.v7; |
| 204 |
View Create View character_set_client collation_connection |
| 205 |
v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY DEFINER VIEW `v7` AS select `t2`.`f1` AS `f1` from `t2` utf8mb4 utf8mb4_0900_ai_ci |
| 206 |
Warnings: |
| 207 |
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist |
| 208 |
revoke insert(f1) on v3 from testdb_2@localhost; |
| 209 |
revoke select,show view on v5 from testdb_2@localhost; |
| 210 |
use testdb_1; |
| 211 |
revoke select,show view on v6 from testdb_2@localhost; |
| 212 |
show fields from testdb_1.v5; |
| 213 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5' |
| 214 |
show create view testdb_1.v5; |
| 215 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5' |
| 216 |
show fields from testdb_1.v6; |
| 217 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v6' |
| 218 |
show create view testdb_1.v6; |
| 219 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v6' |
| 220 |
show fields from testdb_1.v7; |
| 221 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7' |
| 222 |
show create view testdb_1.v7; |
| 223 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v7' |
| 224 |
show create view v4; |
| 225 |
View Create View character_set_client collation_connection |
| 226 |
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `testdb_1`.`v3`.`f1` AS `f1`,`testdb_1`.`v3`.`f2` AS `f2` from `testdb_1`.`v3` utf8mb4 utf8mb4_0900_ai_ci |
| 227 |
show fields from v4; |
| 228 |
Field Type Null Key Default Extra |
| 229 |
f1 char(4) YES NULL |
| 230 |
f2 char(4) YES NULL |
| 231 |
show fields from v2; |
| 232 |
Field Type Null Key Default Extra |
| 233 |
f1 char(4) YES NULL |
| 234 |
show fields from testdb_1.v1; |
| 235 |
Field Type Null Key Default Extra |
| 236 |
f1 char(4) YES NULL |
| 237 |
show create view v2; |
| 238 |
View Create View character_set_client collation_connection |
| 239 |
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `testdb_1`.`v1`.`f1` AS `f1` from `testdb_1`.`v1` utf8mb4 utf8mb4_0900_ai_ci |
| 240 |
show create view testdb_1.v1; |
| 241 |
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v1' |
| 242 |
select table_name from information_schema.columns a |
| 243 |
where a.table_name = 'v2'; |
| 244 |
TABLE_NAME |
| 245 |
v2 |
| 246 |
select view_definition from information_schema.views a |
| 247 |
where a.table_name = 'v2'; |
| 248 |
VIEW_DEFINITION |
| 249 |
select `testdb_1`.`v1`.`f1` AS `f1` from `testdb_1`.`v1` |
| 250 |
select view_definition from information_schema.views a |
| 251 |
where a.table_name = 'testdb_1.v1'; |
| 252 |
VIEW_DEFINITION |
| 253 |
select * from v2; |
| 254 |
ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them |
| 255 |
use test; |
| 256 |
drop view testdb_1.v1, v2, testdb_1.v3, v4; |
| 257 |
drop database testdb_1; |
| 258 |
drop user testdb_1@localhost; |
| 259 |
drop user testdb_2@localhost; |
| 260 |
create database testdb_1; |
| 261 |
create table testdb_1.t1 (a int); |
| 262 |
create view testdb_1.v1 as select * from testdb_1.t1; |
| 263 |
create user mysqltest_1@localhost; |
| 264 |
grant show view on testdb_1.* to mysqltest_1@localhost; |
| 265 |
grant select on testdb_1.v1 to mysqltest_1@localhost; |
| 266 |
select table_schema, table_name, view_definition from information_schema.views |
| 267 |
where table_name='v1'; |
| 268 |
TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION |
| 269 |
testdb_1 v1 select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1` |
| 270 |
show create view testdb_1.v1; |
| 271 |
View Create View character_set_client collation_connection |
| 272 |
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v1` AS select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1` utf8mb4 utf8mb4_0900_ai_ci |
| 273 |
revoke select on testdb_1.v1 from mysqltest_1@localhost; |
| 274 |
select table_schema, table_name, view_definition from information_schema.views |
| 275 |
where table_name='v1'; |
| 276 |
TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION |
| 277 |
testdb_1 v1 |
| 278 |
show create view testdb_1.v1; |
| 279 |
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1' |
| 280 |
drop user mysqltest_1@localhost; |
| 281 |
drop database testdb_1; |
| 282 |
set sql_mode= @orig_sql_mode; |
| 283 |
# |
| 284 |
# Bug#30158484 FULLY QUALIFIED COLUMN NAMES IN WHERE CLAUSE ARE |
| 285 |
# FAILING WITH INFORMATION_SCHEMA TABLES IN 8.0 |
| 286 |
# |
| 287 |
# Case 1: INFORMATION_SCHEMA name in SELECT clause with mixed case. |
| 288 |
# |
| 289 |
# These commands fail with ER_BAD_FIELD_ERROR without the fix. |
| 290 |
SELECT INFORMATION_schema.TABLES.TABLE_NAME, |
| 291 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 292 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME, |
| 293 |
information_schema.TABLES.TABLE_NAME |
| 294 |
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 295 |
TABLE_NAME TABLE_NAME TABLE_NAME TABLE_NAME |
| 296 |
SELECT INFORMATION_schema.TABLES.TABLE_NAME, |
| 297 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 298 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME, |
| 299 |
information_schema.TABLES.TABLE_NAME |
| 300 |
FROM information_schema.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 301 |
TABLE_NAME TABLE_NAME TABLE_NAME TABLE_NAME |
| 302 |
SELECT INFORMATION_schema.TABLES.TABLE_NAME, |
| 303 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 304 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME, |
| 305 |
information_schema.TABLES.TABLE_NAME |
| 306 |
FROM information_SCHEMA.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 307 |
TABLE_NAME TABLE_NAME TABLE_NAME TABLE_NAME |
| 308 |
# |
| 309 |
# Case 2: INFORMATION_SCHEMA name used to specify '*' in SELECT |
| 310 |
# clause with mixed case. |
| 311 |
# |
| 312 |
SELECT INFORMATION_SCHEMA.TABLES.* |
| 313 |
FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 314 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT |
| 315 |
SELECT information_schema.TABLES.* |
| 316 |
FROM information_schema.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 317 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT |
| 318 |
SELECT INFORMATION_SCHEMA.TABLES.* |
| 319 |
FROM information_schema.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 320 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT |
| 321 |
SELECT INFORMATION_schema.TABLES.* |
| 322 |
FROM information_SCHEMA.TABLES WHERE TABLE_NAME='non_existing_table'; |
| 323 |
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT |
| 324 |
# |
| 325 |
# Case 3: INFORMATION_SCHEMA name in WHERE clause with mixed case. |
| 326 |
# |
| 327 |
SELECT COUNT(*) > 1 FROM INFORMATION_SCHEMA.TABLES |
| 328 |
WHERE INFORMATION_schema.TABLES.TABLE_NAME LIKE 'a%' AND |
| 329 |
information_SCHEMA.TABLES.TABLE_NAME LIKE 'b%' AND |
| 330 |
information_schema.TABLES.TABLE_NAME LIKE 'c%' AND |
| 331 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIKE 'd%'; |
| 332 |
COUNT(*) > 1 |
| 333 |
0 |
| 334 |
SELECT COUNT(*) > 1 FROM information_schema.TABLES |
| 335 |
WHERE INFORMATION_schema.TABLES.TABLE_NAME LIKE 'a%' AND |
| 336 |
information_SCHEMA.TABLES.TABLE_NAME LIKE 'b%' AND |
| 337 |
information_schema.TABLES.TABLE_NAME LIKE 'c%' AND |
| 338 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIKE 'd%'; |
| 339 |
COUNT(*) > 1 |
| 340 |
0 |
| 341 |
SELECT COUNT(*) > 1 FROM INFORMATION_schema.TABLES |
| 342 |
WHERE INFORMATION_schema.TABLES.TABLE_NAME LIKE 'a%' AND |
| 343 |
information_SCHEMA.TABLES.TABLE_NAME LIKE 'b%' AND |
| 344 |
information_schema.TABLES.TABLE_NAME LIKE 'c%' AND |
| 345 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIKE 'd%'; |
| 346 |
COUNT(*) > 1 |
| 347 |
0 |
| 348 |
# |
| 349 |
# Case 4: INFORMATION_SCHEMA name in ORDER BY clause with mixed case. |
| 350 |
# |
| 351 |
SELECT COUNT(*) > 1 FROM INFORMATION_SCHEMA.TABLES |
| 352 |
ORDER BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 353 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 354 |
information_schema.TABLES.TABLE_NAME, |
| 355 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME; |
| 356 |
COUNT(*) > 1 |
| 357 |
1 |
| 358 |
SELECT COUNT(*) > 1 FROM information_schema.TABLES |
| 359 |
ORDER BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 360 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 361 |
information_schema.TABLES.TABLE_NAME, |
| 362 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME; |
| 363 |
COUNT(*) > 1 |
| 364 |
1 |
| 365 |
SELECT COUNT(*) > 1 FROM INFORMATION_schema.TABLES |
| 366 |
ORDER BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 367 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 368 |
information_schema.TABLES.TABLE_NAME, |
| 369 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME; |
| 370 |
COUNT(*) > 1 |
| 371 |
1 |
| 372 |
# |
| 373 |
# Case 5: INFORMATION_SCHEMA name in GROUP BY clause with mixed case. |
| 374 |
# |
| 375 |
SELECT COUNT(*) > 1 FROM INFORMATION_SCHEMA.TABLES |
| 376 |
GROUP BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 377 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 378 |
information_schema.TABLES.TABLE_NAME, |
| 379 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIMIT 1; |
| 380 |
COUNT(*) > 1 |
| 381 |
0 |
| 382 |
SELECT COUNT(*) > 1 FROM information_schema.TABLES |
| 383 |
GROUP BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 384 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 385 |
information_schema.TABLES.TABLE_NAME, |
| 386 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIMIT 1; |
| 387 |
COUNT(*) > 1 |
| 388 |
0 |
| 389 |
SELECT COUNT(*) > 1 FROM INFORMATION_schema.TABLES |
| 390 |
GROUP BY INFORMATION_schema.TABLES.TABLE_NAME, |
| 391 |
information_SCHEMA.TABLES.TABLE_NAME, |
| 392 |
information_schema.TABLES.TABLE_NAME, |
| 393 |
INFORMATION_SCHEMA.TABLES.TABLE_NAME LIMIT 1; |
| 394 |
COUNT(*) > 1 |
| 395 |
0 |
| 396 |
# |
| 397 |
# Case 6: Test behavior using INFORMATION_SCHEMA name, I_S table name |
| 398 |
# and I_S column name with mixed cases. |
| 399 |
# |
| 400 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 401 |
WHERE INFORMATION_SCHEMA.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 402 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 403 |
WHERE INFORMATION_SCHEMA.SCHEMATA.schema_name = 'unknowdb'; |
| 404 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 405 |
WHERE INFORMATION_SCHEMA.schemata.SCHEMA_NAME = 'unknowdb'; |
| 406 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 407 |
WHERE INFORMATION_SCHEMA.schemata.schema_name = 'unknowdb'; |
| 408 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 409 |
WHERE information_schema.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 410 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 411 |
WHERE information_schema.SCHEMATA.schema_name = 'unknowdb'; |
| 412 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 413 |
WHERE information_schema.schemata.SCHEMA_NAME = 'unknowdb'; |
| 414 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA |
| 415 |
WHERE information_schema.schemata.schema_name = 'unknowdb'; |
| 416 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 417 |
WHERE INFORMATION_SCHEMA.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 418 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 419 |
WHERE INFORMATION_SCHEMA.SCHEMATA.schema_name = 'unknowdb'; |
| 420 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 421 |
WHERE INFORMATION_SCHEMA.schemata.SCHEMA_NAME = 'unknowdb'; |
| 422 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 423 |
WHERE INFORMATION_SCHEMA.schemata.schema_name = 'unknowdb'; |
| 424 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 425 |
WHERE information_schema.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 426 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 427 |
WHERE information_schema.SCHEMATA.schema_name = 'unknowdb'; |
| 428 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 429 |
WHERE information_schema.schemata.SCHEMA_NAME = 'unknowdb'; |
| 430 |
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.schemata |
| 431 |
WHERE information_schema.schemata.schema_name = 'unknowdb'; |
| 432 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 433 |
WHERE INFORMATION_SCHEMA.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 434 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 435 |
WHERE INFORMATION_SCHEMA.SCHEMATA.schema_name = 'unknowdb'; |
| 436 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 437 |
WHERE INFORMATION_SCHEMA.schemata.SCHEMA_NAME = 'unknowdb'; |
| 438 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 439 |
WHERE INFORMATION_SCHEMA.schemata.schema_name = 'unknowdb'; |
| 440 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 441 |
WHERE information_schema.SCHEMATA.SCHEMA_NAME = 'unknowdb'; |
| 442 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 443 |
WHERE information_schema.SCHEMATA.schema_name = 'unknowdb'; |
| 444 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 445 |
WHERE information_schema.schemata.SCHEMA_NAME = 'unknowdb'; |
| 446 |
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA |
| 447 |
WHERE information_schema.schemata.schema_name = 'unknowdb'; |