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
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