Bug #45948 MySQL crashes with select statement (thai character in where clause)
Submitted: 4 Jul 2009 18:06 Modified: 8 Jul 2009 5:23
Reporter: Chaiyaporn Suratemekul Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S1 (Critical)
Version:5.1.3x / 5.4.x OS:Any
Assigned to: CPU Architecture:Any

[4 Jul 2009 18:06] Chaiyaporn Suratemekul
Description:
MySQL Server above 5.1.30 crash with error message

Version: '5.1.34'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
090705  1:53:10 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=268435456
read_buffer_size=1048576
max_used_connections=3
max_threads=151
threads_connected=2
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 572353 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0xaf20240
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x9102c3b8 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x25)[0x8467085]
/usr/sbin/mysqld(handle_segfault+0x22c)[0x81d94ec]
[0x110420]
/usr/sbin/mysqld(_mi_read_rnd_dynamic_record+0x18b)[0x842b4eb]
/usr/sbin/mysqld(mi_scan+0x44)[0x8425104]
/usr/sbin/mysqld(_ZN9ha_myisam8rnd_nextEPh+0x31)[0x8419731]
/usr/sbin/mysqld(_Z13rr_sequentialP14st_read_record+0x1f)[0x82aa63f]
/usr/sbin/mysqld[0x8241eaf]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0xfc)[0x8240c2c]
/usr/sbin/mysqld[0x82407d7]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x13bf)[0x822fc8f]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x13f)[0x823054f]
/usr/sbin/mysqld(_Z13handle_selectP3THDP6st_lexP13select_resultm+0x161)[0x822b9e1]
/usr/sbin/mysqld[0x81eb41c]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x253)[0x81e52b3]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPKcjPS2_+0x146)[0x81ecb96]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x4e0)[0x81e3910]
/usr/sbin/mysqld(_Z10do_commandP3THD+0xea)[0x81e32fa]
/usr/sbin/mysqld(handle_one_connection+0x112)[0x81e1f82]
/lib/libpthread.so.0[0x90250b]
/lib/libc.so.6(clone+0x5e)[0x843b2e]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xaf70330 = select hn as code,concat(pname,' ',fname,'  ',lname) as ptname,fathername,mathername,admit from patient where (fname_soundex like 'ป%') or (fname like 'ป%') order by fname,lname  limit 100
thd->thread_id=2
thd->killed=NOT_KILLED
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
090705 01:53:10 mysqld_safe Number of processes running now: 0
090705 01:53:10 mysqld_safe mysqld restarted

How to repeat:
This error occur only when table has data more than 40,000 rows and contain Thai character in column  in where clause.

I've populate sample table structure and data that can download from http://58.136.40.32/upload/patient.zip

after restore table (patient) into mysql and run this query

select hn ,concat(pname,' ',fname,'  ',lname) as patient_name  from patient where (fname_soundex like 'ป%') or (fname like 'ป%') order by fname,lname  limit 100;

server will crash.

(This error not occur in MySQL 5.1.30 and below)
[4 Jul 2009 18:14] Chaiyaporn Suratemekul
I've upload file to ftp.mysql.com filename bug-data-45948.zip
[6 Jul 2009 5:37] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Please provide output of SHOW VARIABLES LIKE 'char%' and SHOW VARIABLES LIKE 'coll%'
[6 Jul 2009 9:48] Sveta Smirnova
Most likely duplicate of bug #44810
[8 Jul 2009 5:23] Chaiyaporn Suratemekul
This bug has been solved in MySQL 5.1.36