Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-33988 DELETE single table to support table aliases #3237

Open
wants to merge 1 commit into
base: 11.5
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

@grooverdan grooverdan commented May 1, 2024

  • 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

  • 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

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

@grooverdan grooverdan requested a review from igorbabaev May 1, 2024 03:33
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label May 1, 2024
@grooverdan
Copy link
Member Author

grooverdan commented May 1, 2024

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
Copy link
Member Author

igor on slack:

ok, the patch is approved.

@vuvova
Copy link
Member

vuvova commented May 27, 2024

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

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 is from MySQL commit 1a72b69778a9791be44525501960b08856833b8d
/ Change-Id: Iac3a2b5ed993f65b7f91acdfd60013c2344db5c0.

Co-Author: Gleb Shchepa <gleb.shchepa@oracle.com> (for delete.test)

Reviewed by Igor Babaev (igor@mariadb.com)
@grooverdan grooverdan force-pushed the 11.5-MDEV-33988-delete-table-alias branch from 78129dc to 1446b6c Compare May 28, 2024 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MariaDB Foundation Pull requests created by MariaDB Foundation
2 participants