Skip to content

When DROP TABLE with multiple tables listed, and one of them does not exist, TiDB still drops all the remaining tables #64218

Open

Description

@kennytm

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;

create table aa(a bigint primary key); create table cc like aa;
drop table aa, bb, cc;
-- ✅ ERROR 1051 (42S02): Unknown table 'test.bb'
show tables;

2. What did you expect to see? (Required)

+----------------+
| Tables_in_test |
+----------------+
| aa             |
| cc             |
...
+----------------+

3. What did you see instead (Required)

Tables aa and cc are gone

4. What is your TiDB version? (Required)

Reproduced on v6.5.5, v8.5.3 and master

Activity

  1. kennytm commented on Oct 31, 2025

    @kennytm
    ContributorAuthor

    The existing behavior is compatible with MySQL 5.7.

    However, MySQL 8.0 changed the behavior to keep aa and cc. See the MySQL 8.0.1 release note for the explanation.

    I think the 8.0 behavior is safer, as users don't expect failed statements actually have side effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibility-mysql8This is a compatibility issue with MySQL 8.0(but NOT 5.7)compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)component/ddlThis issue is related to DDL of TiDB.type/compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions