Bug #4802 prompt in mysql client shows wrong database after dropping default db
Submitted: 29 Jul 2004 11:47 Modified: 25 Feb 2005 18:53
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:all versions OS:
Assigned to: Ramil Kalimullin CPU Architecture:Any

[29 Jul 2004 11:47] Georg Richter
Description:
After dropping the default database which was in use, command prompt still shows the dropped 
database as default database. 

How to repeat:
mysql> \R \u@\d> 
PROMPT set to '\u@\d>' 
 
root@(none)>use test; 
Database changed 
 
root@test>drop database test; 
Query OK, 0 rows affected (0.00 sec) 
 
root@test>select database(); 
+------------+ 
| database() | 
+------------+ 
| NULL       | 
+------------+ 
1 row in set (0.00 sec)
[8 Aug 2004 16:54] Kent Boortz
A simple patch that, after sending the query to the server, checked for "DROP " 
in the command string and if a match asked the server for the current database
was rejected. The performance hit is too serious and this is not the way to
solve this. There is a more general problem with the client being unaware
about changes on the server side.

See "Re: Review of patch for Bug#4802?" in <dev-public@mysql.com>
for details.
[25 Feb 2005 13:29] Ramil Kalimullin
fixed in 4.1.11
[25 Feb 2005 18:53] Paul DuBois
Noted in 4.1.11 changelog.