-
Technical task
-
-
Major
-
Resolution:
Unresolved
-
None
-
None
-
-
Implement Oracle-style multi-table UPDATE syntax:
UPDATE (SELECT ... FROM t1,t2 WHERE ... ) SET ...;
|
Example:
DROP TABLE t1;
|
DROP TABLE t2;
|
CREATE TABLE t1 (id INT PRIMARY KEY, p1 INT);
|
INSERT INTO t1 VALUES (1, 100);
|
INSERT INTO t1 VALUES (2, 100);
|
CREATE TABLE t2 (id INT, p2 INT);
|
INSERT INTO t2 VALUES (1, 10);
|
INSERT INTO t2 VALUES (1, 20);
|
UPDATE (SELECT p1,p2 FROM t1,t2 WHERE t1.id=t2.id AND p1=100) SET p2=p2+1;
|
SELECT * FROM t2;
|
ID P2
|
---------- ----------
|
1 11
|
1 21
|
Note, Oracle has some limitations. If I rewrite the above UPDATE statement as:
UPDATE (SELECT p1,p2 FROM t1,t2 WHERE t1.id=t2.id AND p1=100) SET p1=p1+1;
|
it returns an error:
UPDATE (SELECT p1,p2 FROM t1,t2 WHERE t1.id=t2.id AND p1=100) SET p1=p1+1
|
*
|
ERROR at line 1:
|
ORA-01779: cannot modify a column which maps to a non key-preserved table
|
{"report":{"fcp":1209.7999992370605,"ttfb":348.29999923706055,"pageVisibility":"visible","entityId":57673,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3283caf9-8afd-4757-a8ef-6320b96fc5c2","navigationType":0,"readyForUser":1386.1999998092651,"redirectCount":0,"resourceLoadedEnd":1521.5,"resourceLoadedStart":362.3999996185303,"resourceTiming":[{"duration":106.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":362.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":469,"responseStart":0,"secureConnectionStart":0},{"duration":314.5,"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":362.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":677.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":328.29999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":363,"connectEnd":363,"connectStart":363,"domainLookupEnd":363,"domainLookupStart":363,"fetchStart":363,"redirectEnd":0,"redirectStart":0,"requestStart":363,"responseEnd":691.2999992370605,"responseStart":691.2999992370605,"secureConnectionStart":363},{"duration":388,"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":363.79999923706055,"connectEnd":363.79999923706055,"connectStart":363.79999923706055,"domainLookupEnd":363.79999923706055,"domainLookupStart":363.79999923706055,"fetchStart":363.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":363.79999923706055,"responseEnd":751.7999992370605,"responseStart":751.7999992370605,"secureConnectionStart":363.79999923706055},{"duration":401,"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":364,"connectEnd":364,"connectStart":364,"domainLookupEnd":364,"domainLookupStart":364,"fetchStart":364,"redirectEnd":0,"redirectStart":0,"requestStart":364,"responseEnd":765,"responseStart":765,"secureConnectionStart":364},{"duration":401.5,"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":364.19999980926514,"connectEnd":364.19999980926514,"connectStart":364.19999980926514,"domainLookupEnd":364.19999980926514,"domainLookupStart":364.19999980926514,"fetchStart":364.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":364.19999980926514,"responseEnd":765.6999998092651,"responseStart":765.6999998092651,"secureConnectionStart":364.19999980926514},{"duration":401.69999980926514,"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":364.3999996185303,"connectEnd":364.3999996185303,"connectStart":364.3999996185303,"domainLookupEnd":364.3999996185303,"domainLookupStart":364.3999996185303,"fetchStart":364.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":364.3999996185303,"responseEnd":766.0999994277954,"responseStart":766.0999994277954,"secureConnectionStart":364.3999996185303},{"duration":485.69999980926514,"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":364.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":850.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":402,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":364.69999980926514,"connectEnd":364.69999980926514,"connectStart":364.69999980926514,"domainLookupEnd":364.69999980926514,"domainLookupStart":364.69999980926514,"fetchStart":364.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":364.69999980926514,"responseEnd":766.6999998092651,"responseStart":766.6999998092651,"secureConnectionStart":364.69999980926514},{"duration":485.5,"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":364.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":850.2999992370605,"responseStart":0,"secureConnectionStart":0},{"duration":402.3999996185303,"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":365,"connectEnd":365,"connectStart":365,"domainLookupEnd":365,"domainLookupStart":365,"fetchStart":365,"redirectEnd":0,"redirectStart":0,"requestStart":365,"responseEnd":767.3999996185303,"responseStart":767.3999996185303,"secureConnectionStart":365},{"duration":1152.3000001907349,"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":368.19999980926514,"connectEnd":368.19999980926514,"connectStart":368.19999980926514,"domainLookupEnd":368.19999980926514,"domainLookupStart":368.19999980926514,"fetchStart":368.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":368.19999980926514,"responseEnd":1520.5,"responseStart":1520.5,"secureConnectionStart":368.19999980926514},{"duration":1153.2000007629395,"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":368.29999923706055,"connectEnd":368.29999923706055,"connectStart":368.29999923706055,"domainLookupEnd":368.29999923706055,"domainLookupStart":368.29999923706055,"fetchStart":368.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":368.29999923706055,"responseEnd":1521.5,"responseStart":1521.5,"secureConnectionStart":368.29999923706055},{"duration":515,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":863.6999998092651,"connectEnd":863.6999998092651,"connectStart":863.6999998092651,"domainLookupEnd":863.6999998092651,"domainLookupStart":863.6999998092651,"fetchStart":863.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":863.6999998092651,"responseEnd":1378.6999998092651,"responseStart":1378.6999998092651,"secureConnectionStart":863.6999998092651},{"duration":383.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1202.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1202.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1585.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":197,"responseStart":348,"responseEnd":360,"domLoading":356,"domInteractive":1649,"domContentLoadedEventStart":1649,"domContentLoadedEventEnd":1732,"domComplete":2756,"loadEventStart":2756,"loadEventEnd":2758,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1593.5999994277954},{"name":"bigPipe.sidebar-id.end","time":1596.5999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1596.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1602.6999998092651},{"name":"activityTabFullyLoaded","time":1797.5}],"measures":[],"correlationId":"276d6cc43b0a21","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}