List:Commits« Previous MessageNext Message »
From:monty Date:November 1 2006 5:41pm
Subject:bk commit into 5.1 tree (monty:1.2321) BUG#22150
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-01 19:41:09+02:00, monty@stripped +28 -0
  Fixed a lot of compiler warnings (Mainly in mysqld and instance manager)
  Fixed some possible fatal wrong arguments to printf() style functions
  Initialized some not initialized variables
  Fixed bug in stored procedure and continue handlers
  (Fixes Bug#22150)

  include/mysql/plugin.h@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +1 -1
    Remove compiler warning

  mysql-test/mysql-test-run.pl@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +16 -9
    Ensure that --extern works on a clean tree (when 'var' directory doesn't exists)

  server-tools/instance-manager/commands.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +1 -1
    Fixed possible use of unitialized variable

  server-tools/instance-manager/guardian.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +5 -5
    Fixed wrong arguments to log_info() that could cause crashes

  server-tools/instance-manager/instance.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +5 -5
    Fixed wrong arguments to log_info() and log_error() that could cause crashes

  server-tools/instance-manager/instance_options.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +1 -1
    Fixed wrong arguments to log_error() that could cause crashes

  server-tools/instance-manager/mysql_connection.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +10 -10
    Fixed wrong arguments to log_info()

  server-tools/instance-manager/parse.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +1 -1
    Fixed possible use of unitialized variable

  server-tools/instance-manager/user_map.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +4 -5
    Fixed wrong arguments to log_error() that could cause crashes

  sql/Makefile.am@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +3 -0
    Fix for bison 1.875
    (It write an __attribute__() tag that was causing compiler failures)

  sql/ha_ndbcluster.cc@stripped, 2006-11-01 19:41:04+02:00, monty@stripped +11 -10
    Fixed wrong snprintf() arguments
    Remoed not used variables

  sql/ha_ndbcluster_binlog.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +3 -2
    Fixed compiler warning (unsigned/signed comparision)

  sql/handler.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +4 -4
    Fixed wrong parameter to hton->binlog_func()

  sql/item_cmpfunc.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +3 -0
    Removed compiler warnings

  sql/item_timefunc.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +9 -1
    Removed compiler warnings

  sql/log.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +1 -1
    fixed wrong argument to snprintf()

  sql/mysqld.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +3 -3
    Removed compiler warnings
    Fixed wrong arguments to printf()

  sql/partition_info.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +5 -1
    Removed compiler warnings

  sql/protocol.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +3 -1
    reset is_fatal_error for stored procedures
    (Fix for Bug#22150)

  sql/sp_head.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +9 -3
    More DBUG information
    Reset is_fatal_error in case of continue handler.
    (Fix for Bug#22150)

  sql/sql_base.cc@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +2 -0
    Removed compiler warnings

  sql/sql_class.h@stripped, 2006-11-01 19:41:05+02:00, monty@stripped +2 -0
    More DBUG information

  sql/sql_insert.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +9 -3
    Removed compiler warnings
    Initialize not initialized variable (fatal bug)

  sql/sql_parse.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +4 -1
    Added DBUG_ASSERT to detect if stored procedure code returns with a wrong state
    Removed compiler warning

  sql/sql_plugin.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +2 -2
    Fied wrong aruguments to printf() (Fatal bug)

  sql/sql_select.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +6 -5
    Initailize not initialized variable.
    Remove compiler warnings
    Fixed wrong argument to printf() (Possible fatal error)

  sql/sql_view.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +2 -0
    Removed compiler warnings

  sql/table.cc@stripped, 2006-11-01 19:41:06+02:00, monty@stripped +1 -1
    Fixed wrong argument to printf() (Possible fatal)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	nosik.monty.fi
# Root:	/home/my/mysql-5.1

--- 1.161/sql/Makefile.am	2006-11-01 19:41:16 +02:00
+++ 1.162/sql/Makefile.am	2006-11-01 19:41:16 +02:00
@@ -150,9 +150,12 @@
 # things like different grammars for different pars of MySQL can
 # happen if you are unlucky.
 sql_yacc.cc:	sql_yacc.yy
+
 sql_yacc.h:	sql_yacc.yy
 
 sql_yacc.o:	sql_yacc.cc sql_yacc.h $(HEADERS)
+		@SED@ -e 's/__attribute__ ((__unused__))//' sql_yacc.cc > sql_yacc.cc-new
+		@MV@ sql_yacc.cc-new sql_yacc.cc
 		@echo "Note: The following compile may take a long time."
 		@echo "If it fails, re-run configure with --with-low-memory"
 		$(CXXCOMPILE) $(LM_CFLAGS) -c $<

--- 1.273/sql/handler.cc	2006-11-01 19:41:16 +02:00
+++ 1.274/sql/handler.cc	2006-11-01 19:41:16 +02:00
@@ -2947,15 +2947,15 @@
 
 static my_bool binlog_func_foreach(THD *thd, binlog_func_st *bfn)
 {
-  handlerton *hton;
   hton_list_st hton_list;
+  uint i, sz;
+
   hton_list.sz= 0;
   plugin_foreach(thd, binlog_func_list,
                  MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
 
-  uint i= 0, sz= hton_list.sz;
-  while(i < sz)
-    hton_list.hton[i++]->binlog_func(hton, thd, bfn->fn, bfn->arg);
+  for (i= 0, sz= hton_list.sz; i < sz ; i++)
+    hton_list.hton[i]->binlog_func(hton_list.hton[i], thd, bfn->fn, bfn->arg);
   return FALSE;
 }
 

--- 1.225/sql/item_cmpfunc.cc	2006-11-01 19:41:16 +02:00
+++ 1.226/sql/item_cmpfunc.cc	2006-11-01 19:41:16 +02:00
@@ -275,6 +275,9 @@
     my_bitmap_map *old_write_map;
     my_bitmap_map *old_read_map;
 
+    LINT_INIT(old_write_map);
+    LINT_INIT(old_read_map);
+
     if (table)
     {
       old_write_map= dbug_tmp_use_all_columns(table, table->write_set);

--- 1.137/sql/item_timefunc.cc	2006-11-01 19:41:16 +02:00
+++ 1.138/sql/item_timefunc.cc	2006-11-01 19:41:16 +02:00
@@ -1249,6 +1249,11 @@
     interval->second= array[0];
     interval->second_part= array[1];
     break;
+    /* purecov: begin deadcode */
+  case INTERVAL_LAST:
+    DBUG_ASSERT(0);
+    break;
+    /* purecov: end */
   }
   return 0;
 }
@@ -2088,6 +2093,7 @@
   case INTERVAL_HOUR_MICROSECOND: max_length=13; date_value=0; break;
   case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break;
   case INTERVAL_SECOND_MICROSECOND: max_length=9; date_value=0; break;
+  case INTERVAL_LAST: DBUG_ASSERT(0); break;    /* purecov: deadcode */
   }
 }
 
@@ -2157,6 +2163,8 @@
 					    ltime.second_part)*neg;
   case INTERVAL_SECOND_MICROSECOND: return ((longlong)ltime.second*1000000L+
 					    ltime.second_part)*neg;
+  case INTERVAL_LAST: DBUG_ASSERT(0); return(0); /* purecov: deadcode */
+    /* purecov: end */
   }
   return 0;					// Impossible
 }
@@ -2271,7 +2279,7 @@
     {                                           // Safe even if const arg
       char char_type[40];
       my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
-                  cast_cs == &my_charset_bin ? "BINARY" : "CHAR", length);
+                  cast_cs == &my_charset_bin ? "BINARY" : "CHAR", (ulong) length);
 
       if (!res->alloced_length())
       {                                         // Don't change const str

--- 1.239/sql/log.cc	2006-11-01 19:41:16 +02:00
+++ 1.240/sql/log.cc	2006-11-01 19:41:16 +02:00
@@ -2010,7 +2010,7 @@
           goto err;
 
     /* command_type, thread_id */
-    length= my_snprintf(buff, 32, "%5ld ", thread_id);
+      length= my_snprintf(buff, 32, "%5ld ", (long) thread_id);
 
     if (my_b_write(&log_file, (byte*) buff, length))
       goto err;

--- 1.583/sql/mysqld.cc	2006-11-01 19:41:16 +02:00
+++ 1.584/sql/mysqld.cc	2006-11-01 19:41:16 +02:00
@@ -1609,7 +1609,7 @@
 
     if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1))
     {
-      sql_print_error("The socket file path is too long (> %lu): %s",
+      sql_print_error("The socket file path is too long (> %u): %s",
                       sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
       unireg_abort(1);
     }
@@ -3506,7 +3506,7 @@
     {
       if (global_system_variables.log_warnings)
 	sql_print_warning("Asked for %ld thread stack, but got %ld",
-			  thread_stack, stack_size);
+			  thread_stack, (long) stack_size);
 #if defined(__ia64__) || defined(__ia64)
       thread_stack= stack_size*2;
 #else
@@ -5316,7 +5316,7 @@
    (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \
 --skip-merge.",
-   (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0},
+   (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
   {"myisam-recover", OPT_MYISAM_RECOVER,
    "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
    (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,

--- 1.118/sql/protocol.cc	2006-11-01 19:41:16 +02:00
+++ 1.119/sql/protocol.cc	2006-11-01 19:41:16 +02:00
@@ -79,6 +79,7 @@
   if (net && net->no_send_error)
   {
     thd->clear_error();
+    thd->is_fatal_error= 0;			// Error message is given
     DBUG_PRINT("info", ("sending error messages prohibited"));
     DBUG_VOID_RETURN;
   }
@@ -111,7 +112,7 @@
 
   net_send_error_packet(thd, sql_errno, err);
 
-  thd->is_fatal_error=0;			// Error message is given
+  thd->is_fatal_error= 0;			// Error message is given
   thd->net.report_error= 0;
 
   /* Abort multi-result sets */
@@ -156,6 +157,7 @@
   if (net && net->no_send_error)
   {
     thd->clear_error();
+    thd->is_fatal_error= 0;			// Error message is given
     DBUG_PRINT("info", ("sending error messages prohibited"));
     DBUG_VOID_RETURN;
   }

--- 1.359/sql/sql_base.cc	2006-11-01 19:41:16 +02:00
+++ 1.360/sql/sql_base.cc	2006-11-01 19:41:16 +02:00
@@ -6558,6 +6558,8 @@
 has_two_write_locked_tables_with_auto_increment(TABLE_LIST *tables)
 {
   char *first_table_name= NULL, *first_db;
+  LINT_INIT(first_db);
+
   for (TABLE_LIST *table= tables; table; table= table->next_global)
   {
     /* we must do preliminary checks as table->table may be NULL */

--- 1.322/sql/sql_class.h	2006-11-01 19:41:16 +02:00
+++ 1.323/sql/sql_class.h	2006-11-01 19:41:16 +02:00
@@ -1449,10 +1449,12 @@
 #ifndef EMBEDDED_LIBRARY
   inline void clear_error()
   {
+    DBUG_ENTER("clear_error");
     net.last_error[0]= 0;
     net.last_errno= 0;
     net.report_error= 0;
     query_error= 0;
+    DBUG_VOID_RETURN;
   }
   inline bool vio_ok() const { return net.vio != 0; }
 #else

--- 1.232/sql/sql_insert.cc	2006-11-01 19:41:16 +02:00
+++ 1.233/sql/sql_insert.cc	2006-11-01 19:41:16 +02:00
@@ -261,6 +261,8 @@
   TABLE *table= insert_table_list->table;
   my_bool timestamp_mark;
 
+  LINT_INIT(timestamp_mark);
+
   if (table->timestamp_field)
   {
     /*
@@ -1699,7 +1701,7 @@
 write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
               LEX_STRING query, bool ignore, bool log_on)
 {
-  delayed_row *row;
+  delayed_row *row= 0;
   delayed_insert *di=thd->di;
   const Discrete_interval *forced_auto_inc;
   DBUG_ENTER("write_delayed");
@@ -2306,14 +2308,18 @@
   DBUG_RETURN(0);
 
  err:
-  DBUG_EXECUTE("error", max_rows= 0;);
+#ifndef DBUG_OFF
+  max_rows= 0;                                  // For DBUG output
+#endif
   /* Remove all not used rows */
   while ((row=rows.get()))
   {
     delete row;
     thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
     stacked_inserts--;
-    DBUG_EXECUTE("error", max_rows++;);
+#ifndef DBUG_OFF
+    max_rows++;
+#endif
   }
   DBUG_PRINT("error", ("dropped %lu rows after an error", max_rows));
   thread_safe_increment(delayed_insert_errors, &LOCK_delayed_status);

--- 1.585/sql/sql_parse.cc	2006-11-01 19:41:16 +02:00
+++ 1.586/sql/sql_parse.cc	2006-11-01 19:41:16 +02:00
@@ -4633,7 +4633,10 @@
 	  send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 :
                                 thd->row_count_func));
 	else
+        {
+          DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
 	  goto error;		// Substatement should already have sent error
+        }
       }
       break;
     }
@@ -4918,7 +4921,7 @@
           LEX_STRING *name;
           int i;
           
-          for (i= 0; name= names++; i++)
+          for (i= 0; (name= names++); i++)
           {
             buff.append(i ? ", " : "(");
             append_identifier(thd, &buff, name->str, name->length);

--- 1.458/sql/sql_select.cc	2006-11-01 19:41:16 +02:00
+++ 1.459/sql/sql_select.cc	2006-11-01 19:41:16 +02:00
@@ -3598,7 +3598,7 @@
   double best=              DBL_MAX;
   double best_time=         DBL_MAX;
   double records=           DBL_MAX;
-  table_map best_ref_depends_map;
+  table_map best_ref_depends_map= 0;
   double tmp;
   ha_rows rec;
 
@@ -10099,7 +10099,8 @@
   enum_nested_loop_state error= NESTED_LOOP_OK;
   JOIN_TAB *join_tab;
   DBUG_ENTER("do_select");
-
+  LINT_INIT(join_tab);
+  
   join->procedure=procedure;
   join->tmp_table= table;			/* Save for easy recursion */
   join->fields= fields;
@@ -10129,9 +10130,9 @@
     */
     if (!join->conds || join->conds->val_int())
     {
-      error= (*end_select)(join,join_tab,0);
+      error= (*end_select)(join, 0, 0);
       if (error == NESTED_LOOP_OK || error == NESTED_LOOP_QUERY_LIMIT)
-	error= (*end_select)(join,join_tab,1);
+	error= (*end_select)(join, 0, 1);
     }
     else if (join->send_row_on_empty_set())
     {
@@ -10687,7 +10688,7 @@
   */
   if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
     sql_print_error("Got error %d when reading table '%s'",
-		    error, table->s->path);
+		    error, table->s->path.str);
   table->file->print_error(error,MYF(0));
   return 1;
 }

--- 1.246/sql/table.cc	2006-11-01 19:41:16 +02:00
+++ 1.247/sql/table.cc	2006-11-01 19:41:16 +02:00
@@ -480,7 +480,7 @@
       sql_print_warning("'%s' had no or invalid character set, "
                         "and default character set is multi-byte, "
                         "so character column sizes may have changed",
-                        share->path);
+                        share->path.str);
     }
     share->table_charset= default_charset_info;
   }

--- 1.110/sql/sql_view.cc	2006-11-01 19:41:16 +02:00
+++ 1.111/sql/sql_view.cc	2006-11-01 19:41:16 +02:00
@@ -1073,6 +1073,8 @@
     bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
                              lex->can_be_merged());
     TABLE_LIST *view_main_select_tables;
+    LINT_INIT(view_main_select_tables);
+
     if (view_is_mergeable)
     {
       /*

--- 1.191/mysql-test/mysql-test-run.pl	2006-11-01 19:41:16 +02:00
+++ 1.192/mysql-test/mysql-test-run.pl	2006-11-01 19:41:16 +02:00
@@ -1633,7 +1633,7 @@
   # ----------------------------------------------------
   # We are nice and report a bit about our settings
   # ----------------------------------------------------
-  if (!$opt_extern)
+  if (!$opt_extern && $opt_verbose)
   {
     print "Using MTR_BUILD_THREAD      = $ENV{MTR_BUILD_THREAD}\n";
     print "Using MASTER_MYPORT         = $ENV{MASTER_MYPORT}\n";
@@ -2270,6 +2270,11 @@
     }
     check_running_as_root();
   }
+  else
+  {
+    # We have to create the 'var' and related directories
+    cleanup_stale_files();
+  }
 }
 
 sub mysql_install_db () {
@@ -2590,16 +2595,18 @@
   }
 
 
-# MASV cleanup...
-  mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
+  if (!$opt_extern)
+  {
+    # MASV cleanup...
+    mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
 
-  # output current test to ndbcluster log file to enable diagnostics
-  mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
+    # output current test to ndbcluster log file to enable diagnostics
+    mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
 
-  mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
-  if ( $master->[1]->{'pid'} )
-  {
-    mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+    mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+    if ( $master->[1]->{'pid'} ) {
+      mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+    }
   }
 }
 

--- 1.359/sql/ha_ndbcluster.cc	2006-11-01 19:41:16 +02:00
+++ 1.360/sql/ha_ndbcluster.cc	2006-11-01 19:41:16 +02:00
@@ -6488,7 +6488,7 @@
   }
   {
     char buf[128];
-    my_snprintf(buf, sizeof(buf), "mysqld --server-id=%d", server_id);
+    my_snprintf(buf, sizeof(buf), "mysqld --server-id=%lu", server_id);
     g_ndb_cluster_connection->set_name(buf);
   }
   g_ndb_cluster_connection->set_optimized_node_selection
@@ -7245,7 +7245,7 @@
       share->key_length= min_key_length;
     }
     share->key_length=
-      my_snprintf(share->key, min_key_length + 1, "#leak%d",
+      my_snprintf(share->key, min_key_length + 1, "#leak%lu",
                   trailing_share_id++);
   }
   /* Keep it for possible the future trailing free */
@@ -9764,12 +9764,12 @@
   update_status_variables(g_ndb_cluster_connection);
   buflen=
     my_snprintf(buf, sizeof(buf),
-                "cluster_node_id=%u, "
+                "cluster_node_id=%ld, "
                 "connected_host=%s, "
-                "connected_port=%u, "
-                "number_of_data_nodes=%u, "
-                "number_of_ready_data_nodes=%u, "
-                "connect_count=%u",
+                "connected_port=%ld, "
+                "number_of_data_nodes=%ld, "
+                "number_of_ready_data_nodes=%ld, "
+                "connect_count=%ld",
                 ndb_cluster_node_id,
                 ndb_connected_host,
                 ndb_connected_port,
@@ -10691,7 +10691,8 @@
       table->field[c++]->store("NORMAL", 6, system_charset_info);
 
       char extra[100];
-      int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
+      int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",
+                           id, (ulong) lfg.getUndoBufferSize());
       table->field[c]->set_notnull();
       table->field[c]->store(extra, len, system_charset_info);
       schema_table_store_record(thd, table);
@@ -10708,7 +10709,6 @@
   for (i= 0; i < lfglist.count; i++)
   {
     NdbDictionary::Dictionary::List::Element& elt= lfglist.elements[i];
-    unsigned id;
 
     NdbDictionary::LogfileGroup lfg= dict->getLogfileGroup(elt.name);
     ndberr= dict->getNdbError();
@@ -10779,7 +10779,8 @@
     table->field[c++]->store("NORMAL", 6, system_charset_info);
 
     char extra[100];
-    int len= my_snprintf(extra,sizeof(extra),"UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
+    int len= my_snprintf(extra, sizeof(extra), "UNDO_BUFFER_SIZE=%lu",
+                         (ulong) lfg.getUndoBufferSize());
     table->field[c]->set_notnull();
     table->field[c]->store(extra, len, system_charset_info);
     schema_table_store_record(thd, table);

--- 1.21/include/mysql/plugin.h	2006-11-01 19:41:16 +02:00
+++ 1.22/include/mysql/plugin.h	2006-11-01 19:41:16 +02:00
@@ -65,7 +65,7 @@
                  builtin_ ## NAME ## _sizeof_struct_st_plugin, \
                  builtin_ ## NAME ## _plugin)
 
-#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
+#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
 
 /*
   declarations for SHOW STATUS support in plugins

--- 1.36/sql/sql_plugin.cc	2006-11-01 19:41:16 +02:00
+++ 1.37/sql/sql_plugin.cc	2006-11-01 19:41:16 +02:00
@@ -502,7 +502,7 @@
     if ((*plugin_type_deinitialize[plugin->plugin->type])(plugin))
     {
       sql_print_error("Plugin '%s' of type %s failed deinitialization",
-                      plugin->name.str, plugin_type_names[plugin->plugin->type]);
+                      plugin->name.str, plugin_type_names[plugin->plugin->type].str);
     } 
   }
   else if (plugin->plugin->deinit)
@@ -562,7 +562,7 @@
     if ((*plugin_type_initialize[plugin->plugin->type])(plugin))
     {
       sql_print_error("Plugin '%s' registration as a %s failed.",
-                      plugin->name.str, plugin_type_names[plugin->plugin->type]);
+                      plugin->name.str, plugin_type_names[plugin->plugin->type].str);
       goto err;
     }
   }

--- 1.240/sql/sp_head.cc	2006-11-01 19:41:16 +02:00
+++ 1.241/sql/sp_head.cc	2006-11-01 19:41:16 +02:00
@@ -1143,6 +1143,7 @@
 	ctx->clear_handler();
 	ctx->enter_handler(hip);
         thd->clear_error();
+        thd->is_fatal_error= 0;
 	thd->killed= THD::NOT_KILLED;
 	continue;
       }
@@ -1170,8 +1171,9 @@
   state= EXECUTED;
 
  done:
-  DBUG_PRINT("info", ("err_status: %d  killed: %d  query_error: %d",
-		      err_status, thd->killed, thd->query_error));
+  DBUG_PRINT("info", ("err_status: %d  killed: %d  query_error: %d  report_error: %d",
+		      err_status, thd->killed, thd->query_error,
+                      thd->net.report_error));
 
   if (thd->killed)
     err_status= TRUE;
@@ -2375,6 +2377,7 @@
                                        bool open_tables, sp_instr* instr)
 {
   int res= 0;
+  DBUG_ENTER("reset_lex_and_exec_core");
 
   DBUG_ASSERT(!thd->derived_tables);
   DBUG_ASSERT(thd->change_list.is_empty());
@@ -2419,7 +2422,10 @@
       res= -1;
 
   if (!res)
+  {
     res= instr->exec_core(thd, nextp);
+    DBUG_PRINT("info",("exec_core returned: %d", res));
+  }
 
   m_lex->unit.cleanup();
 
@@ -2457,7 +2463,7 @@
 
     cleanup_items() is called in sp_head::execute()
   */
-  return res || thd->net.report_error;
+  DBUG_RETURN(res || thd->net.report_error);
 }
 
 

--- 1.36/server-tools/instance-manager/commands.cc	2006-11-01 19:41:16 +02:00
+++ 1.37/server-tools/instance-manager/commands.cc	2006-11-01 19:41:16 +02:00
@@ -1351,7 +1351,7 @@
 
 int Abstract_option_cmd::execute_impl(st_net *net, ulong connection_id)
 {
-  int err_code;
+  int err_code= 0;
 
   /* Check that all the specified instances exist and are offline. */
 

--- 1.25/server-tools/instance-manager/guardian.cc	2006-11-01 19:41:16 +02:00
+++ 1.26/server-tools/instance-manager/guardian.cc	2006-11-01 19:41:16 +02:00
@@ -158,7 +158,7 @@
     {
       /* clear status fields */
       log_info("guardian: instance %s is running, set state to STARTED",
-               instance->options.instance_name);
+               instance->options.instance_name.str);
       current_node->restart_counter= 0;
       current_node->crash_moment= 0;
       current_node->state= STARTED;
@@ -169,7 +169,7 @@
     switch (current_node->state) {
     case NOT_STARTED:
       log_info("guardian: starting instance %s",
-               instance->options.instance_name);
+               instance->options.instance_name.str);
 
       /* NOTE, set state to STARTING _before_ start() is called */
       current_node->state= STARTING;
@@ -194,7 +194,7 @@
         {
           instance->start();
           log_info("guardian: starting instance %s",
-                   instance->options.instance_name);
+                   instance->options.instance_name.str);
         }
       }
       else
@@ -212,13 +212,13 @@
             current_node->last_checked= current_time;
             current_node->restart_counter++;
             log_info("guardian: restarting instance %s",
-                     instance->options.instance_name);
+                     instance->options.instance_name.str);
           }
         }
         else
         {
           log_info("guardian: cannot start instance %s. Abandoning attempts "
-                   "to (re)start it", instance->options.instance_name);
+                   "to (re)start it", instance->options.instance_name.str);
           current_node->state= CRASHED_AND_ABANDONED;
         }
       }

--- 1.38/server-tools/instance-manager/instance.cc	2006-11-01 19:41:16 +02:00
+++ 1.39/server-tools/instance-manager/instance.cc	2006-11-01 19:41:16 +02:00
@@ -166,7 +166,7 @@
     exit(1);
   case -1:
     log_info("cannot create a new process to start instance %s",
-             instance_options->instance_name);
+             instance_options->instance_name.str);
     return 1;
   }
   return 0;
@@ -311,9 +311,9 @@
   int pid;
   if ((pid= options.get_pid()) != 0)          /* check the pidfile */
     if (options.unlink_pidfile())             /* remove stalled pidfile */
-      log_error("cannot remove pidfile for instance %i, this might be \
-                since IM lacks permmissions or hasn't found the pidifle",
-                options.instance_name);
+      log_error("cannot remove pidfile for instance %s, this might be "
+                "since IM lacks permmissions or hasn't found the pidfile",
+                options.instance_name.str);
 }
 
 
@@ -619,7 +619,7 @@
         log_error("The instance %s is being stopped forcibly. Normally" \
                   "it should not happen. Probably the instance has been" \
                   "hanging. You should also check your IM setup",
-                  options.instance_name);
+                  options.instance_name.str);
         /* After sucessful hard kill the pidfile need to be removed */
         options.unlink_pidfile();
       }

--- 1.37/server-tools/instance-manager/instance_options.cc	2006-11-01 19:41:16 +02:00
+++ 1.38/server-tools/instance-manager/instance_options.cc	2006-11-01 19:41:16 +02:00
@@ -182,7 +182,7 @@
 err:
   if (rc)
     log_error("fill_instance_version: Failed to get version of '%s'",
-              mysqld_path);
+              mysqld_path.str);
   return rc;
 }
 

--- 1.16/server-tools/instance-manager/mysql_connection.cc	2006-11-01 19:41:16 +02:00
+++ 1.17/server-tools/instance-manager/mysql_connection.cc	2006-11-01 19:41:16 +02:00
@@ -165,7 +165,7 @@
 
 void Mysql_connection_thread::run()
 {
-  log_info("accepted mysql connection %d", connection_id);
+  log_info("accepted mysql connection %lu", connection_id);
 
   my_thread_init();
 
@@ -175,7 +175,7 @@
     return;
   }
 
-  log_info("connection %d is checked successfully", connection_id);
+  log_info("connection %lu is checked successfully", connection_id);
 
   vio_keepalive(vio, TRUE);
 
@@ -314,7 +314,7 @@
     packet= (char*) net.read_pos;
     enum enum_server_command command= (enum enum_server_command)
                                       (uchar) *packet;
-    log_info("connection %d: packet_length=%d, command=%d",
+    log_info("connection %lu: packet_length=%lu, command=%d",
              connection_id, packet_length, command);
     return dispatch_command(command, packet + 1, packet_length - 1);
   }
@@ -325,27 +325,27 @@
 {
   switch (command) {
   case COM_QUIT:                                // client exit
-    log_info("query for connection %d received quit command", connection_id);
+    log_info("query for connection %lu received quit command", connection_id);
     return 1;
   case COM_PING:
-    log_info("query for connection %d received ping command", connection_id);
+    log_info("query for connection %lu received ping command", connection_id);
     net_send_ok(&net, connection_id, NULL);
     break;
   case COM_QUERY:
   {
-    log_info("query for connection %d : ----\n%s\n-------------------------",
+    log_info("query for connection %lu : ----\n%s\n-------------------------",
 	     connection_id,packet);
     if (Command *command= parse_command(&instance_map, packet))
     {
       int res= 0;
-      log_info("query for connection %d successfully parsed",connection_id);
+      log_info("query for connection %lu successfully parsed",connection_id);
       res= command->execute(&net, connection_id);
       delete command;
       if (!res)
-        log_info("query for connection %d executed ok",connection_id);
+        log_info("query for connection %lu executed ok",connection_id);
       else
       {
-        log_info("query for connection %d executed err=%d",connection_id,res);
+        log_info("query for connection %lu executed err=%d",connection_id,res);
         net_send_error(&net, res);
         return 0;
       }
@@ -358,7 +358,7 @@
     break;
   }
   default:
-    log_info("query for connection %d received unknown command",connection_id);
+    log_info("query for connection %lu received unknown command",connection_id);
     net_send_error(&net, ER_UNKNOWN_COM_ERROR);
     break;
   }

--- 1.15/server-tools/instance-manager/parse.cc	2006-11-01 19:41:16 +02:00
+++ 1.16/server-tools/instance-manager/parse.cc	2006-11-01 19:41:16 +02:00
@@ -273,7 +273,7 @@
 {
   uint word_len;
   LEX_STRING instance_name;
-  Command *command;
+  Command *command= 0;
   const char *saved_text= text;
 
   Token tok1= shift_token(&text, &word_len);

--- 1.17/server-tools/instance-manager/user_map.cc	2006-11-01 19:41:16 +02:00
+++ 1.18/server-tools/instance-manager/user_map.cc	2006-11-01 19:41:16 +02:00
@@ -74,11 +74,10 @@
   password_length= strlen(password);
   if (password_length > SCRAMBLED_PASSWORD_CHAR_LENGTH)
   {
-    log_info("Error: password is too long (%d). Max length: %d. ",
-              "User line: '%s'.",
-              (int) password_length,
-              (int) SCRAMBLED_PASSWORD_CHAR_LENGTH,
-              (const char *) line);
+    log_info("Error: password is too long (%d). Max length: %d. User line: '%s'.",
+             (int) password_length,
+             (int) SCRAMBLED_PASSWORD_CHAR_LENGTH,
+             line);
     return 1;
   }
 

--- 1.30/sql/partition_info.cc	2006-11-01 19:41:16 +02:00
+++ 1.31/sql/partition_info.cc	2006-11-01 19:41:16 +02:00
@@ -485,6 +485,8 @@
   DBUG_ENTER("partition_info::check_range_constants");
   DBUG_PRINT("enter", ("INT_RESULT with %d parts", no_parts));
 
+  LINT_INIT(current_largest);
+
   part_result_type= INT_RESULT;
   range_int_array= (longlong*)sql_alloc(no_parts * sizeof(longlong));
   if (unlikely(range_int_array == NULL))
@@ -877,7 +879,6 @@
 bool partition_info::set_up_charset_field_preps()
 {
   Field *field, **ptr;
-  char *field_buf;
   char **char_ptrs;
   unsigned i;
   bool found;
@@ -919,6 +920,7 @@
     {
       if (field_is_partition_charset(field))
       {
+        char *field_buf;
         CHARSET_INFO *cs= ((Field_str*)field)->charset();
         size= field->pack_length();
         if (!(field_buf= sql_calloc(size)))
@@ -956,6 +958,8 @@
       unsigned j= 0;
       Field *part_field;
       CHARSET_INFO *cs;
+      char *field_buf;
+      LINT_INIT(field_buf);
 
       if (!field_is_partition_charset(field))
         continue;

--- 1.84/sql/ha_ndbcluster_binlog.cc	2006-11-01 19:41:16 +02:00
+++ 1.85/sql/ha_ndbcluster_binlog.cc	2006-11-01 19:41:16 +02:00
@@ -3907,7 +3907,7 @@
   close_thread_tables(thd);
   pthread_mutex_lock(&injector_mutex);
   /* don't mess with the injector_ndb anymore from other threads */
-  int ndb_obj_cnt= 1; // g_ndb
+  uint ndb_obj_cnt= 1; // g_ndb
   ndb_obj_cnt+= injector_ndb == 0 ? 0 : 1;
   ndb_obj_cnt+= schema_ndb == 0 ? 0 : 1;
   ndb_obj_cnt+= ndbcluster_util_inited ? 1 : 0;
@@ -3930,7 +3930,8 @@
    *   otherwise user thread can have ongoing SUB_DATA
    */
   int sleep_cnt= 0;
-  while (sleep_cnt < 300 && g_ndb_cluster_connection->get_active_ndb_objects() > ndb_obj_cnt)
+  while (sleep_cnt < 300 &&
+         g_ndb_cluster_connection->get_active_ndb_objects() > ndb_obj_cnt)
   {
     my_sleep(10000); // 10ms
     sleep_cnt++;
Thread
bk commit into 5.1 tree (monty:1.2321) BUG#22150monty1 Nov