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

MDEV-33008 Fix spider table discovery

A new column was introduced to the show index output in 10.6 in
f691d9865b

Thus we update the check of the number of columns to be at least 13,
rather than exactly 13.

Also backport an err number and format from 10.5 for better error
messages when the column number is wrong.
This commit is contained in:
Yuchen Pei
2024-01-10 16:36:39 +11:00
parent 2310f659f5
commit eabc74aaef
4 changed files with 57 additions and 3 deletions

View File

@@ -1566,10 +1566,13 @@ int spider_db_mbase_result::fetch_index_for_discover_table_structure(
}
DBUG_RETURN(0);
}
if (num_fields() != 13)
if (num_fields() < 13)
{
DBUG_PRINT("info",("spider num_fields != 13"));
my_printf_error(ER_SPIDER_UNKNOWN_NUM, ER_SPIDER_UNKNOWN_STR, MYF(0));
DBUG_PRINT("info",("spider num_fields < 13"));
my_printf_error(ER_SPIDER_CANT_NUM, ER_SPIDER_CANT_STR1, MYF(0),
"fetch index for table structure discovery because of "
"wrong number of columns in SHOW INDEX FROM output: ",
num_fields());
DBUG_RETURN(ER_SPIDER_UNKNOWN_NUM);
}
bool first = TRUE;