pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.11k stars 5.83k forks source link

No error is reported when the database name is empty #45873

Closed keeplearning20221 closed 9 months ago

keeplearning20221 commented 1 year ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table ``.ttt2(id int key);

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

mysql> create table ``.ttt2(id int key); ERROR 1102 (42000): Incorrect database name ''

3. What did you see instead (Required)

mysql> create table ``.ttt2(id int key); Query OK, 0 rows affected (0.03 sec)

4. What is your TiDB version? (Required)

Release Version: v7.4.0-alpha-21-gcd4cbcd742 Edition: Community Git Commit Hash: https://github.com/pingcap/tidb/commit/cd4cbcd7422f133d88ffc87a41d077d9d8b07bb1 Git Branch: master UTC Build Time: 2023-08-07 08:11:41 GoVersion: go1.20.5 Race Enabled: false Check Table Before Drop: false Store: unistore |

git-hulk commented 1 year ago

Hi @djshow832 Can I take this issue?

tonisanta commented 1 year ago

Hello @djshow832 @keeplearning20221 @aytrack ! Seems it's allowing to have empty database and table names. So how would you like to solve it? When parsing stmt or have a later on validation?

xmh1011 commented 12 months ago

I'd like to fix this issue, can you assign me? @djshow832 @keeplearning20221

yoshikipom commented 10 months ago

/assign