Bug #14586 use et ok, but use et; cause error
Submitted: 2 Nov 2005 18:47 Modified: 2 Nov 2005 19:36
Reporter: Charles Wang Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.15 OS:Solaris (Solaris x86)
Assigned to: MySQL Verification Team CPU Architecture:Any

[2 Nov 2005 18:47] Charles Wang
following is a copy from client

mysql> show databases;    // show you my databases
| Database           |
| information_schema |
| et                 |
| mysql              |
| test               |
4 rows in set (0.00 sec)

mysql> use et  // I may use et
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> use et;   // but when I use et; ERROR 1049 happened
ERROR 1049 (42000): Unknown database 'et;'
mysql> status;   // following is my server/client version
./bin/mysql  Ver 14.12 Distrib 5.0.15, for pc-solaris2.10 (i386) using readline 5.0

Connection id:          6
Current database:       et
Current user:           charles@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.0.15-max
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /tmp/mysql.sock
Uptime:                 1 hour 7 min 1 sec

Threads: 2  Questions: 125  Slow queries: 0  Opens: 0  Flush tables: 1  Open tables: 24  Queries per second avg: 0.031


if the database name is long enough, the use operation can work normally. for example, I may use test, and I may use test; too.

Say, the bug appears if  use a shorter-named database.  

The bug get repeated when I tried to connect a lower version server (v4.1) via a 5.0.15 client (Solaris x86), so I think the bug has something to do with the client part.

How to repeat:
you may create a database which name is like kk, and maybe you need create a table.
try to connect the server:
$mysql -uyouname -p
then you can see mysql>
try use kk
mysql>use kk
you can see this operation works.
but when you type use kk;
mysql>use kk;
you can see something wrong, and the error message is:
ERROR 1049 (42000): Unknown database 'kk;'

Suggested fix:
something wrong with the client.  check the codes and see what happens where use kk;
[2 Nov 2005 19:36] MySQL Verification Team
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

Duplicate of:

[3 Nov 2005 2:01] Charles Wang
The bug has beed reported before, but I failed to find it while searching.
Expecting 5.0.16