Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL)
If you try to execute FLUSH TABLES on a view after read-locking that view with LOCK TABLES ... READ|WRITE, then you get an error message that doesn't seem to make a lot of sense.
For example, if we have this view:
CREATE TABLE t (qty INT, price INT);
CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
Then let's see what happens:
MariaDB [db1]> LOCK TABLES v READ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db1]> FLUSH TABLES v;
ERROR 1100 (HY000): Table 'v' was not locked with LOCK TABLES
If we execute the same statement on the base table, then we get a different error message:
MariaDB [db1]> LOCK TABLES t READ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db1]> FLUSH TABLES t;
ERROR 1099 (HY000): Table 't' was locked with a READ lock and can't be updated
Trying to flush a write-locked view has the same problem:
MariaDB [db1]> LOCK TABLES v WRITE;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db1]> FLUSH TABLES v;
ERROR 1100 (HY000): Table 'v' was not locked with LOCK TABLES
But this does work for base tables:
MariaDB [db1]> LOCK TABLES t WRITE;
Query OK, 0 rows affected (0.00 sec)
MariaDB [db1]> FLUSH TABLES t;
Query OK, 0 rows affected (0.00 sec)
Is the error message wrong, or is FLUSH partially broken for views at the moment?
relates to
MDEV-15888
Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views
Closed
{"report":{"fcp":2336.7999999523163,"ttfb":776.5,"pageVisibility":"visible","entityId":66877,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"3a637a23-96f7-40e2-b234-817478dbcc1b","navigationType":0,"readyForUser":2442.7999999523163,"redirectCount":0,"resourceLoadedEnd":3220.0999999046326,"resourceLoadedStart":782.7999999523163,"resourceTiming":[{"duration":720.8999999761581,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":782.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":782.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1503.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":718.8999999761581,"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":785,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":785,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1503.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":762.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":785.1999999284744,"connectEnd":785.1999999284744,"connectStart":785.1999999284744,"domainLookupEnd":785.1999999284744,"domainLookupStart":785.1999999284744,"fetchStart":785.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":785.1999999284744,"responseEnd":1548,"responseStart":1548,"secureConnectionStart":785.1999999284744},{"duration":890.8999999761581,"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":785.3999999761581,"connectEnd":785.3999999761581,"connectStart":785.3999999761581,"domainLookupEnd":785.3999999761581,"domainLookupStart":785.3999999761581,"fetchStart":785.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":785.3999999761581,"responseEnd":1676.2999999523163,"responseStart":1676.2999999523163,"secureConnectionStart":785.3999999761581},{"duration":913.2000000476837,"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":785.5999999046326,"connectEnd":785.5999999046326,"connectStart":785.5999999046326,"domainLookupEnd":785.5999999046326,"domainLookupStart":785.5999999046326,"fetchStart":785.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":785.5999999046326,"responseEnd":1698.7999999523163,"responseStart":1698.7999999523163,"secureConnectionStart":785.5999999046326},{"duration":914.2999999523163,"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":785.7999999523163,"connectEnd":785.7999999523163,"connectStart":785.7999999523163,"domainLookupEnd":785.7999999523163,"domainLookupStart":785.7999999523163,"fetchStart":785.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":785.7999999523163,"responseEnd":1700.0999999046326,"responseStart":1700.0999999046326,"secureConnectionStart":785.7999999523163},{"duration":914.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":786,"connectEnd":786,"connectStart":786,"domainLookupEnd":786,"domainLookupStart":786,"fetchStart":786,"redirectEnd":0,"redirectStart":0,"requestStart":786,"responseEnd":1700.5,"responseStart":1700.5,"secureConnectionStart":786},{"duration":993.2000000476837,"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":786.1999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":786.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1779.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":914.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":786.3999999761581,"connectEnd":786.3999999761581,"connectStart":786.3999999761581,"domainLookupEnd":786.3999999761581,"domainLookupStart":786.3999999761581,"fetchStart":786.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":786.3999999761581,"responseEnd":1701.1999999284744,"responseStart":1701.1999999284744,"secureConnectionStart":786.3999999761581},{"duration":993.3999999761581,"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":786.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":786.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1779.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":915.1000000238419,"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":786.5999999046326,"connectEnd":786.5999999046326,"connectStart":786.5999999046326,"domainLookupEnd":786.5999999046326,"domainLookupStart":786.5999999046326,"fetchStart":786.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":786.5999999046326,"responseEnd":1701.6999999284744,"responseStart":1701.6999999284744,"secureConnectionStart":786.5999999046326},{"duration":1578.1999999284744,"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":808.3999999761581,"connectEnd":808.3999999761581,"connectStart":808.3999999761581,"domainLookupEnd":808.3999999761581,"domainLookupStart":808.3999999761581,"fetchStart":808.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":808.3999999761581,"responseEnd":2386.5999999046326,"responseStart":2386.5999999046326,"secureConnectionStart":808.3999999761581},{"duration":2402.1999999284744,"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":810.5,"connectEnd":810.5,"connectStart":810.5,"domainLookupEnd":810.5,"domainLookupStart":810.5,"fetchStart":810.5,"redirectEnd":0,"redirectStart":0,"requestStart":810.5,"responseEnd":3212.6999999284744,"responseStart":3212.6999999284744,"secureConnectionStart":810.5},{"duration":569.7999999523163,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1818,"connectEnd":1818,"connectStart":1818,"domainLookupEnd":1818,"domainLookupStart":1818,"fetchStart":1818,"redirectEnd":0,"redirectStart":0,"requestStart":1818,"responseEnd":2387.7999999523163,"responseStart":2387.6999999284744,"secureConnectionStart":1818},{"duration":937.3999999761581,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":2328.899999976158,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":2328.899999976158,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":3266.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":706.1999999284744,"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&whisper-enabled=true","startTime":2513.899999976158,"connectEnd":2513.899999976158,"connectStart":2513.899999976158,"domainLookupEnd":2513.899999976158,"domainLookupStart":2513.899999976158,"fetchStart":2513.899999976158,"redirectEnd":0,"redirectStart":0,"requestStart":2513.899999976158,"responseEnd":3220.0999999046326,"responseStart":3220.0999999046326,"secureConnectionStart":2513.899999976158}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":608,"responseStart":776,"responseEnd":803,"domLoading":780,"domInteractive":3352,"domContentLoadedEventStart":3352,"domContentLoadedEventEnd":3417,"domComplete":4143,"loadEventStart":4144,"loadEventEnd":4144,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":3215.1999999284744},{"name":"bigPipe.sidebar-id.end","time":3216},{"name":"bigPipe.activity-panel-pipe-id.start","time":3216.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":3217.6999999284744},{"name":"activityTabFullyLoaded","time":3443}],"measures":[],"correlationId":"7ee499a3e01eb2","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
ok to push