summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-11-19 12:42:25 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-11-19 12:42:25 +0400
commitb15802298b53f0627ab10739c1e54cfc22434e1a (patch)
treec2353abeb686b3619fb2a385a2c7c82586da31ad /sql/table.cc
parente316f813d922f8666c4ad3dec684939f19aeebca (diff)
downloadmariadb-git-b15802298b53f0627ab10739c1e54cfc22434e1a.tar.gz
Bug#32158 Crash in open_table_from_share, on mysql_unpack_partition errors
added check for the result of mysql_unpack_partition() sql/table.cc: added check for the result of mysql_unpack_partition()
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index c3ddb809b9e..c30407920f4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1787,13 +1787,18 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam, is_create_table,
share->default_part_db_type,
&work_part_info_used);
- if (!tmp)
- outparam->part_info->is_auto_partitioned= share->auto_partitioned;
+ if (tmp)
+ {
+ 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));
/* we should perform the fix_partition_func in either local or
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);
thd->stmt_arena= backup_stmt_arena_ptr;
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);
outparam->part_info->item_free_list= part_func_arena.free_list;
}
+partititon_err:
if (tmp)
{
if (is_create_table)