Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.10.2 , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL) , 10.9(EOL) , 10.10(EOL)
A UNIQUE index that includes a PERIOD in its definition may falsely report a uniqueness violation. Here is an example. Two of the three tables work correctly, but the one with the PERIOD in the UNIQUE index does not. If I insert a value with a trailing space, there should not be an error with collation 'utf8mb4_unicode_nopad_ci'. There is an error when the PERIOD is part of the unique index and the value with the trailing space gets inserted first.
# A table without datetime columns
CREATE TABLE `table` (
`text_column_name` TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
UNIQUE KEY `index_name` (`text_column_name`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
# A table with two datetime columns
CREATE TABLE `table_with_two_datetime_columns` (
`datetime_column_name_1` DATETIME(6) NOT NULL,
`datetime_column_name_2` DATETIME(6) NOT NULL,
`text_column_name` TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
UNIQUE KEY `index_name` (`text_column_name`(191),`datetime_column_name_1`,`datetime_column_name_2`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
#A table with two datetime columns that are part of a PERIOD
CREATE TABLE `table_with_two_range_datetime_columns` (
`datetime_column_name_1` DATETIME(6) NOT NULL,
`datetime_column_name_2` DATETIME(6) NOT NULL,
`text_column_name` TEXT COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
PERIOD FOR `period_name` (`datetime_column_name_1`, `datetime_column_name_2`),
UNIQUE KEY `index_name` (`text_column_name`(191),`period_name` WITHOUT OVERLAPS)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_nopad_ci;
# Insert values in the tables. First is the value without the extra space.
INSERT INTO `table`(`text_column_name`)
VALUES
('abc'),
('abc ')
;
INSERT INTO `table_with_two_datetime_columns`(`datetime_column_name_1`, `datetime_column_name_2`, `text_column_name`)
VALUES
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ')
;
INSERT INTO `table_with_two_range_datetime_columns`(`datetime_column_name_1`, `datetime_column_name_2`, `text_column_name`)
VALUES
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc'),
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'abc ')
;
# Now try again but this time we revert the order of insertions. First is the string with the extra space.
INSERT INTO `table`(`text_column_name`)
VALUES
('def '),
('def')
;
INSERT INTO `table_with_two_datetime_columns`(`datetime_column_name_1`, `datetime_column_name_2`, `text_column_name`)
VALUES
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def')
;
# There will be an error for inserting into this table.
INSERT INTO `table_with_two_range_datetime_columns`(`datetime_column_name_1`, `datetime_column_name_2`, `text_column_name`)
VALUES
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def '),
('2000-01-01 00:00:00.000000', '2001-01-01 00:00:00.000000', 'def')
;
{"report":{"fcp":934.1999998092651,"ttfb":152.39999985694885,"pageVisibility":"visible","entityId":118291,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"81cd73a1-1805-4e56-bc5c-ce40bb3d3131","navigationType":0,"readyForUser":1018.3999998569489,"redirectCount":0,"resourceLoadedEnd":790,"resourceLoadedStart":158.09999990463257,"resourceTiming":[{"duration":313.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":158.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":158.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":471.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":313.2999999523163,"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":158.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":158.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":471.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":322.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":158.59999990463257,"connectEnd":158.59999990463257,"connectStart":158.59999990463257,"domainLookupEnd":158.59999990463257,"domainLookupStart":158.59999990463257,"fetchStart":158.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":158.59999990463257,"responseEnd":481,"responseStart":481,"secureConnectionStart":158.59999990463257},{"duration":348.60000014305115,"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":158.69999980926514,"connectEnd":158.69999980926514,"connectStart":158.69999980926514,"domainLookupEnd":158.69999980926514,"domainLookupStart":158.69999980926514,"fetchStart":158.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":158.69999980926514,"responseEnd":507.2999999523163,"responseStart":507.2999999523163,"secureConnectionStart":158.69999980926514},{"duration":352.40000009536743,"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":158.89999985694885,"connectEnd":158.89999985694885,"connectStart":158.89999985694885,"domainLookupEnd":158.89999985694885,"domainLookupStart":158.89999985694885,"fetchStart":158.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":158.89999985694885,"responseEnd":511.2999999523163,"responseStart":511.2999999523163,"secureConnectionStart":158.89999985694885},{"duration":352.7000000476837,"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":159.19999980926514,"connectEnd":159.19999980926514,"connectStart":159.19999980926514,"domainLookupEnd":159.19999980926514,"domainLookupStart":159.19999980926514,"fetchStart":159.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":159.19999980926514,"responseEnd":511.89999985694885,"responseStart":511.89999985694885,"secureConnectionStart":159.19999980926514},{"duration":352.89999985694885,"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":159.29999995231628,"connectEnd":159.29999995231628,"connectStart":159.29999995231628,"domainLookupEnd":159.29999995231628,"domainLookupStart":159.29999995231628,"fetchStart":159.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":159.29999995231628,"responseEnd":512.1999998092651,"responseStart":512.1999998092651,"secureConnectionStart":159.29999995231628},{"duration":353.7999999523163,"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":159.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":159.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":513.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":353,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":159.69999980926514,"connectEnd":159.69999980926514,"connectStart":159.69999980926514,"domainLookupEnd":159.69999980926514,"domainLookupStart":159.69999980926514,"fetchStart":159.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":159.69999980926514,"responseEnd":512.6999998092651,"responseStart":512.6999998092651,"secureConnectionStart":159.69999980926514},{"duration":353.7000000476837,"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":159.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":159.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":513.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":353.09999990463257,"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":160.09999990463257,"connectEnd":160.09999990463257,"connectStart":160.09999990463257,"domainLookupEnd":160.09999990463257,"domainLookupStart":160.09999990463257,"fetchStart":160.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":160.09999990463257,"responseEnd":513.1999998092651,"responseStart":513.1999998092651,"secureConnectionStart":160.09999990463257},{"duration":396,"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":161.09999990463257,"connectEnd":161.09999990463257,"connectStart":161.09999990463257,"domainLookupEnd":161.09999990463257,"domainLookupStart":161.09999990463257,"fetchStart":161.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":161.09999990463257,"responseEnd":557.0999999046326,"responseStart":557.0999999046326,"secureConnectionStart":161.09999990463257},{"duration":628.7000000476837,"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":161.29999995231628,"connectEnd":161.29999995231628,"connectStart":161.29999995231628,"domainLookupEnd":161.29999995231628,"domainLookupStart":161.29999995231628,"fetchStart":161.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":161.29999995231628,"responseEnd":790,"responseStart":790,"secureConnectionStart":161.29999995231628}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":4,"responseStart":153,"responseEnd":157,"domLoading":156,"domInteractive":1081,"domContentLoadedEventStart":1081,"domContentLoadedEventEnd":1129,"domComplete":1917,"loadEventStart":1917,"loadEventEnd":1917,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1059.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1060.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1060.8999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":1063.5},{"name":"activityTabFullyLoaded","time":1136.7999999523163}],"measures":[],"correlationId":"f79299687f9cf","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":85,"dbReadsTimeInMs":9,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}