diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-11-07 19:21:42 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-11-07 19:24:06 +0300 |
commit | 1e73d7d6c658e881ec50d3b968647b2b45605a19 (patch) | |
tree | 2d5e7ca68ea2a3dc31fc8e1b79117fec17af0034 /sql/partition_info.h | |
parent | 77e8a311e1f919f15845c75d08de4340965c0bc4 (diff) | |
download | mariadb-git-1e73d7d6c658e881ec50d3b968647b2b45605a19.tar.gz |
MDEV-17553 Enable setting start datetime for interval partitioned history of system versioned tables
* Explicit STARTS syntax
* SHOW CREATE
* Default STARTS rounding depending on INTERVAL type
* Warn when STARTS timestamp is later than query time
* Fix uninitialized Lex->create_last_non_select_table under
mysql_unpack_partition()
Default STARTS rounding depending on INTERVAL type
If STARTS clause is omitted, default one is assigned with value
derived from query timestamp. The rounding is done on STARTS value
depending on INTERVAL type:
SECOND: no rounding is done;
MINUTE: timestamp seconds is set to 0;
HOUR: timestamp seconds and minutes are set to 0;
DAY, WEEK, MONTH and YEAR: timestamp seconds, minutes and hours are
set to 0 (the date of rotation is kept as current date).
Diffstat (limited to 'sql/partition_info.h')
-rw-r--r-- | sql/partition_info.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/sql/partition_info.h b/sql/partition_info.h index 00ef815ce09..3a34ad88d28 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -394,27 +394,9 @@ public: bool field_in_partition_expr(Field *field) const; bool vers_init_info(THD *thd); - bool vers_set_interval(THD *thd, Item *item, - interval_type int_type, my_time_t start) - { - DBUG_ASSERT(part_type == VERSIONING_PARTITION); - vers_info->interval.type= int_type; - vers_info->interval.start= start; - if (item->fix_fields_if_needed_for_scalar(thd, &item)) - return true; - bool error= get_interval_value(thd, item, int_type, &vers_info->interval.step) || - vers_info->interval.step.neg || vers_info->interval.step.second_part || - !(vers_info->interval.step.year || vers_info->interval.step.month || - vers_info->interval.step.day || vers_info->interval.step.hour || - vers_info->interval.step.minute || vers_info->interval.step.second); - if (error) - { - my_error(ER_PART_WRONG_VALUE, MYF(0), - thd->lex->create_last_non_select_table->table_name.str, - "INTERVAL"); - } - return error; - } + bool vers_set_interval(THD *thd, Item *interval, + interval_type int_type, Item *starts, + const char *table_name); bool vers_set_limit(ulonglong limit) { DBUG_ASSERT(part_type == VERSIONING_PARTITION); |