Commit 352d8356 authored by kevg's avatar kevg Committed by Aleksey Midenkov

SQL: versioning for tmp HEAP tables created from IB tables [closes #158]

parent 1894fab1
...@@ -55,6 +55,7 @@ x ...@@ -55,6 +55,7 @@ x
prepare stmt from 'select * from vt1 for system_time as of timestamp @t1'; prepare stmt from 'select * from vt1 for system_time as of timestamp @t1';
execute stmt; execute stmt;
x x
1
drop prepare stmt; drop prepare stmt;
create or replace view vt1 as select * from t1; create or replace view vt1 as select * from t1;
select * from vt1 for system_time all; select * from vt1 for system_time all;
......
...@@ -864,7 +864,14 @@ int vers_setup_select(THD *thd, TABLE_LIST *tables, COND **where_expr, ...@@ -864,7 +864,14 @@ int vers_setup_select(THD *thd, TABLE_LIST *tables, COND **where_expr,
} }
Item *cond1= 0, *cond2= 0, *curr= 0; Item *cond1= 0, *cond2= 0, *curr= 0;
if (table->table->versioned_by_sql() || vers_simple_select) // Temporary tables of type HEAP can be created from INNODB tables and
// thus will have uint64 type of sys_trx_(start|end) field.
// They need special handling.
TABLE *t= table->table;
if ((t->s->table_category == TABLE_CATEGORY_TEMPORARY
? t->vers_start_field()->type() != MYSQL_TYPE_LONGLONG
: t->versioned_by_sql()) ||
vers_simple_select)
{ {
switch (vers_conditions.type) switch (vers_conditions.type)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment