tidb-challenge-program / bug-hunting-issue

Bug hunting issues.
3 stars 0 forks source link

P2-[4.0 bug hunting]-[Compatibility]-DUAL table cannot be processed, inconsistent with MySQL #74

Open zhangysh1995 opened 4 years ago

zhangysh1995 commented 4 years ago

Bug Report

1. What did you do?

mysql> select * from dual;
ERROR 1051 (42S02): Unknown table ''

2. What did you expect to see?

It should return the error with the same error code.

mysql> select * from dual;
ERROR 1096 (HY000): No tables used

3. What did you see instead?

It cannot process the table name and is inconsistent with MySQL.

4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

mysql> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                        |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-rc
Git Commit Hash: 79db9e30ab8f98ac07c8ae55c66dfecc24b43d56
Git Branch: heads/refs/tags/v4.0.0-rc
UTC Build Time: 2020-04-08 07:32:25
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

A similar issue which has different error code was opened in TiDB repo.

wwar commented 4 years ago

Here is another one:

tidb> select * from (select 1 from dual);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 34 near "" 

mysql [localhost:8020] {msandbox} ((none)) > select * from (select 1 from dual);
ERROR 1248 (42000): Every derived table must have its own alias

MySQL doesn't explicitly permit the query, but the error message is more useful.

shuke987 commented 4 years ago

/bug P2