diff options
author | unknown <mikael/pappa@dator5.(none)> | 2006-07-12 11:33:22 -0400 |
---|---|---|
committer | unknown <mikael/pappa@dator5.(none)> | 2006-07-12 11:33:22 -0400 |
commit | f5ee357325230929f17e5f5b92b21fd6cfce656c (patch) | |
tree | c3d9a5a489a6a7dc750b00cf189b565d4a6f3597 /sql/partition_info.cc | |
parent | 32369e276faefb92ce905a465dc609e2830a0eb4 (diff) | |
parent | 9d9267429f5cfba9c07adfb6a3e9e72c6b415e83 (diff) | |
download | mariadb-git-f5ee357325230929f17e5f5b92b21fd6cfce656c.tar.gz |
Merge mronstrom@bk-internal.mysql.com:/home/bk/bugs/bug18198
into dator5.(none):/home/pappa/bug18198
mysql-test/r/partition.result:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/partition_info.cc:
manual merge
sql/partition_info.h:
manual merge
sql/sql_table.cc:
manual merge
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 286637bd9aa..94008e621c7 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -695,6 +695,7 @@ end: file A reference to a handler of the table info Create info engine_type Return value for used engine in partitions + check_partition_function Should we check the partition function RETURN VALUE TRUE Error, something went wrong @@ -709,26 +710,40 @@ end: */ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, - handler *file, HA_CREATE_INFO *info) + handler *file, HA_CREATE_INFO *info, + bool check_partition_function) { handlerton **engine_array= NULL; uint part_count= 0; uint i, tot_partitions; bool result= TRUE; char *same_name; - bool part_expression_ok= TRUE; + int part_expression_ok= PF_SAFE; DBUG_ENTER("partition_info::check_partition_info"); - if (part_type != HASH_PARTITION || !list_of_part_fields) - part_expr->walk(&Item::check_partition_func_processor, 0, - (byte*)(&part_expression_ok)); - if (is_sub_partitioned() && !list_of_subpart_fields) - subpart_expr->walk(&Item::check_partition_func_processor, 0, - (byte*)(&part_expression_ok)); - if (!part_expression_ok) + pf_collation_allowed= PF_SAFE; + spf_collation_allowed= PF_SAFE; + if (check_partition_function) { - my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); - goto end; + if (part_type != HASH_PARTITION || !list_of_part_fields) + { + part_expr->walk(&Item::check_partition_func_processor, 0, + (byte*)(&part_expression_ok)); + pf_collation_allowed= (char)part_expression_ok; + part_expression_ok= PF_SAFE; + if (is_sub_partitioned() && !list_of_subpart_fields) + { + subpart_expr->walk(&Item::check_partition_func_processor, 0, + (byte*)(&part_expression_ok)); + } + spf_collation_allowed= (char)part_expression_ok; + } + if (!pf_collation_allowed || + !spf_collation_allowed) + { + my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); + goto end; + } } if (unlikely(!is_sub_partitioned() && !(use_default_subpartitions && use_default_no_subpartitions))) |