1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-02 14:47:37 +03:00

MDEV-14645: AS OF TIMESTAMP is misused as TRX_ID

Remove 1668efb722 that introduced a special magic
behavior for UNIX_TIMESTAMP() in the AS OF context
This commit is contained in:
Sergei Golubchik
2018-02-22 01:24:02 +01:00
parent 33366b1098
commit f3088112cb
11 changed files with 10 additions and 119 deletions

View File

@ -867,28 +867,14 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr
TABLE *t= table->table;
if (t->versioned(VERS_TIMESTAMP))
{
if (vers_conditions)
{
vers_conditions.start.add_typecast(thd, t->s->versioned);
vers_conditions.end.add_typecast(thd, t->s->versioned);
}
MYSQL_TIME max_time;
switch (vers_conditions.type)
{
case SYSTEM_TIME_UNSPECIFIED:
if (t->vers_start_field()->real_type() != MYSQL_TYPE_LONGLONG)
{
MYSQL_TIME max_time;
thd->variables.time_zone->gmt_sec_to_TIME(&max_time, TIMESTAMP_MAX_VALUE);
max_time.second_part= TIME_MAX_SECOND_PART;
curr= newx Item_datetime_literal(thd, &max_time,
TIME_SECOND_PART_DIGITS);
cond1= newx Item_func_eq(thd, row_end, curr);
}
else
{
curr= newx Item_int(thd, ULONGLONG_MAX);
cond1= newx Item_func_eq(thd, row_end, curr);
}
thd->variables.time_zone->gmt_sec_to_TIME(&max_time, TIMESTAMP_MAX_VALUE);
max_time.second_part= TIME_MAX_SECOND_PART;
curr= newx Item_datetime_literal(thd, &max_time, TIME_SECOND_PART_DIGITS);
cond1= newx Item_func_eq(thd, row_end, curr);
cond1= or_items(thd, cond1, newx Item_func_isnull(thd, row_end));
break;
case SYSTEM_TIME_AS_OF: