Type:
Bug
Priority:
Minor
Resolution:
Won't Fix
Affects Version/s:
N/A
Note: there are quite a few tests for ANSI mode in the patch, but they seem to work the other way round – checking that SQL_MODEs which are set under 'SET STATEMENT sql_mode=<mode>}} are not applied when the whole initial SET STATEMENT sql_mode=... FOR ... is being parsed; so I'm not sure if the behavior described below is intentional, which is why I set it to 'Minor' for now. It does not look logical, though.
Example 1 - ANSI_QUOTES
DROP TABLE IF EXISTS t1;
# Query OK, 0 rows affected (0.18 sec)
# Set sql_mode = 'ANSI_QUOTES' to allow the initial parsing of the whole SET STATEMENT .. FOR
SET sql_mode= 'ANSI_QUOTES' ;
# Query OK, 0 rows affected (0.00 sec)
# But for the *actual* CREATE statement we unset the sql_mode, so
# the execution should fail with the syntax error
SET STATEMENT sql_mode= '' FOR CREATE TABLE "t1" (i INT );
# Query OK, 0 rows affected (0.50 sec)
# ... but it doesn 't.
# Compare with the usual behavior:
SET sql_mode = ' ';
# Query OK, 0 rows affected (0.00 sec)
CREATE TABLE "t1" (i INT);
# ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' "t1" (i INT )' at line 1
Example 2 - IGNORE_SPACE
DROP TABLE IF EXISTS count ;
# Query OK, 0 rows affected (0.21 sec)
# IGNORE_SPACE mode should prevent creation of the ` count ` table :
SET STATEMENT sql_mode= 'IGNORE_SPACE' FOR CREATE TABLE count (i INT );
# Query OK, 0 rows affected (0.81 sec)
# ... but it doesn 't.
# Compare with the usual behavior:
SET sql_mode=' IGNORE_SPACE ';
# Query OK, 0 rows affected (0.00 sec)
CREATE TABLE count (i INT);
# ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' count (i INT )' at line 1
It's all the same in Percona server.
{"report":{"fcp":1021.2000000476837,"ttfb":393.2999999523163,"pageVisibility":"visible","entityId":46801,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b8b30dbf-47d1-4db2-adb8-399270267714","navigationType":0,"readyForUser":1136.7000000476837,"redirectCount":0,"resourceLoadedEnd":1220,"resourceLoadedStart":424,"resourceTiming":[{"duration":168.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":424,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":424,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":592.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":167.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":424.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":424.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":592.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":184.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/c54b129276d75dc2a3460e1d78f37913-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":424.39999985694885,"connectEnd":424.39999985694885,"connectStart":424.39999985694885,"domainLookupEnd":424.39999985694885,"domainLookupStart":424.39999985694885,"fetchStart":424.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":424.39999985694885,"responseEnd":609.2999999523163,"responseStart":609.2999999523163,"secureConnectionStart":424.39999985694885},{"duration":285.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/f867843cd2fdb209d4d1d4f760f86346-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":424.5,"connectEnd":424.5,"connectStart":424.5,"domainLookupEnd":424.5,"domainLookupStart":424.5,"fetchStart":424.5,"redirectEnd":0,"redirectStart":0,"requestStart":424.5,"responseEnd":709.5999999046326,"responseStart":709.5999999046326,"secureConnectionStart":424.5},{"duration":288.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/ffdb17665775c5b4d6f097f3974ee359-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":424.59999990463257,"connectEnd":424.59999990463257,"connectStart":424.59999990463257,"domainLookupEnd":424.59999990463257,"domainLookupStart":424.59999990463257,"fetchStart":424.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":424.59999990463257,"responseEnd":713.2000000476837,"responseStart":713.2000000476837,"secureConnectionStart":424.59999990463257},{"duration":289.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":424.59999990463257,"connectEnd":424.59999990463257,"connectStart":424.59999990463257,"domainLookupEnd":424.59999990463257,"domainLookupStart":424.59999990463257,"fetchStart":424.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":424.59999990463257,"responseEnd":713.7000000476837,"responseStart":713.7000000476837,"secureConnectionStart":424.59999990463257},{"duration":289.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":424.7999999523163,"connectEnd":424.7999999523163,"connectStart":424.7999999523163,"domainLookupEnd":424.7999999523163,"domainLookupStart":424.7999999523163,"fetchStart":424.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":424.7999999523163,"responseEnd":714.2000000476837,"responseStart":714.2000000476837,"secureConnectionStart":424.7999999523163},{"duration":289.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":424.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":424.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":714.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":289.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":425,"connectEnd":425,"connectStart":425,"domainLookupEnd":425,"domainLookupStart":425,"fetchStart":425,"redirectEnd":0,"redirectStart":0,"requestStart":425,"responseEnd":714.7000000476837,"responseStart":714.7000000476837,"secureConnectionStart":425},{"duration":290,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":425.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":425.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":715.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":290,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":425.2999999523163,"connectEnd":425.2999999523163,"connectStart":425.2999999523163,"domainLookupEnd":425.2999999523163,"domainLookupStart":425.2999999523163,"fetchStart":425.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":425.2999999523163,"responseEnd":715.2999999523163,"responseStart":715.2999999523163,"secureConnectionStart":425.2999999523163},{"duration":375.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":426.2999999523163,"connectEnd":426.2999999523163,"connectStart":426.2999999523163,"domainLookupEnd":426.2999999523163,"domainLookupStart":426.2999999523163,"fetchStart":426.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":426.2999999523163,"responseEnd":801.3999998569489,"responseStart":801.2999999523163,"secureConnectionStart":426.2999999523163},{"duration":792.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":426.2999999523163,"connectEnd":426.2999999523163,"connectStart":426.2999999523163,"domainLookupEnd":426.2999999523163,"domainLookupStart":426.2999999523163,"fetchStart":426.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":426.2999999523163,"responseEnd":1218.5,"responseStart":1218.5,"secureConnectionStart":426.2999999523163},{"duration":42.39999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":760.2000000476837,"connectEnd":760.2000000476837,"connectStart":760.2000000476837,"domainLookupEnd":760.2000000476837,"domainLookupStart":760.2000000476837,"fetchStart":760.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":760.2000000476837,"responseEnd":802.5999999046326,"responseStart":802.5999999046326,"secureConnectionStart":760.2000000476837},{"duration":241.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/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":978.2000000476837,"connectEnd":978.2000000476837,"connectStart":978.2000000476837,"domainLookupEnd":978.2000000476837,"domainLookupStart":978.2000000476837,"fetchStart":978.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":978.2000000476837,"responseEnd":1220,"responseStart":1219.8999998569489,"secureConnectionStart":978.2000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":259,"responseStart":393,"responseEnd":398,"domLoading":421,"domInteractive":1244,"domContentLoadedEventStart":1244,"domContentLoadedEventEnd":1285,"domComplete":1822,"loadEventStart":1822,"loadEventEnd":1822,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1220.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1221.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1221.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1223.2000000476837},{"name":"activityTabFullyLoaded","time":1301.3999998569489}],"measures":[],"correlationId":"e22f9f4cef666d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":78,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
It can't work because all statement parsed as one. (doc should be updated)