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":1524.5,"ttfb":562.1000003814697,"pageVisibility":"visible","entityId":119011,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"a9c54e2d-51e7-4cd1-96ab-506eac7afb75","navigationType":0,"readyForUser":1602.7000002861023,"redirectCount":0,"resourceLoadedEnd":2228.800000190735,"resourceLoadedStart":567.7000002861023,"resourceTiming":[{"duration":425.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":567.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":567.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":993.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":426.1000003814697,"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":568,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":568,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":994.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":465,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":568.2000002861023,"connectEnd":568.2000002861023,"connectStart":568.2000002861023,"domainLookupEnd":568.2000002861023,"domainLookupStart":568.2000002861023,"fetchStart":568.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":568.2000002861023,"responseEnd":1033.2000002861023,"responseStart":1033.2000002861023,"secureConnectionStart":568.2000002861023},{"duration":570.2000002861023,"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":568.4000000953674,"connectEnd":568.4000000953674,"connectStart":568.4000000953674,"domainLookupEnd":568.4000000953674,"domainLookupStart":568.4000000953674,"fetchStart":568.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":568.4000000953674,"responseEnd":1138.6000003814697,"responseStart":1138.6000003814697,"secureConnectionStart":568.4000000953674},{"duration":574,"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":568.5,"connectEnd":568.5,"connectStart":568.5,"domainLookupEnd":568.5,"domainLookupStart":568.5,"fetchStart":568.5,"redirectEnd":0,"redirectStart":0,"requestStart":568.5,"responseEnd":1142.5,"responseStart":1142.5,"secureConnectionStart":568.5},{"duration":574.1999998092651,"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":568.8000001907349,"connectEnd":568.8000001907349,"connectStart":568.8000001907349,"domainLookupEnd":568.8000001907349,"domainLookupStart":568.8000001907349,"fetchStart":568.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":568.8000001907349,"responseEnd":1143,"responseStart":1143,"secureConnectionStart":568.8000001907349},{"duration":574.5,"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":569,"connectEnd":569,"connectStart":569,"domainLookupEnd":569,"domainLookupStart":569,"fetchStart":569,"redirectEnd":0,"redirectStart":0,"requestStart":569,"responseEnd":1143.5,"responseStart":1143.4000000953674,"secureConnectionStart":569},{"duration":610.9000000953674,"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":569.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":569.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1180.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":575,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":569.3000001907349,"connectEnd":569.3000001907349,"connectStart":569.3000001907349,"domainLookupEnd":569.3000001907349,"domainLookupStart":569.3000001907349,"fetchStart":569.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":569.3000001907349,"responseEnd":1144.3000001907349,"responseStart":1144.3000001907349,"secureConnectionStart":569.3000001907349},{"duration":610.6999998092651,"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":569.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":569.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1180.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":575.1999998092651,"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":569.7000002861023,"connectEnd":569.7000002861023,"connectStart":569.7000002861023,"domainLookupEnd":569.7000002861023,"domainLookupStart":569.7000002861023,"fetchStart":569.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":569.7000002861023,"responseEnd":1144.9000000953674,"responseStart":1144.9000000953674,"secureConnectionStart":569.7000002861023},{"duration":1656.5,"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":570.8000001907349,"connectEnd":570.8000001907349,"connectStart":570.8000001907349,"domainLookupEnd":570.8000001907349,"domainLookupStart":570.8000001907349,"fetchStart":570.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":570.8000001907349,"responseEnd":2227.300000190735,"responseStart":2227.300000190735,"secureConnectionStart":570.8000001907349},{"duration":1657.9000000953674,"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":570.9000000953674,"connectEnd":570.9000000953674,"connectStart":570.9000000953674,"domainLookupEnd":570.9000000953674,"domainLookupStart":570.9000000953674,"fetchStart":570.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":570.9000000953674,"responseEnd":2228.800000190735,"responseStart":2228.800000190735,"secureConnectionStart":570.9000000953674},{"duration":736.5999999046326,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1193.1000003814697,"connectEnd":1193.1000003814697,"connectStart":1193.1000003814697,"domainLookupEnd":1193.1000003814697,"domainLookupStart":1193.1000003814697,"fetchStart":1193.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1193.1000003814697,"responseEnd":1929.7000002861023,"responseStart":1929.7000002861023,"secureConnectionStart":1193.1000003814697}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":401,"responseStart":562,"responseEnd":564,"domLoading":565,"domInteractive":2249,"domContentLoadedEventStart":2249,"domContentLoadedEventEnd":2289,"domComplete":3770,"loadEventStart":3770,"loadEventEnd":3770,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2234},{"name":"bigPipe.sidebar-id.end","time":2234.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2235.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":2235.7000002861023},{"name":"activityTabFullyLoaded","time":2295.9000000953674}],"measures":[],"correlationId":"fe37a28691b020","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}