Type:
New Feature
Priority:
Major
Resolution:
Unresolved
Fix Version/s:
None
Let's add support for the RESTRICT_REFERENCES pragma inside the CREATE PACKAGE statement
for sql_mode=ORACLE.
The RESTRICT_REFERENCES pragma asserts that a stored routine does not read or write database tables or package variables.
Example:
CREATE OR REPLACE PACKAGE pkg1 IS
FUNCTION add_numbers(A IN NUMBER, B IN NUMBER) RETURN NUMBER;
PRAGMA RESTRICT_REFERENCES (add_numbers, WNDS, WNPS, RNPS);
FUNCTION factorial(NUM IN NUMBER) RETURN NUMBER;
PRAGMA RESTRICT_REFERENCES (factorial, WNDS, WNPS, RNPS);
END pkg1;
/
The grammar of the PRAGMA RESTRICT_REFERENCES statement:
PRAGMA RESTRICT_REFERENCES
( { routine_name | DEFAULT } ,
{ RNDS | WNDS | RNPS | WNPS | TRUST }
[, { RNDS | WNDS | RNPS | WNPS | TRUST } ]... ) ;
Specifying routines the pragma is applicable to:
routine - The name of a stored routine, typically a function.
If a function invoke a procedure, then this pragma should also be specified
for the procedure.
DEFAULT - Applies the pragma to all routine in the package specification.
Pragmas in individual routines override the DEFAULT pragma.
Specifying the asserts:
RNDS - The routine reads no database state (does not query database tables).
WNDS - The routine writes no database state (does not modify tables).
RNPS - The routine reads no package state (does not reference the values of package variables).
One cannot specify RNPS if the routine invokes the SQLCODE or SQLERRM function.
WNPS - The routine writes no package state (does not change the values of package variables).
One cannot specify WNPS if the subprogram invokes the SQLCODE or SQLERRM function.
TRUST - Asserts that the routine can be trusted not to violate the other specified assertions.
The pragma asserts we'll be mapped to SQL/PSM flags:
{ CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
The exact mapping we'll be decided later.
blocks
MDEV-34323
Oracle compatibility project 3
Open
{"report":{"fcp":850.4000000953674,"ttfb":164.80000019073486,"pageVisibility":"visible","entityId":129462,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"f56395e2-1931-477a-a778-e8bbc09f95cb","navigationType":0,"readyForUser":926.1000001430511,"redirectCount":0,"resourceLoadedEnd":1039.3000001907349,"resourceLoadedStart":170.40000009536743,"resourceTiming":[{"duration":179.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":170.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":179,"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.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":349.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":188.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":170.80000019073486,"connectEnd":170.80000019073486,"connectStart":170.80000019073486,"domainLookupEnd":170.80000019073486,"domainLookupStart":170.80000019073486,"fetchStart":170.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":170.80000019073486,"responseEnd":358.90000009536743,"responseStart":358.90000009536743,"secureConnectionStart":170.80000019073486},{"duration":291.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":170.90000009536743,"connectEnd":170.90000009536743,"connectStart":170.90000009536743,"domainLookupEnd":170.90000009536743,"domainLookupStart":170.90000009536743,"fetchStart":170.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":170.90000009536743,"responseEnd":462.5,"responseStart":462.5,"secureConnectionStart":170.90000009536743},{"duration":295.40000009536743,"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,"connectEnd":171,"connectStart":171,"domainLookupEnd":171,"domainLookupStart":171,"fetchStart":171,"redirectEnd":0,"redirectStart":0,"requestStart":171,"responseEnd":466.40000009536743,"responseStart":466.40000009536743,"secureConnectionStart":171},{"duration":295.89999985694885,"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.10000014305115,"connectEnd":171.10000014305115,"connectStart":171.10000014305115,"domainLookupEnd":171.10000014305115,"domainLookupStart":171.10000014305115,"fetchStart":171.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":171.10000014305115,"responseEnd":467,"responseStart":467,"secureConnectionStart":171.10000014305115},{"duration":296.2999999523163,"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.20000004768372,"connectEnd":171.20000004768372,"connectStart":171.20000004768372,"domainLookupEnd":171.20000004768372,"domainLookupStart":171.20000004768372,"fetchStart":171.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":171.20000004768372,"responseEnd":467.5,"responseStart":467.5,"secureConnectionStart":171.20000004768372},{"duration":296.69999980926514,"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.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":468,"responseStart":0,"secureConnectionStart":0},{"duration":296.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","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":468,"responseStart":468,"secureConnectionStart":171.40000009536743},{"duration":297.10000014305115,"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.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":468.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":297,"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.70000004768372,"connectEnd":171.70000004768372,"connectStart":171.70000004768372,"domainLookupEnd":171.70000004768372,"domainLookupStart":171.70000004768372,"fetchStart":171.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":171.70000004768372,"responseEnd":468.7000000476837,"responseStart":468.7000000476837,"secureConnectionStart":171.70000004768372},{"duration":866,"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.30000019073486,"connectEnd":172.30000019073486,"connectStart":172.30000019073486,"domainLookupEnd":172.30000019073486,"domainLookupStart":172.30000019073486,"fetchStart":172.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":172.30000019073486,"responseEnd":1038.3000001907349,"responseStart":1038.3000001907349,"secureConnectionStart":172.30000019073486},{"duration":866.2000000476837,"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":172.5,"connectEnd":172.5,"connectStart":172.5,"domainLookupEnd":172.5,"domainLookupStart":172.5,"fetchStart":172.5,"redirectEnd":0,"redirectStart":0,"requestStart":172.5,"responseEnd":1038.7000000476837,"responseStart":1038.7000000476837,"secureConnectionStart":172.5},{"duration":66.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":508.60000014305115,"connectEnd":508.60000014305115,"connectStart":508.60000014305115,"domainLookupEnd":508.60000014305115,"domainLookupStart":508.60000014305115,"fetchStart":508.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":508.60000014305115,"responseEnd":575.2000000476837,"responseStart":575.2000000476837,"secureConnectionStart":508.60000014305115},{"duration":275.2000000476837,"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":764.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":764.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1039.3000001907349,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":13,"responseStart":165,"responseEnd":168,"domLoading":168,"domInteractive":1056,"domContentLoadedEventStart":1056,"domContentLoadedEventEnd":1094,"domComplete":1950,"loadEventStart":1950,"loadEventEnd":1952,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1043.9000000953674},{"name":"bigPipe.sidebar-id.end","time":1044.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1044.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1047.2000000476837},{"name":"activityTabFullyLoaded","time":1103.3000001907349}],"measures":[],"correlationId":"dce1ee9216fe0b","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}