Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.3.20 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL)
Environment:
ubuntu 16.04 mariadb 10.3
When creating a virtual column, if the virtual column is timestamp, the value of the virtual column does not change when the time zone changes, and the mysql version changes.
mariadb10.3:
create table test_timestamp (`create_timestamp` timestamp(3) NOT NULL COMMENT '记录创建时间',`create_time` timestamp(3) GENERATED ALWAYS AS (from_unixtime(`create_timestamp` )) VIRTUAL COMMENT '记录创建时间');
insert into test_timestamp (`create_timestamp`) value (1569495326.861);
mysql> select * from test_timestamp;
+------------------+-------------------------+
| create_timestamp | create_time |
+------------------+-------------------------+
| 1569495326861 | 2019-09-26 10:55:26.861 |
+------------------+-------------------------+
1 row in set (0.01 sec)
mysql> set time_zone = "+01:00";
Query OK, 0 rows affected (0.00 sec)
mysql> select * from test_timestamp;
+------------------+-------------------------+
| create_timestamp | create_time |
+------------------+-------------------------+
| 1569495326861 | 2019-09-26 10:55:26.861 |
+------------------+-------------------------+
1 row in set (0.00 sec)
mysql5.7:
mysql> create table test_timestamp (`create_timestamp` bigint(20) NOT NULL COMMENT '记录创建时间',
-> `create_time` timestamp(3) GENERATED ALWAYS AS (from_unixtime(`create_timestamp` / 1000)) VIRTUAL COMMENT '记录创建时间');
Query OK, 0 rows affected (0.31 sec)
mysql> insert into test_timestamp (`create_timestamp`) value (1569495326861);
Query OK, 1 row affected (0.03 sec)
mysql> select * from test_timestamp;
+------------------+-------------------------+
| create_timestamp | create_time |
+------------------+-------------------------+
| 1569495326861 | 2019-09-26 10:55:26.861 |
+------------------+-------------------------+
1 row in set (0.01 sec)
mysql> set time_zone = "+01:00";
Query OK, 0 rows affected (0.00 sec)
mysql> select * from test_timestamp;
+------------------+-------------------------+
| create_timestamp | create_time |
+------------------+-------------------------+
| 1569495326861 | 2019-09-26 11:55:26.861 |
+------------------+-------------------------+
1 row in set (0.00 sec)
causes
MDEV-21593
from_unixtime can not be longer used in Virtual Column
Stalled
{"report":{"fcp":789.5999999046326,"ttfb":174.69999992847443,"pageVisibility":"visible","entityId":81009,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"fc9db217-5e59-4bf0-96c8-22cc6c1c7c54","navigationType":0,"readyForUser":859.6999999284744,"redirectCount":0,"resourceLoadedEnd":913.5,"resourceLoadedStart":182.79999995231628,"resourceTiming":[{"duration":128.70000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":182.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.5,"responseStart":0,"secureConnectionStart":0},{"duration":128.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":183.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":137.80000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":183.19999992847443,"connectEnd":183.19999992847443,"connectStart":183.19999992847443,"domainLookupEnd":183.19999992847443,"domainLookupStart":183.19999992847443,"fetchStart":183.19999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":183.19999992847443,"responseEnd":321,"responseStart":321,"secureConnectionStart":183.19999992847443},{"duration":184.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":183.29999995231628,"connectEnd":183.29999995231628,"connectStart":183.29999995231628,"domainLookupEnd":183.29999995231628,"domainLookupStart":183.29999995231628,"fetchStart":183.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":183.29999995231628,"responseEnd":367.6999999284744,"responseStart":367.6999999284744,"secureConnectionStart":183.29999995231628},{"duration":188.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":183.39999997615814,"connectEnd":183.39999997615814,"connectStart":183.39999997615814,"domainLookupEnd":183.39999997615814,"domainLookupStart":183.39999997615814,"fetchStart":183.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":183.39999997615814,"responseEnd":372.09999990463257,"responseStart":372.09999990463257,"secureConnectionStart":183.39999997615814},{"duration":189.19999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":183.5,"connectEnd":183.5,"connectStart":183.5,"domainLookupEnd":183.5,"domainLookupStart":183.5,"fetchStart":183.5,"redirectEnd":0,"redirectStart":0,"requestStart":183.5,"responseEnd":372.6999999284744,"responseStart":372.6999999284744,"secureConnectionStart":183.5},{"duration":189.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":183.59999990463257,"connectEnd":183.59999990463257,"connectStart":183.59999990463257,"domainLookupEnd":183.59999990463257,"domainLookupStart":183.59999990463257,"fetchStart":183.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":183.59999990463257,"responseEnd":373.2999999523163,"responseStart":373.2999999523163,"secureConnectionStart":183.59999990463257},{"duration":190,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":183.69999992847443,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":373.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":190,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":183.79999995231628,"connectEnd":183.79999995231628,"connectStart":183.79999995231628,"domainLookupEnd":183.79999995231628,"domainLookupStart":183.79999995231628,"fetchStart":183.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":183.79999995231628,"responseEnd":373.7999999523163,"responseStart":373.7999999523163,"secureConnectionStart":183.79999995231628},{"duration":190.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":183.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":374.5,"responseStart":0,"secureConnectionStart":0},{"duration":190.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":184.09999990463257,"connectEnd":184.09999990463257,"connectStart":184.09999990463257,"domainLookupEnd":184.09999990463257,"domainLookupStart":184.09999990463257,"fetchStart":184.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":184.09999990463257,"responseEnd":374.6999999284744,"responseStart":374.6999999284744,"secureConnectionStart":184.09999990463257},{"duration":554.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":184.79999995231628,"connectEnd":184.79999995231628,"connectStart":184.79999995231628,"domainLookupEnd":184.79999995231628,"domainLookupStart":184.79999995231628,"fetchStart":184.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":184.79999995231628,"responseEnd":739.5999999046326,"responseStart":739.5999999046326,"secureConnectionStart":184.79999995231628},{"duration":558,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":184.89999997615814,"connectEnd":184.89999997615814,"connectStart":184.89999997615814,"domainLookupEnd":184.89999997615814,"domainLookupStart":184.89999997615814,"fetchStart":184.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":184.89999997615814,"responseEnd":742.8999999761581,"responseStart":742.8999999761581,"secureConnectionStart":184.89999997615814},{"duration":139.10000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":537.8999999761581,"connectEnd":537.8999999761581,"connectStart":537.8999999761581,"domainLookupEnd":537.8999999761581,"domainLookupStart":537.8999999761581,"fetchStart":537.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":537.8999999761581,"responseEnd":677,"responseStart":677,"secureConnectionStart":537.8999999761581},{"duration":148.89999997615814,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":763,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":763,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":911.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":137.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true","startTime":775.7999999523163,"connectEnd":775.7999999523163,"connectStart":775.7999999523163,"domainLookupEnd":775.7999999523163,"domainLookupStart":775.7999999523163,"fetchStart":775.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":775.7999999523163,"responseEnd":913.5,"responseStart":913.5,"secureConnectionStart":775.7999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":26,"responseStart":175,"responseEnd":178,"domLoading":178,"domInteractive":916,"domContentLoadedEventStart":916,"domContentLoadedEventEnd":951,"domComplete":1769,"loadEventStart":1769,"loadEventEnd":1771,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":898.6999999284744},{"name":"bigPipe.sidebar-id.end","time":899.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":899.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":902},{"name":"activityTabFullyLoaded","time":955.5999999046326}],"measures":[],"correlationId":"c2f4e5af67630a","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":76,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}