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":768.5,"ttfb":164.10000014305115,"pageVisibility":"visible","entityId":118291,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"1d6d3e40-199c-4044-9f27-61025b696b77","navigationType":0,"readyForUser":851.2000000476837,"redirectCount":0,"resourceLoadedEnd":898.2000000476837,"resourceLoadedStart":170.60000014305115,"resourceTiming":[{"duration":136.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":170.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":307,"responseStart":0,"secureConnectionStart":0},{"duration":136.09999990463257,"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":170.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":307,"responseStart":0,"secureConnectionStart":0},{"duration":146.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":171,"connectEnd":171,"connectStart":171,"domainLookupEnd":171,"domainLookupStart":171,"fetchStart":171,"redirectEnd":0,"redirectStart":0,"requestStart":171,"responseEnd":317.60000014305115,"responseStart":317.60000014305115,"secureConnectionStart":171},{"duration":236.59999990463257,"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":171.10000014305115,"connectEnd":171.10000014305115,"connectStart":171.10000014305115,"domainLookupEnd":171.10000014305115,"domainLookupStart":171.10000014305115,"fetchStart":171.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":171.10000014305115,"responseEnd":407.7000000476837,"responseStart":407.7000000476837,"secureConnectionStart":171.10000014305115},{"duration":240.29999995231628,"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":171.20000004768372,"connectEnd":171.20000004768372,"connectStart":171.20000004768372,"domainLookupEnd":171.20000004768372,"domainLookupStart":171.20000004768372,"fetchStart":171.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":171.20000004768372,"responseEnd":411.5,"responseStart":411.5,"secureConnectionStart":171.20000004768372},{"duration":241.59999990463257,"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":171.30000019073486,"connectEnd":171.30000019073486,"connectStart":171.30000019073486,"domainLookupEnd":171.30000019073486,"domainLookupStart":171.30000019073486,"fetchStart":171.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":171.30000019073486,"responseEnd":412.90000009536743,"responseStart":412.90000009536743,"secureConnectionStart":171.30000019073486},{"duration":242.90000009536743,"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":171.40000009536743,"connectEnd":171.40000009536743,"connectStart":171.40000009536743,"domainLookupEnd":171.40000009536743,"domainLookupStart":171.40000009536743,"fetchStart":171.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":171.40000009536743,"responseEnd":414.30000019073486,"responseStart":414.30000019073486,"secureConnectionStart":171.40000009536743},{"duration":243.80000019073486,"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":171.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":415.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":243.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":171.60000014305115,"connectEnd":171.60000014305115,"connectStart":171.60000014305115,"domainLookupEnd":171.60000014305115,"domainLookupStart":171.60000014305115,"fetchStart":171.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":171.60000014305115,"responseEnd":415.5,"responseStart":415.40000009536743,"secureConnectionStart":171.60000014305115},{"duration":245,"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":171.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":416.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":244.90000009536743,"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":171.90000009536743,"connectEnd":171.90000009536743,"connectStart":171.90000009536743,"domainLookupEnd":171.90000009536743,"domainLookupStart":171.90000009536743,"fetchStart":171.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":171.90000009536743,"responseEnd":416.80000019073486,"responseStart":416.80000019073486,"secureConnectionStart":171.90000009536743},{"duration":455.40000009536743,"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":172.40000009536743,"connectEnd":172.40000009536743,"connectStart":172.40000009536743,"domainLookupEnd":172.40000009536743,"domainLookupStart":172.40000009536743,"fetchStart":172.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":172.40000009536743,"responseEnd":627.8000001907349,"responseStart":627.8000001907349,"secureConnectionStart":172.40000009536743},{"duration":496.60000014305115,"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":177,"connectEnd":177,"connectStart":177,"domainLookupEnd":177,"domainLookupStart":177,"fetchStart":177,"redirectEnd":0,"redirectStart":0,"requestStart":177,"responseEnd":673.6000001430511,"responseStart":673.6000001430511,"secureConnectionStart":177},{"duration":159.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":469.7000000476837,"connectEnd":469.7000000476837,"connectStart":469.7000000476837,"domainLookupEnd":469.7000000476837,"domainLookupStart":469.7000000476837,"fetchStart":469.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":469.7000000476837,"responseEnd":629,"responseStart":629,"secureConnectionStart":469.7000000476837},{"duration":4.1000001430511475,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":674.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":674.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":678.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":216.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":675.2000000476837,"connectEnd":675.2000000476837,"connectStart":675.2000000476837,"domainLookupEnd":675.2000000476837,"domainLookupStart":675.2000000476837,"fetchStart":675.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":675.2000000476837,"responseEnd":891.5,"responseStart":891.5,"secureConnectionStart":675.2000000476837},{"duration":222.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":675.5,"connectEnd":675.5,"connectStart":675.5,"domainLookupEnd":675.5,"domainLookupStart":675.5,"fetchStart":675.5,"redirectEnd":0,"redirectStart":0,"requestStart":675.5,"responseEnd":898.2000000476837,"responseStart":898.2000000476837,"secureConnectionStart":675.5},{"duration":190.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":760.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":760.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":950.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":168.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":783,"connectEnd":783,"connectStart":783,"domainLookupEnd":783,"domainLookupStart":783,"fetchStart":783,"redirectEnd":0,"redirectStart":0,"requestStart":783,"responseEnd":951.2000000476837,"responseStart":951.2000000476837,"secureConnectionStart":783}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":10,"responseStart":164,"responseEnd":173,"domLoading":167,"domInteractive":926,"domContentLoadedEventStart":926,"domContentLoadedEventEnd":970,"domComplete":1478,"loadEventStart":1478,"loadEventEnd":1479,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":889.9000000953674},{"name":"bigPipe.sidebar-id.end","time":890.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":890.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":892.2000000476837},{"name":"activityTabFullyLoaded","time":988.4000000953674}],"measures":[],"correlationId":"87f66f342ed616","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":89,"dbReadsTimeInMs":27,"dbConnsTimeInMs":34,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}