Type:
Technical task
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Sprint:
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Implement the RAISE statement:
where exceptions_name is one of those implemented in MDEV-10839 and MDEV-10582 :
NO_DATA_FOUND
TOO_MANY_ROWS
DUP_VAL_ON_INDEX
INVALID_CURSOR
NO_DATA_FOUND
Oracle's NO_DATA_FOUND will be translated to MariaDB warning ER_SP_FETCH_NO_DATA .
The following three scripts do not return any errors, which proves that NO_DATA_FOUND is cought and raised silently and therefore is more like a warning than an error:
DROP PROCEDURE p1;
CREATE PROCEDURE p1
AS
BEGIN
RAISE NO_DATA_FOUND;
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT );
CREATE PROCEDURE p1
AS
a INT ;
BEGIN
SELECT a INTO a FROM t1;
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT );
CREATE PROCEDURE p1
AS
a INT ;
BEGIN
SELECT a INTO a FROM t1;
EXCEPTION
WHEN NO_DATA_FOUND THEN RAISE;
END ;
/
CALL p1();
This script demonstrates that NO_DATA_FOUND is actually cought and can be translated to a fatal error using an EXCEPTION..RAISE statement.
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT );
CREATE PROCEDURE p1
AS
a INT ;
e EXCEPTION;
BEGIN
SELECT a INTO a FROM t1;
EXCEPTION
WHEN NO_DATA_FOUND THEN RAISE e;
END ;
/
CALL p1();
TOO_MANY_ROWS
Oracle's TOO_MANY_ROWS will be translated to MariaDB error TOO_MANY_ROWS .
The following three scripts return an error:
ORA-01422: exact fetch returns more than requested number of rows
DROP PROCEDURE p1;
CREATE PROCEDURE p1
AS
BEGIN
RAISE TOO_MANY_ROWS;
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT );
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (20);
CREATE PROCEDURE p1
AS
a INT ;
BEGIN
SELECT a INTO a FROM t1;
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT );
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (20);
CREATE PROCEDURE p1
AS
a INT ;
BEGIN
SELECT a INTO a FROM t1;
EXCEPTION
WHEN TOO_MANY_ROWS THEN RAISE;
END ;
/
CALL p1();
DUP_VAL_ON_INDEX
Oracle's DUP_VAL_ON_INDEX will be translated to MariaDB error ER_DUP_ENTRY .
The following three scripts return an error:
ORA-00001: unique constraint ... violated
DROP PROCEDURE p1;
CREATE PROCEDURE p1
AS
BEGIN
RAISE DUP_VAL_ON_INDEX;
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT PRIMARY KEY );
CREATE PROCEDURE p1
AS
BEGIN
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (10);
END ;
/
CALL p1();
DROP TABLE t1;
DROP PROCEDURE p1;
CREATE TABLE t1 (a INT PRIMARY KEY );
CREATE PROCEDURE p1
AS
BEGIN
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (10);
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN RAISE;
END ;
/
CALL p1();
INVALID_CURSOR
Oracle's INVALID_CURSOR will be translated to MariaDB error ER_SP_CURSOR_NOT_OPEN .
There are no comments yet on this issue.
{"report":{"fcp":990.5999999046326,"ttfb":303.2999997138977,"pageVisibility":"visible","entityId":58141,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9619a22c-a234-42a4-b32f-8f85398fdb34","navigationType":0,"readyForUser":1105.3999996185303,"redirectCount":0,"resourceLoadedEnd":1759.5,"resourceLoadedStart":308.8999996185303,"resourceTiming":[{"duration":262.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":308.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":262.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":309.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":271.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":309.5,"connectEnd":309.5,"connectStart":309.5,"domainLookupEnd":309.5,"domainLookupStart":309.5,"fetchStart":309.5,"redirectEnd":0,"redirectStart":0,"requestStart":309.5,"responseEnd":580.6999998092651,"responseStart":580.6999998092651,"secureConnectionStart":309.5},{"duration":296.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":309.59999990463257,"connectEnd":309.59999990463257,"connectStart":309.59999990463257,"domainLookupEnd":309.59999990463257,"domainLookupStart":309.59999990463257,"fetchStart":309.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":309.59999990463257,"responseEnd":606,"responseStart":606,"secureConnectionStart":309.59999990463257},{"duration":300.30000019073486,"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":309.7999997138977,"connectEnd":309.7999997138977,"connectStart":309.7999997138977,"domainLookupEnd":309.7999997138977,"domainLookupStart":309.7999997138977,"fetchStart":309.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":309.7999997138977,"responseEnd":610.0999999046326,"responseStart":610.0999999046326,"secureConnectionStart":309.7999997138977},{"duration":300.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":310.09999990463257,"connectEnd":310.09999990463257,"connectStart":310.09999990463257,"domainLookupEnd":310.09999990463257,"domainLookupStart":310.09999990463257,"fetchStart":310.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":310.09999990463257,"responseEnd":610.5999999046326,"responseStart":610.5999999046326,"secureConnectionStart":310.09999990463257},{"duration":300.80000019073486,"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":310.19999980926514,"connectEnd":310.19999980926514,"connectStart":310.19999980926514,"domainLookupEnd":310.19999980926514,"domainLookupStart":310.19999980926514,"fetchStart":310.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":310.19999980926514,"responseEnd":611,"responseStart":611,"secureConnectionStart":310.19999980926514},{"duration":302,"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":310.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":612.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":300.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":310.59999990463257,"connectEnd":310.59999990463257,"connectStart":310.59999990463257,"domainLookupEnd":310.59999990463257,"domainLookupStart":310.59999990463257,"fetchStart":310.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":310.59999990463257,"responseEnd":611.5,"responseStart":611.5,"secureConnectionStart":310.59999990463257},{"duration":301.80000019073486,"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":310.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":310.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":612.5,"responseStart":0,"secureConnectionStart":0},{"duration":301.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":311,"connectEnd":311,"connectStart":311,"domainLookupEnd":311,"domainLookupStart":311,"fetchStart":311,"redirectEnd":0,"redirectStart":0,"requestStart":311,"responseEnd":612.0999999046326,"responseStart":612,"secureConnectionStart":311},{"duration":1076.9000000953674,"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":316.3999996185303,"connectEnd":316.3999996185303,"connectStart":316.3999996185303,"domainLookupEnd":316.3999996185303,"domainLookupStart":316.3999996185303,"fetchStart":316.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":316.3999996185303,"responseEnd":1393.2999997138977,"responseStart":1393.1999998092651,"secureConnectionStart":316.3999996185303},{"duration":1443.1000003814697,"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":316.3999996185303,"connectEnd":316.3999996185303,"connectStart":316.3999996185303,"domainLookupEnd":316.3999996185303,"domainLookupStart":316.3999996185303,"fetchStart":316.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":316.3999996185303,"responseEnd":1759.5,"responseStart":1759.5,"secureConnectionStart":316.3999996185303},{"duration":951.0999999046326,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":802.5,"connectEnd":802.5,"connectStart":802.5,"domainLookupEnd":802.5,"domainLookupStart":802.5,"fetchStart":802.5,"redirectEnd":0,"redirectStart":0,"requestStart":802.5,"responseEnd":1753.5999999046326,"responseStart":1753.5,"secureConnectionStart":802.5},{"duration":789.3000001907349,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":984.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":984.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1773.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":98,"responseStart":303,"responseEnd":311,"domLoading":307,"domInteractive":1777,"domContentLoadedEventStart":1777,"domContentLoadedEventEnd":1820,"domComplete":2400,"loadEventStart":2400,"loadEventEnd":2400,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1761.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1762},{"name":"bigPipe.activity-panel-pipe-id.start","time":1762.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1762.7999997138977},{"name":"activityTabFullyLoaded","time":1828.3999996185303}],"measures":[],"correlationId":"5b6d867a2d487c","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":117,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}