diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2017-12-15 18:12:18 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2017-12-15 18:12:18 +0300 |
commit | 4624e565f314ed19eefa8532ccd26796b6791bf8 (patch) | |
tree | 3f36c5ac262dc9b3c62c479bc1c7b3a739699a17 /sql/sql_select.cc | |
parent | 70d76723770529a9d89b0ec2fdcae4798f0c29a1 (diff) | |
parent | 84e14bff4a7c99524f82b0133382ce389c6d80d8 (diff) | |
download | mariadb-git-4624e565f314ed19eefa8532ccd26796b6791bf8.tar.gz |
System Versioning 1.0 pre6
Merge remote-tracking branch 'mariadb/bb-10.3-temporal-serg' into trunk
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index af3783f8f64..95cae826015 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -827,6 +827,27 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr vers_select_conds_t &vers_conditions= table->vers_conditions; +#ifdef WITH_PARTITION_STORAGE_ENGINE + /* + if the history is stored in partitions, then partitions + themselves are not versioned + */ + if (table->partition_names && table->table->part_info->vers_info) + { + if (vers_conditions) + { +#define PART_VERS_ERR_MSG "%s PARTITION (%s)" + char buf[NAME_LEN*2 + sizeof(PART_VERS_ERR_MSG)]; + my_snprintf(buf, sizeof(buf), PART_VERS_ERR_MSG, table->alias, + table->partition_names->head()->c_ptr()); + my_error(ER_VERSIONING_REQUIRED, MYF(0), buf); + DBUG_RETURN(-1); + } + else + vers_conditions.init(FOR_SYSTEM_TIME_ALL); + } +#endif + if (outer_table && table != outer_table) // inner table may be outer in recursive CTE { if (vers_conditions) |