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

BUG#20310212 PARTITION DDL- CRASH AFTER THD::NOCHECK_REGISTER_ITEM_

Problem :
---------
Issue-1: The root cause for the issues is that (col1 > 1) is not a
valid partition function and we should have thrown error at much early
stage [partition_info::check_partition_info]. We are not checking
sub-partition expression when partition expression is NULL.

Issue-2: Potential issue for future if any partition function needs to
change item tree during open/fix_fields. We should release changed
items, if any, before doing closefrm when we open the partitioned table
during creation in create_table_impl.

Solution :
----------
1.check_partition_info() - Check for sub-partition expression even if no
partition expression.
[partition by ... columns(...) subpartition by hash(<expr>)]

2.create_table_impl() - Assert that the change list is empty before doing
closefrm for partitioned table. Currently no supported partition function
seems to be changing item tree during open.

Reviewed-by: Mattias Jonsson <mattias.jonsson@oracle.com>

RB: 9345
This commit is contained in:
Debarun Banerjee
2015-06-24 10:27:12 +05:30
parent 1b1161a02b
commit 0eadadad25
4 changed files with 19 additions and 6 deletions

View File

@ -3913,6 +3913,12 @@ static bool check_if_created_table_can_be_opened(THD *thd,
result= (open_table_def(thd, &share, 0) ||
open_table_from_share(thd, &share, "", 0, (uint) READ_ALL,
0, &table, TRUE));
/*
Assert that the change list is empty as no partition function currently
needs to modify item tree. May need call THD::rollback_item_tree_changes
later before calling closefrm if the change list is not empty.
*/
DBUG_ASSERT(thd->change_list.is_empty());
if (! result)
(void) closefrm(&table, 0);