Bug #116322 when log in mysql and do not select database, delete stmt returns error
Submitted: 9 Oct 10:48 Modified: 9 Oct 11:59
Reporter: ximin liang (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version: 9.0.1, 8.0.39 OS:Any
Assigned to: CPU Architecture:Any

[9 Oct 10:48] ximin liang
Description:
Hello MySQL Team:
  I found a case that seems not in line with expectations. Can be repeated in MySQL 9.0.1.

How to repeat:

First create test database and table t1.

create database test;
use test;
create table t1(c1 int);
quit;

The log in MySQL again without selecting database
select database();
+------------+
| database() |
+------------+
| NULL       |
+------------+
delete tt from test.t1 as tt where test.t1.c1 = 2;
ERROR 1046 (3D000): No database selected

Actually tt is alias of t1, database for t1 has specified. 
When dealing tt, parser thought tt does not specify database.
[9 Oct 11:59] MySQL Verification Team
Hello ximin liang,

Thank you for the report and test case.

regards,
Umesh