Bug #1986 Crash in MySQL when a query is executed in a dropped DB

Submitted: 30 Nov 2003 13:52 Modified: 17 Jan 2004 1:55
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1 latest bk tree OS:Linux (Linux)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[30 Nov 2003 13:52] jocelyn fournier
Description:
Hi,

MySQL crashes if a query is executing on an existing DB but the current DB is dropped.

Regards,
  Jocelyn

How to repeat:
CREATE DATABASE DB1;
use DB1;
CREATE TABLE test (a int(1));
CREATE DATABASE TO_BE_DROPPED;
use TO_BE_DROPPED; 
DROP DATABASE TO_BE_DROPPED;
SELECT * FROM DB1.test;

=> ERROR 2013 (HY000): Lost connection to MySQL server during query

Stack trace :

0x80bc95d handle_segfault + 653
0x8346158 pthread_sighandler + 176
0x8370fcf memcpy + 31
0x8162a2d Query_cache::send_result_to_client(THD*, char*, unsigned) + 1021
0x80d43a8 mysql_parse(THD*, char*, unsigned) + 56
0x80ccc7e dispatch_command(enum_server_command, THD*, char*, unsigned) + 1038
0x80cc81a do_command(THD*) + 122
0x80cc078 handle_one_connection + 856
0x8343b7a pthread_start_thread + 218
0x8377daa thread_start + 4
[4 Dec 2003 14:02] Oleksandr Byelkin
ChangeSet 
  1.1651 03/12/04 23:57:10 bell@sanja.is.com.ua +3 -0 
  fixed length of current database name if it is dropped (BUG#1986)
[17 Jan 2004 1:55] Oleksandr Byelkin
Thank You for bugreport, now bug is fixed in our source repository.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 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.