Commit dd3099a0 authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: unsupported engine fix for VTQ funcs

parent 6c516e77
...@@ -3322,6 +3322,11 @@ VTQ_common<Item_func_X>::init_hton() ...@@ -3322,6 +3322,11 @@ VTQ_common<Item_func_X>::init_hton()
hton= plugin_hton(plugin_int_to_ref(innodb_plugin)); hton= plugin_hton(plugin_int_to_ref(innodb_plugin));
DBUG_ASSERT(hton); DBUG_ASSERT(hton);
} }
if (hton && !hton->versioned())
{
my_error(ER_VERS_ENGINE_UNSUPPORTED, MYF(0), Item::name ? Item::name : this->func_name());
hton= NULL;
}
} }
} }
...@@ -3343,6 +3348,7 @@ Item_func_vtq_ts::get_date(MYSQL_TIME *res, ulonglong fuzzy_date) ...@@ -3343,6 +3348,7 @@ Item_func_vtq_ts::get_date(MYSQL_TIME *res, ulonglong fuzzy_date)
if (!hton) if (!hton)
return true; return true;
DBUG_ASSERT(hton->vers_query_trx_id);
null_value= !hton->vers_query_trx_id(thd, res, trx_id, vtq_field); null_value= !hton->vers_query_trx_id(thd, res, trx_id, vtq_field);
return false; return false;
...@@ -3394,6 +3400,7 @@ Item_func_vtq_id::get_by_trx_id(ulonglong trx_id) ...@@ -3394,6 +3400,7 @@ Item_func_vtq_id::get_by_trx_id(ulonglong trx_id)
return 0; return 0;
} }
DBUG_ASSERT(hton->vers_query_trx_id);
null_value= !hton->vers_query_trx_id(thd, &res, trx_id, vtq_field); null_value= !hton->vers_query_trx_id(thd, &res, trx_id, vtq_field);
return res; return res;
} }
...@@ -3404,6 +3411,7 @@ Item_func_vtq_id::get_by_commit_ts(MYSQL_TIME &commit_ts, bool backwards) ...@@ -3404,6 +3411,7 @@ Item_func_vtq_id::get_by_commit_ts(MYSQL_TIME &commit_ts, bool backwards)
THD *thd= current_thd; // can it differ from constructor's? THD *thd= current_thd; // can it differ from constructor's?
DBUG_ASSERT(thd); DBUG_ASSERT(thd);
DBUG_ASSERT(hton->vers_query_commit_ts);
null_value= !hton->vers_query_commit_ts(thd, &cached_result, commit_ts, VTQ_ALL, backwards); null_value= !hton->vers_query_commit_ts(thd, &cached_result, commit_ts, VTQ_ALL, backwards);
if (null_value) if (null_value)
{ {
...@@ -3516,6 +3524,7 @@ Item_func_vtq_trx_sees::val_int() ...@@ -3516,6 +3524,7 @@ Item_func_vtq_trx_sees::val_int()
return true; return true;
} }
DBUG_ASSERT(hton->vers_trx_sees);
bool result= false; bool result= false;
null_value= !hton->vers_trx_sees(thd, result, trx_id1, trx_id0, commit_id1, iso_level1, commit_id0); null_value= !hton->vers_trx_sees(thd, result, trx_id1, trx_id0, commit_id1, iso_level1, commit_id0);
return result; return result;
......
...@@ -7502,8 +7502,8 @@ ER_VERS_FIELD_WRONG_TYPE ...@@ -7502,8 +7502,8 @@ ER_VERS_FIELD_WRONG_TYPE
ER_VERS_WRONG_PARAMS ER_VERS_WRONG_PARAMS
eng "Wrong parameters for versioned table %`s: %s" eng "Wrong parameters for versioned table %`s: %s"
ER_VERS_TRX_ID_UNSUPPORTED ER_VERS_ENGINE_UNSUPPORTED
eng "Engine does not support versioned TRX_ID" eng "Engine does not support System Versioning for %`s"
ER_VERS_RANGE_UNITS_MISMATCH ER_VERS_RANGE_UNITS_MISMATCH
eng "Range units mismatch" eng "Range units mismatch"
......
...@@ -769,7 +769,7 @@ setup_for_system_time(THD *thd, TABLE_LIST *tables, COND **where_expr, SELECT_LE ...@@ -769,7 +769,7 @@ setup_for_system_time(THD *thd, TABLE_LIST *tables, COND **where_expr, SELECT_LE
{ {
if (slex->vers_conditions.unit == UNIT_TRX_ID) if (slex->vers_conditions.unit == UNIT_TRX_ID)
{ {
my_error(ER_VERS_TRX_ID_UNSUPPORTED, MYF(0), table->table_name); my_error(ER_VERS_ENGINE_UNSUPPORTED, MYF(0), table->table_name);
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
} }
......
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