Bug #4070 MySQL command-line client somtimes exitted with segmentation fault
Submitted: 9 Jun 2004 4:14 Modified: 12 Jul 2004 0:57
Reporter: Jindo LIN Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.1.2alpha OS:Linux (Linux 2.6.5-1.358smp)
Assigned to: Assigned Account CPU Architecture:Any

[9 Jun 2004 4:14] Jindo LIN
Description:
I ran into this rather strange crash today where I tried to execute a fairly lengthy query just before exitting the command-line client.  The client crashed with seg fault.  I tried it several times and confirmed that it's reproduceable at least on my box.

My guess is that mysql command-line client tries to save the last query before quitting but did not allocate enough buffer for this operation.  The above scenario cannot be reproduced if the ast query is short enough (something like select 1;)

How to repeat:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 223 to server version: 4.1.2-alpha-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> drop table if exists test.testseg;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> create table test.testseg
    -> (
    ->   `UploadId` bigint(20) unsigned NOT NULL auto_increment,
    ->   `AccountId` mediumint(8) unsigned NOT NULL default '0',
    ->   `UploadType` enum('MyPhoto') NOT NULL default 'MyPhoto',
    ->   `FileType` enum('JPEG','GIF','PNG') NOT NULL default 'JPEG',
    ->   `FileSize` mediumint(8) unsigned NOT NULL default '0',
    ->   `FilePath` varchar(255) NOT NULL default '',
    ->   `Width` smallint(5) unsigned NOT NULL default '0',
    ->   `Height` smallint(5) unsigned NOT NULL default '0',
    ->   `OnDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
    ->   PRIMARY KEY  (`UploadId`),
    ->   KEY `AccountId` (`AccountId`)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.02 sec)

mysql> \q
Segmentation fault
[12 Jun 2004 0:57] Dean Ellis
Are you using our binary?  If so, which (max, standard, debug)?
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".