Reproduce
create or replace table t1 (
x int , y int with system versioning,
row_start timestamp (6) as row start,
row_end timestamp (6) as row end ,
period for system_time(row_start, row_end));
Result
ERROR 4125 (HY000): Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
Expected
Command succeeds.
Geoff Montee (Inactive)
made changes -
2021-10-27 19:05
Description
It looks like transaction-precise tables do not currently support column inclusion:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY,
-> name VARCHAR(255),
-> amount INT WITH SYSTEM VERSIONING,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> );
ERROR 4125 (HY000): Wrong parameters for `accounts_col`: missing 'WITH SYSTEM VERSIONING'
{code}
However, the same can be implemented using column exclusion instead:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY WITHOUT SYSTEM VERSIONING,
-> name VARCHAR(255) WITHOUT SYSTEM VERSIONING,
-> amount INT,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> ) WITH SYSTEM VERSIONING;
Query OK, 0 rows affected (0.020 sec)
{code}
Unlike system-versioned tables, it looks like transaction-precise tables do not currently support column inclusion:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY,
-> name VARCHAR(255),
-> amount INT WITH SYSTEM VERSIONING,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> );
ERROR 4125 (HY000): Wrong parameters for `accounts_col`: missing 'WITH SYSTEM VERSIONING'
{code}
However, the same can be implemented using column exclusion instead:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY WITHOUT SYSTEM VERSIONING,
-> name VARCHAR(255) WITHOUT SYSTEM VERSIONING,
-> amount INT,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> ) WITH SYSTEM VERSIONING;
Query OK, 0 rows affected (0.020 sec)
{code}
Ralf Gebhardt
made changes -
2021-10-28 14:10
Component/s
Versioned Tables
[ 14303
]
Component/s
Versioned Tables
[ 15003
]
Key
MENT-1350
MDEV-26928
Affects Version/s
10.3
[ 22126
]
Affects Version/s
10.4
[ 22408
]
Affects Version/s
10.5
[ 23123
]
Affects Version/s
10.6
[ 24028
]
Affects Version/s
10.4
[ 23604
]
Affects Version/s
10.3
[ 23605
]
Affects Version/s
10.5
[ 23608
]
Affects Version/s
10.6
[ 24027
]
Issue Type
Task
[ 3
]
Bug
[ 1
]
Project
MariaDB Enterprise
[ 11500
]
MariaDB Server
[ 10000
]
Aleksey Midenkov
made changes -
2021-11-02 00:47
Summary
Implement column inclusion for transaction-precise tables
Column inclusion WITH SYSTEM VERSIONING doesn't work with explicit system fields
Aleksey Midenkov
made changes -
2021-11-02 00:48
Description
Unlike system-versioned tables, it looks like transaction-precise tables do not currently support column inclusion:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY,
-> name VARCHAR(255),
-> amount INT WITH SYSTEM VERSIONING,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> );
ERROR 4125 (HY000): Wrong parameters for `accounts_col`: missing 'WITH SYSTEM VERSIONING'
{code}
However, the same can be implemented using column exclusion instead:
{code:sql}
MariaDB [test]> CREATE TABLE accounts_col (
-> id SERIAL PRIMARY KEY WITHOUT SYSTEM VERSIONING,
-> name VARCHAR(255) WITHOUT SYSTEM VERSIONING,
-> amount INT,
-> start_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW START INVISIBLE,
-> end_trxid BIGINT UNSIGNED GENERATED ALWAYS AS ROW END INVISIBLE,
-> PERIOD FOR SYSTEM_TIME(start_trxid, end_trxid)
-> ) WITH SYSTEM VERSIONING;
Query OK, 0 rows affected (0.020 sec)
{code}
h3. Reproduce
{code:sql}
create or replace table t1 (
x int, y int with system versioning,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time(row_start, row_end));
{code}
h3. Result
{code}
ERROR 4125 (HY000): Wrong parameters for `t1`: missing 'WITH SYSTEM VERSIONING'
{code}
h3. Expected
Command succeeds.
Aleksey Midenkov
made changes -
2021-11-02 00:49
Summary
Column inclusion WITH SYSTEM VERSIONING doesn't work with explicit system fields
Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields
Aleksey Midenkov
made changes -
2021-11-02 01:26
Status
Open
[ 1
]
In Progress
[ 3
]
Aleksey Midenkov
made changes -
2021-11-02 01:27
Assignee
Aleksey Midenkov
[ midenok
]
Nikita Malyavin
[ nikitamalyavin
]
Status
In Progress
[ 3
]
In Review
[ 10002
]
Nikita Malyavin
made changes -
2021-11-02 08:27
Assignee
Nikita Malyavin
[ nikitamalyavin
]
Aleksey Midenkov
[ midenok
]
Status
In Review
[ 10002
]
Stalled
[ 10000
]
Aleksey Midenkov
made changes -
2021-11-02 10:02
Fix Version/s
10.3.32
[ 26029
]
Fix Version/s
10.4.22
[ 26031
]
Fix Version/s
10.5.13
[ 26026
]
Fix Version/s
10.6.5
[ 26034
]
Fix Version/s
10.3
[ 22126
]
Aleksey Midenkov
made changes -
2021-11-02 10:03
Resolution
Fixed
[ 1
]
Status
Stalled
[ 10000
]
Closed
[ 6
]
Daniel Bartholomew
made changes -
2021-11-08 19:29
Fix Version/s
10.3.33
[ 26805
]
Fix Version/s
10.4.23
[ 26807
]
Fix Version/s
10.5.14
[ 26809
]
Fix Version/s
10.6.6
[ 26811
]
Fix Version/s
10.5.13
[ 26026
]
Fix Version/s
10.3.32
[ 26029
]
Fix Version/s
10.4.22
[ 26031
]
Fix Version/s
10.6.5
[ 26034
]
Sergei Golubchik
made changes -
2021-12-06 21:54
Workflow
MariaDB v3
[ 126770
]
MariaDB v4
[ 159812
]
{"report":{"fcp":1607.6999998092651,"ttfb":687.6999998092651,"pageVisibility":"visible","entityId":104414,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"a0857e6d-8f0a-474a-8434-20922adc12ac","navigationType":0,"readyForUser":1686.0999999046326,"redirectCount":0,"resourceLoadedEnd":1863.0999999046326,"resourceLoadedStart":708.0999999046326,"resourceTiming":[{"duration":385.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":708.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":708.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1093.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":385.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":708.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":708.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1094.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":443.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":708.5999999046326,"connectEnd":708.5999999046326,"connectStart":708.5999999046326,"domainLookupEnd":708.5999999046326,"domainLookupStart":708.5999999046326,"fetchStart":708.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":708.5999999046326,"responseEnd":1152.3999996185303,"responseStart":1152.3999996185303,"secureConnectionStart":708.5999999046326},{"duration":502.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":708.6999998092651,"connectEnd":708.6999998092651,"connectStart":708.6999998092651,"domainLookupEnd":708.6999998092651,"domainLookupStart":708.6999998092651,"fetchStart":708.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":708.6999998092651,"responseEnd":1211.3999996185303,"responseStart":1211.3999996185303,"secureConnectionStart":708.6999998092651},{"duration":506.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":708.8999996185303,"connectEnd":708.8999996185303,"connectStart":708.8999996185303,"domainLookupEnd":708.8999996185303,"domainLookupStart":708.8999996185303,"fetchStart":708.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":708.8999996185303,"responseEnd":1215,"responseStart":1215,"secureConnectionStart":708.8999996185303},{"duration":506.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":709.0999999046326,"connectEnd":709.0999999046326,"connectStart":709.0999999046326,"domainLookupEnd":709.0999999046326,"domainLookupStart":709.0999999046326,"fetchStart":709.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":709.0999999046326,"responseEnd":1215.5,"responseStart":1215.5,"secureConnectionStart":709.0999999046326},{"duration":506.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":709.3999996185303,"connectEnd":709.3999996185303,"connectStart":709.3999996185303,"domainLookupEnd":709.3999996185303,"domainLookupStart":709.3999996185303,"fetchStart":709.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":709.3999996185303,"responseEnd":1216,"responseStart":1216,"secureConnectionStart":709.3999996185303},{"duration":585.3999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":709.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1294.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":506.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":709.6999998092651,"connectEnd":709.6999998092651,"connectStart":709.6999998092651,"domainLookupEnd":709.6999998092651,"domainLookupStart":709.6999998092651,"fetchStart":709.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":709.6999998092651,"responseEnd":1216.3999996185303,"responseStart":1216.3999996185303,"secureConnectionStart":709.6999998092651},{"duration":585.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":709.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":709.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1295.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":507,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":710,"connectEnd":710,"connectStart":710,"domainLookupEnd":710,"domainLookupStart":710,"fetchStart":710,"redirectEnd":0,"redirectStart":0,"requestStart":710,"responseEnd":1217,"responseStart":1217,"secureConnectionStart":710},{"duration":886.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":711.1999998092651,"connectEnd":711.1999998092651,"connectStart":711.1999998092651,"domainLookupEnd":711.1999998092651,"domainLookupStart":711.1999998092651,"fetchStart":711.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":711.1999998092651,"responseEnd":1597.2999997138977,"responseStart":1597.2999997138977,"secureConnectionStart":711.1999998092651},{"duration":1151.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":711.2999997138977,"connectEnd":711.2999997138977,"connectStart":711.2999997138977,"domainLookupEnd":711.2999997138977,"domainLookupStart":711.2999997138977,"fetchStart":711.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":711.2999997138977,"responseEnd":1863.0999999046326,"responseStart":1863.0999999046326,"secureConnectionStart":711.2999997138977},{"duration":295.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1306.6999998092651,"connectEnd":1306.6999998092651,"connectStart":1306.6999998092651,"domainLookupEnd":1306.6999998092651,"domainLookupStart":1306.6999998092651,"fetchStart":1306.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1306.6999998092651,"responseEnd":1602.1999998092651,"responseStart":1602.1999998092651,"secureConnectionStart":1306.6999998092651},{"duration":366.2999997138977,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1601.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1601.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1967.3999996185303,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":457,"responseStart":687,"responseEnd":696,"domLoading":704,"domInteractive":1916,"domContentLoadedEventStart":1916,"domContentLoadedEventEnd":1967,"domComplete":2413,"loadEventStart":2413,"loadEventEnd":2414,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1881.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1882.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1882.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1888.7999997138977},{"name":"activityTabFullyLoaded","time":2023.1999998092651}],"measures":[],"correlationId":"6ae16dd9fe3720","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":171,"dbReadsTimeInMs":31,"dbConnsTimeInMs":43,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Please review bb-10.3-midenok