1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

versioning: use @@timestamp

Don't use hidden system time in versioning,
but keep the system time logic in THD
to workaround low-res system clock and
replication not versioned to versioned.

This reverts MDEV-14788 (System versioning cannot
be based on local timestamps, as it is now).
Versioning is based on local timestamps again,
but timestamps are protected by MDEV-15923
(option to control who can set session @@timestamp).
This commit is contained in:
Sergei Golubchik
2018-05-02 21:53:12 +02:00
parent 4203f572ae
commit a4272bf154
9 changed files with 36 additions and 100 deletions

View File

@@ -1571,7 +1571,7 @@ static bool check_vers_constants(THD *thd, partition_info *part_info)
my_tz_OFFSET0->TIME_to_gmt_sec(&ltime, &error);
if (error)
goto err;
if (vers_info->hist_part->range_value <= thd->systime())
if (vers_info->hist_part->range_value <= thd->query_start())
vers_info->hist_part= el;
}
return 0;
@@ -5310,7 +5310,7 @@ that are reorganised.
if (*fast_alter_table && tab_part_info->vers_info->interval.is_set())
{
partition_element *hist_part= tab_part_info->vers_info->hist_part;
if (hist_part->range_value <= thd->systime())
if (hist_part->range_value <= thd->query_start())
hist_part->part_state= PART_CHANGED;
}
}