Bug #43086 MERGE engine related warnings on Windows debug build
Submitted: 22 Feb 2009 10:24 Modified: 15 Apr 2009 1:39
Reporter: Ingo Strüwing Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Merge storage engine Severity:S3 (Non-critical)
Version:6.0 OS:Windows
Assigned to: Ingo Strüwing CPU Architecture:Any

[22 Feb 2009 10:24] Ingo Strüwing
Description:
main.merge                               [ fail ]  Found warnings/errors in server log file!
        Test ended at 2009-02-18 09:41:49
file_name	line

C:/cygwin/home/istruewing/bzrroot/mysql-6.0-bug38133-6/mysql-test/var/2/mysqld.1/mysqld.err	Error:Run-Time Check Failure #3 - The variable 'myisam' is being used without being initialized. At c:\cygwin\home\istruewing\bzrroot\mysql-6.0-bug38133-6\storage\myisammrg\ha_myisammrg.cc:528

C:/cygwin/home/istruewing/bzrroot/mysql-6.0-bug38133-6/mysql-test/var/2/mysqld.1/mysqld.err	Error:Run-Time Check Failure #3 - The variable 'myisam' is being used without being initialized. At c:\cygwin\home\istruewing\bzrroot\mysql-6.0-bug38133-6\storage\myisammrg\ha_myisammrg.cc:528

^ Found warnings!!

ok

main.merge_innodb                        [ fail ]  Found warnings/errors in server log file!
        Test ended at 2009-02-18 10:43:23
file_name	line

C:/cygwin/home/istruewing/bzrroot/mysql-6.0-bug38133-6/mysql-test/var/2/mysqld.1/mysqld.err	Error:Run-Time Check Failure #3 - The variable 'myisam' is being used without being initialized. At c:\cygwin\home\istruewing\bzrroot\mysql-6.0-bug38133-6\storage\myisammrg\ha_myisammrg.cc:528

... (similar to main.merge)

Line 528 in ha_myisammrg.cc is:
  DBUG_PRINT("myrg", ("MyISAM handle: %p  my_errno: %d",
                      myisam, my_errno));

How to repeat:
Make a debug build on Windows.
Run the mentioned tests.

Suggested fix:
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- storage/myisammrg/ha_myisammrg.cc   2009-01-18 23:21:43 +0000
+++ storage/myisammrg/ha_myisammrg.cc   2009-02-21 17:54:41 +0000
@@ -462,6 +462,7 @@ static MI_INFO *myisammrg_attach_childre
   MI_INFO       *myisam;
   DBUG_ENTER("myisammrg_attach_children_callback");
 
+  LINT_INIT(myisam);
   my_errno= 0;
 
   /* Get child list item. */
@@ -525,7 +526,7 @@ static MI_INFO *myisammrg_attach_childre
     my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
   }
   DBUG_PRINT("myrg", ("MyISAM handle: %p  my_errno: %d",
-                      myisam, my_errno));
+                      my_errno ? NULL : myisam, my_errno));
 
  err:
   DBUG_RETURN(my_errno ? NULL : myisam);
[22 Feb 2009 10:37] 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/67105

2764 Ingo Struewing	2009-02-22
      Bug#43086 - MERGE engine related warnings on Windows debug build
      
      A windows debug build created warnings in the error log.
      In myisammrg_attach_children_callback() the variable 'myisam'
      could be used without being set.
      
      Added initialization to silence compilers and added conditional
      use of 'myisam'.
     @ storage/myisammrg/ha_myisammrg.cc
        Bug#43086 - MERGE engine related warnings on Windows debug build
        Added LINIT_INIT(myisam).
        Print myisam only if sucessfully assigned.
[23 Feb 2009 15:51] 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/67225

2777 Ingo Struewing	2009-02-23
      Bug#43086 - MERGE engine related warnings on Windows debug build
      
      A windows debug build created warnings in the error log.
      In myisammrg_attach_children_callback() the variable 'myisam'
      could be used without being set.
      
      Added initialization to silence compilers.
      Fixed usage of my_errno along the way.
     @ storage/myisammrg/ha_myisammrg.cc
        Bug#43086 - MERGE engine related warnings on Windows debug build
        Initialized 'myisam'.
        Moved setting of my_errno to the end.
[24 Feb 2009 10:27] 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/67337

2778 Ingo Struewing	2009-02-24
      Bug#43086 - MERGE engine related warnings on Windows debug build
      
      A windows debug build created warnings in the error log.
      In myisammrg_attach_children_callback() the variable 'myisam'
      could be used without being set.
      
      Added initialization to silence compilers.
      Fixed usage of my_errno along the way.
     @ storage/myisammrg/ha_myisammrg.cc
        Bug#43086 - MERGE engine related warnings on Windows debug build
        Initialized 'myisam'.
        Moved setting of my_errno to the "no more children" branch.
[25 Feb 2009 13:10] Ingo Strüwing
Queued to mysql-6.0-backup.
[26 Mar 2009 12:34] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090326121822-pt84kzxxayzho4mn) (version source revid:rafal.somla@sun.com-20090302164601-znhm4tadplfi2iqu) (merge vers: 6.0.11-alpha) (pib:6)
[15 Apr 2009 1:39] Paul DuBois
Cosmetic change to silence warnings. No changelog entry needed.