diff options
author | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-08-30 17:33:55 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-08-30 17:33:55 +0200 |
commit | 86327002fe29e70f0e29d97e0cf0b1e14806c2f8 (patch) | |
tree | 95c1677d57c85cadeb341aee06221cfbe98753ec /sql/partition_info.h | |
parent | 1ed02deea0986ee2aefd7b8bc61390f3675c2e94 (diff) | |
download | mariadb-git-86327002fe29e70f0e29d97e0cf0b1e14806c2f8.tar.gz |
Bug#50036: Inconsistent errors when using TIMESTAMP columns/expressions
It was hard to understand what the error really meant.
The error checking in partitioning is done in several different
parts during the execution of a query which can make it
hard to return useful errors.
Added a new error for bad VALUES part in the per PARTITION clause.
Using the more verbose error that a column is not allowed in
the partitioning function instead of just that the function is
not allowed.
mysql-test/r/partition.result:
changed error to be more specific
mysql-test/r/partition_error.result:
updated result
mysql-test/std_data/parts/t1TIMESTAMP.frm:
.frm file of CREATE TABLE t1 (a TIMESTAMP) PARTITION BY HASH(TO_DAYS(a));
mysql-test/t/partition.test:
changed error to be more specific
mysql-test/t/partition_error.test:
Added test (also for verifying behaviour of previously
created tables which is no longer allowed).
Updated expected errors in other places
sql/partition_info.cc:
Added function report_part_expr_error to
be able to return a more specific error.
Renamed fix_func_partition to fix_partition_values
since the function really fixes/checks the VALUES clause.
sql/partition_info.h:
removed part_result_type, since it was unused.
renamed fix_funk_partition->fix_partition_values
added report_part_expr_error
sql/share/errmsg-utf8.txt:
Added a more specific error.
sql/sql_partition.cc:
made use of report_part_expr_error to get a more specific error.
sql/sql_yacc.yy:
Changed error message to be more specific. And return an other error code.
Diffstat (limited to 'sql/partition_info.h')
-rw-r--r-- | sql/partition_info.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/partition_info.h b/sql/partition_info.h index b196d0b59a2..6ae210d9574 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -166,7 +166,6 @@ public: key_map some_fields_in_PF; handlerton *default_engine_type; - Item_result part_result_type; partition_type part_type; partition_type subpart_type; @@ -226,7 +225,6 @@ public: curr_part_elem(NULL), current_partition(NULL), curr_list_object(0), num_columns(0), default_engine_type(NULL), - part_result_type(INT_RESULT), part_type(NOT_A_PARTITION), subpart_type(NOT_A_PARTITION), part_info_len(0), part_func_len(0), subpart_func_len(0), @@ -279,10 +277,10 @@ public: void print_no_partition_found(TABLE *table); void print_debug(const char *str, uint*); Item* get_column_item(Item *item, Field *field); - int fix_func_partition(THD *thd, - part_elem_value *val, - partition_element *part_elem, - uint part_id); + int fix_partition_values(THD *thd, + part_elem_value *val, + partition_element *part_elem, + uint part_id); bool fix_column_value_functions(THD *thd, part_elem_value *val, uint part_id); @@ -299,6 +297,7 @@ public: bool init_column_part(); bool add_column_list_value(THD *thd, Item *item); void set_show_version_string(String *packet); + void report_part_expr_error(bool use_subpart_expr); private: static int list_part_cmp(const void* a, const void* b); bool set_up_default_partitions(handler *file, HA_CREATE_INFO *info, |