From 57d455460d52da8b124d839fb6462d55b0ca2ee7 Mon Sep 17 00:00:00 2001 From: Mikael Ronstrom Date: Wed, 21 Oct 2009 20:53:44 +0200 Subject: Added checks for no NULL values in VALUES LESS THAN, added tests for no MAXVALUE in VALUES IN --- sql/partition_info.cc | 11 ++++++++++- sql/share/errmsg.txt | 4 ++-- sql/sql_yacc.yy | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'sql') diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 52535041776..3bce7dac1fa 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -1992,7 +1992,7 @@ int partition_info::fix_parser_data(THD *thd) partition_element *part_elem; part_elem_value *val; uint num_elements; - uint i= 0, j; + uint i= 0, j, k; int result; DBUG_ENTER("partition_info::fix_parser_data"); @@ -2020,6 +2020,15 @@ int partition_info::fix_parser_data(THD *thd) my_error(ER_PARTITION_COLUMN_LIST_ERROR, MYF(0)); DBUG_RETURN(TRUE); } + for (k= 0; k < num_columns; k++) + { + part_column_list_val *col_val= &val->col_val_array[k]; + if (col_val->null_value && part_type == RANGE_PARTITION) + { + my_error(ER_NULL_IN_VALUES_LESS_THAN, MYF(0)); + DBUG_RETURN(TRUE); + } + } } else { diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 69f18088807..0bbdacee0bc 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6214,8 +6214,8 @@ ER_WRONG_TYPE_COLUMN_VALUE_ERROR eng "Partition column values of incorrect type" ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR eng "Too many fields in '%-.192s'" -ER_MAXVALUE_IN_LIST_PARTITIONING_ERROR - eng "Cannot use MAXVALUE as value in List partitioning" +ER_MAXVALUE_IN_VALUES_IN + eng "Cannot use MAXVALUE as value in VALUES IN" ER_TOO_MANY_VALUES_ERROR eng "Cannot have more than one value for this type of %-.64s partitioning" ER_ROW_SINGLE_PARTITION_FIELD_ERROR diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c2873bffe9e..43753b7fab2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4229,7 +4229,7 @@ part_value_expr_item: part_column_list_val *col_val; if (part_info->part_type == LIST_PARTITION) { - my_parse_error(ER(ER_MAXVALUE_IN_LIST_PARTITIONING_ERROR)); + my_parse_error(ER(ER_MAXVALUE_IN_VALUES_IN)); MYSQL_YYABORT; } if (part_info->add_max_value()) -- cgit v1.2.1