Bug #92273 Incorrect timezone object used to create dd timestamps for routines and views
Submitted: 3 Sep 2018 11:16 Modified: 14 Sep 2018 19:38
Reporter: Dyre Tjeldvoll Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Sep 2018 11:16] Dyre Tjeldvoll
Description:
This is a "spin-off" from Bug#28492272 where two different issues with very similar symptoms are reported. This bug covers the issue where the THD timezone is used instead of my_tz_OFFSET0 when converting the query start time from seconds since epoch to datetime in ulonglong format. When using the THD's timezone, it becomes possible to set the current timzone and current timestamp such that the resulting timestamp becomes invalid (before beginning of epoch), and this trigger a conversion error assert when trying to persist the timestamp in the DD.

How to repeat:
--echo # Test case 2: Altering view when timestamp=1 and time_zone=-12:00
CREATE VIEW v1 AS SELECT 5;

SET TIME_ZONE='-6:00';
SET TIMESTAMP=1235;

--echo # Altering a view when timstamp+time zone is before beginning of epoch
--echo # must not trigger assert.
ALTER VIEW v1 AS SELECT 6;
SET TIMESTAMP=default;
SET TIME_ZONE=default;
DROP VIEW v1;

Suggested fix:
Use the correct timezone object to perform the conversion. Create a utility function which performs the conversion and use that throughout the DD code.
[14 Sep 2018 19:38] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.14 release, and here's the changelog entry:

Setting time_zone to a negative offset and timestamp to a low value
triggered an assertion when altering routines and views.