MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:September 29 2009 1:08pm
Subject:bzr commit into mysql-5.1-bugteam branch (azundris:3125)
View as plain text  
#At file:///Users/tnurnberg/forest/43746f/51-43746f/ based on revid:azundris@stripped24110-a4g7n4rz67tsdzim

 3125 Tatiana A. Nurnberg	2009-09-29 [merge]
      auto-merge

    added:
      mysql-test/include/have_mysql_upgrade.inc
      mysql-test/include/have_not_innodb_plugin.inc
      mysql-test/lib/v1/incompatible.tests
      mysql-test/r/bug46760.result
      mysql-test/r/not_true.require
      mysql-test/r/partition_innodb_builtin.result
      mysql-test/r/partition_innodb_plugin.result
      mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
      mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result
      mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
      mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test
      mysql-test/t/bug46760-master.opt
      mysql-test/t/bug46760.test
      mysql-test/t/partition_innodb_builtin.test
      mysql-test/t/partition_innodb_plugin.test
      mysql-test/t/status-master.opt
    modified:
      CMakeLists.txt
      client/mysql.cc
      client/mysql_upgrade.c
      client/mysqlcheck.c
      client/mysqlslap.c
      client/mysqltest.cc
      cmd-line-utils/readline/display.c
      cmd-line-utils/readline/util.c
      configure.in
      extra/yassl/include/yassl_int.hpp
      extra/yassl/src/yassl_int.cpp
      include/my_dbug.h
      include/my_global.h
      libmysqld/libmysqld.c
      mysql-test/Makefile.am
      mysql-test/collections/README.experimental
      mysql-test/collections/default.experimental
      mysql-test/extra/binlog_tests/drop_temp_table.test
      mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
      mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test
      mysql-test/include/mtr_warnings.sql
      mysql-test/lib/My/ConfigFactory.pm
      mysql-test/lib/My/Platform.pm
      mysql-test/lib/My/SafeProcess/Makefile.am
      mysql-test/lib/My/SafeProcess/safe_process_win.cc
      mysql-test/lib/mtr_cases.pm
      mysql-test/lib/mtr_report.pm
      mysql-test/lib/v1/mtr_cases.pl
      mysql-test/mysql-stress-test.pl
      mysql-test/mysql-test-run.pl
      mysql-test/r/almost_full.result
      mysql-test/r/alter_table.result
      mysql-test/r/bug46080.result
      mysql-test/r/delete.result
      mysql-test/r/innodb-autoinc.result
      mysql-test/r/insert_select.result
      mysql-test/r/join.result
      mysql-test/r/lowercase_table3.result
      mysql-test/r/myisam.result
      mysql-test/r/mysqltest.result
      mysql-test/r/partition_csv.result
      mysql-test/r/subselect4.result
      mysql-test/r/trigger_notembedded.result
      mysql-test/r/upgrade.result
      mysql-test/r/windows.result
      mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
      mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
      mysql-test/suite/innodb/r/innodb_file_format.result
      mysql-test/suite/innodb/t/innodb_file_format.test
      mysql-test/suite/parts/r/partition_recover_myisam.result
      mysql-test/suite/parts/t/partition_recover_myisam.test
      mysql-test/suite/rpl/r/rpl_bug33931.result
      mysql-test/suite/rpl/r/rpl_do_grant.result
      mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
      mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
      mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
      mysql-test/suite/rpl/r/rpl_idempotency.result
      mysql-test/suite/rpl/r/rpl_init_slave_errors.result
      mysql-test/suite/rpl/r/rpl_log_pos.result
      mysql-test/suite/rpl/r/rpl_packet.result
      mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
      mysql-test/suite/rpl/t/disabled.def
      mysql-test/suite/rpl/t/rpl_bug33931.test
      mysql-test/suite/rpl/t/rpl_do_grant.test
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
      mysql-test/suite/rpl/t/rpl_idempotency.test
      mysql-test/suite/rpl/t/rpl_init_slave_errors.test
      mysql-test/suite/rpl/t/rpl_log_pos.test
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
      mysql-test/t/almost_full.test
      mysql-test/t/alter_table.test
      mysql-test/t/bug46080.test
      mysql-test/t/delete.test
      mysql-test/t/disabled.def
      mysql-test/t/events_logs_tests-master.opt
      mysql-test/t/innodb-autoinc.test
      mysql-test/t/insert_select.test
      mysql-test/t/join.test
      mysql-test/t/log_tables-master.opt
      mysql-test/t/lowercase_table3.test
      mysql-test/t/myisam-system.test
      mysql-test/t/myisam.test
      mysql-test/t/mysqltest.test
      mysql-test/t/not_partition.test
      mysql-test/t/partition_csv.test
      mysql-test/t/ps-master.opt
      mysql-test/t/show_check-master.opt
      mysql-test/t/subselect4.test
      mysql-test/t/upgrade.test
      mysql-test/t/windows.test
      mysql-test/valgrind.supp
      mysys/hash.c
      mysys/mf_keycache.c
      mysys/my_largepage.c
      mysys/my_thr_init.c
      scripts/make_win_bin_dist
      sql-common/my_time.c
      sql/event_db_repository.cc
      sql/field.cc
      sql/field.h
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.cc
      sql/ha_partition.cc
      sql/ha_partition.h
      sql/handler.cc
      sql/handler.h
      sql/item.cc
      sql/item_func.cc
      sql/item_timefunc.cc
      sql/item_xmlfunc.cc
      sql/log_event.cc
      sql/log_event_old.cc
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/partition_info.cc
      sql/repl_failsafe.cc
      sql/rpl_rli.cc
      sql/set_var.cc
      sql/set_var.h
      sql/share/errmsg.txt
      sql/slave.cc
      sql/sql_cache.cc
      sql/sql_class.h
      sql/sql_connect.cc
      sql/sql_db.cc
      sql/sql_delete.cc
      sql/sql_handler.cc
      sql/sql_partition.cc
      sql/sql_plugin.cc
      sql/sql_repl.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sql_table.cc
      sql/strfunc.cc
      sql/udf_example.c
      storage/archive/ha_archive.cc
      storage/csv/ha_tina.cc
      storage/heap/hp_write.c
      storage/innobase/handler/ha_innodb.cc
      storage/innodb_plugin/handler/i_s.cc
      storage/innodb_plugin/include/univ.i
      storage/myisam/mi_check.c
      storage/myisam/mi_search.c
      storage/myisam/mi_write.c
      storage/myisammrg/myrg_open.c
      storage/ndb/test/run-test/Makefile.am
      support-files/binary-configure.sh
      support-files/mysql.spec.sh
      unittest/mysys/base64-t.c
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt	2009-08-11 15:47:33 +0000
+++ b/CMakeLists.txt	2009-08-14 15:18:52 +0000
@@ -137,6 +137,7 @@ ENDIF(MSVC)
 
 IF(WIN32)
   ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
+  ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501")
 ENDIF(WIN32)
 
 # default to x86 platform.  We'll check for X64 in a bit

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-08-28 16:21:54 +0000
+++ b/client/mysql.cc	2009-09-23 13:21:29 +0000
@@ -3561,7 +3561,7 @@ static void print_warnings()
     messages.  To be safe, skip printing the duplicate only if it is the only
     warning.
   */
-  if (!cur || num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10))
+  if (!cur || (num_rows == 1 && error == (uint) strtoul(cur[1], NULL, 10)))
     goto end;
 
   /* Print the warnings */

=== modified file 'client/mysql_upgrade.c'
--- a/client/mysql_upgrade.c	2009-08-28 16:21:54 +0000
+++ b/client/mysql_upgrade.c	2009-09-28 06:24:19 +0000
@@ -54,6 +54,8 @@ static char **defaults_argv;
 
 static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
 
+static my_bool opt_write_binlog;
+
 #include <help_start.h>
 
 static struct my_option my_long_options[]=
@@ -124,6 +126,11 @@ static struct my_option my_long_options[
   {"verbose", 'v', "Display more output about the process",
    (uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
    GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+  {"write-binlog", OPT_WRITE_BINLOG,
+   "All commands including mysqlcheck are binlogged. Enabled by default;"
+   "use --skip-write-binlog when commands should not be sent to replication slaves.",
+   (uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
+   1, 0, 0, 0, 0, 0},
   {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 
@@ -448,6 +455,8 @@ static int run_query(const char *query, 
   int ret;
   File fd;
   char query_file_path[FN_REFLEN];
+  const uchar sql_log_bin[]= "SET SQL_LOG_BIN=0;";
+
   DBUG_ENTER("run_query");
   DBUG_PRINT("enter", ("query: %s", query));
   if ((fd= create_temp_file(query_file_path, opt_tmpdir,
@@ -455,6 +464,22 @@ static int run_query(const char *query, 
                             MYF(MY_WME))) < 0)
     die("Failed to create temporary file for defaults");
 
+  /*
+    Master and slave should be upgraded separately. All statements executed
+    by mysql_upgrade will not be binlogged.
+    'SET SQL_LOG_BIN=0' is executed before any other statements.
+   */
+  if (!opt_write_binlog)
+  {
+    if (my_write(fd, sql_log_bin, sizeof(sql_log_bin)-1,
+                 MYF(MY_FNABP | MY_WME)))
+    {
+      my_close(fd, MYF(0));
+      my_delete(query_file_path, MYF(0));
+      die("Failed to write to '%s'", query_file_path);
+    }
+  }
+
   if (my_write(fd, (uchar*) query, strlen(query),
                MYF(MY_FNABP | MY_WME)))
   {
@@ -648,6 +673,7 @@ static int run_mysqlcheck_upgrade(void)
                   "--check-upgrade",
                   "--all-databases",
                   "--auto-repair",
+                  opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
                   NULL);
 }
 
@@ -662,6 +688,7 @@ static int run_mysqlcheck_fixnames(void)
                   "--all-databases",
                   "--fix-db-names",
                   "--fix-table-names",
+                  opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
                   NULL);
 }
 

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2009-07-14 17:08:38 +0000
+++ b/client/mysqlcheck.c	2009-09-28 06:24:19 +0000
@@ -652,6 +652,17 @@ static int use_db(char *database)
   return 0;
 } /* use_db */
 
+static int disable_binlog()
+{
+  const char *stmt= "SET SQL_LOG_BIN=0";
+  if (mysql_query(sock, stmt))
+  {
+    fprintf(stderr, "Failed to %s\n", stmt);
+    fprintf(stderr, "Error: %s\n", mysql_error(sock));
+    return 1;
+  }
+  return 0;
+}
 
 static int handle_request_for_tables(char *tables, uint length)
 {
@@ -844,6 +855,14 @@ int main(int argc, char **argv)
   if (dbConnect(current_host, current_user, opt_password))
     exit(EX_MYSQLERR);
 
+  if (!opt_write_binlog)
+  {
+    if (disable_binlog()) {
+      first_error= 1;
+      goto end;
+    }
+  }
+
   if (opt_auto_repair &&
       my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
   {

=== modified file 'client/mysqlslap.c'
--- a/client/mysqlslap.c	2009-07-14 17:08:38 +0000
+++ b/client/mysqlslap.c	2009-09-23 13:21:29 +0000
@@ -423,6 +423,7 @@ void concurrency_loop(MYSQL *mysql, uint
   stats *sptr;
   conclusions conclusion;
   unsigned long long client_limit;
+  int sysret;
 
   head_sptr= (stats *)my_malloc(sizeof(stats) * iterations, 
                                 MYF(MY_ZEROFILL|MY_FAE|MY_WME));
@@ -463,7 +464,9 @@ void concurrency_loop(MYSQL *mysql, uint
       run_query(mysql, "SET AUTOCOMMIT=0", strlen("SET AUTOCOMMIT=0"));
 
     if (pre_system)
-      system(pre_system);
+      if ((sysret= system(pre_system)) != 0)
+        fprintf(stderr, "Warning: Execution of pre_system option returned %d.\n", 
+                sysret);
 
     /* 
       Pre statements are always run after all other logic so they can 
@@ -478,7 +481,9 @@ void concurrency_loop(MYSQL *mysql, uint
       run_statements(mysql, post_statements);
 
     if (post_system)
-      system(post_system);
+      if ((sysret= system(post_system)) != 0)
+        fprintf(stderr, "Warning: Execution of post_system option returned %d.\n", 
+                sysret);
 
     /* We are finished with this run */
     if (auto_generate_sql_autoincrement || auto_generate_sql_guid_primary)

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2009-09-10 07:40:57 +0000
+++ b/client/mysqltest.cc	2009-09-23 08:31:18 +0000
@@ -417,6 +417,7 @@ static struct st_expected_errors saved_e
 struct st_command
 {
   char *query, *query_buf,*first_argument,*last_argument,*end;
+  DYNAMIC_STRING content;
   int first_word_len, query_len;
   my_bool abort_on_error;
   struct st_expected_errors expected_errors;
@@ -1140,6 +1141,8 @@ void free_used_memory()
   {
     struct st_command **q= dynamic_element(&q_lines, i, struct st_command**);
     my_free((*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR));
+    if ((*q)->content.str)
+      dynstr_free(&(*q)->content);
     my_free((*q),MYF(0));
   }
   for (i= 0; i < 10; i++)
@@ -1532,7 +1535,7 @@ void show_diff(DYNAMIC_STRING* ds,
   else
     diff_name = 0;
 #else
-  diff_name = "diff";		// Otherwise always assume it's called diff
+  diff_name = "diff";           /* Otherwise always assume it's called diff */
 #endif
 
   if (diff_name)
@@ -3290,21 +3293,30 @@ void do_write_file_command(struct st_com
                      sizeof(write_file_args)/sizeof(struct command_arg),
                      ' ');
 
-  /* If no delimiter was provided, use EOF */
-  if (ds_delimiter.length == 0)
-    dynstr_set(&ds_delimiter, "EOF");
-
   if (!append && access(ds_filename.str, F_OK) == 0)
   {
     /* The file should not be overwritten */
     die("File already exist: '%s'", ds_filename.str);
   }
 
-  init_dynamic_string(&ds_content, "", 1024, 1024);
-  read_until_delimiter(&ds_content, &ds_delimiter);
-  DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str));
-  str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
-  dynstr_free(&ds_content);
+  ds_content= command->content;
+  /* If it hasn't been done already by a loop iteration, fill it in */
+  if (! ds_content.str)
+  {
+    /* If no delimiter was provided, use EOF */
+    if (ds_delimiter.length == 0)
+      dynstr_set(&ds_delimiter, "EOF");
+
+    init_dynamic_string(&ds_content, "", 1024, 1024);
+    read_until_delimiter(&ds_content, &ds_delimiter);
+    command->content= ds_content;
+  }
+  /* This function could be called even if "false", so check before printing */
+  if (cur_block->ok)
+  {
+    DBUG_PRINT("info", ("Writing to file: %s", ds_filename.str));
+    str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
+  }
   dynstr_free(&ds_filename);
   dynstr_free(&ds_delimiter);
   DBUG_VOID_RETURN;
@@ -3447,12 +3459,17 @@ void do_diff_files(struct st_command *co
     die("command \"diff_files\" failed, file '%s' does not exist",
         ds_filename2.str);
 
-  if ((error= compare_files(ds_filename.str, ds_filename2.str)))
+  if ((error= compare_files(ds_filename.str, ds_filename2.str)) &&
+      match_expected_error(command, error, NULL) < 0)
   {
     /* Compare of the two files failed, append them to output
-       so the failure can be analyzed
+       so the failure can be analyzed, but only if it was not
+       expected to fail.
     */
     show_diff(&ds_res, ds_filename.str, ds_filename2.str);
+    log_file.write(&ds_res);
+    log_file.flush();
+    dynstr_set(&ds_res, 0);
   }
 
   dynstr_free(&ds_filename);
@@ -7165,6 +7182,10 @@ void run_query(struct st_connection *cn,
     run_query_normal(cn, command, flags, query, query_len,
 		     ds, &ds_warnings);
 
+  dynstr_free(&ds_warnings);
+  if (command->type == Q_EVAL)
+    dynstr_free(&eval_query);
+
   if (display_result_sorted)
   {
     /* Sort the result set and append it to result */
@@ -7195,11 +7216,8 @@ void run_query(struct st_connection *cn,
     check_require(ds, command->require_file);
   }
 
-  dynstr_free(&ds_warnings);
   if (ds == &ds_result)
     dynstr_free(&ds_result);
-  if (command->type == Q_EVAL)
-    dynstr_free(&eval_query);
   DBUG_VOID_RETURN;
 }
 
@@ -7684,7 +7702,31 @@ int main(int argc, char **argv)
       command->type= Q_COMMENT;
     }
 
-    if (cur_block->ok)
+    my_bool ok_to_do= cur_block->ok;
+    /*
+      Some commands need to be "done" the first time if they may get
+      re-iterated over in a true context. This can only happen if there's 
+      a while loop at some level above the current block.
+    */
+    if (!ok_to_do)
+    {
+      if (command->type == Q_SOURCE ||
+          command->type == Q_WRITE_FILE ||
+          command->type == Q_APPEND_FILE ||
+	  command->type == Q_PERL)
+      {
+	for (struct st_block *stb= cur_block-1; stb >= block_stack; stb--)
+	{
+	  if (stb->cmd == cmd_while)
+	  {
+	    ok_to_do= 1;
+	    break;
+	  }
+	}
+      }
+    }
+
+    if (ok_to_do)
     {
       command->last_argument= command->first_argument;
       processed = 1;
@@ -7993,6 +8035,8 @@ int main(int argc, char **argv)
   if (parsing_disabled)
     die("Test ended with parsing disabled");
 
+  my_bool empty_result= FALSE;
+  
   /*
     The whole test has been executed _sucessfully_.
     Time to compare result or save it to record file.
@@ -8033,11 +8077,20 @@ int main(int argc, char **argv)
   }
   else
   {
-    die("The test didn't produce any output");
+    /* Empty output is an error *unless* we also have an empty result file */
+    if (! result_file_name || record ||
+        compare_files (log_file.file_name(), result_file_name))
+    {
+      die("The test didn't produce any output");
+    }
+    else 
+    {
+      empty_result= TRUE;  /* Meaning empty was expected */
+    }
   }
 
-  if (!command_executed && result_file_name)
-    die("No queries executed but result file found!");
+  if (!command_executed && result_file_name && !empty_result)
+    die("No queries executed but non-empty result file found!");
 
   verbose_msg("Test has succeeded!");
   timer_output();

=== modified file 'cmd-line-utils/readline/display.c'
--- a/cmd-line-utils/readline/display.c	2009-06-29 14:00:47 +0000
+++ b/cmd-line-utils/readline/display.c	2009-09-23 13:21:29 +0000
@@ -465,10 +465,10 @@ rl_redisplay ()
   int newlines, lpos, temp, modmark;
   const char *prompt_this_line;
 #if defined (HANDLE_MULTIBYTE)
-  int num, n0;
+  int num, n0= 0;
   wchar_t wc;
   size_t wc_bytes;
-  int wc_width;
+  int wc_width= 0;
   mbstate_t ps;
   int _rl_wrapped_multicolumn = 0;
 #endif
@@ -828,7 +828,7 @@ rl_redisplay ()
 		  cpos_buffer_position = out;
 		  lb_linenum = newlines;
 		}
-	      for (i = in; i < in+wc_bytes; i++)
+	      for (i = in; i < in+(int)wc_bytes; i++)
 		line[out++] = rl_line_buffer[i];
 	      for (i = 0; i < wc_width; i++)
 		CHECK_LPOS();

=== modified file 'cmd-line-utils/readline/util.c'
--- a/cmd-line-utils/readline/util.c	2009-06-29 13:17:01 +0000
+++ b/cmd-line-utils/readline/util.c	2009-08-14 15:18:52 +0000
@@ -81,8 +81,13 @@ rl_alphabetic (c)
 
 #if defined (HANDLE_MULTIBYTE)
 int
-_rl_walphabetic (wc)
-     wchar_t wc;
+/*
+  Portability issue with VisualAge C++ Professional / C for AIX Compiler, Version 6:
+    "util.c", line 84.1: 1506-343 (S) Redeclaration of _rl_walphabetic differs
+    from previous declaration on line 110 of "rlmbutil.h".
+  So, put type in the function signature here.
+*/
+_rl_walphabetic (wchar_t wc)
 {
   int c;
 

=== modified file 'configure.in'
--- a/configure.in	2009-08-31 14:09:09 +0000
+++ b/configure.in	2009-09-18 13:36:54 +0000
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
 #
 # When changing major version number please also check switch statement
 # in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.39)
+AM_INIT_AUTOMAKE(mysql, 5.1.40)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 PROTOCOL_VERSION=10

=== modified file 'extra/yassl/include/yassl_int.hpp'
--- a/extra/yassl/include/yassl_int.hpp	2008-11-18 16:45:44 +0000
+++ b/extra/yassl/include/yassl_int.hpp	2009-09-23 13:21:29 +0000
@@ -441,7 +441,7 @@ public:
     const Ciphers&    GetCiphers()  const;
     const DH_Parms&   GetDH_Parms() const;
     const Stats&      GetStats()    const;
-    const VerifyCallback getVerifyCallback() const;
+    VerifyCallback    getVerifyCallback() const;
     pem_password_cb   GetPasswordCb() const;
           void*       GetUserData()   const;
           bool        GetSessionCacheOff() const;

=== modified file 'extra/yassl/src/yassl_int.cpp'
--- a/extra/yassl/src/yassl_int.cpp	2009-02-13 16:41:47 +0000
+++ b/extra/yassl/src/yassl_int.cpp	2009-09-23 13:21:29 +0000
@@ -1833,7 +1833,7 @@ SSL_CTX::GetCA_List() const
 }
 
 
-const VerifyCallback SSL_CTX::getVerifyCallback() const
+VerifyCallback SSL_CTX::getVerifyCallback() const
 {
     return verifyCallback_;
 }

=== modified file 'include/my_dbug.h'
--- a/include/my_dbug.h	2009-09-10 12:18:54 +0000
+++ b/include/my_dbug.h	2009-09-23 13:21:29 +0000
@@ -137,13 +137,13 @@ extern FILE *_db_fp_(void);
 #define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
 #define DBUG_PRINT(keyword,arglist) do { } while(0)
 #define DBUG_PUSH(a1)
-#define DBUG_SET(a1)
-#define DBUG_SET_INITIAL(a1)
+#define DBUG_SET(a1)                do { } while(0)
+#define DBUG_SET_INITIAL(a1)        do { } while(0)
 #define DBUG_POP()
 #define DBUG_PROCESS(a1)
 #define DBUG_SETJMP(a1) setjmp(a1)
 #define DBUG_LONGJMP(a1) longjmp(a1)
-#define DBUG_DUMP(keyword,a1,a2)
+#define DBUG_DUMP(keyword,a1,a2)    do { } while(0)
 #define DBUG_END()
 #define DBUG_ASSERT(A)              do { } while(0)
 #define DBUG_LOCK_FILE

=== modified file 'include/my_global.h'
--- a/include/my_global.h	2009-08-28 16:21:54 +0000
+++ b/include/my_global.h	2009-09-17 15:25:52 +0000
@@ -558,12 +558,6 @@ int	__void__;
 #define LINT_INIT(var)
 #endif
 
-#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify)
-#define PURIFY_OR_LINT_INIT(var) var=0
-#else
-#define PURIFY_OR_LINT_INIT(var)
-#endif
-
 /* 
    Suppress uninitialized variable warning without generating code.
 

=== modified file 'libmysqld/libmysqld.c'
--- a/libmysqld/libmysqld.c	2008-02-28 17:55:46 +0000
+++ b/libmysqld/libmysqld.c	2009-09-25 11:39:05 +0000
@@ -164,6 +164,7 @@ mysql_real_connect(MYSQL *mysql,const ch
   port=0;
   unix_socket=0;
 
+  client_flag|=mysql->options.client_flag;
   /* Send client information for access check */
   client_flag|=CLIENT_CAPABILITIES;
   if (client_flag & CLIENT_MULTI_STATEMENTS)

=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2009-07-14 10:06:04 +0000
+++ b/mysql-test/Makefile.am	2009-08-21 11:58:33 +0000
@@ -17,7 +17,8 @@
 
 ## Process this file with automake to create Makefile.in
 
-testdir =	$(prefix)/mysql-test
+testroot =	$(prefix)
+testdir =	$(testroot)/mysql-test
 
 test_SCRIPTS =	mtr \
 		mysql-test-run \

=== modified file 'mysql-test/collections/README.experimental'
--- a/mysql-test/collections/README.experimental	2009-02-25 14:00:17 +0000
+++ b/mysql-test/collections/README.experimental	2009-08-13 13:29:19 +0000
@@ -23,3 +23,10 @@ The syntax is as follows:
    start with the same characters up to the last letter before the asterisk
    are considered experimental:
         main.a*  # get rid of main.alias, main.alibaba and main.agliolio
+
+6) Optionally, the test case may be followed by one or more platform
+   qualifiers beginning with @ or @!. The test will then be considered
+   experimental only/except on that platform. Basic OS names as
+   reported by $^O in Perl, or 'windows' are supported, this includes
+   solaris, linux, windows, aix, darwin, ...  Example:
+        main.alias  @aix @windows    # Fails on those

=== modified file 'mysql-test/collections/default.experimental'
--- a/mysql-test/collections/default.experimental	2009-08-13 20:45:01 +0000
+++ b/mysql-test/collections/default.experimental	2009-09-02 21:29:11 +0000
@@ -1,6 +1,8 @@
 funcs_1.charset_collation_1              # depends on compile-time decisions
-binlog.binlog_tmp_table                  # Bug#45578: Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
-main.ctype_gbk_binlog                    # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
-rpl.rpl_row_create_table                 # Bug#45576: rpl_row_create_table fails on PB2
+main.plugin_load  @solaris               # Bug#42144
+binlog.binlog_tmp_table*                 # Bug#45578: Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
+main.ctype_gbk_binlog  @solaris          # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
+rpl.rpl_row_create_table*                # Bug#45576: rpl_row_create_table fails on PB2
 rpl_ndb.rpl_ndb_log                      # Bug#38998
-rpl.rpl_innodb_bug28430                  # Bug#46029
+rpl.rpl_innodb_bug28430*  @solaris       # Bug#46029
+rpl.rpl_get_master_version_and_clock*    # Bug#46931 2009-08-26 alik rpl.rpl_get_master_version_and_clock fails on hpux11.31

=== modified file 'mysql-test/extra/binlog_tests/drop_temp_table.test'
--- a/mysql-test/extra/binlog_tests/drop_temp_table.test	2007-06-15 16:56:11 +0000
+++ b/mysql-test/extra/binlog_tests/drop_temp_table.test	2009-09-28 02:23:06 +0000
@@ -1,27 +1,62 @@
 
 --disable_warnings
-drop database if exists `drop-temp+table-test`;
+DROP DATABASE IF EXISTS `drop-temp+table-test`;
 --enable_warnings
 
 connect (con1,localhost,root,,);
 connect (con2,localhost,root,,);
 connection con1;
-reset master;
-create database `drop-temp+table-test`;
-use `drop-temp+table-test`;
-create temporary table shortn1 (a int);
-create temporary table `table:name` (a int);
-create temporary table shortn2 (a int);
-select get_lock("a",10);
+RESET MASTER;
+CREATE DATABASE `drop-temp+table-test`;
+USE `drop-temp+table-test`;
+CREATE TEMPORARY TABLE shortn1 (a INT);
+CREATE TEMPORARY TABLE `table:name` (a INT);
+CREATE TEMPORARY TABLE shortn2 (a INT);
+
+##############################################################################
+# BUG#46572 DROP TEMPORARY table IF EXISTS does not have a consistent behavior
+# in ROW mode 
+# 
+# In RBR, 'DROP TEMPORARY TABLE ...' statement should never be binlogged no
+# matter if the tables exist or not. In contrast, both in SBR and MBR, the
+# statement should be always binlogged no matter if the tables exist or not.
+##############################################################################
+CREATE TEMPORARY TABLE tmp(c1 int);
+CREATE TEMPORARY TABLE tmp1(c1 int);
+CREATE TEMPORARY TABLE tmp2(c1 int);
+CREATE TEMPORARY TABLE tmp3(c1 int);
+CREATE TABLE t(c1 int);
+
+DROP TEMPORARY TABLE IF EXISTS tmp;
+
+--disable_warnings
+# Before fixing BUG#46572, 'DROP TEMPORARY TABLE IF EXISTS...' statement was
+# binlogged when the table did not exist in RBR.
+DROP TEMPORARY TABLE IF EXISTS tmp;
+
+# In RBR, 'DROP TEMPORARY TABLE ...' statement is never binlogged no matter if
+# the tables exist or not.
+DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
+DROP TEMPORARY TABLE tmp3;
+
+#In RBR, tmp2 will NOT be binlogged, because it is a temporary table.
+DROP TABLE IF EXISTS tmp2, t;
+
+#In RBR, tmp2 will be binlogged, because it does not exist and master do not know
+# whether it is a temporary table or not.
+DROP TABLE IF EXISTS tmp2, t;
+--enable_warnings
+
+SELECT GET_LOCK("a",10);

 disconnect con1;
 
 connection con2;
 # We want to SHOW BINLOG EVENTS, to know what was logged. But there is no
 # guarantee that logging of the terminated con1 has been done yet.
 # To be sure that logging has been done, we use a user lock.
-select get_lock("a",10);
-let $VERSION=`select version()`;
+SELECT GET_LOCK("a",10);
+let $VERSION=`SELECT VERSION()`;
 source include/show_binlog_events.inc;
-drop database `drop-temp+table-test`;
+DROP DATABASE `drop-temp+table-test`;
 
 # End of 4.1 tests

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2008-07-10 16:09:39 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2009-08-28 14:13:27 +0000
@@ -22,6 +22,8 @@ DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,
 #          should stop the slave.               #
 #################################################
 
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
+
 --echo **** Diff Table Def Start ****
 
 ##############################################

=== modified file 'mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test'
--- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2009-07-16 06:56:43 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test	2009-09-27 09:00:29 +0000
@@ -41,7 +41,17 @@ eval SELECT RELEASE_LOCK($debug_lock);
 connection slave;
 source include/wait_for_slave_io_error.inc;
 let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
-echo Slave_IO_Errno= $last_io_errno;
+--echo Check network error happened here
+if (`SELECT '$last_io_errno' = '2013' || # CR_SERVER_LOST
+            '$last_io_errno' = '2003' || # CR_CONN_HOST_ERROR
+            '$last_io_errno' = '2002' || # CR_CONNECTION_ERROR
+            '$last_io_errno' = '2006' || # CR_SERVER_GONE_ERROR
+            '$last_io_errno' = '1040' || # ER_CON_COUNT_ERROR
+            '$last_io_errno' = '1053'    # ER_SERVER_SHUTDOWN
+            `)
+{
+  --echo NETWORK ERROR
+}
 
 # Write file to make mysql-test-run.pl start up the server again
 --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

=== added file 'mysql-test/include/have_mysql_upgrade.inc'
--- a/mysql-test/include/have_mysql_upgrade.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_mysql_upgrade.inc	2009-09-28 06:24:19 +0000
@@ -0,0 +1,4 @@
+--require r/have_mysql_upgrade.result
+--disable_query_log
+select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
+--enable_query_log

=== added file 'mysql-test/include/have_not_innodb_plugin.inc'
--- a/mysql-test/include/have_not_innodb_plugin.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/have_not_innodb_plugin.inc	2009-09-25 09:26:49 +0000
@@ -0,0 +1,4 @@
+disable_query_log;
+--require r/not_true.require
+select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
+enable_query_log;

=== modified file 'mysql-test/include/mtr_warnings.sql'
--- a/mysql-test/include/mtr_warnings.sql	2009-07-10 11:35:53 +0000
+++ b/mysql-test/include/mtr_warnings.sql	2009-09-24 13:19:06 +0000
@@ -132,7 +132,7 @@ INSERT INTO global_suppressions VALUES
 
  ("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
 
- ("Statement is not safe to log in statement format"),
+ ("Statement may not be safe to log in statement format"),
 
  /* test case for Bug#bug29807 copies a stray frm into database */
  ("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
@@ -162,6 +162,8 @@ INSERT INTO global_suppressions VALUES
  ("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
  ("Slave: Can't DROP 'c7'.* 1091"),
  ("Slave: Key column 'c6'.* 1072"),
+ ("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
+ (".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
 
  /* Test case for Bug#31590 in order_by.test produces the following error */
  ("Out of sort memory; increase server sort buffer size"),
@@ -171,6 +173,7 @@ INSERT INTO global_suppressions VALUES
       this error message.
   */
  ("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
+ ("Slave: Unknown table 't1' Error_code: 1051"),
 
  ("THE_LAST_SUPPRESSION")||
 

=== modified file 'mysql-test/lib/My/ConfigFactory.pm'
--- a/mysql-test/lib/My/ConfigFactory.pm	2009-03-02 12:48:35 +0000
+++ b/mysql-test/lib/My/ConfigFactory.pm	2009-06-22 14:27:05 +0000
@@ -204,8 +204,10 @@ my @mysqld_rules=
  { 'port' => \&fix_port },
  { 'socket' => \&fix_socket },
  { '#log-error' => \&fix_log_error },
- { 'log' => \&fix_log },
- { 'log-slow-queries' => \&fix_log_slow_queries },
+ { 'general_log' => 1 },
+ { 'general_log_file' => \&fix_log },
+ { 'slow_query_log' => 1 },
+ { 'slow_query_log_file' => \&fix_log_slow_queries },
  { '#user' => sub { return shift->{ARGS}->{user} || ""; } },
  { '#password' => sub { return shift->{ARGS}->{password} || ""; } },
  { 'server-id' => \&fix_server_id, },

=== modified file 'mysql-test/lib/My/Platform.pm'
--- a/mysql-test/lib/My/Platform.pm	2009-02-25 09:32:13 +0000
+++ b/mysql-test/lib/My/Platform.pm	2009-08-06 07:30:53 +0000
@@ -106,10 +106,13 @@ sub check_socket_path_length {
   my ($path)= @_;
 
   return 0 if IS_WINDOWS;
+  # This may not be true, but we can't test for it on AIX due to Perl bug
+  # See Bug #45771
+  return 0 if ($^O eq 'aix');
 
   require IO::Socket::UNIX;
 
-  my $truncated= 1; # Be negative
+  my $truncated= undef;
 
   # Create a tempfile name with same length as "path"
   my $tmpdir = tempdir( CLEANUP => 0);
@@ -122,6 +125,7 @@ sub check_socket_path_length {
        Local => $testfile,
        Listen => 1,
       );
+    $truncated= 1; # Be negatvie
 
     die "Could not create UNIX domain socket: $!"
       unless defined $sock;
@@ -133,6 +137,9 @@ sub check_socket_path_length {
 
   };
 
+  die "Unexpected failure when checking socket path length: $@"
+    if $@ and not defined $truncated;
+
   $sock= undef;  # Close socket
   rmtree($tmpdir); # Remove the tempdir and any socket file created
   return $truncated;

=== modified file 'mysql-test/lib/My/SafeProcess/Makefile.am'
--- a/mysql-test/lib/My/SafeProcess/Makefile.am	2008-03-13 16:07:11 +0000
+++ b/mysql-test/lib/My/SafeProcess/Makefile.am	2009-08-21 11:58:33 +0000
@@ -13,7 +13,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-safedir = $(prefix)/mysql-test/lib/My/SafeProcess
+testroot = $(prefix)
+safedir = $(testroot)/mysql-test/lib/My/SafeProcess
 #nobase_bin_PROGRAMS = ...
 safe_PROGRAMS =		my_safe_process
 

=== modified file 'mysql-test/lib/My/SafeProcess/safe_process_win.cc'
--- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc	2009-05-14 19:56:53 +0000
+++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc	2009-07-23 17:01:24 +0000
@@ -163,6 +163,7 @@ int main(int argc, const char** argv )
   HANDLE job_handle;
   HANDLE wait_handles[NUM_HANDLES]= {0};
   PROCESS_INFORMATION process_info= {0};
+  BOOL nocore= FALSE;
 
   sprintf(safe_process_name, "safe_process[%d]", pid);
 
@@ -188,22 +189,33 @@ int main(int argc, const char** argv )
         die("No real args -> nothing to do");
       /* Copy the remaining args to child_arg */
       for (int j= i+1; j < argc; j++) {
-        to+= _snprintf(to, child_args + sizeof(child_args) - to, "%s ", argv[j]);
+	if (strchr (argv[j], ' ')) {
+	  /* Protect with "" if this arg contains a space */
+	  to+= _snprintf(to, child_args + sizeof(child_args) - to,
+                         "\"%s\" ", argv[j]);
+	} else {
+	  to+= _snprintf(to, child_args + sizeof(child_args) - to,
+	                 "%s ", argv[j]);
+	}
       }
       break;
     } else {
-      if ( strcmp(arg, "--verbose") == 0 )
+      if (strcmp(arg, "--verbose") == 0)
         verbose++;
-	  else if ( strncmp(arg, "--parent-pid", 10) == 0 )
-	  {
-	    /* Override parent_pid with a value provided by user */
-		const char* start;
+      else if (strncmp(arg, "--parent-pid", 10) == 0)
+      {
+            /* Override parent_pid with a value provided by user */
+        const char* start;
         if ((start= strstr(arg, "=")) == NULL)
-		  die("Could not find start of option value in '%s'", arg);
-		start++; /* Step past = */
-		if ((parent_pid= atoi(start)) == 0)
-		  die("Invalid value '%s' passed to --parent-id", start);
-	  }
+          die("Could not find start of option value in '%s'", arg);
+        start++; /* Step past = */
+        if ((parent_pid= atoi(start)) == 0)
+          die("Invalid value '%s' passed to --parent-id", start);
+      }
+      else if (strcmp(arg, "--nocore") == 0)
+      {
+        nocore= TRUE;
+      }
       else
         die("Unknown option: %s", arg);
     }
@@ -241,6 +253,11 @@ int main(int argc, const char** argv )
                               &jeli, sizeof(jeli)) == 0)
     message("SetInformationJobObject failed, continue anyway...");
 
+				/* Avoid popup box */
+  if (nocore)
+    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX
+                 | SEM_NOOPENFILEERRORBOX);
+
 #if 0
   /* Setup stdin, stdout and stderr redirect */
   si.dwFlags= STARTF_USESTDHANDLES;

=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2009-08-12 12:46:12 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2009-09-23 12:12:12 +0000
@@ -41,6 +41,7 @@ our $opt_with_ndbcluster_only;
 our $defaults_file;
 our $defaults_extra_file;
 our $reorder= 1;
+our $quick_collect;
 
 sub collect_option {
   my ($opt, $value)= @_;
@@ -68,6 +69,9 @@ require "mtr_misc.pl";
 my $do_test_reg;
 my $skip_test_reg;
 
+# If "Quick collect", set to 1 once a test to run has been found.
+my $some_test_found;
+
 sub init_pattern {
   my ($from, $what)= @_;
   return undef unless defined $from;
@@ -102,6 +106,7 @@ sub collect_test_cases ($$) {
   foreach my $suite (split(",", $suites))
   {
     push(@$cases, collect_one_suite($suite, $opt_cases));
+    last if $some_test_found;
   }
 
   if ( @$opt_cases )
@@ -139,7 +144,7 @@ sub collect_test_cases ($$) {
     }
   }
 
-  if ( $reorder )
+  if ( $reorder && !$quick_collect)
   {
     # Reorder the test cases in an order that will make them faster to run
     my %sort_criteria;
@@ -386,7 +391,7 @@ sub collect_one_suite($)
   # Read combinations for this suite and build testcases x combinations
   # if any combinations exists
   # ----------------------------------------------------------------------
-  if ( ! $skip_combinations )
+  if ( ! $skip_combinations && ! $quick_collect )
   {
     my @combinations;
     my $combination_file= "$suitedir/combinations";
@@ -644,6 +649,12 @@ sub optimize_cases {
 	  if ( $default_engine =~ /^innodb/i );
       }
     }
+
+    if ($quick_collect && ! $tinfo->{'skip'})
+    {
+      $some_test_found= 1;
+      return;
+    }
   }
 }
 
@@ -908,14 +919,14 @@ sub collect_one_test_case {
   if ( $tinfo->{'big_test'} and ! $::opt_big_test )
   {
     $tinfo->{'skip'}= 1;
-    $tinfo->{'comment'}= "Test need 'big-test' option";
+    $tinfo->{'comment'}= "Test needs 'big-test' option";
     return $tinfo
   }
 
   if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
   {
     $tinfo->{'skip'}= 1;
-    $tinfo->{'comment'}= "Test need debug binaries";
+    $tinfo->{'comment'}= "Test needs debug binaries";
     return $tinfo
   }
 
@@ -951,14 +962,14 @@ sub collect_one_test_case {
 
   if ($tinfo->{'federated_test'})
   {
-    # This is a test that need federated, enable it
+    # This is a test that needs federated, enable it
     push(@{$tinfo->{'master_opt'}}, "--loose-federated");
     push(@{$tinfo->{'slave_opt'}}, "--loose-federated");
   }
 
   if ( $tinfo->{'innodb_test'} )
   {
-    # This is a test that need innodb
+    # This is a test that needs innodb
     if ( $::mysqld_variables{'innodb'} eq "OFF" ||
          ! exists $::mysqld_variables{'innodb'} )
     {
@@ -979,7 +990,7 @@ sub collect_one_test_case {
     if (grep(/^--skip-log-bin/,  @::opt_extra_mysqld_opt) )
     {
       $tinfo->{'skip'}= 1;
-      $tinfo->{'comment'}= "Test need binlog";
+      $tinfo->{'comment'}= "Test needs binlog";
       return $tinfo;
     }
   }

=== modified file 'mysql-test/lib/mtr_report.pm'
--- a/mysql-test/lib/mtr_report.pm	2009-06-02 08:00:45 +0000
+++ b/mysql-test/lib/mtr_report.pm	2009-09-03 06:19:54 +0000
@@ -134,8 +134,8 @@ sub mtr_report_test ($) {
           # an asterisk at the end, determine if the characters up to
           # but excluding the asterisk are the same
           if ( $exp ne "" && substr($exp, -1, 1) eq "*" ) {
-            $exp = substr($exp, 0, length($exp) - 1);
-            if ( substr($test_name, 0, length($exp)) ne $exp ) {
+            my $nexp = substr($exp, 0, length($exp) - 1);
+            if ( substr($test_name, 0, length($nexp)) ne $nexp ) {
               # no match, try next entry
               next;
             }

=== added file 'mysql-test/lib/v1/incompatible.tests'
--- a/mysql-test/lib/v1/incompatible.tests	1970-01-01 00:00:00 +0000
+++ b/mysql-test/lib/v1/incompatible.tests	2009-07-16 12:05:46 +0000
@@ -0,0 +1,6 @@
+# This file lists tests that cannot run in MTR v1 for some reason.
+# They will be skipped.
+# Any text following white space after full test name is ignored
+# Only exact test names can be used, no regexp.
+
+main.fulltext_plugin   # Refers to $SIMPLE_PARSER_OPT which is not set

=== modified file 'mysql-test/lib/v1/mtr_cases.pl'
--- a/mysql-test/lib/v1/mtr_cases.pl	2008-11-14 14:39:12 +0000
+++ b/mysql-test/lib/v1/mtr_cases.pl	2009-07-31 09:22:57 +0000
@@ -32,6 +32,7 @@ sub mtr_options_from_test_file($$);
 
 my $do_test;
 my $skip_test;
+my %incompatible;
 
 sub init_pattern {
   my ($from, $what)= @_;
@@ -47,6 +48,15 @@ sub init_pattern {
 }
 
 
+sub collect_incomp_tests {
+  open (INCOMP, "lib/v1/incompatible.tests");
+  while (<INCOMP>)
+  {
+    next unless /^\w/;
+    s/\s.*\n//;		      # Ignore anything from first white space
+    $incompatible{$_}= 1;
+  }
+}
 
 ##############################################################################
 #
@@ -58,6 +68,8 @@ sub collect_test_cases ($) {
   $do_test= init_pattern($::opt_do_test, "--do-test");
   $skip_test= init_pattern($::opt_skip_test, "--skip-test");
 
+  collect_incomp_tests();
+
   my $suites= shift; # Semicolon separated list of test suites
   my $cases = [];    # Array of hash
 
@@ -528,6 +540,17 @@ sub collect_one_test_case($$$$$$$$$) {
   $tinfo->{'component_id'} = $component_id;
   push(@$cases, $tinfo);
 
+  # Remove "combinations" part of test name
+  my $test_base_name= $tinfo->{'name'};
+  $test_base_name=~ s/\s.*\n//;
+
+  if (exists ($incompatible{$test_base_name}))
+  {
+    $tinfo->{'skip'}= 1;
+    $tinfo->{'comment'}= "Test cannot run in mtr v1";
+    return;
+  }
+  
   # ----------------------------------------------------------------------
   # Skip some tests but include in list, just mark them to skip
   # ----------------------------------------------------------------------
@@ -841,7 +864,7 @@ sub collect_one_test_case($$$$$$$$$) {
     if ( $tinfo->{'innodb_test'} )
     {
       # This is a test that need innodb
-      if ( $::mysqld_variables{'innodb'} ne "TRUE" )
+      if ( $::mysqld_variables{'innodb'} eq "OFF" )
       {
 	# innodb is not supported, skip it
 	$tinfo->{'skip'}= 1;

=== modified file 'mysql-test/mysql-stress-test.pl'
--- a/mysql-test/mysql-stress-test.pl	2006-03-03 18:15:01 +0000
+++ b/mysql-test/mysql-stress-test.pl	2009-09-25 15:27:55 +0000
@@ -14,17 +14,16 @@
 # 
 # Design of stress script should allow one:
 # 
-#   - To stress test the mysqltest binary test engine.
-#   - To stress test the regular test suite and any additional test suites
-#     (such as mysql-test-extra-5.0).
-#   - To specify files with lists of tests both for initialization of
-#     stress db and for further testing itself.
-#   - To define the number of threads to be concurrently used in testing.
-#   - To define limitations for the test run. such as the number of tests or
-#     loops for execution or duration of testing, delay between test
-#     executions, and so forth.
-#   - To get a readable log file that can be used for identification of
-#     errors that occur during testing.
+#   - to use for stress testing mysqltest binary as test engine
+#   - to use for stress testing both regular test suite and any
+#     additional test suites (e.g. mysql-test-extra-5.0)
+#   - to specify files with lists of tests both for initialization of
+#     stress db and for further testing itself
+#   - to define number of threads that will be concurrently used in testing
+#   - to define limitations for test run. e.g. number of tests or loops
+#     for execution or duration of testing, delay between test executions, etc.
+#   - to get readable log file which can be used for identification of
+#     errors arose during testing
 # 
 # Basic scenarios:
 # 
@@ -58,6 +57,8 @@
 #       to reproduce and debug errors that was found in continued stress 
 #       testing
 #
+# 2009-01-28 OBN Additions and modifications per WL#4685
+#                
 ########################################################################
 
 use Config;
@@ -114,13 +115,15 @@ $opt_stress_mode="random";
 $opt_loop_count=0;
 $opt_test_count=0;
 $opt_test_duration=0;
-$opt_abort_on_error=0;
+# OBN: Changing abort-on-error default to -1 (for WL-4626/4685): -1 means no abort
+$opt_abort_on_error=-1;
 $opt_sleep_time = 0;
 $opt_threads=1;
 $pid_file="mysql_stress_test.pid";
 $opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest";
 $opt_check_tests_file="";
-@mysqltest_args=("--silent", "-v", "--skip-safemalloc");
+# OBM adding a setting for 'max-connect-retries=7' the default of 500 is to high  
+@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=7");
 
 # Client ip address
 $client_ip=inet_ntoa((gethostbyname(hostname()))[4]);
@@ -133,24 +136,31 @@ $client_ip=~ s/\.//g;
 #
 # S1 - Critical errors - cause immediately abort of testing. These errors
 #                        could be caused by server crash or impossibility
-#                        of test execution
+#                        of test execution. 
 #
 # S2 - Serious errors - these errors are bugs for sure as it knowns that 
 #                       they shouldn't appear during stress testing  
 #
-# S3 - Non-seriuos errros - these errors could be caused by fact that 
+# S3 - Unknown errors - Errors were returned but we don't know what they are 
+#                       so script can't determine if they are OK or not
+#
+# S4 - Non-seriuos errros - these errors could be caused by fact that 
 #                           we execute simultaneously statements that
 #                           affect tests executed by other threads
                             
 %error_strings = ( 'Failed in mysql_real_connect()' => S1,
+                   'Can\'t connect' => S1,       
                    'not found (Errcode: 2)' => S1 );
   
 %error_codes = ( 1012 => S2, 1015 => S2, 1021 => S2,
                  1027 => S2, 1037 => S2, 1038 => S2,
                  1039 => S2, 1040 => S2, 1046 => S2, 
-                 1180 => S2, 1181 => S2, 1203 => S2,
-                 1205 => S2, 1206 => S2, 1207 => S2, 
-                 1223 => S2, 2013 => S1);
+                 1053 => S2, 1180 => S2, 1181 => S2, 
+                 1203 => S2, 1205 => S4, 1206 => S2, 
+                 1207 => S2, 1213 => S4, 1223 => S2, 
+                 2002 => S1, 2003 => S1, 2006 => S1,
+                 2013 => S1 
+                 );
 
 share(%test_counters);
 %test_counters=( loop_count => 0, test_count=>0);
@@ -158,6 +168,35 @@ share(%test_counters);
 share($exiting);
 $exiting=0;
 
+# OBN Code and 'set_exit_code' function added by ES to set an exit code based on the error category returned 
+#     in combination with the --abort-on-error value see WL#4685)
+use constant ABORT_MAKEWEIGHT => 20;  
+share($gExitCode);
+$gExitCode = 0;   # global exit code
+sub set_exit_code {
+	my $severity = shift;
+	my $code = 0;
+	if ( $severity =~ /^S(\d+)/ ) {
+		$severity = $1;
+		$code = 11 - $severity; # S1=10, S2=9, ... -- as per WL
+	}
+	else {
+	# we know how we call the sub: severity should be S<num>; so, we should never be here...
+		print STDERR "Unknown severity format: $severity; setting to S1\n";
+		$severity = 1;
+	}
+	$abort = 0;
+	if ( $severity <= $opt_abort_on_error ) {
+		# the test finished with a failure severe enough to abort. We are adding the 'abort flag' to the exit code
+		$code += ABORT_MAKEWEIGHT;
+		# but are not exiting just yet -- we need to update global exit code first
+		$abort = 1;
+	}
+	lock $gExitCode; # we can use lock here because the script uses threads anyway
+	$gExitCode = $code if $code > $gExitCode;
+	kill INT, $$ if $abort; # this is just a way to call sig_INT_handler: it will set exiting flag, which should do the rest
+}
+
 share($test_counters_lock);
 $test_counters_lock=0;
 share($log_file_lock);
@@ -176,7 +215,8 @@ GetOptions("server-host=s", "server-logs
            "threads=s", "sleep-time=s", "loop-count=i", "test-count=i",
            "test-duration=i", "test-suffix=s", "check-tests-file", 
            "verbose", "log-error-details", "cleanup", "mysqltest=s", 
-           "abort-on-error", "help") || usage();
+           # OBN: (changing 'abort-on-error' to numberic for WL-4626/4685) 
+           "abort-on-error=i" => \$opt_abort_on_error, "help") || usage();
 
 usage() if ($opt_help);
 
@@ -563,7 +603,15 @@ EOF
 
   if ($opt_test_duration)
   {
-    sleep($opt_test_duration);
+  # OBN - At this point we need to wait for the duration of the test, hoever
+  #       we need to be able to quit if an 'abort-on-error' condition has happend 
+  #       with one of the children (WL#4685). Using solution by ES and replacing 
+  #       the 'sleep' command with a loop checking the abort condition every second
+  
+	foreach ( 1..$opt_test_duration ) {       
+		last if $exiting;                     
+		sleep 1;                              
+	}
     kill INT, $$;                             #Interrupt child threads
   }
 
@@ -580,6 +628,8 @@ EOF
   print "EXIT\n";
 }
 
+exit $gExitCode; # ES WL#4685: script should return a meaningful exit code
+
 sub test_init
 {
   my ($env)=@_;
@@ -681,7 +731,9 @@ sub test_execute
         {
           if (!exists($error_codes{$err_code}))
           {
-            $severity="S3";
+            # OBN Changing severity level to S4 from S3 as S3 now reserved
+            #     for the case where the error is unknown (for WL#4626/4685
+            $severity="S4";
             $err_code=0;
           }
           else
@@ -734,6 +786,7 @@ sub test_execute
     {
       push @{$env->{test_status}}, "Severity $severity: $total";
       $env->{errors}->{total}=+$total;
+      set_exit_code($severity);  
     }
   }
 
@@ -748,18 +801,20 @@ sub test_execute
 
   log_session_errors($env, $test_file);
 
-  if (!$exiting && ($signal_num == 2 || $signal_num == 15 || 
-      ($opt_abort_on_error && $env->{errors}->{S1} > 0)))
+  #OBN Removing the case of S1 and abort-on-error as that is now set 
+  #     inside the set_exit_code function (for WL#4626/4685)
+  #if (!$exiting && ($signal_num == 2 || $signal_num == 15 || 
+  #       ($opt_abort_on_error && $env->{errors}->{S1} > 0)))
+  if (!$exiting && ($signal_num == 2 || $signal_num == 15))
   {
-    #mysqltest was interrupted with INT or TERM signals or test was 
-    #ran with --abort-on-error option and we got errors with severity S1
+    #mysqltest was interrupted with INT or TERM signals 
     #so we assume that we should cancel testing and exit
     $exiting=1;
+    # OBN - Adjusted text to exclude case of S1 and abort-on-error that 
+    #       was mentioned (for WL#4626/4685)
     print STDERR<<EOF;
 WARNING:
-   mysqltest was interrupted with INT or TERM signals or test was 
-   ran with --abort-on-error option and we got errors with severity S1
-   (test cann't connect to the server or server crashed) so we assume that 
+   mysqltest was interrupted with INT or TERM signals  so we assume that 
    we should cancel testing and exit. Please check log file for this thread 
    in $stress_log_file or 
    inspect below output of the last test case executed with mysqltest to 
@@ -840,12 +895,23 @@ LOOP:
              $client_env{test_count}."]:".
              " TID ".$client_env{thread_id}.
              " test: '$test_name' ".
-             " Errors: ".join(" ",@{$client_env{test_status}}),"\n";
-      print "\n";
+             " Errors: ".join(" ",@{$client_env{test_status}}).
+                ( $exiting ? " (thread aborting)" : "" )."\n";
     }
   
-    sleep($opt_sleep_time) if($opt_sleep_time);
-
+    # OBN - At this point we need to wait until the 'wait' time between test
+    #       executions passes (in case it is specifed) passes, hoever we need
+    #       to be able to quit and break out of the test if an 'abort-on-error' 
+    #       condition has happend with one of the other children (WL#4685). 
+    #       Using solution by ES and replacing the 'sleep' command with a loop 
+    #       checking the abort condition every second
+  
+	if ( $opt_sleep_time ) {                
+		foreach ( 1..$opt_sleep_time ) {     
+			last if $exiting;               
+			sleep 1;                        
+		}                                   
+	}                                       
   }
 }
 
@@ -1119,6 +1185,9 @@ mysql-stress-test.pl --stress-basedir=<d
 --cleanup

   Force to clean up working directory (specified with --stress-basedir)
 
+--abort-on-error=<number>
+  Causes the script to abort if an error with severity <= number was encounterd
+
 --log-error-details
   Enable errors details in the global error log file. (Default: off)
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-09-02 15:45:33 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-09-02 21:29:11 +0000
@@ -209,6 +209,7 @@ sub check_timeout { return $opt_testcase
 
 my $opt_start;
 my $opt_start_dirty;
+my $start_only;
 my $opt_wait_all;
 my $opt_repeat= 1;
 my $opt_retry= 3;
@@ -984,6 +985,9 @@ sub command_line_setup {
 
   if ( $opt_experimental )
   {
+    # $^O on Windows considered not generic enough
+    my $plat= (IS_WINDOWS) ? 'windows' : $^O;
+
     # read the list of experimental test cases from the file specified on
     # the command line
     open(FILE, "<", $opt_experimental) or mtr_error("Can't read experimental file: $opt_experimental");
@@ -994,6 +998,15 @@ sub command_line_setup {
       # remove comments (# foo) at the beginning of the line, or after a 
       # blank at the end of the line
       s/( +|^)#.*$//;
+      # If @ platform specifier given, use this entry only if it contains
+      # @<platform> or @!<xxx> where xxx != platform
+      if (/\@.*/)
+      {
+	next if (/\@!$plat/);
+	next unless (/\@$plat/ or /\@!/);
+	# Then remove @ and everything after it
+	s/\@.*$//;
+      }
       # remove whitespace
       s/^ +//;              
       s/ +$//;
@@ -1241,13 +1254,28 @@ sub command_line_setup {
     {
       mtr_error("Can't use --extern when using debugger");
     }
+    # Set one week timeout (check-testcase timeout will be 1/10th)
+    $opt_testcase_timeout= 7 * 24 * 60;
+    $opt_suite_timeout= 7 * 24 * 60;
+    # One day to shutdown
+    $opt_shutdown_timeout= 24 * 60;
+    # One day for PID file creation (this is given in seconds not minutes)
+    $opt_start_timeout= 24 * 60 * 60;
+  }
+
+  # --------------------------------------------------------------------------
+  # Modified behavior with --start options
+  # --------------------------------------------------------------------------
+  if ($opt_start or $opt_start_dirty) {
+    collect_option ('quick-collect', 1);
+    $start_only= 1;
   }
 
   # --------------------------------------------------------------------------
   # Check use of wait-all
   # --------------------------------------------------------------------------
 
-  if ($opt_wait_all && ! ($opt_start_dirty || $opt_start))
+  if ($opt_wait_all && ! $start_only)
   {
     mtr_error("--wait-all can only be used with --start or --start-dirty");
   }
@@ -1506,6 +1534,10 @@ sub collect_mysqld_features_from_running
     }
   }
 
+  # "Convert" innodb flag
+  $mysqld_variables{'innodb'}= "ON"
+    if ($mysqld_variables{'have_innodb'} eq "YES");
+
   # Parse version
   my $version_str= $mysqld_variables{'version'};
   if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)/ )
@@ -1764,7 +1796,7 @@ sub environment_setup {
     my $plugin_filename;
     if (IS_WINDOWS)
     {
-       $plugin_filename = "ha_example.dll"; 
+       $plugin_filename = "ha_example.dll";
     }
     else 
     {
@@ -1772,7 +1804,8 @@ sub environment_setup {
     }
     my $lib_example_plugin=
       mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
-		      "$basedir/storage/example/.libs/".$plugin_filename);
+		      "$basedir/storage/example/.libs/".$plugin_filename,
+                      "$basedir/lib/mysql/plugin/".$plugin_filename);
     $ENV{'EXAMPLE_PLUGIN'}=
       ($lib_example_plugin ? basename($lib_example_plugin) : "");
     $ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
@@ -2811,7 +2844,7 @@ sub run_testcase_check_skip_test($)
 
   if ( $tinfo->{'skip'} )
   {
-    mtr_report_test_skipped($tinfo);
+    mtr_report_test_skipped($tinfo) unless $start_only;
     return 1;
   }
 
@@ -3298,9 +3331,16 @@ sub run_testcase ($) {
   # server exits
   # ----------------------------------------------------------------------
 
-  if ( $opt_start or $opt_start_dirty )
+  if ( $start_only )
   {
     mtr_print("\nStarted", started(all_servers()));
+    mtr_print("Using config for test", $tinfo->{name});
+    mtr_print("Port and socket path for server(s):");
+    foreach my $mysqld ( mysqlds() )
+    {
+      mtr_print ($mysqld->name() . "  " . $mysqld->value('port') .
+	      "  " . $mysqld->value('socket'));
+    }
     mtr_print("Waiting for server(s) to exit...");
     if ( $opt_wait_all ) {
       My::SafeProcess->wait_all();
@@ -3542,8 +3582,8 @@ sub run_testcase ($) {
 # error log and write all lines that look
 # suspicious into $error_log.warnings
 #
-sub extract_warning_lines ($) {
-  my ($error_log) = @_;
+sub extract_warning_lines ($$) {
+  my ($error_log, $tname) = @_;
 
   # Open the servers .err log file and read all lines
   # belonging to current tets into @lines
@@ -3551,14 +3591,27 @@ sub extract_warning_lines ($) {
     or mtr_error("Could not open file '$error_log' for reading: $!");
 
   my @lines;
+  my $found_test= 0;		# Set once we've found the log of this test
   while ( my $line = <$Ferr> )
   {
-    if ( $line =~ /^CURRENT_TEST:/ )
+    if ($found_test)
+    {
+      # If test wasn't last after all, discard what we found, test again.
+      if ( $line =~ /^CURRENT_TEST:/)
+      {
+	@lines= ();
+	$found_test= $line =~ /^CURRENT_TEST: $tname/;
+      }
+      else
+      {
+	push(@lines, $line);
+      }
+    }
+    else
     {
-      # Throw away lines from previous tests
-      @lines = ();
+      # Search for beginning of test, until found
+      $found_test= 1 if ($line =~ /^CURRENT_TEST: $tname/);
     }
-    push(@lines, $line);
   }
   $Ferr = undef; # Close error log file
 
@@ -3595,10 +3648,8 @@ sub extract_warning_lines ($) {
      # and correcting them shows a few additional harmless warnings.
      # Thus those patterns are temporarily removed from the list
      # of patterns. For more info see BUG#42408
-     # qr/^Warning:|mysqld: Warning|\[Warning\]/,
-     # qr/^Error:|\[ERROR\]/,
-     qr/^Warning:|mysqld: Warning/,
-     qr/^Error:/,
+     qr/^Warning:|mysqld: Warning|\[Warning\]/,
+     qr/^Error:|\[ERROR\]/,
      qr/^==.* at 0x/,
      qr/InnoDB: Warning|InnoDB: Error/,
      qr/^safe_mutex:|allocated at line/,
@@ -3638,7 +3689,7 @@ sub start_check_warnings ($$) {
   my $log_error= $mysqld->value('#log-error');
   # To be communicated to the test
   $ENV{MTR_LOG_ERROR}= $log_error;
-  extract_warning_lines($log_error);
+  extract_warning_lines($log_error, $tinfo->{name});
 
   my $args;
   mtr_init_args(\$args);
@@ -4078,8 +4129,8 @@ sub mysqld_arguments ($$$) {
 
   if ( $mysql_version_id >= 50106 )
   {
-    # Turn on logging to both tables and file
-    mtr_add_arg($args, "--log-output=table,file");
+    # Turn on logging to file
+    mtr_add_arg($args, "--log-output=file");
   }
 
   # Check if "extra_opt" contains skip-log-bin
@@ -5123,7 +5174,7 @@ Options to control what test suites or c
   skip-rpl              Skip the replication test cases.
   big-test              Also run tests marked as "big"
   enable-disabled       Run also tests marked as disabled
-  print_testcases       Don't run the tests but print details about all the
+  print-testcases       Don't run the tests but print details about all the
                         selected tests, in the order they would be run.
 
 Options that specify ports

=== modified file 'mysql-test/r/almost_full.result'
--- a/mysql-test/r/almost_full.result	2007-11-12 09:00:22 +0000
+++ b/mysql-test/r/almost_full.result	2009-08-25 13:56:50 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("The table 't1' is full");
 drop table if exists t1;
 set global myisam_data_pointer_size=2;
 CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;

=== modified file 'mysql-test/r/alter_table.result'
--- a/mysql-test/r/alter_table.result	2008-12-09 13:31:22 +0000
+++ b/mysql-test/r/alter_table.result	2009-09-29 10:58:42 +0000
@@ -1268,4 +1268,66 @@ a	b
 4	b
 5	a
 DROP TABLE t1;
+#
+# Bug#45567: Fast ALTER TABLE broken for enum and set
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a ENUM('a1','a2'));
+INSERT INTO t1 VALUES ('a1'),('a2');
+# No copy: No modification
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+# No copy: Add new enumeration to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a3');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+# Copy: Modify and add new to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx','a5');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# Copy: Remove from the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# Copy: Add new enumeration
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# No copy: Add new enumerations to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx','a5','a6');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+DROP TABLE t1;
+CREATE TABLE t1 (a SET('a1','a2'));
+INSERT INTO t1 VALUES ('a1'),('a2');
+# No copy: No modification
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+# No copy: Add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a3');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+# Copy: Modify and add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx','a5');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# Copy: Remove from the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# Copy: Add new member
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+# No copy: Add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6');
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+# Copy: Numerical incrase (pack lenght)
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6','a7','a8','a9','a10');
+affected rows: 2
+info: Records: 2  Duplicates: 0  Warnings: 0
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/bug46080.result'
--- a/mysql-test/r/bug46080.result	2009-07-13 11:17:14 +0000
+++ b/mysql-test/r/bug46080.result	2009-09-03 06:38:06 +0000
@@ -2,6 +2,8 @@
 # Bug #46080: group_concat(... order by) crashes server when
 #  sort_buffer_size cannot allocate
 #
+call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
+call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
 CREATE TABLE t1(a CHAR(255));
 INSERT INTO t1 VALUES ('a');
 SET @@SESSION.sort_buffer_size=5*16*1000000;

=== added file 'mysql-test/r/bug46760.result'
--- a/mysql-test/r/bug46760.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/bug46760.result	2009-09-18 13:01:18 +0000
@@ -0,0 +1,43 @@
+#
+# Bug#46760: Fast ALTER TABLE no longer works for InnoDB
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+# By using --enable_info and verifying that number of affected
+# rows is 0 we check that this ALTER TABLE is really carried
+# out as "fast/online" operation, i.e. without full-blown data
+# copying.
+#
+# I.e. info for the below statement should normally look like:
+#
+# affected rows: 0
+# info: Records: 0  Duplicates: 0  Warnings: 0
+ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 10;
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT '10'
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+#
+# MySQL Bug#39200: optimize table does not recognize 
+# ROW_FORMAT=COMPRESSED
+#
+CREATE TABLE t1 (a INT) ROW_FORMAT=compressed;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+OPTIMIZE TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	optimize	status	Table is already up to date
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
+DROP TABLE t1;
+End of 5.1 tests

=== modified file 'mysql-test/r/delete.result'
--- a/mysql-test/r/delete.result	2007-12-07 14:15:58 +0000
+++ b/mysql-test/r/delete.result	2009-09-28 10:48:52 +0000
@@ -279,3 +279,48 @@ ERROR 42000: Incorrect number of argumen
 DROP TABLE t1;
 DROP FUNCTION f1;
 End of 5.0 tests
+#
+# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger, 
+# merge table
+#
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+INSERT INTO t3 VALUES (1), (2);
+CREATE TRIGGER tr1 BEFORE DELETE ON t2
+FOR EACH ROW INSERT INTO no_such_table VALUES (1);
+DELETE t1, t2, t3 FROM t1, t2, t3;
+ERROR 42S02: Table 'test.no_such_table' doesn't exist
+SELECT * FROM t1;
+a
+SELECT * FROM t2;
+a
+1
+2
+SELECT * FROM t3;
+a
+1
+2
+DROP TABLE t1, t2, t3;
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+INSERT INTO t3 VALUES (1), (2);
+CREATE TRIGGER tr1 AFTER DELETE ON t2
+FOR EACH ROW INSERT INTO no_such_table VALUES (1);
+DELETE t1, t2, t3 FROM t1, t2, t3;
+ERROR 42S02: Table 'test.no_such_table' doesn't exist
+SELECT * FROM t1;
+a
+SELECT * FROM t2;
+a
+2
+SELECT * FROM t3;
+a
+1
+2
+DROP TABLE t1, t2, t3;

=== modified file 'mysql-test/r/innodb-autoinc.result'
--- a/mysql-test/r/innodb-autoinc.result	2009-03-12 00:18:44 +0000
+++ b/mysql-test/r/innodb-autoinc.result	2009-09-23 12:12:12 +0000
@@ -867,3 +867,25 @@ INSERT INTO t2 SELECT NULL FROM t1;
 Got one of the listed errors
 DROP TABLE t1;
 DROP TABLE t2;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+INSERT INTO t1 VALUES (null);
+ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+SELECT * FROM t1;
+d1
+1
+3
+SELECT * FROM t1;
+d1
+1
+3
+INSERT INTO t1 VALUES(null);
+Got one of the listed errors
+ALTER TABLE t1 AUTO_INCREMENT = 3;
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+d1
+1
+3
+4
+DROP TABLE t1;

=== modified file 'mysql-test/r/insert_select.result'
--- a/mysql-test/r/insert_select.result	2009-07-24 12:09:35 +0000
+++ b/mysql-test/r/insert_select.result	2009-09-02 16:58:17 +0000
@@ -841,6 +841,7 @@ SET max_heap_table_size = 16384;
 SET @old_myisam_data_pointer_size = @@myisam_data_pointer_size;
 SET GLOBAL myisam_data_pointer_size = 2;
 INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
+call mtr.add_suppression("mysqld: The table '.*#sql.*' is full");
 INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
 Got one of the listed errors
 SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;

=== modified file 'mysql-test/r/join.result'
--- a/mysql-test/r/join.result	2008-10-06 12:37:52 +0000
+++ b/mysql-test/r/join.result	2009-09-29 02:23:38 +0000
@@ -1064,3 +1064,13 @@ a	b	c	d
 128	NULL	128	NULL
 DROP TABLE IF EXISTS t1,t2;
 End of 5.0 tests.
+CREATE TABLE t1 (f1 int);
+CREATE TABLE t2 (f1 int);
+INSERT INTO t2  VALUES (1);
+CREATE VIEW v1 AS SELECT * FROM t2;
+PREPARE stmt FROM 'UPDATE t2 AS A NATURAL JOIN v1 B SET B.f1 = 1';
+EXECUTE stmt;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP VIEW v1;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/r/lowercase_table3.result'
--- a/mysql-test/r/lowercase_table3.result	2009-02-13 21:12:59 +0000
+++ b/mysql-test/r/lowercase_table3.result	2009-08-28 14:13:27 +0000
@@ -1,4 +1,4 @@
-call mtr.add_suppression("Cannot find or open table test/BUG29839 from .*");
+call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
 DROP TABLE IF EXISTS t1,T1;
 CREATE TABLE t1 (a INT);
 SELECT * FROM T1;

=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result	2009-04-30 11:03:44 +0000
+++ b/mysql-test/r/myisam.result	2009-09-21 09:58:15 +0000
@@ -2252,4 +2252,23 @@ h+0	d + 0	e	g + 0
 1	1	3	0
 1	1	4	0
 DROP TABLE t1;
+#
+# Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field
+# (same content / differen checksum)
+#
+CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam;
+INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)"));
+checksum table t1;
+Table	Checksum
+test.t1	326284887
+CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam;
+INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)"));
+checksum table t2;
+Table	Checksum
+test.t2	326284887
+CREATE TABLE t3 select * from t1;
+checksum table t3;
+Table	Checksum
+test.t3	326284887
+drop table t1,t2,t3;
 End of 5.1 tests

=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result	2009-05-27 20:54:40 +0000
+++ b/mysql-test/r/mysqltest.result	2009-09-02 09:17:33 +0000
@@ -314,21 +314,10 @@ here is the sourced script
 1 = outer loop variable before dec
 
 0 = outer loop variable after dec
-
-2 = outer loop variable after while
-here is the sourced script
-
-2 = outer loop variable before dec
-
-1 = outer loop variable after dec
-
-1 = outer loop variable after while
+outer=2 ifval=0
+outer=1 ifval=1
 here is the sourced script
 
-1 = outer loop variable before dec
-
-0 = outer loop variable after dec
-
 In loop
 here is the sourced script
 
@@ -538,6 +527,10 @@ mysqltest: At line 1: Missing required a
 mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found
 Content for test_file1
 mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp'
+These lines should be repeated,
+if things work as expected
+These lines should be repeated,
+if things work as expected
 Some data
 for cat_file command
 of mysqltest

=== added file 'mysql-test/r/not_true.require'
--- a/mysql-test/r/not_true.require	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/not_true.require	2009-09-25 09:26:49 +0000
@@ -0,0 +1,2 @@
+TRUE
+NULL

=== modified file 'mysql-test/r/partition_csv.result'
--- a/mysql-test/r/partition_csv.result	2009-07-31 23:39:26 +0000
+++ b/mysql-test/r/partition_csv.result	2009-09-03 06:38:06 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Failed to write to mysql.general_log");
 drop table if exists t1;
 create table t1 (a int)
 engine = csv

=== added file 'mysql-test/r/partition_innodb_builtin.result'
--- a/mysql-test/r/partition_innodb_builtin.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/partition_innodb_builtin.result	2009-09-25 09:26:49 +0000
@@ -0,0 +1,39 @@
+SET NAMES utf8;
+CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
+ENGINE=InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION `p0``\""e` VALUES LESS THAN (100)
+(SUBPARTITION `sp0``\""e`,
+SUBPARTITION `sp1``\""e`),
+PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
+(SUBPARTITION `sp2``\""e`,
+SUBPARTITION `sp3``\""e`));
+INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
+START TRANSACTION;
+# con1
+SET NAMES utf8;
+START TRANSACTION;
+# default connection
+UPDATE `t``\""e` SET a = 16 WHERE a = 0;
+# con1
+UPDATE `t``\""e` SET a = 8 WHERE a = 22;
+UPDATE `t``\""e` SET a = 12 WHERE a = 0;
+# default connection
+UPDATE `t``\""e` SET a = 4 WHERE a = 22;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+# First table reported in 'SHOW ENGINE InnoDB STATUS'
+SHOW ENGINE InnoDB STATUS;
+Type	Name	Status
+InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+SHOW ENGINE InnoDB STATUS;
+Type	Name	Status
+InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
+set @@sql_mode = @old_sql_mode;
+# con1
+ROLLBACK;
+# default connection
+DROP TABLE `t``\""e`;
+SET NAMES DEFAULT;

=== added file 'mysql-test/r/partition_innodb_plugin.result'
--- a/mysql-test/r/partition_innodb_plugin.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/partition_innodb_plugin.result	2009-09-25 09:26:49 +0000
@@ -0,0 +1,50 @@
+SET NAMES utf8;
+CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
+ENGINE=InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION `p0``\""e` VALUES LESS THAN (100)
+(SUBPARTITION `sp0``\""e`,
+SUBPARTITION `sp1``\""e`),
+PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
+(SUBPARTITION `sp2``\""e`,
+SUBPARTITION `sp3``\""e`));
+INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
+START TRANSACTION;
+# con1
+SET NAMES utf8;
+START TRANSACTION;
+# default connection
+UPDATE `t``\""e` SET a = 16 WHERE a = 0;
+# con1
+UPDATE `t``\""e` SET a = 8 WHERE a = 22;
+UPDATE `t``\""e` SET a = 12 WHERE a = 0;
+# default connection
+SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
+GROUP BY lock_table;
+lock_table	COUNT(*)
+`test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */	2
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
+GROUP BY lock_table;
+lock_table	COUNT(*)
+"test"."t`\""""e" /* Partition "p0`\""""e", Subpartition "sp0`\""""e" */	2
+set @@sql_mode = @old_sql_mode;
+UPDATE `t``\""e` SET a = 4 WHERE a = 22;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+# First table reported in 'SHOW ENGINE InnoDB STATUS'
+SHOW ENGINE InnoDB STATUS;
+Type	Name	Status
+InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+SHOW ENGINE InnoDB STATUS;
+Type	Name	Status
+InnoDB		index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
+set @@sql_mode = @old_sql_mode;
+# con1
+ROLLBACK;
+# default connection
+DROP TABLE `t``\""e`;
+SET NAMES DEFAULT;

=== modified file 'mysql-test/r/subselect4.result'
--- a/mysql-test/r/subselect4.result	2009-09-03 15:03:46 +0000
+++ b/mysql-test/r/subselect4.result	2009-09-28 13:48:40 +0000
@@ -27,4 +27,35 @@ SELECT 1;
 1
 1
 DROP TABLE t1,t2,t3;
+#
+# Bug #47106: Crash / segfault on adding EXPLAIN to a non-crashing 
+# query
+#
+CREATE TABLE t1 (
+a INT,
+b INT,
+PRIMARY KEY (a),
+KEY b (b)
+);
+INSERT INTO t1 VALUES (1, 1), (2, 1);
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1;
+CREATE TABLE t3 LIKE t1;
+INSERT INTO t3 SELECT * FROM t1;
+# Should not crash.
+# Should have 1 impossible where and 2 dependent subqs.
+EXPLAIN
+SELECT
+(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
+FROM t3 WHERE 1 = 0 GROUP BY 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
+2	DEPENDENT SUBQUERY	t1	index	NULL	PRIMARY	4	NULL	2	Using index
+2	DEPENDENT SUBQUERY	t2	index	b	b	5	NULL	2	Using where; Using index; Using join buffer
+# should return 0 rows
+SELECT
+(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
+FROM t3 WHERE 1 = 0 GROUP BY 1;
+(SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
+DROP TABLE t1,t2,t3;
 End of 5.0 tests.

=== modified file 'mysql-test/r/trigger_notembedded.result'
--- a/mysql-test/r/trigger_notembedded.result	2009-06-25 10:52:50 +0000
+++ b/mysql-test/r/trigger_notembedded.result	2009-09-17 11:33:23 +0000
@@ -180,8 +180,6 @@ NULL	mysqltest_db1	trg5	DELETE	NULL	mysq
 DROP USER mysqltest_dfn@localhost;
 DROP USER mysqltest_inv@localhost;
 DROP DATABASE mysqltest_db1;
-Warnings:
-Warning	1454	No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
 DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
 DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
 DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';

=== modified file 'mysql-test/r/upgrade.result'
--- a/mysql-test/r/upgrade.result	2009-04-30 12:46:49 +0000
+++ b/mysql-test/r/upgrade.result	2009-08-25 13:56:50 +0000
@@ -108,11 +108,7 @@ a-b-c
 show create view `a-b-c`.v1;
 View	Create View	character_set_client	collation_connection
 v1	CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `a`.`f1` AS `f1` from (`a-b-c`.`t1` `a` join `information_schema`.`tables` `b`) where (convert(`a`.`f1` using utf8) = `b`.`TABLE_NAME`)	utf8	utf8_general_ci
-Warnings:
-Note	1600	Creation context of view `a-b-c`.`v1' is invalid
 select * from `a-b-c`.v1;
 f1
-Warnings:
-Note	1600	Creation context of view `a-b-c`.`v1' is invalid
 drop database `a-b-c`;
 use test;

=== modified file 'mysql-test/r/windows.result'
--- a/mysql-test/r/windows.result	2009-02-12 09:52:01 +0000
+++ b/mysql-test/r/windows.result	2009-09-22 11:22:07 +0000
@@ -53,3 +53,10 @@ ERROR HY000: No paths allowed for shared
 execute abc;
 ERROR HY000: No paths allowed for shared library
 deallocate prepare abc;
+#
+# Bug#45498: Socket variable not available on Windows
+#
+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME = 'socket';
+VARIABLE_NAME
+SOCKET

=== modified file 'mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result'
--- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result	2009-09-28 02:23:06 +0000
@@ -1,17 +1,31 @@
-drop database if exists `drop-temp+table-test`;
-reset master;
-create database `drop-temp+table-test`;
-use `drop-temp+table-test`;
-create temporary table shortn1 (a int);
-create temporary table `table:name` (a int);
-create temporary table shortn2 (a int);
-select get_lock("a",10);
-get_lock("a",10)
+DROP DATABASE IF EXISTS `drop-temp+table-test`;
+RESET MASTER;
+CREATE DATABASE `drop-temp+table-test`;
+USE `drop-temp+table-test`;
+CREATE TEMPORARY TABLE shortn1 (a INT);
+CREATE TEMPORARY TABLE `table:name` (a INT);
+CREATE TEMPORARY TABLE shortn2 (a INT);
+CREATE TEMPORARY TABLE tmp(c1 int);
+CREATE TEMPORARY TABLE tmp1(c1 int);
+CREATE TEMPORARY TABLE tmp2(c1 int);
+CREATE TEMPORARY TABLE tmp3(c1 int);
+CREATE TABLE t(c1 int);
+DROP TEMPORARY TABLE IF EXISTS tmp;
+DROP TEMPORARY TABLE IF EXISTS tmp;
+DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
+DROP TEMPORARY TABLE tmp3;
+DROP TABLE IF EXISTS tmp2, t;
+DROP TABLE IF EXISTS tmp2, t;
+SELECT GET_LOCK("a",10);
+GET_LOCK("a",10)
 1
-select get_lock("a",10);
-get_lock("a",10)
+SELECT GET_LOCK("a",10);
+GET_LOCK("a",10)
 1
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	create database `drop-temp+table-test`
-drop database `drop-temp+table-test`;
+master-bin.000001	#	Query	#	#	CREATE DATABASE `drop-temp+table-test`
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TABLE t(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
+DROP DATABASE `drop-temp+table-test`;

=== modified file 'mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result'
--- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result	2009-08-28 09:45:57 +0000
+++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result	2009-09-28 02:23:06 +0000
@@ -1,21 +1,43 @@
-drop database if exists `drop-temp+table-test`;
-reset master;
-create database `drop-temp+table-test`;
-use `drop-temp+table-test`;
-create temporary table shortn1 (a int);
-create temporary table `table:name` (a int);
-create temporary table shortn2 (a int);
-select get_lock("a",10);
-get_lock("a",10)
+DROP DATABASE IF EXISTS `drop-temp+table-test`;
+RESET MASTER;
+CREATE DATABASE `drop-temp+table-test`;
+USE `drop-temp+table-test`;
+CREATE TEMPORARY TABLE shortn1 (a INT);
+CREATE TEMPORARY TABLE `table:name` (a INT);
+CREATE TEMPORARY TABLE shortn2 (a INT);
+CREATE TEMPORARY TABLE tmp(c1 int);
+CREATE TEMPORARY TABLE tmp1(c1 int);
+CREATE TEMPORARY TABLE tmp2(c1 int);
+CREATE TEMPORARY TABLE tmp3(c1 int);
+CREATE TABLE t(c1 int);
+DROP TEMPORARY TABLE IF EXISTS tmp;
+DROP TEMPORARY TABLE IF EXISTS tmp;
+DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
+DROP TEMPORARY TABLE tmp3;
+DROP TABLE IF EXISTS tmp2, t;
+DROP TABLE IF EXISTS tmp2, t;
+SELECT GET_LOCK("a",10);
+GET_LOCK("a",10)
 1
-select get_lock("a",10);
-get_lock("a",10)
+SELECT GET_LOCK("a",10);
+GET_LOCK("a",10)
 1
 show binlog events from <binlog_start>;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-master-bin.000001	#	Query	#	#	create database `drop-temp+table-test`
-master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; create temporary table shortn1 (a int)
-master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; create temporary table `table:name` (a int)
-master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; create temporary table shortn2 (a int)
+master-bin.000001	#	Query	#	#	CREATE DATABASE `drop-temp+table-test`
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn1 (a INT)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE `table:name` (a INT)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn2 (a INT)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp1(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; CREATE TABLE t(c1 int)
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS tmp, tmp1
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TEMPORARY TABLE tmp3
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
+master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t
 master-bin.000001	#	Query	#	#	use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
-drop database `drop-temp+table-test`;
+DROP DATABASE `drop-temp+table-test`;

=== modified file 'mysql-test/suite/innodb/r/innodb_file_format.result'
--- a/mysql-test/suite/innodb/r/innodb_file_format.result	2009-07-30 12:42:56 +0000
+++ b/mysql-test/suite/innodb/r/innodb_file_format.result	2009-09-02 16:58:17 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
 select @@innodb_file_format;
 @@innodb_file_format
 Antelope

=== modified file 'mysql-test/suite/innodb/t/innodb_file_format.test'
--- a/mysql-test/suite/innodb/t/innodb_file_format.test	2009-07-30 12:42:56 +0000
+++ b/mysql-test/suite/innodb/t/innodb_file_format.test	2009-09-02 16:58:17 +0000
@@ -1,6 +1,8 @@
 -- source include/have_innodb.inc
 -- source suite/innodb/include/have_innodb_plugin.inc
 
+call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
+
 let $format=`select @@innodb_file_format`;
 let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
 

=== modified file 'mysql-test/suite/parts/r/partition_recover_myisam.result'
--- a/mysql-test/suite/parts/r/partition_recover_myisam.result	2008-08-19 09:44:22 +0000
+++ b/mysql-test/suite/parts/r/partition_recover_myisam.result	2009-08-29 21:29:47 +0000
@@ -1,3 +1,5 @@
+call mtr.add_suppression("./test/t1_will_crash");
+call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
 CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM;
 INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
 FLUSH TABLES;

=== modified file 'mysql-test/suite/parts/t/partition_recover_myisam.test'
--- a/mysql-test/suite/parts/t/partition_recover_myisam.test	2009-02-01 12:00:48 +0000
+++ b/mysql-test/suite/parts/t/partition_recover_myisam.test	2009-08-29 21:29:47 +0000
@@ -1,4 +1,8 @@
 # test the auto-recover (--myisam-recover) of partitioned myisam tables
+
+call mtr.add_suppression("./test/t1_will_crash");
+call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc");
+
 --source include/have_partition.inc
 --disable_warnings
 --disable_query_log

=== modified file 'mysql-test/suite/rpl/r/rpl_bug33931.result'
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result	2009-02-11 11:56:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result	2009-08-28 14:13:27 +0000
@@ -1,5 +1,5 @@
 reset master;
-call mtr.add_suppression("Failed during slave thread initialization");
+call mtr.add_suppression("Failed during slave I/O thread initialization");
 stop slave;
 reset slave;
 SET GLOBAL debug="d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";

=== modified file 'mysql-test/suite/rpl/r/rpl_do_grant.result'
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result	2009-03-18 13:48:23 +0000
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result	2009-09-01 11:38:17 +0000
@@ -166,4 +166,7 @@ DROP FUNCTION upgrade_del_func;
 DROP FUNCTION upgrade_alter_func;
 DROP DATABASE bug42217_db;
 DROP USER 'create_rout_db'@'localhost';
+call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+USE mtr;
+call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
 "End of test"

=== modified file 'mysql-test/suite/rpl/r/rpl_extraCol_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result	2009-08-28 14:13:27 +0000
@@ -4,6 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
 **** Diff Table Def Start ****
 *** On Slave ***
 STOP SLAVE;

=== modified file 'mysql-test/suite/rpl/r/rpl_extraCol_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result	2009-08-28 14:13:27 +0000
@@ -4,6 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
 **** Diff Table Def Start ****
 *** On Slave ***
 STOP SLAVE;

=== modified file 'mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result'
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2009-07-16 06:56:43 +0000
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2009-09-27 09:00:29 +0000
@@ -4,6 +4,8 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
+call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again");
 SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
 IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
 1
@@ -16,7 +18,8 @@ start slave;
 SELECT RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
 RELEASE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
 1
-Slave_IO_Errno= 2013
+Check network error happened here
+NETWORK ERROR
 SELECT IS_FREE_LOCK("debug_lock.before_get_SERVER_ID");
 IS_FREE_LOCK("debug_lock.before_get_SERVER_ID")
 1
@@ -29,7 +32,8 @@ start slave;
 SELECT RELEASE_LOCK("debug_lock.before_get_SERVER_ID");
 RELEASE_LOCK("debug_lock.before_get_SERVER_ID")
 1
-Slave_IO_Errno= 2013
+Check network error happened here
+NETWORK ERROR
 set global debug= '';
 reset master;
 include/stop_slave.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_idempotency.result'
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result	2009-04-05 12:03:04 +0000
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result	2009-08-25 13:56:50 +0000
@@ -4,7 +4,8 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
 call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
 SET @old_slave_exec_mode= @@global.slave_exec_mode;
 CREATE TABLE t1 (a INT PRIMARY KEY);

=== modified file 'mysql-test/suite/rpl/r/rpl_init_slave_errors.result'
--- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result	2009-04-06 00:22:34 +0000
+++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result	2009-08-28 14:13:27 +0000
@@ -9,6 +9,7 @@ reset slave;
 SET GLOBAL debug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
 start slave;
 Reporting the following error: Failed during slave thread initialization
+call mtr.add_suppression("Failed during slave I/O thread initialization");
 SET GLOBAL debug= "";
 stop slave;
 reset slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_log_pos.result'
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result	2008-07-10 16:09:39 +0000
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result	2009-09-24 13:19:06 +0000
@@ -4,6 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
 master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>

=== added file 'mysql-test/suite/rpl/r/rpl_mysql_upgrade.result'
--- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result	2009-09-28 06:24:19 +0000
@@ -0,0 +1,13 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
+CREATE DATABASE `#mysql50#mysqltest-1`;
+Master position is not changed
+STOP SLAVE SQL_THREAD;
+Master position has been changed
+DROP DATABASE `mysqltest-1`;
+DROP DATABASE `#mysql50#mysqltest-1`;

=== modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
--- a/mysql-test/suite/rpl/r/rpl_packet.result	2009-01-23 12:22:05 +0000
+++ b/mysql-test/suite/rpl/r/rpl_packet.result	2009-09-24 13:19:06 +0000
@@ -4,6 +4,8 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
 drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
 create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
 SET @@global.max_allowed_packet=1024;
@@ -32,6 +34,21 @@ include/start_slave.inc
 CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
 INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
 Slave_IO_Running = No (expect No)
+SELECT "Got a packet bigger than 'max_allowed_packet' bytes" AS Last_IO_Error;
+Last_IO_Error
+Got a packet bigger than 'max_allowed_packet' bytes
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+Slave_IO_Running = No (expect No)
+SELECT "Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'" AS Last_IO_Error;
+Last_IO_Error
+Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'
 ==== clean up ====
 DROP TABLE t1;
 SET @@global.max_allowed_packet= 1024;

=== added file 'mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result'
--- a/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_disabled_slave_key.result	2009-09-27 21:02:47 +0000
@@ -0,0 +1,26 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t (a int, b int, c int, key(b));
+SET SQL_LOG_BIN=1;
+CREATE TABLE t (a int, b int, c int);
+INSERT INTO t VALUES (1,2,4);
+INSERT INTO t VALUES (4,3,4);
+DELETE FROM t;
+DROP TABLE t;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t (a int, b int, c int, key(b));
+ALTER TABLE t DISABLE KEYS;
+INSERT INTO t VALUES (1,2,4);
+INSERT INTO t VALUES (4,3,4);
+DELETE FROM t;
+DROP TABLE t;

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	2009-03-23 01:07:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	2009-09-01 11:38:17 +0000
@@ -51,3 +51,4 @@ Last_SQL_Errno	9
 Last_SQL_Error	Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
 drop table t1;
 drop table t1;
+call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2009-07-06 22:20:17 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2009-09-27 10:12:58 +0000
@@ -10,6 +10,3 @@
 #
 ##############################################################################
 
-rpl_cross_version      : Bug#42311 2009-03-27 joro rpl_cross_version fails on macosx
-rpl_init_slave         : Bug#44920 2009-07006 pcrews MTR2 is not processing master.opt input properly on Windows.  *Must be done this way due to the nature of the bug*
-

=== modified file 'mysql-test/suite/rpl/t/rpl_bug33931.test'
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test	2009-02-11 11:56:25 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test	2009-08-28 14:13:27 +0000
@@ -15,7 +15,7 @@ reset master;
 connection slave;
 
 # Add suppression for expected warnings in slaves error log
-call mtr.add_suppression("Failed during slave thread initialization");
+call mtr.add_suppression("Failed during slave I/O thread initialization");
 
 --disable_warnings
 stop slave;

=== modified file 'mysql-test/suite/rpl/t/rpl_do_grant.test'
--- a/mysql-test/suite/rpl/t/rpl_do_grant.test	2009-09-13 21:43:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_do_grant.test	2009-09-18 13:35:40 +0000
@@ -210,5 +210,10 @@ DROP FUNCTION upgrade_del_func;
 DROP FUNCTION upgrade_alter_func;
 DROP DATABASE bug42217_db;
 DROP USER 'create_rout_db'@'localhost';
- 
+
+call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+connection slave;
+USE mtr;
+call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
+
 --echo "End of test"

=== modified file 'mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test'
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2009-07-17 05:07:43 +0000
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2009-09-24 13:19:06 +0000
@@ -16,6 +16,8 @@
 
 source include/master-slave.inc;
 source include/have_debug.inc;
+call mtr.add_suppression("Slave I/O: .* failed with error: Lost connection to MySQL server at 'reading initial communication packet'");
+call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again");
 #Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
 connection slave;
 let $debug_saved= `select @@global.debug`;

=== modified file 'mysql-test/suite/rpl/t/rpl_idempotency.test'
--- a/mysql-test/suite/rpl/t/rpl_idempotency.test	2009-04-05 12:03:04 +0000
+++ b/mysql-test/suite/rpl/t/rpl_idempotency.test	2009-08-25 13:56:50 +0000
@@ -8,7 +8,8 @@ connection slave;
 source include/have_innodb.inc;
 
 # Add suppression for expected warning(s) in slaves error log
-call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032");
+call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451");
 call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452");
 
 SET @old_slave_exec_mode= @@global.slave_exec_mode;

=== modified file 'mysql-test/suite/rpl/t/rpl_init_slave_errors.test'
--- a/mysql-test/suite/rpl/t/rpl_init_slave_errors.test	2009-04-06 00:22:34 +0000
+++ b/mysql-test/suite/rpl/t/rpl_init_slave_errors.test	2009-08-28 14:13:27 +0000
@@ -57,6 +57,7 @@ source include/wait_for_slave_to_stop.in
 
 let $error= query_get_value(SHOW SLAVE STATUS, Last_Error, 1);
 echo Reporting the following error: $error;
+call mtr.add_suppression("Failed during slave I/O thread initialization");
 
 SET GLOBAL debug= "";
 

=== modified file 'mysql-test/suite/rpl/t/rpl_log_pos.test'
--- a/mysql-test/suite/rpl/t/rpl_log_pos.test	2008-07-10 16:09:39 +0000
+++ b/mysql-test/suite/rpl/t/rpl_log_pos.test	2009-09-24 13:19:06 +0000
@@ -11,6 +11,7 @@
 # Passes with rbr no problem, removed statement include [jbm]
 
 source include/master-slave.inc;
+call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary");
 source include/show_master_status.inc;
 sync_slave_with_master;
 source include/stop_slave.inc;

=== added file 'mysql-test/suite/rpl/t/rpl_mysql_upgrade.test'
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test	2009-09-28 06:24:19 +0000
@@ -0,0 +1,56 @@
+#############################################################################
+# BUG#43579 mysql_upgrade tries to alter log tables on replicated database
+# Master and slave should be upgraded separately.  All statements executed by
+# mysql_upgrade will not be binlogged. --write-binlog and --skip-write-binlog
+# options are added into mysql_upgrade. These options control whether sql
+# statements are binlogged or not. 
+#############################################################################
+--source include/master-slave.inc
+
+# Only run test if "mysql_upgrade" is found
+--source include/have_mysql_upgrade.inc
+
+connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
+CREATE DATABASE `#mysql50#mysqltest-1`;
+--enable_warnings
+sync_slave_with_master;
+
+connection master;
+let $before_position= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
+#--skip-write-binlog option disables binlog.
+--exec $MYSQL_UPGRADE --skip-write-binlog --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
+sync_slave_with_master;
+
+connection master;
+let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+if (`SELECT '$before_position'='$after_position'`)
+{
+  echo Master position is not changed;
+}
+
+#Some log events of the mysql_upgrade's will cause errors on slave.
+connection slave;
+STOP SLAVE SQL_THREAD;
+source include/wait_for_slave_sql_to_stop.inc;
+
+connection master;
+#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
+--exec $MYSQL_UPGRADE --skip-verbose --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
+
+connection master;
+let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+if (!`SELECT '$before_position'='$after_position'`)
+{
+  echo Master position has been changed;
+}
+
+DROP DATABASE `mysqltest-1`;
+connection slave;
+DROP DATABASE `#mysql50#mysqltest-1`;

=== modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
--- a/mysql-test/suite/rpl/t/rpl_packet.test	2009-01-23 12:22:05 +0000
+++ b/mysql-test/suite/rpl/t/rpl_packet.test	2009-09-24 13:19:06 +0000
@@ -5,6 +5,9 @@
 
 # max-out size db name 
 source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
 
 let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
 disable_warnings;
@@ -86,6 +89,35 @@ connection slave;
 --source include/wait_for_slave_io_to_stop.inc
 let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
 --echo Slave_IO_Running = $slave_io_running (expect No)
+#
+# Bug#42914: The slave I/O thread must stop after trying to read the above
+# event, However there is no Last_IO_Error report.
+#
+let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+eval SELECT "$last_io_error" AS Last_IO_Error;
+
+#
+# Bug#42914: On the master, if a binary log event is larger than
+# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
+# is sent to a slave when it requests a dump from the master, thus leading the
+# I/O thread to stop. However, there is no Last_IO_Error reported.
+#
+source include/master-slave-reset.inc;
+connection master;
+CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+sync_slave_with_master;
+
+connection master;
+INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+
+connection slave;
+# The slave I/O thread must stop after receiving
+# ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
+--source include/wait_for_slave_io_to_stop.inc
+let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+--echo Slave_IO_Running = $slave_io_running (expect No)
+let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+eval SELECT "$last_io_error" AS Last_IO_Error;
 
 --echo ==== clean up ====
 connection master;

=== added file 'mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test'
--- a/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_disabled_slave_key.test	2009-09-27 21:02:47 +0000
@@ -0,0 +1,73 @@
+# BUG#47312: RBR: Disabling key on slave breaks replication:
+# HA_ERR_WRONG_INDEX
+#
+# Description
+# ===========
+#   
+#   This test case checks whether disabling a key on a slave breaks
+#   replication or not.
+#   
+#   Case #1, shows that while not using ALTER TABLE... DISABLE KEYS and
+#   the slave has no key defined while the master has one, replication
+#   won't break.
+#
+#   Case #2, shows that before patch for BUG#47312, if defining key on
+#   slave table, and later disable it, replication would break. This
+#   has been fixed.
+# 
+
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+#
+# Case #1: master has key, but slave has not. 

+#          Replication does not break.
+# 
+
+SET SQL_LOG_BIN=0;
+CREATE TABLE t (a int, b int, c int, key(b));
+SET SQL_LOG_BIN=1;
+
+-- connection slave
+
+CREATE TABLE t (a int, b int, c int);
+
+-- connection master
+
+INSERT INTO t VALUES (1,2,4);
+INSERT INTO t VALUES (4,3,4);
+DELETE FROM t;
+
+-- sync_slave_with_master
+
+-- connection master
+DROP TABLE t;
+
+-- sync_slave_with_master
+
+#
+# Case #2: master has key, slave also has one, 
+#          but it gets disabled sometime.
+#          Replication does not break anymore.
+# 
+-- source include/master-slave-reset.inc
+-- connection master
+
+CREATE TABLE t (a int, b int, c int, key(b));
+
+-- sync_slave_with_master
+
+ALTER TABLE t DISABLE KEYS;
+
+-- connection master
+
+INSERT INTO t VALUES (1,2,4);
+INSERT INTO t VALUES (4,3,4);
+DELETE FROM t;
+
+-- sync_slave_with_master
+
+-- connection master
+DROP TABLE t;
+
+-- sync_slave_with_master

=== modified file 'mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	2009-03-23 01:07:25 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	2009-09-01 11:38:17 +0000
@@ -7,6 +7,7 @@
 #    1 - Creates a table and populates it through "LOAD DATA INFILE".
 #    2 - Catches error.
 ##########################################################################
+
 --source include/have_binlog_format_mixed_or_statement.inc
 --source include/have_innodb.inc
 --source include/have_debug.inc
@@ -47,3 +48,5 @@ drop table t1;
 connection slave;
 
 drop table t1;
+
+call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result	2008-11-04 07:43:21 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result	2009-08-29 08:30:59 +0000
@@ -4,6 +4,7 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
 **** Diff Table Def Start ****
 *** On Slave ***
 STOP SLAVE;

=== modified file 'mysql-test/t/almost_full.test'
--- a/mysql-test/t/almost_full.test	2007-11-12 09:00:22 +0000
+++ b/mysql-test/t/almost_full.test	2009-08-25 13:56:50 +0000
@@ -2,6 +2,8 @@
 # Some special cases with empty tables
 #
 
+call mtr.add_suppression("The table 't1' is full");
+
 --disable_warnings
 drop table if exists t1;
 --enable_warnings

=== modified file 'mysql-test/t/alter_table.test'
--- a/mysql-test/t/alter_table.test	2008-12-09 13:31:22 +0000
+++ b/mysql-test/t/alter_table.test	2009-09-29 10:58:42 +0000
@@ -1000,4 +1000,50 @@ ALTER TABLE t1 MODIFY b ENUM('a', 'z', '
 SELECT * FROM t1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#45567: Fast ALTER TABLE broken for enum and set
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a ENUM('a1','a2'));
+INSERT INTO t1 VALUES ('a1'),('a2');
+--enable_info
+--echo # No copy: No modification
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2');
+--echo # No copy: Add new enumeration to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a3');
+--echo # Copy: Modify and add new to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx','a5');
+--echo # Copy: Remove from the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','xx');
+--echo # Copy: Add new enumeration
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx');
+--echo # No copy: Add new enumerations to the end
+ALTER TABLE t1 MODIFY COLUMN a ENUM('a1','a2','a0','xx','a5','a6');
+--disable_info
+DROP TABLE t1;
+
+CREATE TABLE t1 (a SET('a1','a2'));
+INSERT INTO t1 VALUES ('a1'),('a2');
+--enable_info
+--echo # No copy: No modification
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2');
+--echo # No copy: Add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a3');
+--echo # Copy: Modify and add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx','a5');
+--echo # Copy: Remove from the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','xx');
+--echo # Copy: Add new member
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx');
+--echo # No copy: Add new to the end
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6');
+--echo # Copy: Numerical incrase (pack lenght)
+ALTER TABLE t1 MODIFY COLUMN a SET('a1','a2','a0','xx','a5','a6','a7','a8','a9','a10');
+--disable_info
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'mysql-test/t/bug46080.test'
--- a/mysql-test/t/bug46080.test	2009-07-13 11:17:14 +0000
+++ b/mysql-test/t/bug46080.test	2009-09-03 06:38:06 +0000
@@ -3,6 +3,9 @@
 --echo #  sort_buffer_size cannot allocate
 --echo #
 
+call mtr.add_suppression("Out of memory at line .*, 'my_alloc.c'");
+call mtr.add_suppression("needed .* byte .*k., memory in use: .* bytes .*k");
+
 CREATE TABLE t1(a CHAR(255));
 INSERT INTO t1 VALUES ('a');
 

=== added file 'mysql-test/t/bug46760-master.opt'
--- a/mysql-test/t/bug46760-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/bug46760-master.opt	2009-09-18 13:01:18 +0000
@@ -0,0 +1,2 @@
+--innodb-lock-wait-timeout=2
+--innodb-file-per-table

=== added file 'mysql-test/t/bug46760.test'
--- a/mysql-test/t/bug46760.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/bug46760.test	2009-09-18 13:01:18 +0000
@@ -0,0 +1,38 @@
+-- source include/have_innodb.inc
+
+--echo #
+--echo # Bug#46760: Fast ALTER TABLE no longer works for InnoDB
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--echo # By using --enable_info and verifying that number of affected
+--echo # rows is 0 we check that this ALTER TABLE is really carried
+--echo # out as "fast/online" operation, i.e. without full-blown data
+--echo # copying.
+--echo #
+--echo # I.e. info for the below statement should normally look like:
+--echo #
+--echo # affected rows: 0
+--echo # info: Records: 0  Duplicates: 0  Warnings: 0
+
+--enable_info
+ALTER TABLE t1 ALTER COLUMN a SET DEFAULT 10;
+--disable_info
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MySQL Bug#39200: optimize table does not recognize 
+--echo # ROW_FORMAT=COMPRESSED
+--echo #
+
+CREATE TABLE t1 (a INT) ROW_FORMAT=compressed;
+SHOW CREATE TABLE t1;
+OPTIMIZE TABLE t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo End of 5.1 tests

=== modified file 'mysql-test/t/delete.test'
--- a/mysql-test/t/delete.test	2007-12-07 14:15:58 +0000
+++ b/mysql-test/t/delete.test	2009-09-28 10:48:52 +0000
@@ -292,3 +292,47 @@ DROP TABLE t1;
 DROP FUNCTION f1;
 
 --echo End of 5.0 tests
+
+--echo #
+--echo # Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger, 
+--echo # merge table
+--echo #
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+INSERT INTO t3 VALUES (1), (2);
+
+CREATE TRIGGER tr1 BEFORE DELETE ON t2
+FOR EACH ROW INSERT INTO no_such_table VALUES (1);
+
+--error ER_NO_SUCH_TABLE
+DELETE t1, t2, t3 FROM t1, t2, t3;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+DROP TABLE t1, t2, t3;
+
+CREATE TABLE t1 ( a INT );
+CREATE TABLE t2 ( a INT );
+CREATE TABLE t3 ( a INT );
+
+INSERT INTO t1 VALUES (1), (2);
+INSERT INTO t2 VALUES (1), (2);
+INSERT INTO t3 VALUES (1), (2);
+
+CREATE TRIGGER tr1 AFTER DELETE ON t2
+FOR EACH ROW INSERT INTO no_such_table VALUES (1);
+
+--error ER_NO_SUCH_TABLE
+DELETE t1, t2, t3 FROM t1, t2, t3;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+SELECT * FROM t3;
+
+DROP TABLE t1, t2, t3;

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-07-06 22:20:17 +0000
+++ b/mysql-test/t/disabled.def	2009-09-29 08:12:04 +0000
@@ -12,5 +12,5 @@
 kill                     : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
 innodb_bug39438          : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows.  Note that this test is not run on windows and on embedded in PB for main trees currently"
 query_cache_28249        : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
-init_connect             : Bug#44920 2009-07-06 pcrews MTR not processing master.opt input properly on Windows.  *Must be done this way due to the nature of the bug*
-
+partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
+partition_innodb_plugin  : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes

=== modified file 'mysql-test/t/events_logs_tests-master.opt'
--- a/mysql-test/t/events_logs_tests-master.opt	2006-03-01 15:27:57 +0000
+++ b/mysql-test/t/events_logs_tests-master.opt	2009-08-27 13:17:09 +0000
@@ -1 +1 @@
---log-slow-queries
+--log-output=table,file --log-slow-queries

=== modified file 'mysql-test/t/innodb-autoinc.test'
--- a/mysql-test/t/innodb-autoinc.test	2009-03-12 00:18:44 +0000
+++ b/mysql-test/t/innodb-autoinc.test	2009-09-23 12:12:12 +0000
@@ -478,3 +478,23 @@ INSERT INTO t2 SELECT c1 FROM t1;
 INSERT INTO t2 SELECT NULL FROM t1;
 DROP TABLE t1;
 DROP TABLE t2;
+#
+# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
+# the index (PRIMARY)
+# This test requires a restart of the server
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+INSERT INTO t1 VALUES (null);
+ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+SELECT * FROM t1;
+# Restart the server
+-- source include/restart_mysqld.inc
+# The MySQL and InnoDB data dictionaries should now be out of sync.
+# The select should print message to the error log
+SELECT * FROM t1;
+-- error ER_AUTOINC_READ_FAILED,1467
+INSERT INTO t1 VALUES(null);
+ALTER TABLE t1 AUTO_INCREMENT = 3;
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/insert_select.test'
--- a/mysql-test/t/insert_select.test	2009-07-24 12:09:35 +0000
+++ b/mysql-test/t/insert_select.test	2009-09-02 16:58:17 +0000
@@ -407,6 +407,7 @@ SET GLOBAL myisam_data_pointer_size = 2;
 
 INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
 
+call mtr.add_suppression("mysqld: The table '.*#sql.*' is full");
 --error ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL
 INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7;
 

=== modified file 'mysql-test/t/join.test'
--- a/mysql-test/t/join.test	2008-10-06 12:37:52 +0000
+++ b/mysql-test/t/join.test	2009-09-29 02:23:38 +0000
@@ -729,4 +729,24 @@ SELECT * FROM t1 JOIN t2 ON b=c ORDER BY
 SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a;
 
 DROP TABLE IF EXISTS t1,t2;
+
 --echo End of 5.0 tests.
+
+
+#
+# Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE
+#
+CREATE TABLE t1 (f1 int);
+
+CREATE TABLE t2 (f1 int);
+INSERT INTO t2  VALUES (1);
+CREATE VIEW v1 AS SELECT * FROM t2;
+
+PREPARE stmt FROM 'UPDATE t2 AS A NATURAL JOIN v1 B SET B.f1 = 1';
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+
+DROP VIEW v1;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/t/log_tables-master.opt'
--- a/mysql-test/t/log_tables-master.opt	2006-03-06 18:03:17 +0000
+++ b/mysql-test/t/log_tables-master.opt	2009-08-27 13:17:09 +0000
@@ -1 +1 @@
---log-slow-queries
+--log-output=table,file --log-slow-queries

=== modified file 'mysql-test/t/lowercase_table3.test'
--- a/mysql-test/t/lowercase_table3.test	2009-02-13 21:12:59 +0000
+++ b/mysql-test/t/lowercase_table3.test	2009-08-28 14:13:27 +0000
@@ -9,7 +9,7 @@
 --source include/have_case_insensitive_file_system.inc
 --source include/not_windows.inc
 
-call mtr.add_suppression("Cannot find or open table test/BUG29839 from .*");
+call mtr.add_suppression("Cannot find or open table test/BUG29839 from");
 
 --disable_warnings
 DROP TABLE IF EXISTS t1,T1;

=== modified file 'mysql-test/t/myisam-system.test'
--- a/mysql-test/t/myisam-system.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/t/myisam-system.test	2009-09-17 11:33:23 +0000
@@ -12,11 +12,11 @@ let $MYSQLD_DATADIR= `select @@datadir`;
 drop table if exists t1;
 create table t1 (a int) engine=myisam;
 --remove_file $MYSQLD_DATADIR/test/t1.MYI
---error 1051,6
+--error ER_BAD_TABLE_ERROR,6
 drop table t1;
 create table t1 (a int) engine=myisam;
 --remove_file $MYSQLD_DATADIR/test/t1.MYD
---error 1105,6,29
+--error ER_BAD_TABLE_ERROR,6,29
 drop table t1;
---error 1051
+--error ER_BAD_TABLE_ERROR
 drop table t1;

=== modified file 'mysql-test/t/myisam.test'
--- a/mysql-test/t/myisam.test	2009-04-30 11:03:44 +0000
+++ b/mysql-test/t/myisam.test	2009-09-21 09:58:15 +0000
@@ -1503,5 +1503,20 @@ SELECT h+0, d + 0, e, g + 0 FROM t1;
 
 DROP TABLE t1;
 
+--echo #
+--echo # Test of BUG#35570 CHECKSUM TABLE unreliable if LINESTRING field
+--echo # (same content / differen checksum)
+--echo #
+
+CREATE TABLE t1 (line LINESTRING NOT NULL) engine=myisam;
+INSERT INTO t1 VALUES (GeomFromText("POINT(0 0)"));
+checksum table t1;
+CREATE TABLE t2 (line LINESTRING NOT NULL) engine=myisam;
+INSERT INTO t2 VALUES (GeomFromText("POINT(0 0)"));
+checksum table t2;
+CREATE TABLE t3 select * from t1;
+checksum table t3;
+drop table t1,t2,t3;
+
 --echo End of 5.1 tests
 

=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test	2009-05-27 20:54:40 +0000
+++ b/mysql-test/t/mysqltest.test	2009-09-02 09:17:33 +0000
@@ -853,16 +853,18 @@ while ($outer)
   eval SELECT '$outer = outer loop variable after dec' AS "";
 }
 
+# Test source in an if in a while which is false on 1st iteration
 let $outer= 2; # Number of outer loops
+let $ifval= 0; # false 1st time
 while ($outer)
 {
-  eval SELECT '$outer = outer loop variable after while' AS "";
+  echo outer=$outer ifval=$ifval;
 
-  echo here is the sourced script;
-
-  eval SELECT '$outer = outer loop variable before dec' AS "";
+  if ($ifval) {
+    --source $MYSQLTEST_VARDIR/tmp/sourced.inc
+  }
   dec $outer;
-  eval SELECT '$outer = outer loop variable after dec' AS "";
+  inc $ifval;
 }
 
 
@@ -1663,6 +1665,20 @@ EOF
 
 remove_file $MYSQLTEST_VARDIR/tmp/test_file1.tmp;
 
+# Test append_file within while
+let $outer= 2; # Number of outer loops
+while ($outer)
+{
+  append_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+These lines should be repeated,
+if things work as expected
+EOF
+  dec $outer;
+}
+
+cat_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+remove_file $MYSQLTEST_VARDIR/tmp/app_while.tmp;
+
 # ----------------------------------------------------------------------------
 # test for cat_file
 # ----------------------------------------------------------------------------
@@ -1710,10 +1726,6 @@ EOF
 --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
 --diff_files $MYSQLTEST_VARDIR/tmp/diff2.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
 
-# Write the below commands to a intermediary file and execute them with
-# mysqltest in --exec, since the output will vary depending on what "diff"
-# is available it is sent to /dev/null
---write_file $MYSQLTEST_VARDIR/tmp/diff.test
 # Compare files that differ in size
 --error 2
 --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp
@@ -1725,13 +1737,6 @@ EOF
 --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
 --error 1
 --diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
-exit;
-EOF
-
-# Execute the above diffs, and send their output to /dev/null - only
-# interesting to see that it returns correct error codes
---exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/diff.test > /dev/null 2>&1
-
 
 # Compare equal files, again...
 --diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
@@ -1740,7 +1745,6 @@ EOF
 --remove_file $MYSQLTEST_VARDIR/tmp/diff2.tmp
 --remove_file $MYSQLTEST_VARDIR/tmp/diff3.tmp
 --remove_file $MYSQLTEST_VARDIR/tmp/diff4.tmp
---remove_file $MYSQLTEST_VARDIR/tmp/diff.test
 
 
 # ----------------------------------------------------------------------------

=== modified file 'mysql-test/t/not_partition.test'
--- a/mysql-test/t/not_partition.test	2009-01-08 14:16:44 +0000
+++ b/mysql-test/t/not_partition.test	2009-09-02 21:29:11 +0000
@@ -15,7 +15,7 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
 # Bug#39893: Crash if select on a partitioned table,
 #            when partitioning is disabled
 FLUSH TABLES;
---copy_file $MYSQLTEST_VARDIR/std_data_ln/parts/t1.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file $MYSQLTEST_VARDIR/std_data/parts/t1.frm $MYSQLD_DATADIR/test/t1.frm
 SELECT * FROM t1;
 TRUNCATE TABLE t1;
 ANALYZE TABLE t1;

=== modified file 'mysql-test/t/partition_csv.test'
--- a/mysql-test/t/partition_csv.test	2009-07-31 23:39:26 +0000
+++ b/mysql-test/t/partition_csv.test	2009-09-03 06:38:06 +0000
@@ -10,6 +10,8 @@
 --source include/have_partition.inc
 --source include/have_csv.inc
 
+call mtr.add_suppression("Failed to write to mysql.general_log");
+
 #
 # Bug#19307: Partitions: csv delete failure
 #            = CSV engine crashes

=== added file 'mysql-test/t/partition_innodb_builtin.test'
--- a/mysql-test/t/partition_innodb_builtin.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/partition_innodb_builtin.test	2009-09-25 09:26:49 +0000
@@ -0,0 +1,67 @@
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source include/have_not_innodb_plugin.inc
+
+#
+# Bug#32430 - show engine innodb status causes errors
+#
+SET NAMES utf8;
+CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
+ENGINE=InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION `p0``\""e` VALUES LESS THAN (100)
+ (SUBPARTITION `sp0``\""e`,
+  SUBPARTITION `sp1``\""e`),
+ PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
+ (SUBPARTITION `sp2``\""e`,
+  SUBPARTITION `sp3``\""e`));
+INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
+START TRANSACTION;
+--echo # con1
+connect(con1,localhost,root,,);
+SET NAMES utf8;
+START TRANSACTION;
+--echo # default connection
+connection default;
+UPDATE `t``\""e` SET a = 16 WHERE a = 0;
+--echo # con1
+connection con1;
+UPDATE `t``\""e` SET a = 8 WHERE a = 22;
+let $id_1= `SELECT CONNECTION_ID()`;
+SEND;
+UPDATE `t``\""e` SET a = 12 WHERE a = 0;
+--echo # default connection
+connection default;
+let $wait_timeout= 2;
+let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE ID = $id_1 AND STATE = 'Searching rows for update';
+--source include/wait_condition.inc
+#--echo # tested wait condition $wait_condition_reps times
+--error ER_LOCK_DEADLOCK
+UPDATE `t``\""e` SET a = 4 WHERE a = 22;
+--echo # First table reported in 'SHOW ENGINE InnoDB STATUS'
+# RECORD LOCKS space id 0 page no 50 n bits 80 index `PRIMARY` in \
+# Database `test`, Table `t1`, Partition `p0`, Subpartition `sp0` \
+# trx id 0 775
+# NOTE: replace_regex is very slow on match copy/past '(.*)' regex's
+# on big texts, removing a lot of text before + after makes it much faster.
+#/.*in (.*) trx.*/\1/
+--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
+SHOW ENGINE InnoDB STATUS;
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+# INNODB_LOCKS only exists in innodb_plugin
+#SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;
+--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
+SHOW ENGINE InnoDB STATUS;
+set @@sql_mode = @old_sql_mode;
+--echo # con1
+connection con1;
+REAP;
+ROLLBACK;
+disconnect con1;
+--echo # default connection
+connection default;
+DROP TABLE `t``\""e`;
+SET NAMES DEFAULT;

=== added file 'mysql-test/t/partition_innodb_plugin.test'
--- a/mysql-test/t/partition_innodb_plugin.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/partition_innodb_plugin.test	2009-09-25 09:26:49 +0000
@@ -0,0 +1,75 @@
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source suite/innodb/include/have_innodb_plugin.inc
+
+#
+# Bug#32430 - show engine innodb status causes errors
+#
+SET NAMES utf8;
+CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
+ENGINE=InnoDB
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION `p0``\""e` VALUES LESS THAN (100)
+ (SUBPARTITION `sp0``\""e`,
+  SUBPARTITION `sp1``\""e`),
+ PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
+ (SUBPARTITION `sp2``\""e`,
+  SUBPARTITION `sp3``\""e`));
+INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
+START TRANSACTION;
+--echo # con1
+connect(con1,localhost,root,,);
+SET NAMES utf8;
+START TRANSACTION;
+--echo # default connection
+connection default;
+UPDATE `t``\""e` SET a = 16 WHERE a = 0;
+--echo # con1
+connection con1;
+UPDATE `t``\""e` SET a = 8 WHERE a = 22;
+let $id_1= `SELECT CONNECTION_ID()`;
+SEND;
+UPDATE `t``\""e` SET a = 12 WHERE a = 0;
+--echo # default connection
+connection default;
+let $wait_timeout= 2;
+let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE ID = $id_1 AND STATE = 'Searching rows for update';
+--source include/wait_condition.inc
+#--echo # tested wait condition $wait_condition_reps times
+# INNODB_LOCKS only exists in innodb_plugin
+--sorted_result
+SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
+GROUP BY lock_table;
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+--sorted_result
+SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
+GROUP BY lock_table;
+set @@sql_mode = @old_sql_mode;
+--error ER_LOCK_DEADLOCK
+UPDATE `t``\""e` SET a = 4 WHERE a = 22;
+--echo # First table reported in 'SHOW ENGINE InnoDB STATUS'
+# RECORD LOCKS space id 0 page no 50 n bits 80 index `PRIMARY` in \
+# Database `test`, Table `t1`, Partition `p0`, Subpartition `sp0` \
+# trx id 0 775
+# NOTE: replace_regex is very slow on match copy/past '(.*)' regex's
+# on big texts, removing a lot of text before + after makes it much faster.
+#/.*in (.*) trx.*/\1/
+--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
+SHOW ENGINE InnoDB STATUS;
+set @old_sql_mode = @@sql_mode;
+set sql_mode = 'ANSI_QUOTES';
+--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in //
+SHOW ENGINE InnoDB STATUS;
+set @@sql_mode = @old_sql_mode;
+--echo # con1
+connection con1;
+REAP;
+ROLLBACK;
+disconnect con1;
+--echo # default connection
+connection default;
+DROP TABLE `t``\""e`;
+SET NAMES DEFAULT;

=== modified file 'mysql-test/t/ps-master.opt'
--- a/mysql-test/t/ps-master.opt	2006-10-12 23:10:34 +0000
+++ b/mysql-test/t/ps-master.opt	2009-08-27 13:17:09 +0000
@@ -1 +1 @@
---log-slow-queries --log-long-format --log-queries-not-using-indexes
+--log-output=table,file --log-slow-queries --log-long-format --log-queries-not-using-indexes

=== modified file 'mysql-test/t/show_check-master.opt'
--- a/mysql-test/t/show_check-master.opt	2007-08-01 06:41:13 +0000
+++ b/mysql-test/t/show_check-master.opt	2009-08-27 13:17:09 +0000
@@ -1 +1 @@
---log-slow-queries --log-long-format --log-queries-not-using-indexes --myisam-recover=""
+--log-output=table,file --log-slow-queries --log-long-format --log-queries-not-using-indexes --myisam-recover=""

=== added file 'mysql-test/t/status-master.opt'
--- a/mysql-test/t/status-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/status-master.opt	2009-08-27 13:17:09 +0000
@@ -0,0 +1 @@
+--log-output=table,file

=== modified file 'mysql-test/t/subselect4.test'
--- a/mysql-test/t/subselect4.test	2009-09-03 15:03:46 +0000
+++ b/mysql-test/t/subselect4.test	2009-09-18 09:34:08 +0000
@@ -28,5 +28,37 @@ SELECT 1;
 
 DROP TABLE t1,t2,t3;
 
+--echo #
+--echo # Bug #47106: Crash / segfault on adding EXPLAIN to a non-crashing 
+--echo # query
+--echo #
+
+CREATE TABLE t1 (
+  a INT,
+  b INT,
+  PRIMARY KEY (a),
+  KEY b (b)
+);
+INSERT INTO t1 VALUES (1, 1), (2, 1);
+
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * FROM t1;
+
+CREATE TABLE t3 LIKE t1;
+INSERT INTO t3 SELECT * FROM t1;
+
+--echo # Should not crash.
+--echo # Should have 1 impossible where and 2 dependent subqs.
+EXPLAIN
+SELECT
+  (SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
+FROM t3 WHERE 1 = 0 GROUP BY 1;
+
+--echo # should return 0 rows
+SELECT
+  (SELECT 1 FROM t1,t2 WHERE t2.b > t3.b)
+FROM t3 WHERE 1 = 0 GROUP BY 1;
+
+DROP TABLE t1,t2,t3;
 
 --echo End of 5.0 tests.

=== modified file 'mysql-test/t/upgrade.test'
--- a/mysql-test/t/upgrade.test	2009-04-30 12:46:49 +0000
+++ b/mysql-test/t/upgrade.test	2009-08-25 13:56:50 +0000
@@ -124,6 +124,8 @@ with_check_option=0
 timestamp=2009-04-10 11:53:37
 create-version=1
 source=select f1 from `a-b-c`.t1 a, information_schema.tables b\nwhere a.f1 = b.table_name
+client_cs_name=utf8
+connection_cl_name=utf8_general_ci
 EOF
 
 show databases like '%a-b-c%';

=== modified file 'mysql-test/t/windows.test'
--- a/mysql-test/t/windows.test	2009-02-12 09:52:01 +0000
+++ b/mysql-test/t/windows.test	2009-09-22 11:22:07 +0000
@@ -92,3 +92,9 @@ execute abc;
 execute abc;
 deallocate prepare abc;
 
+--echo #
+--echo # Bug#45498: Socket variable not available on Windows
+--echo #
+
+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+  WHERE VARIABLE_NAME = 'socket';

=== modified file 'mysql-test/valgrind.supp'
--- a/mysql-test/valgrind.supp	2009-08-06 03:07:09 +0000
+++ b/mysql-test/valgrind.supp	2009-09-25 11:52:41 +0000
@@ -1,4 +1,3 @@
-#
 # Suppress some common (not fatal) errors in system libraries found by valgrind
 #
 
@@ -625,3 +624,101 @@
    fun:start_thread
 }
 
+# suppressions for glibc 2.6.1 64 bit
+
+{
+   Mem loss within nptl_pthread_exit_hack_handler 6
+   Memcheck:Leak
+   fun:malloc
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   fun:__libc_dlopen_mode
+   fun:pthread_cancel_init
+   fun:_Unwind_ForcedUnwind
+   fun:__pthread_unwind
+   fun:pthread_exit
+   fun:nptl_pthread_exit_hack_handler
+}
+
+{
+   Mem loss within nptl_pthread_exit_hack_handler 7
+   Memcheck:Leak
+   fun:malloc
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   fun:__libc_dlopen_mode
+   fun:pthread_cancel_init
+   fun:_Unwind_ForcedUnwind
+   fun:__pthread_unwind
+   fun:pthread_exit
+   fun:nptl_pthread_exit_hack_handler
+   fun:start_thread
+   fun:clone
+}
+
+{
+   Mem loss within nptl_pthread_exit_hack_handler 8
+   Memcheck:Leak
+   fun:calloc
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   fun:__libc_dlopen_mode
+   fun:pthread_cancel_init
+   fun:_Unwind_ForcedUnwind
+   fun:__pthread_unwind
+   fun:pthread_exit
+   fun:nptl_pthread_exit_hack_handler
+   fun:start_thread
+   fun:clone
+}
+
+{
+   Mem loss within nptl_pthread_exit_hack_handler 8
+   Memcheck:Leak
+   fun:calloc
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   obj:*/ld-*.so
+   obj:*/libc-*.so
+   fun:__libc_dlopen_mode
+   fun:pthread_cancel_init
+   fun:_Unwind_ForcedUnwind
+   fun:__pthread_unwind
+   fun:pthread_exit
+   fun:nptl_pthread_exit_hack_handler
+}
+
+#
+# Pthread doesn't free all thread specific memory before program exists
+#
+{
+   pthread allocate_tls memory loss in 2.6.1.
+   Memcheck:Leak 
+   fun:calloc
+   obj:*/ld-*.so
+   fun:_dl_allocate_tls
+   fun:pthread_create*
+}
+

=== modified file 'mysys/hash.c'
--- a/mysys/hash.c	2009-06-22 11:10:34 +0000
+++ b/mysys/hash.c	2009-09-17 15:25:52 +0000
@@ -332,13 +332,8 @@ my_bool my_hash_insert(HASH *info, const
 {
   int flag;
   size_t idx,halfbuff,hash_nr,first_index;
-  uchar *ptr_to_rec,*ptr_to_rec2;
-  HASH_LINK *data,*empty,*gpos,*gpos2,*pos;
-
-  LINT_INIT(gpos);
-  LINT_INIT(gpos2);
-  LINT_INIT(ptr_to_rec);
-  LINT_INIT(ptr_to_rec2);
+  uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2);
+  HASH_LINK *data,*empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos;
 
   if (HASH_UNIQUE & info->flags)
   {

=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c	2009-07-10 23:12:13 +0000
+++ b/mysys/mf_keycache.c	2009-09-24 13:28:13 +0000
@@ -13,7 +13,8 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
-/*
+/**
+  @file
   These functions handle keyblock cacheing for ISAM and MyISAM tables.
 
   One cache can handle many files.
@@ -36,7 +37,9 @@
   blocks_unused is the sum of never used blocks in the pool and of currently
   free blocks. blocks_used is the number of blocks fetched from the pool and
   as such gives the maximum number of in-use blocks at any time.
+*/
 
+/*
   Key Cache Locking
   =================
 
@@ -368,8 +371,8 @@ static inline uint next_power(uint value
 */
 
 int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
-		   size_t use_mem, uint division_limit,
-		   uint age_threshold)
+                   size_t use_mem, uint division_limit,
+                   uint age_threshold)
 {
   ulong blocks, hash_links;
   size_t length;
@@ -560,8 +563,8 @@ err:
 */
 
 int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
-		     size_t use_mem, uint division_limit,
-		     uint age_threshold)
+                     size_t use_mem, uint division_limit,
+                     uint age_threshold)
 {
   int blocks;
   DBUG_ENTER("resize_key_cache");
@@ -760,6 +763,13 @@ void end_key_cache(KEY_CACHE *keycache, 
                         (ulong) keycache->global_cache_r_requests,
                         (ulong) keycache->global_cache_read));
 
+  /*
+    Reset these values to be able to detect a disabled key cache.
+    See Bug#44068 (RESTORE can disable the MyISAM Key Cache).
+  */
+  keycache->blocks_used= 0;
+  keycache->blocks_unused= 0;
+
   if (cleanup)
   {
     pthread_mutex_destroy(&keycache->cache_lock);
@@ -1343,7 +1353,11 @@ static void unreg_request(KEY_CACHE *key
   DBUG_ASSERT(block->prev_changed && *block->prev_changed == block);
   DBUG_ASSERT(!block->next_used);
   DBUG_ASSERT(!block->prev_used);
-  if (! --block->requests)
+  /*
+    Unregister the request, but do not link erroneous blocks into the
+    LRU ring.
+  */
+  if (!--block->requests && !(block->status & BLOCK_ERROR))
   {
     my_bool hot;
     if (block->hits_left)
@@ -1425,8 +1439,7 @@ static void wait_for_readers(KEY_CACHE *
 #ifdef THREAD
   struct st_my_thread_var *thread= my_thread_var;
   DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
-  DBUG_ASSERT(!(block->status & (BLOCK_ERROR | BLOCK_IN_FLUSH |
-                                 BLOCK_CHANGED)));
+  DBUG_ASSERT(!(block->status & (BLOCK_IN_FLUSH | BLOCK_CHANGED)));
   DBUG_ASSERT(block->hash_link);
   DBUG_ASSERT(block->hash_link->block == block);
   /* Linked in file_blocks or changed_blocks hash. */
@@ -2210,9 +2223,9 @@ restart:
                 thread might change the block->hash_link value
               */
               error= my_pwrite(block->hash_link->file,
-                               block->buffer+block->offset,
+                               block->buffer + block->offset,
                                block->length - block->offset,
-                               block->hash_link->diskpos+ block->offset,
+                               block->hash_link->diskpos + block->offset,
                                MYF(MY_NABP | MY_WAIT_IF_FULL));
               keycache_pthread_mutex_lock(&keycache->cache_lock);
 
@@ -2536,7 +2549,6 @@ uchar *key_cache_read(KEY_CACHE *keycach
     reg1 BLOCK_LINK *block;
     uint read_length;
     uint offset;
-    uint status;
     int page_st;
 
     /*
@@ -2571,9 +2583,11 @@ uchar *key_cache_read(KEY_CACHE *keycach
     do
     {
       /* Cache could be disabled in a later iteration. */
-
       if (!keycache->can_be_used)
-	goto no_key_cache;
+      {
+        KEYCACHE_DBUG_PRINT("key_cache_read", ("keycache cannot be used"));
+        goto no_key_cache;
+      }
       /* Start reading at the beginning of the cache block. */
       filepos-= offset;
       /* Do not read beyond the end of the cache block. */
@@ -2634,7 +2648,7 @@ uchar *key_cache_read(KEY_CACHE *keycach
       }
 
       /* block status may have added BLOCK_ERROR in the above 'if'. */
-      if (!((status= block->status) & BLOCK_ERROR))
+      if (!(block->status & BLOCK_ERROR))
       {
 #ifndef THREAD
         if (! return_buffer)
@@ -2660,14 +2674,22 @@ uchar *key_cache_read(KEY_CACHE *keycach
 
       remove_reader(block);
 
-      /*
-         Link the block into the LRU ring if it's the last submitted
-         request for the block. This enables eviction for the block.
-           */
-      unreg_request(keycache, block, 1);
+      /* Error injection for coverage testing. */
+      DBUG_EXECUTE_IF("key_cache_read_block_error",
+                      block->status|= BLOCK_ERROR;);
 
-      if (status & BLOCK_ERROR)
+      /* Do not link erroneous blocks into the LRU ring, but free them. */
+      if (!(block->status & BLOCK_ERROR))
+      {
+        /*
+          Link the block into the LRU ring if it's the last submitted
+          request for the block. This enables eviction for the block.
+        */
+        unreg_request(keycache, block, 1);
+      }
+      else
       {
+        free_block(keycache, block);
         error= 1;
         break;
       }
@@ -2677,7 +2699,7 @@ uchar *key_cache_read(KEY_CACHE *keycach
       if (return_buffer)
 	DBUG_RETURN(block->buffer);
 #endif
-  next_block:
+    next_block:
       buff+= read_length;
       filepos+= read_length+offset;
       offset= 0;
@@ -2685,6 +2707,7 @@ uchar *key_cache_read(KEY_CACHE *keycach
     } while ((length-= read_length));
     goto end;
   }
+  KEYCACHE_DBUG_PRINT("key_cache_read", ("keycache not initialized"));
 
 no_key_cache:
   /* Key cache is not used */
@@ -2705,6 +2728,7 @@ end:
     dec_counter_for_resize_op(keycache);
     keycache_pthread_mutex_unlock(&keycache->cache_lock);
   }
+  DBUG_PRINT("exit", ("error: %d", error ));
   DBUG_RETURN(error ? (uchar*) 0 : start);
 }
 
@@ -2913,19 +2937,27 @@ int key_cache_insert(KEY_CACHE *keycache
         DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
       } /* end of if (!(block->status & BLOCK_ERROR)) */
 
-
       remove_reader(block);
 
-      /*
-         Link the block into the LRU ring if it's the last submitted
-         request for the block. This enables eviction for the block.
-      */
-      unreg_request(keycache, block, 1);
-
-      error= (block->status & BLOCK_ERROR);
+      /* Error injection for coverage testing. */
+      DBUG_EXECUTE_IF("key_cache_insert_block_error",
+                      block->status|= BLOCK_ERROR; errno=EIO;);
 
-      if (error)
+      /* Do not link erroneous blocks into the LRU ring, but free them. */
+      if (!(block->status & BLOCK_ERROR))
+      {
+        /*
+          Link the block into the LRU ring if it's the last submitted
+          request for the block. This enables eviction for the block.
+        */
+        unreg_request(keycache, block, 1);
+      }
+      else
+      {
+        free_block(keycache, block);
+        error= 1;
         break;
+      }
 
       buff+= read_length;
       filepos+= read_length+offset;
@@ -3176,7 +3208,7 @@ int key_cache_write(KEY_CACHE *keycache,
 
       if (!dont_write)
       {
-	/* Not used in the server. buff has been written to disk at start. */
+        /* Not used in the server. buff has been written to disk at start. */
         if ((block->status & BLOCK_CHANGED) &&
             (!offset && read_length >= keycache->key_cache_block_size))
              link_to_file_list(keycache, block, block->hash_link->file, 1);
@@ -3206,14 +3238,24 @@ int key_cache_write(KEY_CACHE *keycache,
       */
       remove_reader(block);
 
-      /*
-         Link the block into the LRU ring if it's the last submitted
-         request for the block. This enables eviction for the block.
-      */
-      unreg_request(keycache, block, 1);
+      /* Error injection for coverage testing. */
+      DBUG_EXECUTE_IF("key_cache_write_block_error",
+                      block->status|= BLOCK_ERROR;);
 
-      if (block->status & BLOCK_ERROR)
+      /* Do not link erroneous blocks into the LRU ring, but free them. */
+      if (!(block->status & BLOCK_ERROR))
+      {
+        /*
+          Link the block into the LRU ring if it's the last submitted
+          request for the block. This enables eviction for the block.
+        */
+        unreg_request(keycache, block, 1);
+      }
+      else
       {
+        /* Pretend a "clean" block to avoid complications. */
+        block->status&= ~(BLOCK_CHANGED);
+        free_block(keycache, block);
         error= 1;
         break;
       }
@@ -3288,8 +3330,9 @@ static void free_block(KEY_CACHE *keycac
 {
   KEYCACHE_THREAD_TRACE("free block");
   KEYCACHE_DBUG_PRINT("free_block",
-                      ("block %u to be freed, hash_link %p",
-                       BLOCK_NUMBER(block), block->hash_link));
+                      ("block %u to be freed, hash_link %p  status: %u",
+                       BLOCK_NUMBER(block), block->hash_link,
+                       block->status));
   /*
     Assert that the block is not free already. And that it is in a clean
     state. Note that the block might just be assigned to a hash_link and
@@ -3371,10 +3414,14 @@ static void free_block(KEY_CACHE *keycac
   if (block->status & BLOCK_IN_EVICTION)
     return;
 
-  /* Here the block must be in the LRU ring. Unlink it again. */
-  DBUG_ASSERT(block->next_used && block->prev_used &&
-              *block->prev_used == block);
-  unlink_block(keycache, block);
+  /* Error blocks are not put into the LRU ring. */
+  if (!(block->status & BLOCK_ERROR))
+  {
+    /* Here the block must be in the LRU ring. Unlink it again. */
+    DBUG_ASSERT(block->next_used && block->prev_used &&
+                *block->prev_used == block);
+    unlink_block(keycache, block);
+  }
   if (block->temperature == BLOCK_WARM)
     keycache->warm_blocks--;
   block->temperature= BLOCK_COLD;
@@ -3463,8 +3510,7 @@ static int flush_cached_blocks(KEY_CACHE
                   (BLOCK_READ | BLOCK_IN_FLUSH | BLOCK_CHANGED | BLOCK_IN_USE));
       block->status|= BLOCK_IN_FLUSHWRITE;
       keycache_pthread_mutex_unlock(&keycache->cache_lock);
-      error= my_pwrite(file,
-                       block->buffer+block->offset,
+      error= my_pwrite(file, block->buffer+block->offset,
                        block->length - block->offset,
                        block->hash_link->diskpos+ block->offset,
                        MYF(MY_NABP | MY_WAIT_IF_FULL));
@@ -3491,7 +3537,6 @@ static int flush_cached_blocks(KEY_CACHE
         right queue anyway.
       */
       link_to_file_list(keycache, block, file, 1);
-
     }
     block->status&= ~BLOCK_IN_FLUSH;
     /*
@@ -3527,7 +3572,7 @@ static int flush_cached_blocks(KEY_CACHE
 
 
 /*
-  flush all key blocks for a file to disk, but don't do any mutex locks.
+  Flush all key blocks for a file to disk, but don't do any mutex locks.
 
   SYNOPSIS
     flush_key_blocks_int()
@@ -3560,8 +3605,8 @@ static int flush_key_blocks_int(KEY_CACH
               file, keycache->blocks_used, keycache->blocks_changed));
 
 #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
-    DBUG_EXECUTE("check_keycache",
-                 test_key_cache(keycache, "start of flush_key_blocks", 0););
+  DBUG_EXECUTE("check_keycache",
+               test_key_cache(keycache, "start of flush_key_blocks", 0););
 #endif
 
   cache= cache_buff;
@@ -3692,7 +3737,6 @@ restart:
             {
               /* It's a temporary file */
               DBUG_ASSERT(!(block->status & BLOCK_REASSIGNED));
-
               /*
                 free_block() must not be called with BLOCK_CHANGED. Note
                 that we must not change the BLOCK_CHANGED flag outside of
@@ -4403,8 +4447,8 @@ static void keycache_debug_print(const c
   va_start(args,fmt);
   if (keycache_debug_log)
   {
-    VOID(vfprintf(keycache_debug_log, fmt, args));
-    VOID(fputc('\n',keycache_debug_log));
+    (void) vfprintf(keycache_debug_log, fmt, args);
+    (void) fputc('\n',keycache_debug_log);
   }
   va_end(args);
 }

=== modified file 'mysys/my_largepage.c'
--- a/mysys/my_largepage.c	2007-10-02 07:32:33 +0000
+++ b/mysys/my_largepage.c	2009-09-18 07:19:02 +0000
@@ -121,7 +121,7 @@ uchar* my_large_malloc_int(size_t size, 
   DBUG_ENTER("my_large_malloc_int");
 
   /* Align block size to my_large_page_size */
-  size = ((size - 1) & ~(my_large_page_size - 1)) + my_large_page_size;
+  size= MY_ALIGN(size, (size_t) my_large_page_size);
   
   shmid = shmget(IPC_PRIVATE, size, SHM_HUGETLB | SHM_R | SHM_W);
   if (shmid < 0)

=== modified file 'mysys/my_thr_init.c'
--- a/mysys/my_thr_init.c	2008-12-04 18:41:53 +0000
+++ b/mysys/my_thr_init.c	2009-09-28 12:40:45 +0000
@@ -108,10 +108,11 @@ my_bool my_thread_global_init(void)
     pthread_attr_t  dummy_thread_attr;
 
     pthread_attr_init(&dummy_thread_attr);
-    pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_DETACHED);
+    pthread_attr_setdetachstate(&dummy_thread_attr, PTHREAD_CREATE_JOINABLE);
 
-    pthread_create(&dummy_thread,&dummy_thread_attr,
-                   nptl_pthread_exit_hack_handler, NULL);
+    if (pthread_create(&dummy_thread,&dummy_thread_attr,
+                       nptl_pthread_exit_hack_handler, NULL) == 0)
+      (void)pthread_join(dummy_thread, NULL);
   }
 #endif /* TARGET_OS_LINUX */
 

=== modified file 'scripts/make_win_bin_dist'
--- a/scripts/make_win_bin_dist	2009-04-14 19:53:00 +0000
+++ b/scripts/make_win_bin_dist	2009-09-04 15:45:07 +0000
@@ -279,6 +279,8 @@ cp include/mysql/plugin.h $DESTDIR/inclu
 # ----------------------------------------------------------------------
 
 mkdir -p $DESTDIR/lib/opt
+mkdir -p $DESTDIR/lib/plugin
+cp sql/$TARGET/mysqld.lib $DESTDIR/lib/
 cp libmysql/$TARGET/libmysql.dll \
    libmysql/$TARGET/libmysql.lib \
    libmysql/$TARGET/mysqlclient.lib \
@@ -286,6 +288,10 @@ cp libmysql/$TARGET/libmysql.dll \
    regex/$TARGET/regex.lib \
    strings/$TARGET/strings.lib \
    zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/
+if [ -d storage/innodb_plugin ]; then
+  cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \
+     $DESTDIR/lib/plugin/
+fi
 
 if [ x"$TARGET" != x"release" ] ; then
   cp libmysql/$TARGET/libmysql.pdb \
@@ -294,11 +300,17 @@ if [ x"$TARGET" != x"release" ] ; then
      regex/$TARGET/regex.pdb \
      strings/$TARGET/strings.pdb \
      zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/
+  if [ -d storage/innodb_plugin ]; then
+    cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \
+       $DESTDIR/lib/plugin/
+  fi
 fi
 
+
 if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \
      x"$PACK_DEBUG" = x"yes" ] ; then
   mkdir -p $DESTDIR/lib/debug
+  mkdir -p $DESTDIR/lib/plugin/debug
   cp libmysql/debug/libmysql.dll \
      libmysql/debug/libmysql.lib \
      libmysql/debug/libmysql.pdb \
@@ -312,6 +324,12 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysq
      strings/debug/strings.pdb \
      zlib/debug/zlib.lib \
      zlib/debug/zlib.pdb $DESTDIR/lib/debug/
+  if [ -d storage/innodb_plugin ]; then
+    cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \
+       storage/innodb_plugin/debug/ha_innodb_plugin.lib \
+       storage/innodb_plugin/debug/ha_innodb_plugin.pdb \
+       $DESTDIR/lib/plugin/debug/
+  fi
 fi
 
 # ----------------------------------------------------------------------

=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2009-09-01 11:04:56 +0000
+++ b/sql-common/my_time.c	2009-09-17 15:25:52 +0000
@@ -165,7 +165,7 @@ str_to_datetime(const char *str, uint le
   uint add_hours= 0, start_loop;
   ulong not_zero_date, allow_space;
   my_bool is_internal_format;
-  const char *pos, *last_field_pos;
+  const char *pos, *UNINIT_VAR(last_field_pos);
   const char *end=str+length;
   const uchar *format_position;
   my_bool found_delimitier= 0, found_space= 0;
@@ -174,7 +174,6 @@ str_to_datetime(const char *str, uint le
   DBUG_PRINT("ENTER",("str: %.*s",length,str));
 
   LINT_INIT(field_length);
-  LINT_INIT(last_field_pos);
 
   *was_cut= 0;
 

=== modified file 'sql/event_db_repository.cc'
--- a/sql/event_db_repository.cc	2008-11-10 20:21:49 +0000
+++ b/sql/event_db_repository.cc	2009-09-23 13:21:29 +0000
@@ -711,7 +711,7 @@ Event_db_repository::update_event(THD *t
   DBUG_ENTER("Event_db_repository::update_event");
 
   /* None or both must be set */
-  DBUG_ASSERT(new_dbname && new_name || new_dbname == new_name);
+  DBUG_ASSERT((new_dbname && new_name) || new_dbname == new_name);
 
   /* Reset sql_mode during data dictionary operations. */
   thd->variables.sql_mode= 0;

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2009-08-28 16:21:54 +0000
+++ b/sql/field.cc	2009-09-29 10:58:42 +0000
@@ -8833,38 +8833,81 @@ bool Field::eq_def(Field *field)
 
 
 /**
+  Compare the first t1::count type names.
+
+  @return TRUE if the type names of t1 match those of t2. FALSE otherwise.
+*/
+
+static bool compare_type_names(CHARSET_INFO *charset, TYPELIB *t1, TYPELIB *t2)
+{
+  for (uint i= 0; i < t1->count; i++)
+    if (my_strnncoll(charset,
+                     (const uchar*) t1->type_names[i],
+                     t1->type_lengths[i],
+                     (const uchar*) t2->type_names[i],
+                     t2->type_lengths[i]))
+      return FALSE;
+  return TRUE;
+}
+
+/**
   @return
   returns 1 if the fields are equally defined
 */
 
 bool Field_enum::eq_def(Field *field)
 {
+  TYPELIB *values;
+
   if (!Field::eq_def(field))
-    return 0;
-  return compare_enum_values(((Field_enum*) field)->typelib);
-}
+    return FALSE;
 
+  values= ((Field_enum*) field)->typelib;
 
-bool Field_enum::compare_enum_values(TYPELIB *values)
-{
+  /* Definition must be strictly equal. */

   if (typelib->count != values->count)
     return FALSE;
-  for (uint i= 0; i < typelib->count; i++)
-    if (my_strnncoll(field_charset,
-                     (const uchar*) typelib->type_names[i],
-                     typelib->type_lengths[i],
-                     (const uchar*) values->type_names[i],
-                     values->type_lengths[i]))
-      return FALSE;
-  return TRUE;
+
+  return compare_type_names(field_charset, typelib, values);
 }
 
 
+/**
+  Check whether two fields can be considered 'equal' for table
+  alteration purposes. Fields are equal if they retain the same
+  pack length and if new members are added to the end of the list.
+
+  @return IS_EQUAL_YES if fields are compatible.
+          IS_EQUAL_NO otherwise.
+*/
+
 uint Field_enum::is_equal(Create_field *new_field)
 {
-  if (!Field_str::is_equal(new_field))
-    return 0;
-  return compare_enum_values(new_field->interval);
+  TYPELIB *values= new_field->interval;
+
+  /*
+    The fields are compatible if they have the same flags,
+    type, charset and have the same underlying length.
+  */
+  if (compare_str_field_flags(new_field, flags) ||
+      new_field->sql_type != real_type() ||
+      new_field->charset != field_charset ||
+      new_field->pack_length != pack_length())
+    return IS_EQUAL_NO;
+
+  /*
+    Changing the definition of an ENUM or SET column by adding a new
+    enumeration or set members to the end of the list of valid member
+    values only alters table metadata and not table data.
+  */
+  if (typelib->count > values->count)
+    return IS_EQUAL_NO;
+
+  /* Check whether there are modification before the end. */
+  if (! compare_type_names(field_charset, typelib, new_field->interval))
+    return IS_EQUAL_NO;
+
+  return IS_EQUAL_YES;
 }
 
 

=== modified file 'sql/field.h'
--- a/sql/field.h	2009-08-24 19:47:08 +0000
+++ b/sql/field.h	2009-09-29 10:58:42 +0000
@@ -472,6 +472,13 @@ public:
   /* maximum possible display length */
   virtual uint32 max_display_length()= 0;
 
+  /**
+    Whether a field being created is compatible with a existing one.
+
+    Used by the ALTER TABLE code to evaluate whether the new definition
+    of a table is compatible with the old definition so that it can
+    determine if data needs to be copied over (table data change).
+  */
   virtual uint is_equal(Create_field *new_field);
   /* convert decimal to longlong with overflow check */
   longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
@@ -1862,7 +1869,6 @@ public:
   CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; }
 private:
   int do_save_field_metadata(uchar *first_byte);
-  bool compare_enum_values(TYPELIB *values);
   uint is_equal(Create_field *new_field);
 };
 

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-06-19 08:24:43 +0000
+++ b/sql/ha_ndbcluster.cc	2009-09-23 13:10:23 +0000
@@ -9426,9 +9426,11 @@ ndb_util_thread_fail:
   pthread_cond_signal(&COND_ndb_util_ready);
   pthread_mutex_unlock(&LOCK_ndb_util_thread);
   DBUG_PRINT("exit", ("ndb_util_thread"));
+
+  DBUG_LEAVE;                               // Must match DBUG_ENTER()
   my_thread_end();
   pthread_exit(0);
-  DBUG_RETURN(NULL);
+  return NULL;                              // Avoid compiler warnings
 }
 
 /*

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2009-08-01 21:24:20 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2009-09-23 13:10:23 +0000
@@ -3663,9 +3663,11 @@ pthread_handler_t ndb_binlog_thread_func
     ndb_binlog_thread_running= -1;
     pthread_mutex_unlock(&injector_mutex);
     pthread_cond_signal(&injector_cond);
+
+    DBUG_LEAVE;                               // Must match DBUG_ENTER()
     my_thread_end();
     pthread_exit(0);
-    DBUG_RETURN(NULL);
+    return NULL;                              // Avoid compiler warnings
   }
   lex_start(thd);
 
@@ -4376,10 +4378,11 @@ err:
   (void) pthread_cond_signal(&injector_cond);
 
   DBUG_PRINT("exit", ("ndb_binlog_thread"));
-  my_thread_end();
 
+  DBUG_LEAVE;                               // Must match DBUG_ENTER()
+  my_thread_end();
   pthread_exit(0);
-  DBUG_RETURN(NULL);
+  return NULL;                              // Avoid compiler warnings
 }
 
 bool

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2009-09-11 22:40:23 +0000
+++ b/sql/ha_partition.cc	2009-09-23 13:21:29 +0000
@@ -1001,7 +1001,7 @@ static bool print_admin_msg(THD* thd, co
 
   if (!thd->vio_ok())
   {
-    sql_print_error(msgbuf);
+    sql_print_error("%s", msgbuf);
     return TRUE;
   }
 
@@ -3037,7 +3037,7 @@ int ha_partition::write_row(uchar * buf)
   }
   m_last_part= part_id;
   DBUG_PRINT("info", ("Insert in partition %d", part_id));
-  start_part_bulk_insert(part_id);
+  start_part_bulk_insert(thd, part_id);
 
   tmp_disable_binlog(thd); /* Do not replicate the low-level changes. */
   error= m_file[part_id]->ha_write_row(buf);
@@ -3101,7 +3101,7 @@ int ha_partition::update_row(const uchar
   }
 
   m_last_part= new_part_id;
-  start_part_bulk_insert(new_part_id);
+  start_part_bulk_insert(thd, new_part_id);
   if (new_part_id == old_part_id)
   {
     DBUG_PRINT("info", ("Update in partition %d", new_part_id));
@@ -3282,17 +3282,63 @@ void ha_partition::start_bulk_insert(ha_
   Check if start_bulk_insert has been called for this partition,
   if not, call it and mark it called
 */
-void ha_partition::start_part_bulk_insert(uint part_id)
+void ha_partition::start_part_bulk_insert(THD *thd, uint part_id)
 {
+  long old_buffer_size;
   if (!bitmap_is_set(&m_bulk_insert_started, part_id) &&
       bitmap_is_set(&m_bulk_insert_started, m_tot_parts))
   {
+    old_buffer_size= thd->variables.read_buff_size;
+    /* Update read_buffer_size for this partition */
+    thd->variables.read_buff_size= estimate_read_buffer_size(old_buffer_size);
     m_file[part_id]->ha_start_bulk_insert(guess_bulk_insert_rows());
     bitmap_set_bit(&m_bulk_insert_started, part_id);
+    thd->variables.read_buff_size= old_buffer_size;
   }
   m_bulk_inserted_rows++;
 }
 
+/*
+  Estimate the read buffer size for each partition.
+  SYNOPSIS
+    ha_partition::estimate_read_buffer_size()
+    original_size  read buffer size originally set for the server
+  RETURN VALUE
+    estimated buffer size.
+  DESCRIPTION
+    If the estimated number of rows to insert is less than 10 (but not 0)
+    the new buffer size is same as original buffer size.
+    In case of first partition of when partition function is monotonic 
+    new buffer size is same as the original buffer size.
+    For rest of the partition total buffer of 10*original_size is divided 
+    equally if number of partition is more than 10 other wise each partition
+    will be allowed to use original buffer size.
+*/
+long ha_partition::estimate_read_buffer_size(long original_size)
+{
+  /*
+    If number of rows to insert is less than 10, but not 0,
+    return original buffer size.
+  */
+  if (estimation_rows_to_insert && (estimation_rows_to_insert < 10))
+    return (original_size);
+  /*
+    If first insert/partition and monotonic partition function,
+    allow using buffer size originally set.
+   */
+  if (!m_bulk_inserted_rows &&
+      m_part_func_monotonicity_info != NON_MONOTONIC &&
+      m_tot_parts > 1)
+    return original_size;
+  /*
+    Allow total buffer used in all partition to go up to 10*read_buffer_size.
+    11*read_buffer_size in case of monotonic partition function.
+  */
+
+  if (m_tot_parts < 10)
+      return original_size;
+  return (original_size * 10 / m_tot_parts);
+}
 
 /*
   Try to predict the number of inserts into this partition.

=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h	2009-09-04 13:02:15 +0000
+++ b/sql/ha_partition.h	2009-09-23 13:21:29 +0000
@@ -367,7 +367,8 @@ public:
   virtual int end_bulk_insert();
 private:
   ha_rows guess_bulk_insert_rows();
-  void start_part_bulk_insert(uint part_id);
+  void start_part_bulk_insert(THD *thd, uint part_id);
+  long estimate_read_buffer_size(long original_size);
 public:
 
   virtual bool is_fatal_error(int error, uint flags)
@@ -772,10 +773,10 @@ public:
     if (m_handler_status < handler_initialized ||
         m_handler_status >= handler_closed)
       DBUG_RETURN(PARTITION_ENABLED_TABLE_FLAGS);
-    else
-      DBUG_RETURN((m_file[0]->ha_table_flags() &
-                   ~(PARTITION_DISABLED_TABLE_FLAGS)) |
-                  (PARTITION_ENABLED_TABLE_FLAGS));
+
+    DBUG_RETURN((m_file[0]->ha_table_flags() &
+                 ~(PARTITION_DISABLED_TABLE_FLAGS)) |
+                (PARTITION_ENABLED_TABLE_FLAGS));
   }
 
   /*

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2009-09-09 09:38:50 +0000
+++ b/sql/handler.cc	2009-09-23 13:21:29 +0000
@@ -3501,14 +3501,10 @@ int handler::index_next_same(uchar *buf,
   if (!(error=index_next(buf)))
   {
     my_ptrdiff_t ptrdiff= buf - table->record[0];
-    uchar *save_record_0;
-    KEY *key_info;
-    KEY_PART_INFO *key_part;
-    KEY_PART_INFO *key_part_end;
-    LINT_INIT(save_record_0);
-    LINT_INIT(key_info);
-    LINT_INIT(key_part);
-    LINT_INIT(key_part_end);
+    uchar *UNINIT_VAR(save_record_0);
+    KEY *UNINIT_VAR(key_info);
+    KEY_PART_INFO *UNINIT_VAR(key_part);
+    KEY_PART_INFO *UNINIT_VAR(key_part_end);
 
     /*
       key_cmp_if_same() compares table->record[0] against 'key'.

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2009-08-17 14:14:51 +0000
+++ b/sql/handler.h	2009-09-18 13:01:18 +0000
@@ -913,6 +913,15 @@ typedef struct st_ha_create_information
   ulong key_block_size;
   SQL_LIST merge_list;
   handlerton *db_type;
+  /**
+    Row type of the table definition.
+
+    Defaults to ROW_TYPE_DEFAULT for all non-ALTER statements.
+    For ALTER TABLE defaults to ROW_TYPE_NOT_USED (means "keep the current").
+
+    Can be changed either explicitly by the parser.
+    If nothing speficied inherits the value of the original table (if present).
+  */
   enum row_type row_type;
   uint null_bits;                       /* NULL bits at start of record */
   uint options;				/* OR of HA_CREATE_ options */

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2009-08-28 16:21:54 +0000
+++ b/sql/item.cc	2009-09-29 02:23:38 +0000
@@ -6331,9 +6331,26 @@ bool Item_direct_view_ref::fix_fields(TH
   /* view fild reference must be defined */
   DBUG_ASSERT(*ref);
   /* (*ref)->check_cols() will be made in Item_direct_ref::fix_fields */
-  if (!(*ref)->fixed &&
-      ((*ref)->fix_fields(thd, ref)))
+  if ((*ref)->fixed)
+  {
+    Item *ref_item= (*ref)->real_item();
+    if (ref_item->type() == Item::FIELD_ITEM)
+    {
+      /*
+        In some cases we need to update table read set(see bug#47150).
+        If ref item is FIELD_ITEM and fixed then field and table
+        have proper values. So we can use them for update.
+      */
+      Field *fld= ((Item_field*) ref_item)->field;
+      DBUG_ASSERT(fld && fld->table);
+      if (thd->mark_used_columns == MARK_COLUMNS_READ)
+        bitmap_set_bit(fld->table->read_set, fld->field_index);
+    }
+  }
+  else if (!(*ref)->fixed &&
+           ((*ref)->fix_fields(thd, ref)))
     return TRUE;
+
   return Item_direct_ref::fix_fields(thd, reference);
 }
 

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-08-31 14:09:09 +0000
+++ b/sql/item_func.cc	2009-09-24 13:28:13 +0000
@@ -435,8 +435,7 @@ bool Item_func::eq(const Item *item, boo
 
 Field *Item_func::tmp_table_field(TABLE *table)
 {
-  Field *field;
-  LINT_INIT(field);
+  Field *field= NULL;
 
   switch (result_type()) {
   case INT_RESULT:
@@ -4236,9 +4235,8 @@ void Item_func_set_user_var::save_item_r
 bool
 Item_func_set_user_var::update()
 {
-  bool res;
+  bool res= 0;
   DBUG_ENTER("Item_func_set_user_var::update");
-  LINT_INIT(res);
 
   switch (cached_result_type) {
   case REAL_RESULT:

=== modified file 'sql/item_timefunc.cc'
--- a/sql/item_timefunc.cc	2009-08-28 10:55:59 +0000
+++ b/sql/item_timefunc.cc	2009-09-23 13:21:29 +0000
@@ -278,9 +278,9 @@ static bool extract_date_time(DATE_TIME_
   int  strict_week_number_year= -1;
   int frac_part;
   bool usa_time= 0;
-  bool sunday_first_n_first_week_non_iso;
-  bool strict_week_number;
-  bool strict_week_number_year_type;
+  bool UNINIT_VAR(sunday_first_n_first_week_non_iso);
+  bool UNINIT_VAR(strict_week_number);
+  bool UNINIT_VAR(strict_week_number_year_type);
   const char *val_begin= val;
   const char *val_end= val + length;
   const char *ptr= format->format.str;
@@ -288,11 +288,6 @@ static bool extract_date_time(DATE_TIME_
   CHARSET_INFO *cs= &my_charset_bin;
   DBUG_ENTER("extract_date_time");
 
-  LINT_INIT(strict_week_number);
-  /* Remove valgrind varnings when using gcc 3.3 and -O1 */
-  PURIFY_OR_LINT_INIT(strict_week_number_year_type);
-  PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso);
-
   if (!sub_pattern_end)
     bzero((char*) l_time, sizeof(*l_time));
 
@@ -1349,15 +1344,11 @@ bool get_interval_value(Item *args,inter
 			       String *str_value, INTERVAL *interval)
 {
   ulonglong array[5];
-  longlong value;
-  const char *str;
-  size_t length;
+  longlong UNINIT_VAR(value);
+  const char *UNINIT_VAR(str);
+  size_t UNINIT_VAR(length);
   CHARSET_INFO *cs=str_value->charset();
 
-  LINT_INIT(value);
-  LINT_INIT(str);
-  LINT_INIT(length);
-
   bzero((char*) interval,sizeof(*interval));
   if ((int) int_type <= INTERVAL_MICROSECOND)
   {

=== modified file 'sql/item_xmlfunc.cc'
--- a/sql/item_xmlfunc.cc	2009-07-10 23:12:13 +0000
+++ b/sql/item_xmlfunc.cc	2009-09-23 13:21:29 +0000
@@ -1354,7 +1354,7 @@ my_xpath_lex_scan(MY_XPATH *xpath,
                   MY_XPATH_LEX *lex, const char *beg, const char *end)
 {
   int ch, ctype, length;
-  for ( ; beg < end && *beg == ' ' ; beg++); // skip leading spaces
+  for ( ; beg < end && *beg == ' ' ; beg++) ; // skip leading spaces
   lex->beg= beg;
   
   if (beg >= end)
@@ -1423,7 +1423,7 @@ my_xpath_lex_scan(MY_XPATH *xpath,
 
   if (my_xdigit(ch)) // a sequence of digits
   {
-    for ( ; beg < end && my_xdigit(*beg) ; beg++);
+    for ( ; beg < end && my_xdigit(*beg) ; beg++) ;
     lex->end= beg;
     lex->term= MY_XPATH_LEX_DIGITS;
     return;
@@ -1431,7 +1431,7 @@ my_xpath_lex_scan(MY_XPATH *xpath,
 
   if (ch == '"' || ch == '\'')  // a string: either '...' or "..."
   {
-    for ( ; beg < end && *beg != ch ; beg++);
+    for ( ; beg < end && *beg != ch ; beg++) ;
     if (beg < end)
     {
       lex->end= beg+1;

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2009-09-28 12:41:10 +0000
+++ b/sql/log_event.cc	2009-09-29 13:08:18 +0000
@@ -8842,11 +8842,11 @@ int Rows_log_event::find_row(const Relay
    */ 
   store_record(table,record[1]);    
 
-  if (table->s->keys > 0)
+  if (table->s->keys > 0 && table->s->keys_in_use.is_set(0))
   {
     DBUG_PRINT("info",("locating record using primary key (index_read)"));
 
-    /* We have a key: search the table using the index */
+    /* The 0th key is active: search the table using the index */
     if (!table->file->inited && (error= table->file->ha_index_init(0, FALSE)))
     {
       DBUG_PRINT("info",("ha_index_init returns error %d",error));

=== modified file 'sql/log_event_old.cc'
--- a/sql/log_event_old.cc	2009-02-13 16:41:47 +0000
+++ b/sql/log_event_old.cc	2009-09-23 13:21:29 +0000
@@ -1245,8 +1245,8 @@ Old_rows_log_event::Old_rows_log_event(T
     solution, to be able to terminate a started statement in the
     binary log: the extraneous events will be removed in the future.
    */
-  DBUG_ASSERT(tbl_arg && tbl_arg->s && tid != ~0UL ||
-              !tbl_arg && !cols && tid == ~0UL);
+  DBUG_ASSERT((tbl_arg && tbl_arg->s && tid != ~0UL) ||
+              (!tbl_arg && !cols && tid == ~0UL));
 
   if (thd_arg->options & OPTION_NO_FOREIGN_KEY_CHECKS)
       set_flags(NO_FOREIGN_KEY_CHECKS_F);
@@ -1409,7 +1409,7 @@ int Old_rows_log_event::do_add_row_data(
 #endif
 
   DBUG_ASSERT(m_rows_buf <= m_rows_cur);
-  DBUG_ASSERT(!m_rows_buf || m_rows_end && m_rows_buf < m_rows_end);
+  DBUG_ASSERT(!m_rows_buf || (m_rows_end && m_rows_buf < m_rows_end));
   DBUG_ASSERT(m_rows_cur <= m_rows_end);
 
   /* The cast will always work since m_rows_cur <= m_rows_end */

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2009-08-26 12:45:50 +0000
+++ b/sql/mysql_priv.h	2009-09-25 09:26:49 +0000
@@ -2277,10 +2277,9 @@ enum enum_explain_filename_mode
 {
   EXPLAIN_ALL_VERBOSE= 0,
   EXPLAIN_PARTITIONS_VERBOSE,
-  EXPLAIN_PARTITIONS_AS_COMMENT,
-  EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING
+  EXPLAIN_PARTITIONS_AS_COMMENT
 };
-uint explain_filename(const char *from, char *to, uint to_length,
+uint explain_filename(THD* thd, const char *from, char *to, uint to_length,
                       enum_explain_filename_mode explain_mode);
 uint filename_to_tablename(const char *from, char *to, uint to_length);
 uint tablename_to_filename(const char *from, char *to, uint to_length);

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-09-10 07:40:57 +0000
+++ b/sql/mysqld.cc	2009-09-23 13:21:29 +0000
@@ -1107,13 +1107,13 @@ void kill_mysql(void)
 
 #if defined(__NETWARE__)
 extern "C" void kill_server(int sig_ptr)
-#define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN
+#define RETURN_FROM_KILL_SERVER return
 #elif !defined(__WIN__)
 static void *kill_server(void *sig_ptr)
-#define RETURN_FROM_KILL_SERVER DBUG_RETURN(0)
+#define RETURN_FROM_KILL_SERVER return 0
 #else
 static void __cdecl kill_server(int sig_ptr)
-#define RETURN_FROM_KILL_SERVER DBUG_VOID_RETURN
+#define RETURN_FROM_KILL_SERVER return
 #endif
 {
   DBUG_ENTER("kill_server");
@@ -1121,7 +1121,10 @@ static void __cdecl kill_server(int sig_
   int sig=(int) (long) sig_ptr;			// This is passed a int
   // if there is a signal during the kill in progress, ignore the other
   if (kill_in_progress)				// Safety
+  {
+    DBUG_LEAVE;
     RETURN_FROM_KILL_SERVER;
+  }
   kill_in_progress=TRUE;
   abort_loop=1;					// This should be set
   if (sig != 0) // 0 is not a valid signal number
@@ -1156,12 +1159,19 @@ static void __cdecl kill_server(int sig_
     pthread_join(select_thread, NULL);		// wait for main thread
 #endif /* __NETWARE__ */
 
+  DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   my_thread_end();
   pthread_exit(0);
   /* purecov: end */
 
-#endif /* EMBEDDED_LIBRARY */
+  RETURN_FROM_KILL_SERVER;                      // Avoid compiler warnings
+
+#else /* EMBEDDED_LIBRARY*/
+
+  DBUG_LEAVE;
   RETURN_FROM_KILL_SERVER;
+
+#endif /* EMBEDDED_LIBRARY */
 }
 
 
@@ -1935,8 +1945,9 @@ bool one_thread_per_connection_end(THD *
   my_thread_end();
   (void) pthread_cond_broadcast(&COND_thread_count);
 
+  DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   pthread_exit(0);
-  DBUG_RETURN(0);                               // Impossible
+  return 0;                                     // Avoid compiler warnings
 }
 
 
@@ -2119,15 +2130,14 @@ static void init_signals(void)
   win_install_sigabrt_handler();
   if(opt_console)
     SetConsoleCtrlHandler(console_event_handler,TRUE);
-  else
-  {
+
     /* Avoid MessageBox()es*/
-   _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
-   _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
-   _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
-   _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
-   _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
-   _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
+  _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
+  _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
+  _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
+  _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
+  _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
+  _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
 
    /*
      Do not use SEM_NOGPFAULTERRORBOX in the following SetErrorMode (),
@@ -2136,8 +2146,8 @@ static void init_signals(void)
      exception filter is not guaranteed to work in all situation
      (like heap corruption or stack overflow)
    */
-   SetErrorMode(SetErrorMode(0)|SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
-  }
+  SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS
+                               | SEM_NOOPENFILEERRORBOX);
   SetUnhandledExceptionFilter(my_unhandler_exception_filter);
 }
 
@@ -2757,7 +2767,9 @@ pthread_handler_t signal_hand(void *arg 
       DBUG_PRINT("quit",("signal_handler: calling my_thread_end()"));
       my_thread_end();
       signal_thread_in_use= 0;
+      DBUG_LEAVE;                               // Must match DBUG_ENTER()
       pthread_exit(0);				// Safety
+      return 0;                                 // Avoid compiler warnings
     }
     switch (sig) {
     case SIGTERM:
@@ -3707,6 +3719,7 @@ static void end_ssl()
 
 static int init_server_components()
 {
+  FILE* reopen;
   DBUG_ENTER("init_server_components");
   /*
     We need to call each of these following functions to ensure that
@@ -3749,7 +3762,7 @@ static int init_server_components()
       if (freopen(log_error_file, "a+", stdout))
 #endif
       {
-        freopen(log_error_file, "a+", stderr);
+        reopen= freopen(log_error_file, "a+", stderr);
         setbuf(stderr, NULL);
       }
     }
@@ -4604,7 +4617,7 @@ default_service_handling(char **argv,
     if (opt_delim= strchr(extra_opt, '='))
     {
       size_t length= ++opt_delim - extra_opt;
-      strnmov(pos, extra_opt, length);
+      pos= strnmov(pos, extra_opt, length);
     }
     else
       opt_delim= extra_opt;

=== modified file 'sql/partition_info.cc'
--- a/sql/partition_info.cc	2008-12-02 10:18:01 +0000
+++ b/sql/partition_info.cc	2009-09-23 13:21:29 +0000
@@ -483,10 +483,8 @@ static bool check_engine_condition(parti
   {
     DBUG_RETURN(TRUE);
   }
-  else
-  {
-    DBUG_RETURN(FALSE);
-  }
+
+  DBUG_RETURN(FALSE);
 }
 
 

=== modified file 'sql/repl_failsafe.cc'
--- a/sql/repl_failsafe.cc	2009-05-15 12:57:51 +0000
+++ b/sql/repl_failsafe.cc	2009-09-23 13:10:23 +0000
@@ -638,9 +638,11 @@ err:
   if (recovery_captain)
     mysql_close(recovery_captain);
   delete thd;
+
+  DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   my_thread_end();
   pthread_exit(0);
-  DBUG_RETURN(0);
+  return 0;                                     // Avoid compiler warnings
 }
 #endif
 

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2009-07-09 07:28:38 +0000
+++ b/sql/rpl_rli.cc	2009-09-23 13:21:29 +0000
@@ -33,10 +33,10 @@ Relay_log_info::Relay_log_info()
   :Slave_reporting_capability("SQL"),
    no_storage(FALSE), replicate_same_server_id(::replicate_same_server_id),
    info_fd(-1), cur_log_fd(-1), save_temporary_tables(0),
+   cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
 #if HAVE_purify
    is_fake(FALSE),
 #endif
-   cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
    group_master_log_pos(0), log_space_total(0), ignore_log_space_limit(0),
    last_master_timestamp(0), slave_skip_counter(0),
    abort_pos_wait(0), slave_run_id(0), sql_thd(0),
@@ -300,7 +300,7 @@ Failed to open the existing relay log in
   DBUG_RETURN(error);
 
 err:
-  sql_print_error(msg);
+  sql_print_error("%s", msg);
   end_io_cache(&rli->info_file);
   if (info_fd >= 0)
     my_close(info_fd, MYF(0));

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2009-09-10 07:40:57 +0000
+++ b/sql/set_var.cc	2009-09-23 13:21:29 +0000
@@ -529,11 +529,11 @@ static sys_var_const    sys_skip_network
 static sys_var_const    sys_skip_show_database(&vars, "skip_show_database",
                                             OPT_GLOBAL, SHOW_BOOL,
                                             (uchar*) &opt_skip_show_db);
-#ifdef HAVE_SYS_UN_H
+
 static sys_var_const    sys_socket(&vars, "socket",
                                    OPT_GLOBAL, SHOW_CHAR_PTR,
                                    (uchar*) &mysqld_unix_port);
-#endif
+
 #ifdef HAVE_THR_SETCONCURRENCY
 /* purecov: begin tested */
 static sys_var_const    sys_thread_concurrency(&vars, "thread_concurrency",
@@ -3349,7 +3349,7 @@ int set_var_init()
   uint count= 0;
   DBUG_ENTER("set_var_init");
   
-  for (sys_var *var=vars.first; var; var= var->next, count++);
+  for (sys_var *var=vars.first; var; var= var->next, count++) ;
 
   if (hash_init(&system_variable_hash, system_charset_info, count, 0,
                 0, (hash_get_key) get_sys_var_length, 0, HASH_UNIQUE))
@@ -4184,10 +4184,10 @@ bool sys_var_opt_readonly::update(THD *t
     can cause to wait on a read lock, it's required for the client application
     to unlock everything, and acceptable for the server to wait on all locks.
   */
-  if (result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE))
+  if ((result= close_cached_tables(thd, NULL, FALSE, TRUE, TRUE)))
     goto end_with_read_lock;
 
-  if (result= make_global_read_lock_block_commit(thd))
+  if ((result= make_global_read_lock_block_commit(thd)))
     goto end_with_read_lock;
 
   /* Change the opt_readonly system variable, safe because the lock is held */
@@ -4200,6 +4200,7 @@ end_with_read_lock:
 }
 
 
+#ifndef DBUG_OFF
 /* even session variable here requires SUPER, because of -#o,file */
 bool sys_var_thd_dbug::check(THD *thd, set_var *var)
 {
@@ -4226,6 +4227,8 @@ uchar *sys_var_thd_dbug::value_ptr(THD *
     DBUG_EXPLAIN(buf, sizeof(buf));
   return (uchar*) thd->strdup(buf);
 }
+#endif /* DBUG_OFF */
+
 
 #ifdef HAVE_EVENT_SCHEDULER
 bool sys_var_event_scheduler::check(THD *thd, set_var *var)

=== modified file 'sql/set_var.h'
--- a/sql/set_var.h	2009-06-19 09:29:21 +0000
+++ b/sql/set_var.h	2009-09-23 13:21:29 +0000
@@ -621,6 +621,7 @@ public:
   uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
 };
 
+#ifndef DBUG_OFF
 class sys_var_thd_dbug :public sys_var_thd
 {
 public:
@@ -634,7 +635,7 @@ public:
   void set_default(THD *thd, enum_var_type type) { DBUG_POP(); }
   uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b);
 };
-
+#endif /* DBUG_OFF */
 
 
 /* some variables that require special handling */

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2009-08-07 13:08:32 +0000
+++ b/sql/share/errmsg.txt	2009-09-18 08:20:29 +0000
@@ -4702,7 +4702,7 @@ ER_NOT_SUPPORTED_YET 42000 
         swe "Denna version av MySQL kan ännu inte utföra '%s'"
 ER_MASTER_FATAL_ERROR_READING_BINLOG  
         nla "Kreeg fatale fout %d: '%-.128s' van master tijdens lezen van data uit binaire log"
-        eng "Got fatal error %d: '%-.128s' from master when reading data from binary log"
+        eng "Got fatal error %d from master when reading data from binary log: '%-.128s'"
         ger "Schwerer Fehler %d: '%-.128s vom Master beim Lesen des binären Logs"
         ita "Errore fatale %d: '%-.128s' dal master leggendo i dati dal log binario"
         por "Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log"

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-08-24 10:37:44 +0000
+++ b/sql/slave.cc	2009-09-23 13:21:29 +0000
@@ -1195,7 +1195,7 @@ err:
     if (master_res)
       mysql_free_result(master_res);
     DBUG_ASSERT(err_code != 0);
-    mi->report(ERROR_LEVEL, err_code, err_buff);
+    mi->report(ERROR_LEVEL, err_code, "%s", err_buff);
     DBUG_RETURN(1);
   }
 
@@ -2386,7 +2386,7 @@ static bool check_io_slave_killed(THD *t
   if (io_slave_killed(thd, mi))
   {
     if (info && global_system_variables.log_warnings)
-      sql_print_information(info);
+      sql_print_information("%s", info);
     return TRUE;
   }
   return FALSE;
@@ -2456,13 +2456,13 @@ static int try_to_reconnect(THD *thd, MY
     }
     else
     {
-      sql_print_information(buf);
+      sql_print_information("%s", buf);
     }
   }
   if (safe_reconnect(thd, mysql, mi, 1) || io_slave_killed(thd, mi))
   {
     if (global_system_variables.log_warnings)
-      sql_print_information(messages[SLAVE_RECON_MSG_KILLED_AFTER]);
+      sql_print_information("%s", messages[SLAVE_RECON_MSG_KILLED_AFTER]);
     return 1;
   }
   return 0;
@@ -2678,15 +2678,19 @@ Log entry on master is longer than max_a
 slave. If the entry is correct, restart the server with a higher value of \
 max_allowed_packet",
                           thd->variables.max_allowed_packet);
+          mi->report(ERROR_LEVEL, ER_NET_PACKET_TOO_LARGE,
+                     "%s", ER(ER_NET_PACKET_TOO_LARGE));
           goto err;
         case ER_MASTER_FATAL_ERROR_READING_BINLOG:
-          sql_print_error(ER(mysql_error_number), mysql_error_number,
-                          mysql_error(mysql));
+          mi->report(ERROR_LEVEL, ER_MASTER_FATAL_ERROR_READING_BINLOG,
+                     ER(ER_MASTER_FATAL_ERROR_READING_BINLOG),
+                     mysql_error_number, mysql_error(mysql));
           goto err;
-        case EE_OUTOFMEMORY:
-        case ER_OUTOFMEMORY:
+        case ER_OUT_OF_RESOURCES:
           sql_print_error("\
 Stopping slave I/O thread due to out-of-memory error from master");
+          mi->report(ERROR_LEVEL, ER_OUT_OF_RESOURCES,
+                     "%s", ER(ER_OUT_OF_RESOURCES));
           goto err;
         }
         if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings,
@@ -2795,9 +2799,11 @@ err:
   pthread_cond_broadcast(&mi->stop_cond);       // tell the world we are done
   DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
   pthread_mutex_unlock(&mi->run_lock);
+
+  DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   my_thread_end();
   pthread_exit(0);
-  DBUG_RETURN(0);                               // Can't return anything here
+  return 0;                                     // Avoid compiler warnings
 }
 
 /*
@@ -3044,7 +3050,7 @@ log '%s' at position %s, relay log '%s' 
  	      This function is reporting an error which was not reported
  	      while executing exec_relay_log_event().
  	    */ 
-            rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), errmsg);
+            rli->report(ERROR_LEVEL, thd->main_da.sql_errno(), "%s", errmsg);
           }
           else if (last_errno != thd->main_da.sql_errno())
           {
@@ -3153,10 +3159,11 @@ the slave SQL thread with \"SLAVE START\
   pthread_cond_broadcast(&rli->stop_cond);
   DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5););
   pthread_mutex_unlock(&rli->run_lock);  // tell the world we are done
-  
+
+  DBUG_LEAVE;                                   // Must match DBUG_ENTER()
   my_thread_end();
   pthread_exit(0);
-  DBUG_RETURN(0);                               // Can't return anything here
+  return 0;                                     // Avoid compiler warnings
 }
 
 

=== modified file 'sql/sql_cache.cc'
--- a/sql/sql_cache.cc	2009-06-16 08:34:47 +0000
+++ b/sql/sql_cache.cc	2009-09-23 13:21:29 +0000
@@ -383,7 +383,7 @@ static void debug_wait_for_kill(const ch
   thd= current_thd;
   prev_info= thd->proc_info;
   thd->proc_info= info;
-  sql_print_information(info);
+  sql_print_information("%s", info);
   while(!thd->killed)
     my_sleep(1000);
   thd->killed= THD::NOT_KILLED;

=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h	2009-09-10 08:49:49 +0000
+++ b/sql/sql_class.h	2009-09-28 10:48:52 +0000
@@ -2907,7 +2907,8 @@ public:
   bool send_data(List<Item> &items);
   bool initialize_tables (JOIN *join);
   void send_error(uint errcode,const char *err);
-  int  do_deletes();
+  int do_deletes();
+  int do_table_deletes(TABLE *table, bool ignore);
   bool send_eof();
   virtual void abort();
 };

=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc	2009-06-08 22:05:24 +0000
+++ b/sql/sql_connect.cc	2009-09-23 13:21:29 +0000
@@ -985,7 +985,7 @@ static void end_connection(THD *thd)
   if (thd->user_connect)
     decrease_user_connections(thd->user_connect);
 
-  if (thd->killed || net->error && net->vio != 0)
+  if (thd->killed || (net->error && net->vio != 0))
   {
     statistic_increment(aborted_threads,&LOCK_status);
   }

=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc	2009-08-13 02:48:57 +0000
+++ b/sql/sql_db.cc	2009-09-23 13:21:29 +0000
@@ -907,6 +907,9 @@ bool mysql_rm_db(THD *thd,char *db,bool 
     remove_db_from_cache(db);
     pthread_mutex_unlock(&LOCK_open);
 
+    Drop_table_error_handler err_handler(thd->get_internal_handler());
+    thd->push_internal_handler(&err_handler);
+
     error= -1;
     /*
       We temporarily disable the binary log while dropping the objects
@@ -939,6 +942,7 @@ bool mysql_rm_db(THD *thd,char *db,bool 
       error = 0;
       reenable_binlog(thd);
     }
+    thd->pop_internal_handler();
   }
   if (!silent && deleted>=0)
   {
@@ -1446,11 +1450,11 @@ cmp_db_names(const char *db1_name,
 {
   return
          /* db1 is NULL and db2 is NULL */
-         !db1_name && !db2_name ||
+         (!db1_name && !db2_name) ||
 
          /* db1 is not-NULL, db2 is not-NULL, db1 == db2. */
-         db1_name && db2_name &&
-         my_strcasecmp(system_charset_info, db1_name, db2_name) == 0;
+         (db1_name && db2_name &&
+         my_strcasecmp(system_charset_info, db1_name, db2_name) == 0);
 }
 
 

=== modified file 'sql/sql_delete.cc'
--- a/sql/sql_delete.cc	2009-08-21 05:55:35 +0000
+++ b/sql/sql_delete.cc	2009-09-28 10:48:52 +0000
@@ -860,22 +860,19 @@ void multi_delete::abort()
 
 
 
-/*
+/**
   Do delete from other tables.
-  Returns values:
-	0 ok
-	1 error
+
+  @retval 0 ok
+  @retval 1 error
+
+  @todo Is there any reason not use the normal nested-loops join? If not, and
+  there is no documentation supporting it, this method and callee should be
+  removed and there should be hooks within normal execution.
 */
 
 int multi_delete::do_deletes()
 {
-  int local_error= 0, counter= 0, tmp_error;
-  bool will_batch;
-  /*
-    If the IGNORE option is used all non fatal errors will be translated
-    to warnings and we should not break the row-by-row iteration
-  */
-  bool ignore= thd->lex->current_select->no_error;
   DBUG_ENTER("do_deletes");
   DBUG_ASSERT(do_delete);
 
@@ -886,79 +883,108 @@ int multi_delete::do_deletes()
   table_being_deleted= (delete_while_scanning ? delete_tables->next_local :
                         delete_tables);
  
-  for (; table_being_deleted;
+  for (uint counter= 0; table_being_deleted;
        table_being_deleted= table_being_deleted->next_local, counter++)
   { 
-    ha_rows last_deleted= deleted;
     TABLE *table = table_being_deleted->table;
     if (tempfiles[counter]->get(table))
+      DBUG_RETURN(1);
+
+    int local_error= 
+      do_table_deletes(table, thd->lex->current_select->no_error);
+
+    if (thd->killed && !local_error)
+      DBUG_RETURN(1);
+
+    if (local_error == -1)				// End of file
+      local_error = 0;
+
+    if (local_error)
+      DBUG_RETURN(local_error);
+  }
+  DBUG_RETURN(0);
+}
+
+
+/**
+   Implements the inner loop of nested-loops join within multi-DELETE
+   execution.
+
+   @param table The table from which to delete.
+
+   @param ignore If used, all non fatal errors will be translated
+   to warnings and we should not break the row-by-row iteration.
+
+   @return Status code
+
+   @retval  0 All ok.
+   @retval  1 Triggers or handler reported error.
+   @retval -1 End of file from handler.
+*/
+int multi_delete::do_table_deletes(TABLE *table, bool ignore)
+{
+  int local_error= 0;
+  READ_RECORD info;
+  ha_rows last_deleted= deleted;
+  DBUG_ENTER("do_deletes_for_table");
+  init_read_record(&info, thd, table, NULL, 0, 1, FALSE);
+  /*
+    Ignore any rows not found in reference tables as they may already have
+    been deleted by foreign key handling
+  */
+  info.ignore_not_found_rows= 1;
+  bool will_batch= !table->file->start_bulk_delete();
+  while (!(local_error= info.read_record(&info)) && !thd->killed)
+  {
+    if (table->triggers &&
+        table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
+                                          TRG_ACTION_BEFORE, FALSE))
     {
-      local_error=1;
+      local_error= 1;
       break;
     }
-
-    READ_RECORD	info;
-    init_read_record(&info, thd, table, NULL, 0, 1, FALSE);
+      
+    local_error= table->file->ha_delete_row(table->record[0]);
+    if (local_error && !ignore)
+    {
+      table->file->print_error(local_error, MYF(0));
+      break;
+    }
+      
     /*
-      Ignore any rows not found in reference tables as they may already have
-      been deleted by foreign key handling
+      Increase the reported number of deleted rows only if no error occurred
+      during ha_delete_row.
+      Also, don't execute the AFTER trigger if the row operation failed.
     */
-    info.ignore_not_found_rows= 1;
-    will_batch= !table->file->start_bulk_delete();
-    while (!(local_error=info.read_record(&info)) && !thd->killed)
+    if (!local_error)
     {
+      deleted++;
       if (table->triggers &&
           table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
-                                            TRG_ACTION_BEFORE, FALSE))
+                                            TRG_ACTION_AFTER, FALSE))
       {
         local_error= 1;
         break;
       }
-
-      local_error= table->file->ha_delete_row(table->record[0]);
-      if (local_error && !ignore)
-      {
-        table->file->print_error(local_error,MYF(0));
-        break;
-      }
-
-      /*
-        Increase the reported number of deleted rows only if no error occurred
-        during ha_delete_row.
-        Also, don't execute the AFTER trigger if the row operation failed.
-      */
-      if (!local_error)
-      {
-        deleted++;
-        if (table->triggers &&
-            table->triggers->process_triggers(thd, TRG_EVENT_DELETE,
-                                              TRG_ACTION_AFTER, FALSE))
-        {
-          local_error= 1;
-          break;
-        }
-      }
     }
-    if (will_batch && (tmp_error= table->file->end_bulk_delete()))
+  }
+  if (will_batch)
+  {
+    int tmp_error= table->file->end_bulk_delete();
+    if (tmp_error && !local_error)
     {
-      if (!local_error)
-      {
-        local_error= tmp_error;
-        table->file->print_error(local_error,MYF(0));
-      }
+      local_error= tmp_error;
+      table->file->print_error(local_error, MYF(0));
     }
-    if (last_deleted != deleted && !table->file->has_transactions())
-      thd->transaction.stmt.modified_non_trans_table= TRUE;
-    end_read_record(&info);
-    if (thd->killed && !local_error)
-      local_error= 1;
-    if (local_error == -1)				// End of file
-      local_error = 0;
   }
+  if (last_deleted != deleted && !table->file->has_transactions())
+    thd->transaction.stmt.modified_non_trans_table= TRUE;
+
+  end_read_record(&info);
+
   DBUG_RETURN(local_error);
 }
 
-
 /*
   Send ok to the client
 

=== modified file 'sql/sql_handler.cc'
--- a/sql/sql_handler.cc	2009-07-15 23:23:57 +0000
+++ b/sql/sql_handler.cc	2009-09-17 15:25:52 +0000
@@ -422,16 +422,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST 
   String	buffer(buff, sizeof(buff), system_charset_info);
   int           error, keyno= -1;
   uint          num_rows;
-  uchar		*key;
-  uint		key_len;
+  uchar		*UNINIT_VAR(key);
+  uint		UNINIT_VAR(key_len);
   bool          need_reopen;
   DBUG_ENTER("mysql_ha_read");
   DBUG_PRINT("enter",("'%s'.'%s' as '%s'",
                       tables->db, tables->table_name, tables->alias));
 
-  LINT_INIT(key);
-  LINT_INIT(key_len);
-
   thd->lex->select_lex.context.resolve_in_table_list_only(tables);
   list.push_front(new Item_field(&thd->lex->select_lex.context,
                                  NULL, NULL, "*"));

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2009-09-02 12:20:47 +0000
+++ b/sql/sql_partition.cc	2009-09-23 13:21:29 +0000
@@ -7098,9 +7098,9 @@ static uint32 get_next_partition_via_wal
     longlong dummy;
     field->store(part_iter->field_vals.cur++,
                  ((Field_num*)field)->unsigned_flag);
-    if (part_iter->part_info->is_sub_partitioned() &&
+    if ((part_iter->part_info->is_sub_partitioned() &&
         !part_iter->part_info->get_part_partition_id(part_iter->part_info,
-                                                     &part_id, &dummy) ||
+                                                     &part_id, &dummy)) ||
         !part_iter->part_info->get_partition_id(part_iter->part_info,
                                                 &part_id, &dummy))
       return part_id;

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-05-18 08:10:30 +0000
+++ b/sql/sql_plugin.cc	2009-09-23 13:21:29 +0000
@@ -368,7 +368,7 @@ static st_plugin_dl *plugin_dl_add(const
     if (report & REPORT_TO_USER)
       my_error(ER_UDF_NO_PATHS, MYF(0));
     if (report & REPORT_TO_LOG)
-      sql_print_error(ER(ER_UDF_NO_PATHS));
+      sql_print_error("%s", ER(ER_UDF_NO_PATHS));
     DBUG_RETURN(0);
   }
   /* If this dll is already loaded just increase ref_count. */
@@ -1520,7 +1520,7 @@ error:
 
 void plugin_shutdown(void)
 {
-  uint i, count= plugin_array.elements, free_slots= 0;
+  uint i, count= plugin_array.elements;
   struct st_plugin_int **plugins, *plugin;
   struct st_plugin_dl **dl;
   DBUG_ENTER("plugin_shutdown");
@@ -1541,18 +1541,13 @@ void plugin_shutdown(void)
     while (reap_needed && (count= plugin_array.elements))
     {
       reap_plugins();
-      for (i= free_slots= 0; i < count; i++)
+      for (i= 0; i < count; i++)
       {
         plugin= *dynamic_element(&plugin_array, i, struct st_plugin_int **);
-        switch (plugin->state) {
-        case PLUGIN_IS_READY:
+        if (plugin->state == PLUGIN_IS_READY)
+        {
           plugin->state= PLUGIN_IS_DELETED;
           reap_needed= true;
-          break;
-        case PLUGIN_IS_FREED:
-        case PLUGIN_IS_UNINITIALIZED:
-          free_slots++;
-          break;
         }
       }
       if (!reap_needed)
@@ -1565,9 +1560,6 @@ void plugin_shutdown(void)
       }
     }
 
-    if (count > free_slots)
-      sql_print_warning("Forcing shutdown of %d plugins", count - free_slots);
-
     plugins= (struct st_plugin_int **) my_alloca(sizeof(void*) * (count+1));
 
     /*
@@ -1589,8 +1581,8 @@ void plugin_shutdown(void)
       if (!(plugins[i]->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_FREED |
                                  PLUGIN_IS_DISABLED)))
       {
-        sql_print_information("Plugin '%s' will be forced to shutdown",
-                              plugins[i]->name.str);
+        sql_print_warning("Plugin '%s' will be forced to shutdown",
+                          plugins[i]->name.str);
         /*
           We are forcing deinit on plugins so we don't want to do a ref_count
           check until we have processed all the plugins.

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2009-07-24 16:04:55 +0000
+++ b/sql/sql_repl.cc	2009-09-18 08:20:29 +0000
@@ -623,7 +623,7 @@ impossible position";
       */
       {
 	log.error=0;
-	bool read_packet = 0, fatal_error = 0;
+	bool read_packet = 0;
 
 #ifndef DBUG_OFF
 	if (max_binlog_dump_events && !left_events--)
@@ -645,7 +645,7 @@ impossible position";
 	*/
 
 	pthread_mutex_lock(log_lock);
-	switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0)) {
+	switch (error= Log_event::read_log_event(&log, packet, (pthread_mutex_t*) 0)) {
 	case 0:
 	  /* we read successfully, so we'll need to send it to the slave */
 	  pthread_mutex_unlock(log_lock);
@@ -671,8 +671,8 @@ impossible position";
 
 	default:
 	  pthread_mutex_unlock(log_lock);
-	  fatal_error = 1;
-	  break;
+          test_for_non_eof_log_read_errors(error, &errmsg);
+          goto err;
 	}
 
 	if (read_packet)
@@ -701,12 +701,6 @@ impossible position";
 	  */
 	}
 
-	if (fatal_error)
-	{
-	  errmsg = "error reading log entry";
-          my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
-	  goto err;
-	}
 	log.error=0;
       }
     }

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2009-09-08 09:37:09 +0000

+++ b/sql/sql_select.cc	2009-09-28 13:48:40 +0000
@@ -2248,7 +2248,7 @@ JOIN::destroy()
 	tab->cleanup();
     }
     tmp_join->tmp_join= 0;
-    tmp_table_param.cleanup();
+    tmp_table_param.copy_field= 0;
     DBUG_RETURN(tmp_join->destroy());
   }
   cond_equal= 0;
@@ -3308,12 +3308,12 @@ add_key_equal_fields(KEY_FIELD **key_fie
      @retval FALSE  it's something else
 */
 
-inline static bool
+static bool
 is_local_field (Item *field)
 {
-  field= field->real_item();
-  return field->type() == Item::FIELD_ITEM && 
-    !((Item_field *)field)->depended_from;
+  return field->real_item()->type() == Item::FIELD_ITEM
+    && !(field->used_tables() & OUTER_REF_TABLE_BIT)
+    && !((Item_field *)field->real_item())->depended_from;
 }
 
 

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2009-08-28 16:21:54 +0000

+++ b/sql/sql_show.cc	2009-09-23 13:21:29 +0000
@@ -3529,7 +3529,9 @@ static int get_schema_tables_record(THD 
     TABLE_SHARE *share= show_table->s;
     handler *file= show_table->file;
     handlerton *tmp_db_type= share->db_type();
+#ifdef WITH_PARTITION_STORAGE_ENGINE
     bool is_partitioned= FALSE;
+#endif
     if (share->tmp_table == SYSTEM_TMP_TABLE)
       table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
     else if (share->tmp_table)

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2009-09-10 08:49:49 +0000
+++ b/sql/sql_table.cc	2009-09-29 08:12:04 +0000
@@ -70,15 +70,21 @@ static void wait_for_kill_signal(THD *th
 
 /**
   @brief Helper function for explain_filename
+  @param thd          Thread handle
+  @param to_p         Explained name in system_charset_info
+  @param end_p        End of the to_p buffer
+  @param name         Name to be converted
+  @param name_len     Length of the name, in bytes
 */
-static char* add_identifier(char *to_p, const char * end_p,
-                           const char* name, uint name_len, bool add_quotes)
+static char* add_identifier(THD* thd, char *to_p, const char * end_p,
+                            const char* name, uint name_len)
 {
   uint res;
   uint errors;
   const char *conv_name;
   char tmp_name[FN_REFLEN];
   char conv_string[FN_REFLEN];
+  int quote;
 
   DBUG_ENTER("add_identifier");
   if (!name[name_len])
@@ -102,19 +108,21 @@ static char* add_identifier(char *to_p, 
     conv_name= conv_string;
   }
 
-  if (add_quotes && (end_p - to_p > 2))
+  quote = thd ? get_quote_char_for_identifier(thd, conv_name, res - 1) : '"';
+
+  if (quote != EOF && (end_p - to_p > 2))
   {
-    *(to_p++)= '`';
+    *(to_p++)= (char) quote;
     while (*conv_name && (end_p - to_p - 1) > 0)
     {
       uint length= my_mbcharlen(system_charset_info, *conv_name);
       if (!length)
         length= 1;
-      if (length == 1 && *conv_name == '`')
+      if (length == 1 && *conv_name == (char) quote)
       { 
         if ((end_p - to_p) < 3)
           break;
-        *(to_p++)= '`';
+        *(to_p++)= (char) quote;
         *(to_p++)= *(conv_name++);
       }
       else if (((long) length) < (end_p - to_p))
@@ -125,7 +133,11 @@ static char* add_identifier(char *to_p, 
       else
         break;                               /* string already filled */
     }
-    to_p= strnmov(to_p, "`", end_p - to_p);
+    if (end_p > to_p) {
+      *(to_p++)= (char) quote;
+      if (end_p > to_p)
+	*to_p= 0; /* terminate by NUL, but do not include it in the count */
+    }
   }
   else
     to_p= strnmov(to_p, conv_name, end_p - to_p);
@@ -145,6 +157,7 @@ static char* add_identifier(char *to_p, 
   diagnostic, error etc. when it would be useful to know what a particular
   file [and directory] means. Such as SHOW ENGINE STATUS, error messages etc.
 
+   @param      thd          Thread handle
    @param      from         Path name in my_charset_filename
                             Null terminated in my_charset_filename, normalized
                             to use '/' as directory separation character.
@@ -161,13 +174,12 @@ static char* add_identifier(char *to_p, 
                             [,[ Temporary| Renamed] Partition `p`
                             [, Subpartition `sp`]] *|
                             (| is really a /, and it is all in one line)
-                            EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING ->
-                            same as above but no quotes are added.
 
    @retval     Length of returned string
 */
 
-uint explain_filename(const char *from,
+uint explain_filename(THD* thd,
+		      const char *from,
                       char *to,
                       uint to_length,
                       enum_explain_filename_mode explain_mode)
@@ -281,14 +293,12 @@ uint explain_filename(const char *from,
     {
       to_p= strnmov(to_p, ER(ER_DATABASE_NAME), end_p - to_p);
       *(to_p++)= ' ';
-      to_p= add_identifier(to_p, end_p, db_name, db_name_len, 1);
+      to_p= add_identifier(thd, to_p, end_p, db_name, db_name_len);
       to_p= strnmov(to_p, ", ", end_p - to_p);
     }
     else
     {
-      to_p= add_identifier(to_p, end_p, db_name, db_name_len,
-                           (explain_mode !=
-                            EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING));
+      to_p= add_identifier(thd, to_p, end_p, db_name, db_name_len);
       to_p= strnmov(to_p, ".", end_p - to_p);
     }
   }
@@ -296,16 +306,13 @@ uint explain_filename(const char *from,
   {
     to_p= strnmov(to_p, ER(ER_TABLE_NAME), end_p - to_p);
     *(to_p++)= ' ';
-    to_p= add_identifier(to_p, end_p, table_name, table_name_len, 1);
+    to_p= add_identifier(thd, to_p, end_p, table_name, table_name_len);
   }
   else
-    to_p= add_identifier(to_p, end_p, table_name, table_name_len,
-                         (explain_mode !=
-                          EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING));
+    to_p= add_identifier(thd, to_p, end_p, table_name, table_name_len);
   if (part_name)
   {
-    if (explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT ||
-        explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING)
+    if (explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT)
       to_p= strnmov(to_p, " /* ", end_p - to_p);
     else if (explain_mode == EXPLAIN_PARTITIONS_VERBOSE)
       to_p= strnmov(to_p, " ", end_p - to_p);
@@ -321,20 +328,15 @@ uint explain_filename(const char *from,
     }
     to_p= strnmov(to_p, ER(ER_PARTITION_NAME), end_p - to_p);
     *(to_p++)= ' ';
-    to_p= add_identifier(to_p, end_p, part_name, part_name_len,
-                         (explain_mode !=
-                          EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING));
+    to_p= add_identifier(thd, to_p, end_p, part_name, part_name_len);
     if (subpart_name)
     {
       to_p= strnmov(to_p, ", ", end_p - to_p);
       to_p= strnmov(to_p, ER(ER_SUBPARTITION_NAME), end_p - to_p);
       *(to_p++)= ' ';
-      to_p= add_identifier(to_p, end_p, subpart_name, subpart_name_len,
-                           (explain_mode !=
-                            EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING));
+      to_p= add_identifier(thd, to_p, end_p, subpart_name, subpart_name_len);
     }
-    if (explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT ||
-        explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT_NO_QUOTING)
+    if (explain_mode == EXPLAIN_PARTITIONS_AS_COMMENT)
       to_p= strnmov(to_p, " */", end_p - to_p);
   }
   DBUG_PRINT("exit", ("to '%s'", to));
@@ -1949,7 +1951,7 @@ int mysql_rm_table_part2(THD *thd, TABLE
       being built.  The string always end in a comma and the comma
       will be chopped off before being written to the binary log.
       */
-    if (thd->current_stmt_binlog_row_based && !dont_log_query)
+    if (!drop_temporary && thd->current_stmt_binlog_row_based && !dont_log_query)
     {
       non_temp_tables_count++;
       /*
@@ -6656,9 +6658,19 @@ view_err:
     goto err;
   }
 
+  /*
+   If this is an ALTER TABLE and no explicit row type specified reuse
+   the table's row type.
+   Note : this is the same as if the row type was specified explicitly.
+  */
   if (create_info->row_type == ROW_TYPE_NOT_USED)
   {
+    /* ALTER TABLE without explicit row type */
     create_info->row_type= table->s->row_type;
+  }
+  else
+  {
+    /* ALTER TABLE with specific row type */
     create_info->used_fields |= HA_CREATE_USED_ROW_FORMAT;
   }
 
@@ -7887,8 +7899,14 @@ bool mysql_checksum_table(THD *thd, TABL
 	    for (uint i= 0; i < t->s->fields; i++ )
 	    {
 	      Field *f= t->field[i];
-	      if ((f->type() == MYSQL_TYPE_BLOB) ||
-                  (f->type() == MYSQL_TYPE_VARCHAR))
+        enum_field_types field_type= f->type();
+        /*
+          BLOB and VARCHAR have pointers in their field, we must convert
+          to string; GEOMETRY is implemented on top of BLOB.
+        */
+        if ((field_type == MYSQL_TYPE_BLOB) ||
+            (field_type == MYSQL_TYPE_VARCHAR) ||
+            (field_type == MYSQL_TYPE_GEOMETRY))
 	      {
 		String tmp;
 		f->val_str(&tmp);

=== modified file 'sql/strfunc.cc'
--- a/sql/strfunc.cc	2009-03-14 18:58:23 +0000
+++ b/sql/strfunc.cc	2009-09-23 13:21:29 +0000
@@ -147,7 +147,7 @@ static uint parse_name(TYPELIB *lib, con
     }
   }
   else
-    for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
+    for (; pos != end && *pos != '=' && *pos !=',' ; pos++) ;
 
   uint var_len= (uint) (pos - start);
   /* Determine which flag it is */

=== modified file 'sql/udf_example.c'
--- a/sql/udf_example.c	2009-02-13 16:41:47 +0000
+++ b/sql/udf_example.c	2009-09-17 15:25:52 +0000
@@ -139,10 +139,10 @@ typedef long long longlong;
 #include <mysql.h>
 #include <ctype.h>
 
-static pthread_mutex_t LOCK_hostname;
-
 #ifdef HAVE_DLOPEN
 
+static pthread_mutex_t LOCK_hostname;
+
 /* These must be right or mysqld will not find the symbol! */
 
 my_bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message);

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2009-09-10 06:58:13 +0000
+++ b/storage/archive/ha_archive.cc	2009-09-23 13:21:29 +0000
@@ -522,8 +522,8 @@ int ha_archive::open(const char *name, i
   {
     DBUG_RETURN(0);
   }
-  else
-    DBUG_RETURN(rc);
+
+  DBUG_RETURN(rc);
 }
 
 
@@ -1575,10 +1575,8 @@ int ha_archive::check(THD* thd, HA_CHECK
     share->crashed= FALSE;
     DBUG_RETURN(HA_ADMIN_CORRUPT);
   }
-  else
-  {
-    DBUG_RETURN(HA_ADMIN_OK);
-  }
+
+  DBUG_RETURN(HA_ADMIN_OK);
 }
 
 /*

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2009-03-24 09:02:01 +0000
+++ b/storage/csv/ha_tina.cc	2009-09-23 13:21:29 +0000
@@ -1598,8 +1598,8 @@ int ha_tina::check(THD* thd, HA_CHECK_OP
     share->crashed= TRUE;
     DBUG_RETURN(HA_ADMIN_CORRUPT);
   }
-  else
-    DBUG_RETURN(HA_ADMIN_OK);
+
+  DBUG_RETURN(HA_ADMIN_OK);
 }
 
 

=== modified file 'storage/heap/hp_write.c'
--- a/storage/heap/hp_write.c	2009-02-13 16:41:47 +0000
+++ b/storage/heap/hp_write.c	2009-09-17 15:25:52 +0000
@@ -196,13 +196,10 @@ int hp_write_key(HP_INFO *info, HP_KEYDE
   HP_SHARE *share = info->s;
   int flag;
   ulong halfbuff,hashnr,first_index;
-  uchar *ptr_to_rec,*ptr_to_rec2;
-  HASH_INFO *empty,*gpos,*gpos2,*pos;
+  uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2);
+  HASH_INFO *empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos;
   DBUG_ENTER("hp_write_key");
 
-  LINT_INIT(gpos); LINT_INIT(gpos2);
-  LINT_INIT(ptr_to_rec); LINT_INIT(ptr_to_rec2);
-
   flag=0;
   if (!(empty= hp_find_free_hash(share,&keyinfo->block,share->records)))
     DBUG_RETURN(-1);				/* No more memory */

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2009-08-11 13:05:25 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2009-09-17 06:29:43 +0000
@@ -2515,12 +2515,28 @@ ha_innobase::innobase_initialize_autoinc
 
 		dict_table_autoinc_initialize(innodb_table, auto_inc);
 
-	} else {
+	} else if (error == DB_RECORD_NOT_FOUND) {
 		ut_print_timestamp(stderr);
-		fprintf(stderr, "  InnoDB: Error: (%lu) Couldn't read "
-			"the MAX(%s) autoinc value from the "
-			"index (%s).\n", error, col_name, index->name);
-	}
+		fprintf(stderr, "  InnoDB: MySQL and InnoDB data "
+			"dictionaries are out of sync.\n"
+			"InnoDB: Unable to find the AUTOINC column %s in the "
+			"InnoDB table %s.\n"
+			"InnoDB: We set the next AUTOINC column value to the "
+			"maximum possible value,\n"
+			"InnoDB: in effect disabling the AUTOINC next value "
+			"generation.\n"
+			"InnoDB: You can either set the next AUTOINC value "
+			"explicitly using ALTER TABLE\n"
+			"InnoDB: or fix the data dictionary by recreating "
+			"the table.\n",
+			col_name, index->table->name);
+
+		auto_inc = 0xFFFFFFFFFFFFFFFFULL;
+
+		dict_table_autoinc_initialize(innodb_table, auto_inc);
+
+		error = DB_SUCCESS;
+	} /* else other errors are still fatal */
 
 	return(ulong(error));
 }
@@ -2731,7 +2747,6 @@ retry:
 		if (dict_table_autoinc_read(prebuilt->table) == 0) {
 
 			error = innobase_initialize_autoinc();
-			/* Should always succeed! */
 			ut_a(error == DB_SUCCESS);
 		}
 

=== modified file 'storage/innodb_plugin/handler/i_s.cc'
--- a/storage/innodb_plugin/handler/i_s.cc	2009-06-10 08:59:49 +0000
+++ b/storage/innodb_plugin/handler/i_s.cc	2009-08-14 15:18:52 +0000
@@ -69,14 +69,16 @@ do {									\
 #define STRUCT_FLD(name, value)	value
 #endif
 
-static const ST_FIELD_INFO END_OF_ST_FIELD_INFO =
-	{STRUCT_FLD(field_name,		NULL),
-	 STRUCT_FLD(field_length,	0),
-	 STRUCT_FLD(field_type,		MYSQL_TYPE_NULL),
-	 STRUCT_FLD(value,		0),
-	 STRUCT_FLD(field_flags,	0),
-	 STRUCT_FLD(old_name,		""),
-	 STRUCT_FLD(open_method,	SKIP_OPEN_TABLE)};
+/* Don't use a static const variable here, as some C++ compilers (notably
+HPUX aCC: HP ANSI C++ B3910B A.03.65) can't handle it. */
+#define END_OF_ST_FIELD_INFO \
+	{STRUCT_FLD(field_name,		NULL), \
+	 STRUCT_FLD(field_length,	0), \
+	 STRUCT_FLD(field_type,		MYSQL_TYPE_NULL), \
+	 STRUCT_FLD(value,		0), \
+	 STRUCT_FLD(field_flags,	0), \
+	 STRUCT_FLD(old_name,		""), \
+	 STRUCT_FLD(open_method,	SKIP_OPEN_TABLE)}
 
 /*
 Use the following types mapping:

=== modified file 'storage/innodb_plugin/include/univ.i'
--- a/storage/innodb_plugin/include/univ.i	2009-07-30 12:42:56 +0000
+++ b/storage/innodb_plugin/include/univ.i	2009-08-14 15:18:52 +0000
@@ -408,7 +408,8 @@ it is read. */
 /* Minimize cache-miss latency by moving data at addr into a cache before
 it is read or written. */
 # define UNIV_PREFETCH_RW(addr) __builtin_prefetch(addr, 1, 3)
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+/* Sun Studio includes sun_prefetch.h as of version 5.9 */
+#elif (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590)
 # include <sun_prefetch.h>
 #if __SUNPRO_C >= 0x550
 # undef UNIV_INTERN

=== modified file 'storage/myisam/mi_check.c'
--- a/storage/myisam/mi_check.c	2009-08-28 16:21:54 +0000
+++ b/storage/myisam/mi_check.c	2009-09-28 13:55:01 +0000
@@ -801,7 +801,7 @@ static int chk_index(MI_CHECK *param, MI
     {
       DBUG_DUMP("old",(uchar*) info->lastkey, info->lastkey_length);
       DBUG_DUMP("new",(uchar*) key, key_length);
-      DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
+      DBUG_DUMP("new_in_page",(uchar*) old_keypos,(uint) (keypos-old_keypos));
 
       if (comp_flag & SEARCH_FIND && flag == 0)
 	mi_check_print_error(param,"Found duplicated key at page %s",llstr(page,llbuff));
@@ -871,7 +871,7 @@ static int chk_index(MI_CHECK *param, MI
 			 llstr(page,llbuff),llstr(record,llbuff2),
 			 llstr(info->state->data_file_length,llbuff3)));
       DBUG_DUMP("key",(uchar*) key,key_length);
-      DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
+      DBUG_DUMP("new_in_page",(uchar*) old_keypos,(uint) (keypos-old_keypos));
       goto err;
     }
     param->record_checksum+=(ha_checksum) record;
@@ -1545,6 +1545,8 @@ int mi_repair(MI_CHECK *param, register 
   if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
     param->testflag|=T_CALC_CHECKSUM;
 
+  DBUG_ASSERT(param->use_buffers < SIZE_T_MAX);
+
   if (!param->using_global_keycache)
     VOID(init_key_cache(dflt_key_cache, param->key_cache_block_size,
                         (size_t) param->use_buffers, 0, 0));

=== modified file 'storage/myisam/mi_search.c'
--- a/storage/myisam/mi_search.c	2009-08-28 16:21:54 +0000
+++ b/storage/myisam/mi_search.c	2009-09-17 15:25:52 +0000
@@ -302,7 +302,8 @@ int _mi_prefix_search(MI_INFO *info, reg
   uchar *end, *kseg, *vseg;
   uchar *sort_order=keyinfo->seg->charset->sort_order;
   uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
-  uchar *saved_from, *saved_to, *saved_vseg;
+  uchar *UNINIT_VAR(saved_from), *UNINIT_VAR(saved_to);
+  uchar *UNINIT_VAR(saved_vseg);
   uint  saved_length=0, saved_prefix_len=0;
   uint  length_pack;
   DBUG_ENTER("_mi_prefix_search");
@@ -310,9 +311,6 @@ int _mi_prefix_search(MI_INFO *info, reg
   LINT_INIT(length);
   LINT_INIT(prefix_len);
   LINT_INIT(seg_len_pack);
-  LINT_INIT(saved_from);
-  LINT_INIT(saved_to);
-  LINT_INIT(saved_vseg);
 
   t_buff[0]=0;                                  /* Avoid bugs */
   end= page+mi_getint(page);

=== modified file 'storage/myisam/mi_write.c'
--- a/storage/myisam/mi_write.c	2009-04-29 02:59:10 +0000
+++ b/storage/myisam/mi_write.c	2009-09-17 15:25:52 +0000
@@ -712,8 +712,8 @@ static uchar *_mi_find_last_pos(MI_KEYDE
 				uchar *key, uint *return_key_length,
 				uchar **after_key)
 {
-  uint keys,length,last_length,key_ref_length;
-  uchar *end,*lastpos,*prevpos;
+  uint keys,length,UNINIT_VAR(last_length),key_ref_length;
+  uchar *end,*lastpos,*UNINIT_VAR(prevpos);
   uchar key_buff[MI_MAX_KEY_BUFF];
   DBUG_ENTER("_mi_find_last_pos");
 
@@ -732,8 +732,6 @@ static uchar *_mi_find_last_pos(MI_KEYDE
     DBUG_RETURN(end);
   }
 
-  LINT_INIT(prevpos);
-  LINT_INIT(last_length);
   end=page+length-key_ref_length;
   *key='\0';
   length=0;

=== modified file 'storage/myisammrg/myrg_open.c'
--- a/storage/myisammrg/myrg_open.c	2009-08-28 16:21:54 +0000
+++ b/storage/myisammrg/myrg_open.c	2009-09-23 13:21:29 +0000
@@ -392,7 +392,7 @@ int myrg_attach_children(MYRG_INFO *m_in
   int        save_errno;
   uint       idx;
   uint       child_nr;
-  uint       key_parts;
+  uint       UNINIT_VAR(key_parts);
   uint       min_keys;
   my_bool    bad_children= FALSE;
   DBUG_ENTER("myrg_attach_children");
@@ -409,7 +409,6 @@ int myrg_attach_children(MYRG_INFO *m_in
   rc= 1;
   errpos= 0;
   file_offset= 0;
-  LINT_INIT(key_parts);
   min_keys= 0;
   child_nr= 0;
   while ((myisam= (*callback)(callback_param)))

=== modified file 'storage/ndb/test/run-test/Makefile.am'
--- a/storage/ndb/test/run-test/Makefile.am	2007-08-31 14:12:51 +0000
+++ b/storage/ndb/test/run-test/Makefile.am	2009-08-21 11:58:33 +0000
@@ -13,7 +13,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-testdir=$(prefix)/mysql-test/ndb
+testroot=$(prefix)
+testdir=$(testroot)/mysql-test/ndb
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
 include $(top_srcdir)/storage/ndb/config/type_util.mk.am

=== modified file 'support-files/binary-configure.sh'
--- a/support-files/binary-configure.sh	2003-03-21 16:53:55 +0000
+++ b/support-files/binary-configure.sh	2009-09-28 14:14:33 +0000
@@ -1,4 +1,28 @@
 #!/bin/sh
+
+SCRIPT_NAME="`basename $0`"
+
+usage()
+{
+  echo "Usage: ${SCRIPT_NAME} [--help|-h]"
+  echo ""
+  echo "This script creates the MySQL system tables and starts the server."
+}
+
+for arg do
+  case "$arg" in
+    --help|-h)
+      usage
+      exit 0
+      ;;
+    *)
+      echo "${SCRIPT_NAME}: unknown option $arg"
+      usage
+      exit 2
+      ;;
+  esac
+done
+
 if test ! -x  ./scripts/mysql_install_db
 then
   echo "I didn't find the script './scripts/mysql_install_db'."

=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2009-08-24 09:13:34 +0000
+++ b/support-files/mysql.spec.sh	2009-09-02 23:48:06 +0000
@@ -319,7 +319,7 @@ sh -c  "PATH=\"${MYSQL_BUILD_PATH:-$PATH
 		--with-blackhole-storage-engine \
 		--with-federated-storage-engine \
 		--without-plugin-daemon_example \
-		--without-plugin-example \
+		--without-plugin-ftexample \
 		--with-partition \
 		--with-big-tables \
 %if %{WITH_BUNDLED_ZLIB}
@@ -715,7 +715,11 @@ fi
 %attr(755, root, root) %{_bindir}/resolve_stack_dump
 %attr(755, root, root) %{_bindir}/resolveip
 
-%attr(755, root, root) %{_libdir}/plugin/*.so*
+%attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so*
+%if %{WITHOUT_INNODB_PLUGIN}
+%else
+%attr(755, root, root) %{_libdir}/mysql/plugin/ha_innodb_plugin.so*
+%endif
 
 %attr(755, root, root) %{_sbindir}/mysqld
 %attr(755, root, root) %{_sbindir}/mysqld-debug
@@ -842,8 +846,13 @@ fi
 %{_libdir}/mysql/libvio.a
 %{_libdir}/mysql/libz.a
 %{_libdir}/mysql/libz.la
-%{_libdir}/plugin/*.a
-%{_libdir}/plugin/*.la
+%{_libdir}/mysql/plugin/ha_example.a
+%{_libdir}/mysql/plugin/ha_example.la
+%if %{WITHOUT_INNODB_PLUGIN}
+%else
+%{_libdir}/mysql/plugin/ha_innodb_plugin.a
+%{_libdir}/mysql/plugin/ha_innodb_plugin.la
+%endif
 
 %files shared
 %defattr(-, root, root, 0755)
@@ -880,9 +889,9 @@ fi
 * Fri Aug 21 2009 Jonathan Perkin <jperkin@stripped>
 
 - Install plugin libraries in appropriate packages.
-- Disable example plugins.
+- Disable libdaemon_example and ftexample plugins.
 
-* Thu Aug 20 2009 Jonathan Perkin <jperkin@stripped>
+* Thu Aug 20 2009 Jonathan Perkin <jperkin@stripped>
 
 - Update variable used for mysql-test suite location to match source.
 

=== modified file 'unittest/mysys/base64-t.c'
--- a/unittest/mysys/base64-t.c	2007-08-01 19:59:05 +0000
+++ b/unittest/mysys/base64-t.c	2009-09-23 13:21:29 +0000
@@ -84,7 +84,7 @@ main(void)
           unsigned char c= dst[k+l];
           sprintf(buf, "%.2x ", (unsigned)c);
         }
-        diag(buf);
+        diag("%s", buf);
       }
       diag("src length: %.8x, dst length: %.8x\n",
            (uint) src_len, (uint) dst_len);

Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090929130818-cpmif407ssozf2p5.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (azundris:3125)Tatiana A. Nurnberg29 Sep