Bug #100 Test failure in "analyse" test
Submitted: 26 Feb 2003 6:35 Modified: 27 Apr 2003 3:04
Reporter: Lenz Grimmer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.0 OS:Mac OS X (Mac OS X 10.2.4)
Assigned to: Alexander Barkov CPU Architecture:Any

[26 Feb 2003 6:35] Lenz Grimmer
Description:
The "analyse" test fails with the following error: 
 
 TEST                         USER   SYSTEM  ELAPSED        RESULT 
------------------------------------------------------------------------ 
analyse                       ....     ....     ....       [ fail ] 
 
   >> Error at line 16: query 'EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE()' failed: 
2013: Lost connection to MySQL server during query<< 
 
mysqld dies with "signal 10", nothing else is printed in the logs. 

How to repeat:
./mysql-test-run --local t/analyse.test
[26 Feb 2003 7:12] Oleksandr Byelkin
I can't reproduce this on lastest 4.1 tree
[28 Mar 2003 4:11] Lenz Grimmer
As discussed on IRC, it still happens with the latest
BK tree and only on Mac OS X - please investigate. Thanks!
[28 Mar 2003 7:49] Lenz Grimmer
Assigned to Bar, as he has already investigated this.
[31 Mar 2003 6:05] Lenz Grimmer
Update via email: 
 
I found the reason for this. 
This is not bug in utf8 code or in charsets code generally. 
Take a look into sql_class.h, row 903 
 
  { 
     /* We must have a table name here as this is used with 
add_table_to_list 
*/ 
     db.str=0; table.str=(char *)"*"; table.length=1; 
   } 
 
table.str is initialized to static memory area. 
Using cast (char*) case somebody tricked the compiler not to produce 
warning that a variable pointer is initialized to static momory. 
 
Now take a look here, in sql_parse.cc, row 3852: 
 
  if (lower_case_table_names && table->table.length) 
     my_casedn_str(files_charset_info, table->table.str); 
 
Our static memory is passed to my_casedn_str(), which is going to 
change it's second argument. 
 
That result to memory fault.
[27 Apr 2003 3:04] Michael Widenius
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html