Bug #34949 | Passing invalid parameter to CHAR() in an ORDER BY causes MySQL to hang | ||
---|---|---|---|
Submitted: | 29 Feb 2008 3:23 | Modified: | 30 May 2008 19:14 |
Reporter: | Lindsey Smith | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 4.1.22 | OS: | Any |
Assigned to: | Georgi Kodinov | CPU Architecture: | Any |
Tags: | char hang |
[29 Feb 2008 3:23]
Lindsey Smith
[29 Feb 2008 4:24]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described. Bug is not repeatable with 5.x.y: mysql> select * from crashtest order by char(crash using utf8); +-------+ | crash | +-------+ | -1000 | +-------+ 1 row in set, 1 warning (0.00 sec) mysql> show warnings\G *************************** 1. row *************************** Level: Error Code: 1300 Message: Invalid utf8 character string: 'FFFFFC' 1 row in set (0.00 sec) mysql> select version(); +--------------------------+ | version() | +--------------------------+ | 5.0.56-enterprise-gpl-nt | +--------------------------+ 1 row in set (0.00 sec)
[7 Mar 2008 12:02]
Georgi Kodinov
Tested on Linux (FC8) using the 4.1.22 official "mysql-standard-4.1.22-pc-linux-gnu-i686-icc-glibc23.tar.gz" from MySQL's site. I've got : + select @@version; + @@version + 4.1.22-standard-log + set character set utf8; + show variables like 'char%'; + Variable_name Value + character_set_client utf8 + character_set_connection utf8 + character_set_database utf8 + character_set_results utf8 + character_set_server utf8 + character_set_system utf8 + CREATE DATABASE `crashtest` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; + use crashtest; + CREATE TABLE `crashtest` ( + `crash` char(10) NOT NULL default '' + ) ENGINE=INNODB DEFAULT CHARSET=utf8; + INSERT INTO `crashtest` VALUES ('35'); + INSERT INTO `crashtest` VALUES ('36'); + INSERT INTO `crashtest` VALUES ('37'); + select * from crashtest order by char(crash using utf8); + crash + 35 + 36 + 37 + TRUNCATE TABLE `crashtest`; + INSERT INTO `crashtest` VALUES ('-1000'); + select * from crashtest order by char(crash using utf8); + crash + -1000 and no crashes or hangs. Going to test on Win32 next
[7 Mar 2008 13:47]
Georgi Kodinov
I've got the hang on windows xp. This looks like windows specific bug.
[21 Mar 2008 14:04]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/44332 ChangeSet@1.2709, 2008-03-21 16:03:42+02:00, gkodinov@magare.gmz +4 -0 Bug#34949: Passing invalid parameter to CHAR() in an ORDER BY causes MySQL to hang. The function my_strnxfrm_utf8() was not checking for certain error codes returned by my_utf8_uni(). Back-ported the correct check from 5.0.
[7 Apr 2008 12:35]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/44990 ChangeSet@1.2709, 2008-04-07 15:34:42+03:00, gkodinov@magare.gmz +3 -0 Bug#34949: Passing invalid parameter to CHAR() in an ORDER BY causes MySQL to hang. The function my_strnxfrm_utf8() was not checking for certain error codes returned by my_utf8_uni(). Back-ported the correct check from 5.0.
[7 Apr 2008 12:50]
Alexander Barkov
Joro, the patch http://lists.mysql.com/commits/44990 is ok to push. Thanks for taking into account my previous suggestions!
[28 May 2008 10:01]
Bugs System
Pushed into 6.0.6-alpha
[30 May 2008 19:14]
Paul DuBois
Noted in 6.0.6 changelog. Passing an invalid parameter to CHAR() in an ORDER BY clause caused the server to hang.