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

Please implement FOR UPDATE OF tablename,... and FOR SHARE OF tablename,...

    XMLWordPrintable

Details

    Description

      MySQL v8 has implemented enhanced control of locking in SELECT statements with joins, whereby you can lock some but not all tables in the join with FOR UPDATE OF <table>,<table>... and/or FOR SHARE OF <table>,<table>... (the latter equivalent to taking locks as in 'LOCK IN SHARE MODE').

      This is very useful, because (for example) in a long running transaction that performs an update, you might often have joins with tables that aren't being updated, and these might be used by many other simultaneous sessions that you don't want to block. So it's important to only lock "FOR UPDATE" those tables actually being updated.

      You can try doing this with subqueries, but it's very cumbersome.

      Please implement the "FOR UPDATE OF ..." and "FOR SHARE OF ..." syntax!
      (preferably allowing both in the same SELECT, for maximum control).

      Thanks.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Dean T Dean Trower
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start 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.