diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-12-14 18:35:12 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-12-14 20:19:14 +0100 |
commit | 18405e5fd994c37698c6fbf0996ecc9e7d1af0f2 (patch) | |
tree | 243f7fdad5d603ca30ead2da414c787683eec2b9 /sql/partition_info.cc | |
parent | f149013393dcef06940cc82f11247ceafb935fae (diff) | |
download | mariadb-git-18405e5fd994c37698c6fbf0996ecc9e7d1af0f2.tar.gz |
Partitioning syntax for versioning
partition by system_time (
partition p0 history,
partition pn current
)
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 073d42f921f..86ec1fd2751 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -927,7 +927,7 @@ bool partition_info::vers_set_expression(THD *thd, partition_element *el, MYSQL_ for (uint i= 0; i < num_columns; ++i) { part_column_list_val *col_val= add_column_value(thd); - if (el->type() == partition_element::AS_OF_NOW) + if (el->type() == partition_element::CURRENT) { col_val->max_value= true; col_val->item_expression= NULL; @@ -991,20 +991,20 @@ bool partition_info::vers_setup_expression(THD * thd, uint32 alter_add) if (alter_add) { /* Non-empty historical partitions are left as is. */ - if (el->type() == partition_element::VERSIONING && !el->empty) + if (el->type() == partition_element::HISTORY && !el->empty) { ++id; continue; } /* Newly added element is inserted before AS_OF_NOW. */ - if (el->id == UINT32_MAX || el->type() == partition_element::AS_OF_NOW) + if (el->id == UINT32_MAX || el->type() == partition_element::CURRENT) { DBUG_ASSERT(table && table->s); Vers_min_max_stats *stat_trx_end= new (&table->s->mem_root) Vers_min_max_stats(&table->s->vers_end_field()->field_name, table->s); table->s->stat_trx[id * num_columns + STAT_TRX_END]= stat_trx_end; el->id= id++; - if (el->type() == partition_element::AS_OF_NOW) + if (el->type() == partition_element::CURRENT) break; goto set_expression; } @@ -1037,7 +1037,7 @@ bool partition_info::vers_scan_min_max(THD *thd, partition_element *part) uint32 part_id= part->id * sub_factor; uint32 part_id_end= part_id + sub_factor; DBUG_ASSERT(part->empty); - DBUG_ASSERT(part->type() == partition_element::VERSIONING); + DBUG_ASSERT(part->type() == partition_element::HISTORY); DBUG_ASSERT(table->s->stat_trx); for (; part_id < part_id_end; ++part_id) { @@ -1198,7 +1198,7 @@ bool partition_info::vers_setup_stats(THD * thd, bool is_create_table_ind) partition_element *el= NULL, *prev; while ((prev= el, el= it++)) { - if (el->type() == partition_element::VERSIONING && dont_stat) + if (el->type() == partition_element::HISTORY && dont_stat) { if (el->id == table->s->hist_part_id) { @@ -1216,7 +1216,7 @@ bool partition_info::vers_setup_stats(THD * thd, bool is_create_table_ind) if (!is_create_table_ind) { - if (el->type() == partition_element::AS_OF_NOW) + if (el->type() == partition_element::CURRENT) { uchar buf[8]; Field_timestampf fld(buf, NULL, 0, Field::NONE, &table->vers_end_field()->field_name, NULL, 6); @@ -1237,10 +1237,10 @@ bool partition_info::vers_setup_stats(THD * thd, bool is_create_table_ind) } } - if (el->type() == partition_element::AS_OF_NOW) + if (el->type() == partition_element::CURRENT) break; - DBUG_ASSERT(el->type() == partition_element::VERSIONING); + DBUG_ASSERT(el->type() == partition_element::HISTORY); if (vers_info->hist_part) { @@ -2085,13 +2085,13 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, } if (part_type == VERSIONING_PARTITION) { - if (part_elem->type() == partition_element::VERSIONING) + if (part_elem->type() == partition_element::HISTORY) { hist_parts++; } else { - DBUG_ASSERT(part_elem->type() == partition_element::AS_OF_NOW); + DBUG_ASSERT(part_elem->type() == partition_element::CURRENT); now_parts++; } } @@ -2141,7 +2141,7 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type, Sql_condition::WARN_LEVEL_WARN, WARN_VERS_PARAMETERS, ER_THD(thd, WARN_VERS_PARAMETERS), - "no rotation condition for multiple `VERSIONING` partitions."); + "no rotation condition for multiple HISTORY partitions."); } } if (now_parts > 1) |