Skip to content

DROP TABLE IF EXISTS behavior difference #7867

@morgo

Description

@morgo

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
tidb> drop table if exists idontexistatall;
Query OK, 0 rows affected (0.00 sec)
  1. What did you expect to see?
mysql57> drop table if exists idontexistatall;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql57> show warnings;
+-------+------+--------------------------------------+
| Level | Code | Message                              |
+-------+------+--------------------------------------+
| Note  | 1051 | Unknown table 'test.idontexistatall' |
+-------+------+--------------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?

TiDB does not return a warning in the scenario the table didn't exist.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
MySQL [test]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-25-g3104c8723
Git Commit Hash: 3104c87230600e7514b3a7190689ebea30a1d8ee
Git Branch: newmaster
UTC Build Time: 2018-10-10 02:41:43
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)

This bug does not affect any programs to my knowledge, but is a nice to have compatibility issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions