Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15888

Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK for views

    XMLWordPrintable

Details

    Description

      FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK does not currently work for views.

      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;
      

      We can see this behavior:

      MariaDB [db1]> FLUSH TABLES v WITH READ LOCK;
      ERROR 1347 (HY000): 'db1.v' is not BASE TABLE
      

      However, LOCK TABLES ... READ is smart enough to lock the underlying tables:

      MariaDB [db1]> LOCK TABLES v READ;
      Query OK, 0 rows affected (0.00 sec)
      

      Some users would like to see FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK work similarly for views.

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.