Type:
Task
Priority:
Major
Resolution:
Fixed
DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:
if (m_thd->variables.sql_mode & MODE_ORACLE)
{
switch (symbol->tok) {
...
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
...
}
}
blocks
MDEV-12518
Unify sql_yacc.yy and sql_yacc_ora.yy
Closed
Alexander Barkov
made changes -
2018-11-12 05:24
Summary
Add sql_mode specific tokens for the keyword DECODE
Add sql_mode specific tokens for the keyword DECLARE
Alexander Barkov
made changes -
2018-11-12 05:24
Description
Add sql_mode specific tokens for the keyword DECODE
DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:
{code:cpp}
if (m_thd->variables.sql_mode & MODE_ORACLE)
{
switch (symbol->tok) {
...
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
...
}
}
{code}
Add sql_mode specific tokens for the keyword DECLARE
DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:
{code:cpp}
if (m_thd->variables.sql_mode & MODE_ORACLE)
{
switch (symbol->tok) {
...
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
...
}
}
{code}
Alexander Barkov
made changes -
2018-11-12 05:24
Description
Add sql_mode specific tokens for the keyword DECLARE
DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:
{code:cpp}
if (m_thd->variables.sql_mode & MODE_ORACLE)
{
switch (symbol->tok) {
...
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
...
}
}
{code}
DECLARE has different meanings in the default sql_mode and in sql_mode=ORACLE.
To unify sql_yacc.yy and sql_yacc_ora.yy easier, we'll add sql_mode specific tokens for this keyword and modify the grammar in sql_yacc.yy and sql_yacc_ora.yy accordingly.
Instead of DECLARE_SYM, we'll have separate DECLARE_MARIADB_SYM and DECLARE_ORACLE_SYM.
This will make possible for native and Oracle grammar rules to co-exists in the same *.yy files.
By default, Lex_input_stream::find_keyword() will return DECLARE_MARIADB_SYM, and translate it to DECLARE_ORACLE_SYM in Oracle compatibility mode:
{code:cpp}
if (m_thd->variables.sql_mode & MODE_ORACLE)
{
switch (symbol->tok) {
...
case DECLARE_MARIADB_SYM: return DECLARE_ORACLE_SYM;
...
}
}
{code}
Alexander Barkov
made changes -
2018-11-12 05:25
issue.field.resolutiondate
2018-11-12 05:25:31.0
2018-11-12 05:25:31.124
Alexander Barkov
made changes -
2018-11-12 05:25
Component/s
Parser
[ 10201
]
Fix Version/s
10.3.11
[ 23141
]
Fix Version/s
10.3
[ 22126
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:24
Workflow
MariaDB v3
[ 90539
]
MariaDB v4
[ 133747
]
{"report":{"fcp":1102,"ttfb":338,"pageVisibility":"visible","entityId":70721,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"400db1bf-c933-4360-b60a-64cda7daf5b0","navigationType":0,"readyForUser":1187.5,"redirectCount":0,"resourceLoadedEnd":1240.9000005722046,"resourceLoadedStart":343.5,"resourceTiming":[{"duration":261.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":343.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":343.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":604.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":261.4000005722046,"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":343.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":343.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":605.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":297.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":343.9000005722046,"connectEnd":343.9000005722046,"connectStart":343.9000005722046,"domainLookupEnd":343.9000005722046,"domainLookupStart":343.9000005722046,"fetchStart":343.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":343.9000005722046,"responseEnd":641.8000001907349,"responseStart":641.8000001907349,"secureConnectionStart":343.9000005722046},{"duration":355,"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":344.1000003814697,"connectEnd":344.1000003814697,"connectStart":344.1000003814697,"domainLookupEnd":344.1000003814697,"domainLookupStart":344.1000003814697,"fetchStart":344.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":344.1000003814697,"responseEnd":699.1000003814697,"responseStart":699.1000003814697,"secureConnectionStart":344.1000003814697},{"duration":358.80000019073486,"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":344.30000019073486,"connectEnd":344.30000019073486,"connectStart":344.30000019073486,"domainLookupEnd":344.30000019073486,"domainLookupStart":344.30000019073486,"fetchStart":344.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":344.30000019073486,"responseEnd":703.1000003814697,"responseStart":703.1000003814697,"secureConnectionStart":344.30000019073486},{"duration":359.1000003814697,"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":344.5,"connectEnd":344.5,"connectStart":344.5,"domainLookupEnd":344.5,"domainLookupStart":344.5,"fetchStart":344.5,"redirectEnd":0,"redirectStart":0,"requestStart":344.5,"responseEnd":703.6000003814697,"responseStart":703.5,"secureConnectionStart":344.5},{"duration":359.20000076293945,"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":344.69999980926514,"connectEnd":344.69999980926514,"connectStart":344.69999980926514,"domainLookupEnd":344.69999980926514,"domainLookupStart":344.69999980926514,"fetchStart":344.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":344.69999980926514,"responseEnd":703.9000005722046,"responseStart":703.9000005722046,"secureConnectionStart":344.69999980926514},{"duration":440.79999923706055,"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":344.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":344.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":785.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":359.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":345.1000003814697,"connectEnd":345.1000003814697,"connectStart":345.1000003814697,"domainLookupEnd":345.1000003814697,"domainLookupStart":345.1000003814697,"fetchStart":345.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":345.1000003814697,"responseEnd":704.4000005722046,"responseStart":704.4000005722046,"secureConnectionStart":345.1000003814697},{"duration":440.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":345.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":345.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":786,"responseStart":0,"secureConnectionStart":0},{"duration":359.69999980926514,"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":345.30000019073486,"connectEnd":345.30000019073486,"connectStart":345.30000019073486,"domainLookupEnd":345.30000019073486,"domainLookupStart":345.30000019073486,"fetchStart":345.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":345.30000019073486,"responseEnd":705,"responseStart":705,"secureConnectionStart":345.30000019073486},{"duration":692.4000005722046,"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":346.19999980926514,"connectEnd":346.19999980926514,"connectStart":346.19999980926514,"domainLookupEnd":346.19999980926514,"domainLookupStart":346.19999980926514,"fetchStart":346.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":346.19999980926514,"responseEnd":1038.6000003814697,"responseStart":1038.6000003814697,"secureConnectionStart":346.19999980926514},{"duration":872.5999994277954,"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":350.6000003814697,"connectEnd":350.6000003814697,"connectStart":350.6000003814697,"domainLookupEnd":350.6000003814697,"domainLookupStart":350.6000003814697,"fetchStart":350.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":350.6000003814697,"responseEnd":1223.1999998092651,"responseStart":1223.1999998092651,"secureConnectionStart":350.6000003814697},{"duration":248.9000005722046,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":798,"connectEnd":798,"connectStart":798,"domainLookupEnd":798,"domainLookupStart":798,"fetchStart":798,"redirectEnd":0,"redirectStart":0,"requestStart":798,"responseEnd":1046.9000005722046,"responseStart":1046.9000005722046,"secureConnectionStart":798},{"duration":185.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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":1055.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1055.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1240.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":205.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1056.8000001907349,"connectEnd":1056.8000001907349,"connectStart":1056.8000001907349,"domainLookupEnd":1056.8000001907349,"domainLookupStart":1056.8000001907349,"fetchStart":1056.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1056.8000001907349,"responseEnd":1262.6999998092651,"responseStart":1262.6999998092651,"secureConnectionStart":1056.8000001907349},{"duration":209.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1057.1999998092651,"connectEnd":1057.1999998092651,"connectStart":1057.1999998092651,"domainLookupEnd":1057.1999998092651,"domainLookupStart":1057.1999998092651,"fetchStart":1057.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1057.1999998092651,"responseEnd":1267,"responseStart":1267,"secureConnectionStart":1057.1999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":156,"responseStart":338,"responseEnd":342,"domLoading":341,"domInteractive":1251,"domContentLoadedEventStart":1251,"domContentLoadedEventEnd":1299,"domComplete":1547,"loadEventStart":1547,"loadEventEnd":1548,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1224.8000001907349},{"name":"bigPipe.sidebar-id.end","time":1225.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1225.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1228.1999998092651},{"name":"activityTabFullyLoaded","time":1319.8000001907349}],"measures":[],"correlationId":"807c8eb5aec83b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":121,"dbReadsTimeInMs":18,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}