1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Backporting bugs fixes fixed by MDEV-31340 from 11.5

The patch for MDEV-31340 fixed the following bugs:

MDEV-33084 LASTVAL(t1) and LASTVAL(T1) do not work well with lower-case-table-names=0
MDEV-33085 Tables T1 and t1 do not work well with ENGINE=CSV and lower-case-table-names=0
MDEV-33086 SHOW OPEN TABLES IN DB1 -- is case insensitive with lower-case-table-names=0
MDEV-33088 Cannot create triggers in the database `MYSQL`
MDEV-33103 LOCK TABLE t1 AS t2 -- alias is not case sensitive with lower-case-table-names=0
MDEV-33108 TABLE_STATISTICS and INDEX_STATISTICS are case insensitive with lower-case-table-names=0
MDEV-33109 DROP DATABASE MYSQL -- does not drop SP with lower-case-table-names=0
MDEV-33110 HANDLER commands are case insensitive with lower-case-table-names=0
MDEV-33119 User is case insensitive in INFORMATION_SCHEMA.VIEWS
MDEV-33120 System log table names are case insensitive with lower-cast-table-names=0

Backporting the fixes from 11.5 to 10.5
This commit is contained in:
Alexander Barkov
2024-05-21 08:53:40 +04:00
parent b2944adb76
commit 310fd6ff69
23 changed files with 561 additions and 90 deletions

View File

@ -1154,8 +1154,9 @@ static bool wsrep_tables_accessible_when_detached(const TABLE_LIST *tables)
{
for (const TABLE_LIST *table= tables; table; table= table->next_global)
{
LEX_CSTRING db= table->db, tn= table->table_name;
if (get_table_category(&db, &tn) < TABLE_CATEGORY_INFORMATION)
if (get_table_category(Lex_ident_db(table->db),
Lex_ident_table(table->table_name))
< TABLE_CATEGORY_INFORMATION)
return false;
}
return tables != NULL;
@ -6522,15 +6523,15 @@ static TABLE *find_temporary_table_for_rename(THD *thd,
{
TABLE_LIST *next= table->next_local;
if (!strcmp(table->get_db_name(), cur_table->get_db_name()) &&
!strcmp(table->get_table_name(), cur_table->get_table_name()))
if (!strcmp(table->get_db_name().str, cur_table->get_db_name().str) &&
!strcmp(table->get_table_name().str, cur_table->get_table_name().str))
{
/* Table was moved away, can't be same as 'table' */
found= 1;
res= 0; // Table can't be a temporary table
}
if (!strcmp(next->get_db_name(), cur_table->get_db_name()) &&
!strcmp(next->get_table_name(), cur_table->get_table_name()))
if (!strcmp(next->get_db_name().str, cur_table->get_db_name().str) &&
!strcmp(next->get_table_name().str, cur_table->get_table_name().str))
{
/*
Table has matching name with new name of this table. cur_table should
@ -7299,7 +7300,7 @@ check_table_access(THD *thd, privilege_t requirements, TABLE_LIST *tables,
INSERT_ACL : SELECT_ACL);
}
if (check_access(thd, want_access, table_ref->get_db_name(),
if (check_access(thd, want_access, table_ref->get_db_name().str,
&table_ref->grant.privilege,
&table_ref->grant.m_internal,
0, no_errors))