diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-20 13:30:05 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-20 13:30:05 +0200 |
commit | e3d89652e5fd314f03875a3d026490452b2a5986 (patch) | |
tree | 9f4d60e4431933ba6e53feb3372c9297c8b8836c /sql/partition_info.cc | |
parent | 7bbc6c14d1e8fcf1f4737e0a5fcf6237fe18bd23 (diff) | |
parent | 042f763268c0f209e7c12e0a6a72bb5d204dfe29 (diff) | |
download | mariadb-git-e3d89652e5fd314f03875a3d026490452b2a5986.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index ce9329e8f6a..14f301e2d85 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2743,6 +2743,24 @@ end: DBUG_RETURN(result); } + +bool partition_info::error_if_requires_values() const +{ + switch (part_type) { + case NOT_A_PARTITION: + case HASH_PARTITION: + break; + case RANGE_PARTITION: + my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN"); + return true; + case LIST_PARTITION: + my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN"); + return true; + } + return false; +} + + /** Fix partition data from parser. @@ -2832,6 +2850,8 @@ bool partition_info::fix_parser_data(THD *thd) part_elem= it++; List_iterator<part_elem_value> list_val_it(part_elem->list_val_list); num_elements= part_elem->list_val_list.elements; + if (!num_elements && error_if_requires_values()) + DBUG_RETURN(true); DBUG_ASSERT(part_type == RANGE_PARTITION ? num_elements == 1U : TRUE); for (j= 0; j < num_elements; j++) |