diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-22 12:23:39 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-12-22 12:23:39 +0200 |
commit | 985d2d393c285ecd4539cb579b680f7b91fdaa1a (patch) | |
tree | 8cabf6c09758c30df04de96ca98c7827d5665493 /sql/partition_info.cc | |
parent | a76a2522ec4f8c069827e038997387a8b8eb3a3a (diff) | |
parent | 461cf3e5a3c2d346d75b1407b285f8daf9d01f67 (diff) | |
download | mariadb-git-985d2d393c285ecd4539cb579b680f7b91fdaa1a.tar.gz |
Merge remote-tracking branch 'origin/10.1' into 10.2
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 656a89d8706..d66f011e5d7 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -2382,6 +2382,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. @@ -2472,6 +2490,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); |