diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-03-27 16:15:38 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-03-27 16:15:38 +0500 |
commit | 50563d39309ba82448a31f6a98e40181422f5147 (patch) | |
tree | 59cc3feb8364d307b4a70b2555ba0f8b6adcbd5c /sql/item_cmpfunc.h | |
parent | 7bc013444aca41d94cb3ae344079f2ec89c1de1f (diff) | |
download | mariadb-git-50563d39309ba82448a31f6a98e40181422f5147.tar.gz |
Bug #27084 partitioning by list seems failing when using case
creation of the partitioned table could fail as we created Item-s for
it's list function in thd->mem_root, and then do Item->fix_fields
in the context of other table->mem_root (so that memory alloced
there was alloced in this table->mem_root). As we freed the
table->mem_root before we do thd->free_items, our Item-s had
pointers to the freed memory, that caused the crash
mysql-test/r/partition.result:
result
mysql-test/t/partition.test:
testcase
sql/item_cmpfunc.cc:
here is better place for the implementation
sql/item_cmpfunc.h:
implementation moved to .cc file
sql/sql_partition.cc:
work_part_info_used parameter added to mysql_unpack_partition
sql/sql_partition.h:
work_part_info_used parameter added to mysql_unpack_partition
sql/table.cc:
we do 'fix_partition_func' using the proper arena now.
It's necessary as Item_*::fix_fields can alloc memory
using thd->mem_root and this has to be same mem_root that
we used to alloc these Item-s
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r-- | sql/item_cmpfunc.h | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index edc905d50ff..8919d955355 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -1106,18 +1106,7 @@ public: Item *find_item(String *str); CHARSET_INFO *compare_collation() { return cmp_collation.collation; } bool check_partition_func_processor(byte *bool_arg) { return FALSE;} - void cleanup() - { - uint i; - DBUG_ENTER("Item_func_case::cleanup"); - Item_func::cleanup(); - for (i= 0; i <= (uint)DECIMAL_RESULT; i++) - { - delete cmp_items[i]; - cmp_items[i]= 0; - } - DBUG_VOID_RETURN; - } + void cleanup(); }; /* |