List:Commits« Previous MessageNext Message »
From:Mayank Prasad Date:December 23 2011 11:50am
Subject:bzr push into mysql-trunk branch (mayank.prasad:3680 to 3681) Bug#12561297
View as plain text  
 3681 Mayank Prasad	2011-12-23
      bug#12561297:
            
      Details: 
       - fixed failing test case on pb2 for sparc platform.
      
      Issue:
       In function init_embedded_server(), fake_argv (*char[]), which has a string 
       constant as its first element, was being assigned to argvp (char***), which  
       was not proper as while dereferencing argvp[0][0] (in my_load_defaults()), 
       it was not able to access that memory location.
      
      Solution:
      - Removed unnecessary C-Style type casting which is potential cause to
        introduce similar issue.
      - First assigning 'array of char pointer' to '**char' (temp pointer) and then
        assigning its address to '***char' resolves the issue.
      - Tell the master server to not use innodb, otherwise mysqld_embedded
        (which starts innodb) will hang for a looong time waiting to lock innodb
        data segments. 

    added:
      mysql-test/t/mysql_embedded-master.opt
    modified:
      libmysqld/lib_sql.cc
      mysql-test/mysql-test-run.pl
 3680 Sneha Modi	2011-12-22 [merge]
      Bug#11754150: A test case for bug#6857 has been disabled in sp.test:
      
      Merging from mysql-5.5 -> mysql-trunk

    modified:
      mysql-test/t/sp.test
=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc	2011-10-13 07:26:28 +0000
+++ b/libmysqld/lib_sql.cc	2011-12-23 08:55:18 +0000
@@ -500,11 +500,14 @@ int init_embedded_server(int argc, char
     This mess is to allow people to call the init function without
     having to mess with a fake argv
    */
-  int *argcp;
-  char ***argvp;
-  int fake_argc = 1;
-  char *fake_argv[] = { (char *)"", 0 };
-  const char *fake_groups[] = { "server", "embedded", 0 };
+  int *argcp= NULL;
+  char ***argvp= NULL;
+  int fake_argc= 1;
+  char *fake_argv[2];
+  char fake_server[]= "server";
+  char fake_embedded[]= "embedded";
+  char *fake_groups[]= { fake_server, fake_embedded, NULL };
+  char fake_name[]= "fake_name";
   my_bool acl_error;
 
   if (my_thread_init())
@@ -513,17 +516,21 @@ int init_embedded_server(int argc, char
   if (argc)
   {
     argcp= &argc;
-    argvp= (char***) &argv;
+    argvp= &argv;
   }
   else
   {
+    fake_argv[0]= fake_name;
+    fake_argv[1]= NULL;
+
+    char **foo= &fake_argv[0];
     argcp= &fake_argc;
-    argvp= (char ***) &fake_argv;
+    argvp= &foo;
   }
   if (!groups)
-    groups= (char**) fake_groups;
+    groups= fake_groups;
 
-  my_progname= (char *)"mysql_embedded";
+  my_progname= "mysql_embedded";
 
   /*
     Perform basic logger initialization logger. Should be called after

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2011-12-05 12:01:10 +0000
+++ b/mysql-test/mysql-test-run.pl	2011-12-23 08:55:18 +0000
@@ -2013,8 +2013,9 @@ sub executable_setup () {
   $exe_mysql=          mtr_exe_exists("$path_client_bindir/mysql");
   $exe_mysql_plugin=   mtr_exe_exists("$path_client_bindir/mysql_plugin");
 
-  $exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded",
-                                            "$bindir/bin/mysql_embedded");
+  $exe_mysql_embedded=
+    mtr_exe_maybe_exists("$bindir/libmysqld/examples/mysql_embedded",
+                         "$bindir/bin/mysql_embedded");
 
   if ( ! $opt_skip_ndbcluster )
   {

=== added file 'mysql-test/t/mysql_embedded-master.opt'
--- a/mysql-test/t/mysql_embedded-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/mysql_embedded-master.opt	2011-12-23 08:55:18 +0000
@@ -0,0 +1,3 @@
+--default-storage-engine=MyISAM 
+--default-tmp-storage-engine=MyISAM 
+--skip-innodb 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mayank.prasad:3680 to 3681) Bug#12561297Mayank Prasad25 Dec