Commit 5c2f8c01 authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Oleksandr Byelkin

MDEV-32503 Queries from I_S.KEY_PERIOD_USAGE do not obey case-sensitivity

Set the correct values for idx_field1, idx_field2 (i.e. db and table name
fields) of ST_SCHEMA_TABLE instance.
parent 261993f5
--- suite/period/r/i_s_notembedded.result 2024-01-01 19:50:37.000000000 +0100
+++ suite/period/r/i_s_notembedded,win.reject 2024-01-01 19:57:18.888306500 +0100
@@ -69,13 +69,17 @@
set names latin1 collate latin1_general_cs;
select table_name from information_schema.periods where table_schema = 'TEST';
table_name
+t
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
table_name
+t
set names latin1 collate latin1_general_ci;
select table_name from information_schema.periods where table_schema = 'TEST';
table_name
+t
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
table_name
+t
# [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
# does not work
select constraint_name from information_schema.key_period_usage where table_name = 't';
......@@ -58,3 +58,25 @@ def test t2 mytime s e
connection default;
drop user periods_hidden@localhost;
drop tables t1, t2;
# MDEV-32503 Queries from KEY_PERIOD_USAGE don't obey case-sensitivity
create table t (a int, b date, c date, period for app(b,c),
unique idx(a, app without overlaps));
set names latin1 collate latin1_general_cs;
select table_name from information_schema.periods where table_schema = 'TEST';
table_name
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
table_name
set names latin1 collate latin1_general_ci;
select table_name from information_schema.periods where table_schema = 'TEST';
table_name
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
table_name
# [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
# does not work
select constraint_name from information_schema.key_period_usage where table_name = 't';
constraint_name
idx
select constraint_name from information_schema.key_period_usage where constraint_name = 'idx';
constraint_name
idx
drop table t;
--source include/not_embedded.inc
--source include/platform.inc
select * from information_schema.periods;
......@@ -47,3 +48,27 @@ select * from information_schema.periods where table_schema = 'test';
--connection default
drop user periods_hidden@localhost;
drop tables t1, t2;
--echo # MDEV-32503 Queries from KEY_PERIOD_USAGE don't obey case-sensitivity
create table t (a int, b date, c date, period for app(b,c),
unique idx(a, app without overlaps));
set names latin1 collate latin1_general_cs;
select table_name from information_schema.periods where table_schema = 'TEST';
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
set names latin1 collate latin1_general_ci;
select table_name from information_schema.periods where table_schema = 'TEST';
select table_name from information_schema.key_period_usage where table_schema = 'TEST';
--echo # [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
--echo # does not work
disable_warnings; # storage engine 'Innodb' is not found
select constraint_name from information_schema.key_period_usage where table_name = 't';
select constraint_name from information_schema.key_period_usage where constraint_name = 'idx';
enable_warnings;
drop table t;
......@@ -10360,7 +10360,7 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0,
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"KEY_PERIOD_USAGE", Show::key_period_usage_fields_info, 0,
get_all_tables, 0, get_schema_key_period_usage_record, 1, 2, 0,
get_all_tables, 0, get_schema_key_period_usage_record, 4, 5, 0,
OPTIMIZE_I_S_TABLE | OPEN_FRM_FILE_ONLY},
{"OPEN_TABLES", Show::open_tables_fields_info, 0,
fill_open_tables, make_old_format, 0, -1, -1, 1, 0},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment