Bug #28490 crash in handler.cc, handler::print_error(int error, myf errflag)
Submitted: 17 May 2007 6:35 Modified: 25 Jun 2007 22:43
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1.19 OS:Any
Assigned to: Gleb Shchepa CPU Architecture:Any
Tags: crash

[17 May 2007 6:35] Shane Bester
Description:
after running the testcase for bug #28477 a few times,
subsequent "drop table if exists t1_test;" causes a repeatable crash if t1_test has some partitions.

The server crashes in this code:

/** @brief
  Print error that we got from handler function

  NOTE
   In case of delete table it's only safe to use the following parts of
   the 'table' structure:
     table->s->path
     table->alias
*/
void handler::print_error(int error, myf errflag)
{

<cut>
my_error(textno, errflag, table_share->table_name.str, error);
  DBUG_VOID_RETURN;
}

The my_error is crashing.  This table is partitioned, and likely some parts are missing due to other bugs.

table_share->table_name is NULL, so how can .str work ?

How to repeat:
read the source code, or use testcase in bug #28477 until you get this crash:

mysqld.exe!handler::print_error
mysqld.exe!ha_partition::print_error
mysqld.exe!ha_delete_table
mysqld.exe!mysql_rm_table_part2
mysqld.exe!mysql_rm_table
mysqld.exe!mysql_execute_command
mysqld.exe!strmake_root
mysqld.exe!st_select_lex::add_table_to_list
mysqld.exe!MYSQLparse
mysqld.exe!dispatch_command
mysqld.exe!do_command
mysqld.exe!handle_one_connection
mysqld.exe!pthread_start
mysqld.exe!_callthreadstart
mysqld.exe!_threadstart
kernel32.dll!FlsSetValue

This isn't windows specific, - you can repeat it on linux too.

Suggested fix:
up to you.
[14 Jun 2007 18:24] Gleb Shchepa
Can't repeat on 5.1-bk:

+-------------------+
| VERSION()         |
+-------------------+
| 5.1.20-beta-debug | 
+-------------------+
[25 Jun 2007 22:43] Gleb Shchepa
This bug is duplicated: it was already fixed by latest patches for bug #28477.