server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-33988 DELETE single table to support table aliases

Open grooverdan opened this issue 9 months ago • 2 comments

  • [x] The Jira issue number for this PR is: MDEV-33988

Description

Gain MySQL compatibility by allowing table aliases in a single table statement.

This now supports the syntax of:

DELETE [delete_opts] FROM tbl_name [[AS] tbl_alias] [PARTITION (partition_name [, partition_name] ...)] ....

The delete.test addition from MySQL commit 1a72b69778a9791be44525501960b08856833b8d / Change-Id: Iac3a2b5ed993f65b7f91acdfd60013c2344db5c0.

Release Notes

Single table deletes now support a table alias (before optional partition information).

How can this PR be tested?

mtr tests included.

Basing the PR against the correct MariaDB version

  • [X] This is a new feature and the PR is based against the latest MariaDB development branch.
  • [ ] This is a bug fix and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • [X] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [X] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

grooverdan avatar May 01 '24 03:05 grooverdan

from @igorbabaev on slack :

I need additional test cases where single table delete with an IN sibquery in the WHERE clause is converted into multi-table delete. I need the following queries:

  1. The alias in delete coincides with the table name in IN subquery.

  2. The alias in delete is different from the alias in IN subquery

  3. The alias in delete is the same as the alias in IN subquery.

Regards,

Igor.

grooverdan avatar May 01 '24 05:05 grooverdan

igor on slack:

ok, the patch is approved.

grooverdan avatar May 01 '24 08:05 grooverdan

@grooverdan , please push into bb-11.6-MDEV-33988-delete-table-alias branch

vuvova avatar May 27 '24 10:05 vuvova