Oracle supports prefixing the index name in CREATE INDEX with the database name, MariaDB does not. For compatibility it would be reasonable to support this syntax, even if it is ignored, in SQL_MODE=Oracle. Two different SQL_MODE options would be reasonable
IGNORE_INDEX_DBNAME - Always ignore the database name.
IGNORE_INDEX_SAMEDBNAME - Ignore database name if it matches the table name, else raise an error.
Oracle supports the syntax schema_name.index_name because indexes are schema objects. You can also do
DROPINDEX schema_name.index_name;
And, naturally, index names are unique within a schema.
In MariaDB model an index is an object within a table. You cannot drop an index if you don't know the table name, and a schema can have many indexes with exactly the same name.
We definitely cannot do Oracle-style DROP INDEX and while we can do CREATE INDEX as a syntax sugar, I expect it'd very confusing, because it implies something that MariaDB doesn't do.
Sergei Golubchik
added a comment - Oracle supports the syntax schema_name.index_name because indexes are schema objects . You can also do
DROP INDEX schema_name.index_name;
And, naturally, index names are unique within a schema.
In MariaDB model an index is an object within a table . You cannot drop an index if you don't know the table name, and a schema can have many indexes with exactly the same name.
We definitely cannot do Oracle-style DROP INDEX and while we can do CREATE INDEX as a syntax sugar, I expect it'd very confusing, because it implies something that MariaDB doesn't do.
I agree with what you say, largely, but in the name of compatibility I still think it is reasonable, assuming the sql_mode is set to allow it. It wouldn't be the first piece of, sometimes confusing, syntactic sugar we support. When you export a schema from Oracle using Oracle datapump, which is pretty much standard, then you always get index names prefixed with database names, even if the indexes are in the same database as the table. So this syntax is actually rather common.
Anders Karlsson
added a comment - I agree with what you say, largely, but in the name of compatibility I still think it is reasonable, assuming the sql_mode is set to allow it. It wouldn't be the first piece of, sometimes confusing, syntactic sugar we support. When you export a schema from Oracle using Oracle datapump, which is pretty much standard, then you always get index names prefixed with database names, even if the indexes are in the same database as the table. So this syntax is actually rather common.
People
Unassigned
Anders Karlsson
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":903.8000001907349,"ttfb":346.5,"pageVisibility":"visible","entityId":133350,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5a1aa4e0-4269-44e1-9508-fe3b776f1e2c","navigationType":0,"readyForUser":973.2000002861023,"redirectCount":0,"resourceLoadedEnd":920.3000001907349,"resourceLoadedStart":354.1000003814697,"resourceTiming":[{"duration":48.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":354.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.5,"responseStart":0,"secureConnectionStart":0},{"duration":48.30000019073486,"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":354.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":113.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":354.6000003814697,"connectEnd":354.6000003814697,"connectStart":354.6000003814697,"domainLookupEnd":354.6000003814697,"domainLookupStart":354.6000003814697,"fetchStart":354.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":407.30000019073486,"responseEnd":467.80000019073486,"responseStart":426.1000003814697,"secureConnectionStart":354.6000003814697},{"duration":137.5,"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":354.80000019073486,"connectEnd":354.80000019073486,"connectStart":354.80000019073486,"domainLookupEnd":354.80000019073486,"domainLookupStart":354.80000019073486,"fetchStart":354.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":406.90000009536743,"responseEnd":492.30000019073486,"responseStart":423,"secureConnectionStart":354.80000019073486},{"duration":73.60000038146973,"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":355,"connectEnd":355,"connectStart":355,"domainLookupEnd":355,"domainLookupStart":355,"fetchStart":355,"redirectEnd":0,"redirectStart":0,"requestStart":407.40000009536743,"responseEnd":428.6000003814697,"responseStart":427.80000019073486,"secureConnectionStart":355},{"duration":80.89999961853027,"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":355.1000003814697,"connectEnd":355.1000003814697,"connectStart":355.1000003814697,"domainLookupEnd":355.1000003814697,"domainLookupStart":355.1000003814697,"fetchStart":355.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":409.1000003814697,"responseEnd":436,"responseStart":435.1000003814697,"secureConnectionStart":355.1000003814697},{"duration":81.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":355.40000009536743,"connectEnd":355.40000009536743,"connectStart":355.40000009536743,"domainLookupEnd":355.40000009536743,"domainLookupStart":355.40000009536743,"fetchStart":355.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":409.90000009536743,"responseEnd":436.90000009536743,"responseStart":436.1000003814697,"secureConnectionStart":355.40000009536743},{"duration":52.80000019073486,"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":355.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":408.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":117,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":355.7000002861023,"connectEnd":355.7000002861023,"connectStart":355.7000002861023,"domainLookupEnd":355.7000002861023,"domainLookupStart":355.7000002861023,"fetchStart":355.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":411,"responseEnd":472.7000002861023,"responseStart":471.80000019073486,"secureConnectionStart":355.7000002861023},{"duration":54.59999990463257,"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":355.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":355.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":410.5,"responseStart":0,"secureConnectionStart":0},{"duration":86.90000009536743,"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":356,"connectEnd":424.30000019073486,"connectStart":424.30000019073486,"domainLookupEnd":424.30000019073486,"domainLookupStart":424.30000019073486,"fetchStart":356,"redirectEnd":0,"redirectStart":0,"requestStart":425.2000002861023,"responseEnd":442.90000009536743,"responseStart":438.80000019073486,"secureConnectionStart":424.30000019073486},{"duration":315.3999996185303,"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":366.6000003814697,"connectEnd":366.6000003814697,"connectStart":366.6000003814697,"domainLookupEnd":366.6000003814697,"domainLookupStart":366.6000003814697,"fetchStart":366.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":669.3000001907349,"responseEnd":682,"responseStart":681.2000002861023,"secureConnectionStart":366.6000003814697},{"duration":553.5999999046326,"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":366.7000002861023,"connectEnd":366.7000002861023,"connectStart":366.7000002861023,"domainLookupEnd":366.7000002861023,"domainLookupStart":366.7000002861023,"fetchStart":366.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":904.4000000953674,"responseEnd":920.3000001907349,"responseStart":919.5,"secureConnectionStart":366.7000002861023},{"duration":233,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":662.5,"connectEnd":662.5,"connectStart":662.5,"domainLookupEnd":662.5,"domainLookupStart":662.5,"fetchStart":662.5,"redirectEnd":0,"redirectStart":0,"requestStart":857.4000000953674,"responseEnd":895.5,"responseStart":894.8000001907349,"secureConnectionStart":662.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":183,"responseStart":346,"responseEnd":366,"domLoading":350,"domInteractive":1021,"domContentLoadedEventStart":1021,"domContentLoadedEventEnd":1061,"domComplete":1420,"loadEventStart":1420,"loadEventEnd":1420,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1005.7000002861023},{"name":"bigPipe.sidebar-id.end","time":1006.6000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":1006.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1008},{"name":"activityTabFullyLoaded","time":1090}],"measures":[],"correlationId":"cd9a3961c5c304","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":14,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Oracle supports the syntax schema_name.index_name because indexes are schema objects. You can also do
And, naturally, index names are unique within a schema.
In MariaDB model an index is an object within a table. You cannot drop an index if you don't know the table name, and a schema can have many indexes with exactly the same name.
We definitely cannot do Oracle-style DROP INDEX and while we can do CREATE INDEX as a syntax sugar, I expect it'd very confusing, because it implies something that MariaDB doesn't do.