mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
SQL: unsupported engine fix for VTQ funcs
This commit is contained in:
parent
6c516e77d5
commit
dd3099a00d
3 changed files with 12 additions and 3 deletions
|
@ -3322,6 +3322,11 @@ VTQ_common<Item_func_X>::init_hton()
|
|||
hton= plugin_hton(plugin_int_to_ref(innodb_plugin));
|
||||
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)
|
|||
if (!hton)
|
||||
return true;
|
||||
|
||||
DBUG_ASSERT(hton->vers_query_trx_id);
|
||||
null_value= !hton->vers_query_trx_id(thd, res, trx_id, vtq_field);
|
||||
|
||||
return false;
|
||||
|
@ -3394,6 +3400,7 @@ Item_func_vtq_id::get_by_trx_id(ulonglong trx_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(hton->vers_query_trx_id);
|
||||
null_value= !hton->vers_query_trx_id(thd, &res, trx_id, vtq_field);
|
||||
return res;
|
||||
}
|
||||
|
@ -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?
|
||||
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);
|
||||
if (null_value)
|
||||
{
|
||||
|
@ -3516,6 +3524,7 @@ Item_func_vtq_trx_sees::val_int()
|
|||
return true;
|
||||
}
|
||||
|
||||
DBUG_ASSERT(hton->vers_trx_sees);
|
||||
bool result= false;
|
||||
null_value= !hton->vers_trx_sees(thd, result, trx_id1, trx_id0, commit_id1, iso_level1, commit_id0);
|
||||
return result;
|
||||
|
|
|
@ -7502,8 +7502,8 @@ ER_VERS_FIELD_WRONG_TYPE
|
|||
ER_VERS_WRONG_PARAMS
|
||||
eng "Wrong parameters for versioned table %`s: %s"
|
||||
|
||||
ER_VERS_TRX_ID_UNSUPPORTED
|
||||
eng "Engine does not support versioned TRX_ID"
|
||||
ER_VERS_ENGINE_UNSUPPORTED
|
||||
eng "Engine does not support System Versioning for %`s"
|
||||
|
||||
ER_VERS_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
|
|||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue