1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-08 00:28:29 +03:00

MDEV-35622 SEGV, ASAN use-after-poison when reading system table with less than expected number of columns

Relaxed check, only number of columns and the PK.
Enough to avoid crashes, but doesn't break upgrades and migration
from MySQL as in MDEV-37777.

Added checks everywhere. (flush/create/alter/drop server)

Check mysql.plugin table too.
This commit is contained in:
Sergei Golubchik
2025-10-01 12:12:02 +02:00
parent bc609a8411
commit 1bdaabc0c6
5 changed files with 167 additions and 26 deletions

View File

@@ -6129,11 +6129,12 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
if ((err_code= drop_server(thd, &lex->server_options)))
{
if (! lex->if_exists() && err_code == ER_FOREIGN_SERVER_DOESNT_EXIST)
if (! lex->if_exists() || err_code != ER_FOREIGN_SERVER_DOESNT_EXIST)
{
DBUG_PRINT("info", ("problem dropping server %s",
lex->server_options.server_name.str));
my_error(err_code, MYF(0), lex->server_options.server_name.str);
if (!thd->is_error())
my_error(err_code, MYF(0), lex->server_options.server_name.str);
}
else
{