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.