Bug #42747 debug message uses uninitialized variable in myisammrg_attach_children_callback
Submitted: 11 Feb 2009 6:07 Modified: 8 Feb 2010 11:28
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Merge storage engine Severity:S3 (Non-critical)
Version:5.1-bzr, 6.0.10-debug OS:Windows
Assigned to: Sergey Vojtovich CPU Architecture:Any

[11 Feb 2009 6:07] Shane Bester
Description:
Version: '6.0.10-alpha-debug'  socket: ''  port: 3306  Source distribution

Error:Run-Time Check Failure #3 - The variable 'myisam' is being used without being initialized. At e:\builds\bzr\6.0\storage\myisammrg\ha_myisammrg.cc:528

/* Extract the MyISAM table structure pointer from the handler object. */
if ((child->file->ht->db_type != DB_TYPE_MYISAM) ||
   !(myisam= ((ha_myisam*) child->file)->file_ptr()))
{
  DBUG_PRINT("error", ("no MyISAM handle for child table: '%s'.'%s' %p",
                   child->s->db.str, child->s->table_name.str,
                  child));
  my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
 DBUG_PRINT("myrg", ("MyISAM handle: %p  my_errno: %d",  
                   myisam, my_errno));  <--------- HERE

How to repeat:
please review the code and see that "myisam" is not given a value if child->file->ht->db_type != DB_TYPE_MYISAM.
[11 Feb 2009 8:59] Valeriy Kravchuk
Verified by code review. Actually, 5.1-bzr has the same code, line 381.
[8 Feb 2010 11:28] Sergey Vojtovich
Fixed by http://lists.mysql.com/commits/98942.