server
server copied to clipboard
MDEV-33988 DELETE single table to support table aliases
- [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.
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:
-
The alias in delete coincides with the table name in IN subquery.
-
The alias in delete is different from the alias in IN subquery
-
The alias in delete is the same as the alias in IN subquery.
Regards,
Igor.
igor on slack:
ok, the patch is approved.
@grooverdan , please push into bb-11.6-MDEV-33988-delete-table-alias branch