When we execute the following SQL statement, we failed to update the row where the duplicate data is located.
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t BLOB, n INT, UNIQUE (t));
INSERT INTO t1 VALUES ('Hrecvx_0004ln-00',1), ('Hrecvx_0004mm-00',1);
INSERT INTO t1 VALUES ('Hrecvx_0004mm-00',2) ON DUPLICATE KEY UPDATE n = VALUES
;
Result: The SQL statement update the value of n in the line where Hrecvx_0004ln-00 is located. However, it should update the line where Hrecvx_0004mm-00 is located.
mysql> DROP TABLE IF EXISTS t1;
|
Query OK, 0 rows affected (0.00 sec)
|
|
mysql> CREATE TABLE t1 (t BLOB, n INT, UNIQUE (t));
|
Query OK, 0 rows affected (0.01 sec)
|
|
mysql> INSERT INTO t1 VALUES ('Hrecvx_0004ln-00',1), ('Hrecvx_0004mm-00',1);
|
Query OK, 2 rows affected (0.00 sec)
|
Records: 2 Duplicates: 0 Warnings: 0
|
|
mysql> SELECT * FROM t1;
|
+------------------+------+
|
| t | n |
|
+------------------+------+
|
| Hrecvx_0004ln-00 | 1 |
|
| Hrecvx_0004mm-00 | 1 |
|
+------------------+------+
|
2 rows in set (0.00 sec)
|
|
mysql> INSERT INTO t1 VALUES ('Hrecvx_0004mm-00',2) ON DUPLICATE KEY UPDATE n = VALUES (n);
|
Query OK, 2 rows affected (0.00 sec)
|
|
mysql> SELECT * FROM t1;
|
+------------------+------+
|
| t | n |
|
+------------------+------+
|
| Hrecvx_0004ln-00 | 2 |
|
| Hrecvx_0004mm-00 | 1 |
|
+------------------+------+
|
2 rows in set (0.00 sec)
|
|
There are no comments yet on this issue.
{"report":{"fcp":632.5999999046326,"ttfb":125.70000004768372,"pageVisibility":"visible","entityId":119011,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":1,"journeyId":"010c82cb-794d-4d8d-8a8d-bd626d8bd6b5","navigationType":0,"readyForUser":748.8999998569489,"redirectCount":0,"resourceLoadedEnd":628.5999999046326,"resourceLoadedStart":131.70000004768372,"resourceTiming":[{"duration":11,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":131.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":131.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":142.70000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":11.200000047683716,"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":132,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":132,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":143.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":77.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":132.09999990463257,"connectEnd":132.09999990463257,"connectStart":132.09999990463257,"domainLookupEnd":132.09999990463257,"domainLookupStart":132.09999990463257,"fetchStart":132.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":132.09999990463257,"responseEnd":209.79999995231628,"responseStart":209.79999995231628,"secureConnectionStart":132.09999990463257},{"duration":112.89999985694885,"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":132.20000004768372,"connectEnd":132.20000004768372,"connectStart":132.20000004768372,"domainLookupEnd":132.20000004768372,"domainLookupStart":132.20000004768372,"fetchStart":132.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":132.20000004768372,"responseEnd":245.09999990463257,"responseStart":245.09999990463257,"secureConnectionStart":132.20000004768372},{"duration":116.59999990463257,"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":132.29999995231628,"connectEnd":132.29999995231628,"connectStart":132.29999995231628,"domainLookupEnd":132.29999995231628,"domainLookupStart":132.29999995231628,"fetchStart":132.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":132.29999995231628,"responseEnd":248.89999985694885,"responseStart":248.89999985694885,"secureConnectionStart":132.29999995231628},{"duration":117.39999985694885,"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":132.5,"connectEnd":132.5,"connectStart":132.5,"domainLookupEnd":132.5,"domainLookupStart":132.5,"fetchStart":132.5,"redirectEnd":0,"redirectStart":0,"requestStart":132.5,"responseEnd":249.89999985694885,"responseStart":249.79999995231628,"secureConnectionStart":132.5},{"duration":118.09999990463257,"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":132.5,"connectEnd":132.5,"connectStart":132.5,"domainLookupEnd":132.5,"domainLookupStart":132.5,"fetchStart":132.5,"redirectEnd":0,"redirectStart":0,"requestStart":132.5,"responseEnd":250.59999990463257,"responseStart":250.59999990463257,"secureConnectionStart":132.5},{"duration":119,"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":132.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":132.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":251.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":118.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":132.70000004768372,"connectEnd":132.70000004768372,"connectStart":132.70000004768372,"domainLookupEnd":132.70000004768372,"domainLookupStart":132.70000004768372,"fetchStart":132.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":132.70000004768372,"responseEnd":251.29999995231628,"responseStart":251.29999995231628,"secureConnectionStart":132.70000004768372},{"duration":119.20000004768372,"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":132.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":132.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":252,"responseStart":0,"secureConnectionStart":0},{"duration":119.10000014305115,"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":132.89999985694885,"connectEnd":132.89999985694885,"connectStart":132.89999985694885,"domainLookupEnd":132.89999985694885,"domainLookupStart":132.89999985694885,"fetchStart":132.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":132.89999985694885,"responseEnd":252,"responseStart":252,"secureConnectionStart":132.89999985694885},{"duration":492.09999990463257,"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":133.79999995231628,"connectEnd":133.79999995231628,"connectStart":133.79999995231628,"domainLookupEnd":133.79999995231628,"domainLookupStart":133.79999995231628,"fetchStart":133.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":133.79999995231628,"responseEnd":625.8999998569489,"responseStart":625.8999998569489,"secureConnectionStart":133.79999995231628},{"duration":494.7999999523163,"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":133.79999995231628,"connectEnd":133.79999995231628,"connectStart":133.79999995231628,"domainLookupEnd":133.79999995231628,"domainLookupStart":133.79999995231628,"fetchStart":133.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":133.79999995231628,"responseEnd":628.5999999046326,"responseStart":628.5999999046326,"secureConnectionStart":133.79999995231628},{"duration":176.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":445.59999990463257,"connectEnd":445.59999990463257,"connectStart":445.59999990463257,"domainLookupEnd":445.59999990463257,"domainLookupStart":445.59999990463257,"fetchStart":445.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":445.59999990463257,"responseEnd":622.2999999523163,"responseStart":622.2999999523163,"secureConnectionStart":445.59999990463257},{"duration":8,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":625.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":625.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":633.0999999046326,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":4,"responseStart":125,"responseEnd":127,"domLoading":129,"domInteractive":800,"domContentLoadedEventStart":800,"domContentLoadedEventEnd":835,"domComplete":946,"loadEventStart":946,"loadEventEnd":947,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":785.2000000476837},{"name":"bigPipe.sidebar-id.end","time":786.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":786.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":786.7999999523163},{"name":"activityTabFullyLoaded","time":842.8999998569489}],"measures":[],"correlationId":"d6d96415cd8cc3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":67,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}