Bug #2601 USE `abc de` does not work in mysql client
Description:
Hi!
Tested with the latest 4.0 tree. I can create a database with a space in its name, but USE ... does not work in the mysql client. On the other hand, giving the database name as a command parameter to mysql works.
Regards,
Heikki
heikki@hundin:~/mysql-4.0/client> ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.18-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database `abc de`;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| abc de |
| mysql |
| test |
| test2 |
+----------+
4 rows in set (0.00 sec)
mysql> create table `abc de`.`kuk kuu`(a int) type = innodb;
Query OK, 0 rows affected (0.03 sec)
mysql> use `abc de`;
ERROR 1049: Unknown database '`abc'
mysql> exit
Bye
heikki@hundin:~/mysql-4.0/client> ./mysql "abc de"
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.18-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show tables;
+------------------+
| Tables_in_abc de |
+------------------+
| kuk kuu |
+------------------+
1 row in set (0.00 sec)
How to repeat:
heikki@hundin:~/mysql-4.0/client> ./mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.18-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database `abc de`;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| abc de |
| mysql |
| test |
| test2 |
+----------+
4 rows in set (0.00 sec)
mysql> create table `abc de`.`kuk kuu`(a int) type = innodb;
Query OK, 0 rows affected (0.03 sec)
mysql> use `abc de`;
ERROR 1049: Unknown database '`abc'
mysql> exit
Bye
heikki@hundin:~/mysql-4.0/client> ./mysql "abc de"
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.0.18-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show tables;
+------------------+
| Tables_in_abc de |
+------------------+
| kuk kuu |
+------------------+
1 row in set (0.00 sec)
Suggested fix:
Fix the USE syntax parser in the client or the server.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.