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

Add support of ORDER BY and LIMIT to multidelete query and hints to normal DELETE.

    XMLWordPrintable

Details

    • New Feature
    • Status: Stalled (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 11.6
    • Parser
    • None

    Description

      Delete doesn't work with LIMIT and Hints and I don't find any specific reason behind this. Even not in documentation.

      MariaDB [test]> DELETE t1.* FROM test1 t1 WHERE ID=1;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> DELETE t1.* FROM test1 t1 WHERE ID=1 LIMIT 10;
      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 'LIMIT 10' at line 1
      MariaDB [test]> 
       
      MariaDB [test]> DELETE t1.* FROM test1 t1 use index(ix_id) WHERE ID = 1 limit 10;
      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 'limit 10' at line 1
      MariaDB [test]> 
      
      

      Doc says, "For the multiple-table syntax, DELETE deletes from each tbl_name the rows that satisfy the conditions. In this case, ORDER BY and LIMIT> cannot be used." But here there are no multiple tables.
      https://mariadb.com/kb/en/delete/

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              niljoshi Nilnandan Joshi
              Votes:
              0 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.