Bug #99266 SQL USE command with backticks fails if there was no default database selected
Submitted: 15 Apr 2020 12:47 Modified: 15 Apr 2020 14:16
Reporter: Hontvari Jozsef Levente Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.6/5.7/8.0 OS:Ubuntu (16.04.6 LTS)
Assigned to: CPU Architecture:x86
Tags: Use

[15 Apr 2020 12:47] Hontvari Jozsef Levente
If the mysql client is started without current database, then issuing a 

USE `something` 

statement fails with 

ERROR 1046 (3D000): No database selected

error message.

Repeating the same command without backicks works. Repeating the same command also works if there is default database selected (e.g. starting mysql client with "mysql somedb"

How to repeat:
mysql --database=

mysql> USE `mysql`;
ERROR 1046 (3D000): No database selected

# just for testing
mysql> use game
Database changed
[15 Apr 2020 14:16] MySQL Verification Team
Thank you for the bug report.