1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#32158 Crash in open_table_from_share, on mysql_unpack_partition errors

added check for the result of mysql_unpack_partition()
This commit is contained in:
gluh@mysql.com/eagle.(none)
2007-11-19 12:42:25 +04:00
parent 7a47199880
commit be3070ef93

View File

@ -1787,13 +1787,18 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam, is_create_table, outparam, is_create_table,
share->default_part_db_type, share->default_part_db_type,
&work_part_info_used); &work_part_info_used);
if (!tmp) if (tmp)
outparam->part_info->is_auto_partitioned= share->auto_partitioned; {
thd->stmt_arena= backup_stmt_arena_ptr;
thd->restore_active_arena(&part_func_arena, &backup_arena);
goto partititon_err;
}
outparam->part_info->is_auto_partitioned= share->auto_partitioned;
DBUG_PRINT("info", ("autopartitioned: %u", share->auto_partitioned)); DBUG_PRINT("info", ("autopartitioned: %u", share->auto_partitioned));
/* we should perform the fix_partition_func in either local or /* we should perform the fix_partition_func in either local or
caller's arena depending on work_part_info_used value caller's arena depending on work_part_info_used value
*/ */
if (!tmp && !work_part_info_used) if (!work_part_info_used)
tmp= fix_partition_func(thd, outparam, is_create_table); tmp= fix_partition_func(thd, outparam, is_create_table);
thd->stmt_arena= backup_stmt_arena_ptr; thd->stmt_arena= backup_stmt_arena_ptr;
thd->restore_active_arena(&part_func_arena, &backup_arena); thd->restore_active_arena(&part_func_arena, &backup_arena);
@ -1803,6 +1808,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
tmp= fix_partition_func(thd, outparam, is_create_table); tmp= fix_partition_func(thd, outparam, is_create_table);
outparam->part_info->item_free_list= part_func_arena.free_list; outparam->part_info->item_free_list= part_func_arena.free_list;
} }
partititon_err:
if (tmp) if (tmp)
{ {
if (is_create_table) if (is_create_table)