1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-35641 bring call to use_all_columns() forward when reading from mysql.servers

TABLE::use_all_columns turn on all bits of read_set, which is
interpreted by innodb as a request to read all columns. Without doing
so before calling init_read_record(), innodb will not retrieve any
columns if mysql.servers table has been altered to use innodb as the
engine, and any foreign servers stored in the table are "lost".
This commit is contained in:
Yuchen Pei
2024-12-16 10:26:21 +11:00
parent 04408fff40
commit f862fe8b2b
3 changed files with 19 additions and 3 deletions

View File

@ -283,7 +283,7 @@ end:
static bool servers_load(THD *thd, TABLE_LIST *tables)
{
TABLE *table;
TABLE *table= tables[0].table;
READ_RECORD read_record_info;
bool return_val= TRUE;
DBUG_ENTER("servers_load");
@ -292,7 +292,8 @@ static bool servers_load(THD *thd, TABLE_LIST *tables)
free_root(&mem, MYF(0));
init_sql_alloc(key_memory_servers, &mem, ACL_ALLOC_BLOCK_SIZE, 0, MYF(0));
if (init_read_record(&read_record_info,thd,table=tables[0].table, NULL, NULL,
table->use_all_columns();
if (init_read_record(&read_record_info,thd,table, NULL, NULL,
1,0, FALSE))
DBUG_RETURN(1);
while (!(read_record_info.read_record()))
@ -405,7 +406,6 @@ get_server_from_table_to_cache(TABLE *table)
FOREIGN_SERVER *server= (FOREIGN_SERVER *)alloc_root(&mem,
sizeof(FOREIGN_SERVER));
DBUG_ENTER("get_server_from_table_to_cache");
table->use_all_columns();
/* get each field into the server struct ptr */
ptr= get_field(&mem, table->field[0]);