List:Commits« Previous MessageNext Message »
From:Marc Alff Date:September 26 2011 11:31pm
Subject:bzr push into mysql-trunk branch (marc.alff:3420 to 3421)
View as plain text  
 3421 Marc Alff	2011-09-27 [merge]
      Merge mysql-trunk --> mysql-trunk-pfs-tuning

    removed:
      support-files/config.huge.ini.sh
      support-files/config.medium.ini.sh
      support-files/config.small.ini.sh
      support-files/ndb-config-2-node.ini.sh
    modified:
      client/mysql_plugin.c
      client/mysqltest.cc
      cmake/plugin.cmake
      extra/perror.c
      include/mysql/plugin.h
      include/mysql/plugin_audit.h.pp
      include/mysql/plugin_auth.h.pp
      include/mysql/plugin_ftparser.h.pp
      libmysql/authentication_win/common.cc
      libmysql/authentication_win/common.h
      libmysql/authentication_win/handshake_client.cc
      libmysql/authentication_win/log_client.cc
      mysql-test/include/order_by.inc
      mysql-test/mysql-test-run.pl
      mysql-test/r/ctype_errors.result
      mysql-test/r/ctype_utf16.result
      mysql-test/r/ctype_utf32_uca.result
      mysql-test/r/func_str.result
      mysql-test/r/order_by_all.result
      mysql-test/r/order_by_icp_mrr.result
      mysql-test/r/order_by_none.result
      mysql-test/r/plugin_auth.result
      mysql-test/r/sp-error.result
      mysql-test/r/sp.result
      mysql-test/r/type_float.result
      mysql-test/r/union.result
      mysql-test/suite/innodb/r/innodb-index.result
      mysql-test/suite/innodb/t/innodb-index.test
      mysql-test/t/ctype_errors.test
      mysql-test/t/ctype_utf32_uca.test
      mysql-test/t/func_str.test
      mysql-test/t/mysql_plugin.test
      mysql-test/t/plugin_auth.test
      mysql-test/t/sp-error.test
      mysql-test/t/sp.test
      mysql-test/t/type_float.test
      mysql-test/t/union.test
      plugin/audit_null/audit_null.c
      plugin/auth/auth_socket.c
      plugin/auth/dialog.c
      plugin/auth/qa_auth_interface.c
      plugin/auth/qa_auth_server.c
      plugin/auth/test_plugin.c
      plugin/daemon_example/daemon_example.cc
      plugin/fulltext/plugin_example.c
      plugin/semisync/semisync_master_plugin.cc
      plugin/semisync/semisync_slave_plugin.cc
      sql/binlog.cc
      sql/ha_ndbcluster.cc
      sql/ha_partition.cc
      sql/item_create.cc
      sql/item_strfunc.cc
      sql/item_strfunc.h
      sql/share/errmsg-utf8.txt
      sql/sql_acl.cc
      sql/sql_error.cc
      sql/sql_lex.cc
      sql/sql_plugin.cc
      sql/sql_union.cc
      sql/sql_yacc.yy
      storage/archive/ha_archive.cc
      storage/blackhole/ha_blackhole.cc
      storage/csv/ha_tina.cc
      storage/example/ha_example.cc
      storage/federated/ha_federated.cc
      storage/heap/ha_heap.cc
      storage/innobase/btr/btr0pcur.c
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/handler/i_s.cc
      storage/innobase/include/btr0pcur.h
      storage/innobase/include/btr0pcur.ic
      storage/innobase/include/mtr0mtr.h
      storage/innobase/include/srv0mon.h
      storage/innobase/include/ut0mem.h
      storage/innobase/include/ut0mem.ic
      storage/innobase/mtr/mtr0mtr.c
      storage/innobase/os/os0file.c
      storage/innobase/read/read0read.c
      storage/innobase/row/row0purge.c
      storage/innobase/trx/trx0purge.c
      storage/innobase/ut/ut0mem.c
      storage/myisam/ha_myisam.cc
      storage/myisammrg/ha_myisammrg.cc
      storage/perfschema/ha_perfschema.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr.h
      strings/dtoa.c
      support-files/CMakeLists.txt
      support-files/mysql.spec.sh
      tests/mysql_client_test.c
 3420 Marc Alff	2011-09-21
      Misc cleanup

    modified:
      sql/sql_base.cc
=== modified file 'client/mysql_plugin.c'
--- a/client/mysql_plugin.c	2011-08-11 16:48:00 +0000
+++ b/client/mysql_plugin.c	2011-09-23 10:55:10 +0000
@@ -846,12 +846,19 @@ static int process_options(int argc, cha
   {
     i= (int)strlength(opt_basedir);
     if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2)
+    {
+      char buff[FN_REFLEN];
+      
+      strncpy(buff, opt_basedir, sizeof(buff) - 1);
 #ifdef __WIN__
-      if (opt_basedir[i-1] != '/')
-        strcat(opt_basedir, "//");
+      strncat(buff, "/", sizeof(buff) - strlen(buff) - 1);
 #else
-      strcat(opt_basedir, FN_DIRSEP);
+      strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
 #endif
+      buff[sizeof(buff) - 1]= 0;
+      my_delete(opt_basedir, MYF(0));
+      opt_basedir= my_strdup(buff, MYF(MY_FAE));
+    }
   }
   
   /*
@@ -1157,10 +1164,13 @@ static int bootstrap_server(char *server
 
 #ifdef __WIN__
   char *format_str= 0;
-  char *verbose_str= "";
+  const char *verbose_str= NULL;
+   
   
   if (opt_verbose)
-    strcat(verbose_str, "--console");
+    verbose_str= "--console";
+  else
+    verbose_str= "";
   if (has_spaces(opt_datadir) || has_spaces(opt_basedir) ||
       has_spaces(bootstrap_file))
     format_str= "\"%s %s --bootstrap --datadir=%s --basedir=%s < %s\"";

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2011-08-22 13:24:38 +0000
+++ b/client/mysqltest.cc	2011-09-22 08:26:08 +0000
@@ -8076,6 +8076,7 @@ void free_re(void)
   my_regfree(&sp_re);
   my_regfree(&view_re);
   my_regfree(&opt_trace_re);
+  my_regfree(&explain_re);
   my_regex_end();
 }
 

=== modified file 'cmake/plugin.cmake'
--- a/cmake/plugin.cmake	2011-06-10 14:12:38 +0000
+++ b/cmake/plugin.cmake	2011-09-21 11:01:41 +0000
@@ -196,6 +196,10 @@ MACRO(MYSQL_ADD_PLUGIN)
     # Install dynamic library
     MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
     INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+    # Add installed files to list for RPMs
+    FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
+            "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
+            "%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/debug/${ARG_MODULE_OUTPUT_NAME}.so\n")
     # For internal testing in PB2, append collections files
     IF(DEFINED ENV{PB2WORKDIR})
       PLUGIN_APPEND_COLLECTIONS(${plugin})

=== modified file 'extra/perror.c'
--- a/extra/perror.c	2011-07-04 00:25:46 +0000
+++ b/extra/perror.c	2011-09-20 14:24:18 +0000
@@ -34,7 +34,6 @@ static my_bool verbose;
 
 #include "../include/my_base.h"
 #include "../mysys/my_handler_errors.h"
-// #include "../include/my_compare.h"
 
 #ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
 static my_bool ndb_code;

=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h	2011-07-19 15:11:15 +0000
+++ b/include/mysql/plugin.h	2011-09-21 11:01:41 +0000
@@ -73,7 +73,7 @@ typedef struct st_mysql_xid MYSQL_XID;
   Plugin API. Common for all plugin types.
 */
 
-#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
+#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0103
 
 /*
   The allowable types of plugins
@@ -122,7 +122,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
                  builtin_ ## NAME ## _sizeof_struct_st_plugin, \
                  builtin_ ## NAME ## _plugin)
 
-#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
+#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
 
 /**
   declarations for SHOW STATUS support in plugins
@@ -149,6 +149,14 @@ typedef int (*mysql_show_var_func)(MYSQL
 
 
 /*
+  Constants for plugin flags.
+ */
+
+#define PLUGIN_OPT_NO_INSTALL   1UL   /* Not dynamically loadable */
+#define PLUGIN_OPT_NO_UNINSTALL 2UL   /* Not dynamically unloadable */
+
+
+/*
   declarations for server variables and command line options
 */
 
@@ -420,6 +428,7 @@ struct st_mysql_plugin
   struct st_mysql_show_var *status_vars;
   struct st_mysql_sys_var **system_vars;
   void * __reserved1;   /* reserved for dependency checking             */
+  unsigned long flags;  /* flags for plugin */
 };
 
 /*************************************************************************

=== modified file 'include/mysql/plugin_audit.h.pp'
--- a/include/mysql/plugin_audit.h.pp	2011-07-19 15:11:15 +0000
+++ b/include/mysql/plugin_audit.h.pp	2011-09-21 11:01:41 +0000
@@ -118,6 +118,7 @@ struct st_mysql_plugin
   struct st_mysql_show_var *status_vars;
   struct st_mysql_sys_var **system_vars;
   void * __reserved1;
+  unsigned long flags;
 };
 #include "plugin_ftparser.h"
 #include "plugin.h"

=== modified file 'include/mysql/plugin_auth.h.pp'
--- a/include/mysql/plugin_auth.h.pp	2011-07-19 15:11:15 +0000
+++ b/include/mysql/plugin_auth.h.pp	2011-09-21 11:01:41 +0000
@@ -118,6 +118,7 @@ struct st_mysql_plugin
   struct st_mysql_show_var *status_vars;
   struct st_mysql_sys_var **system_vars;
   void * __reserved1;
+  unsigned long flags;
 };
 #include "plugin_ftparser.h"
 #include "plugin.h"

=== modified file 'include/mysql/plugin_ftparser.h.pp'
--- a/include/mysql/plugin_ftparser.h.pp	2011-07-19 15:11:15 +0000
+++ b/include/mysql/plugin_ftparser.h.pp	2011-09-21 11:01:41 +0000
@@ -44,7 +44,7 @@ typedef enum _thd_wait_type_e {
   THD_WAIT_BINLOG= 8,
   THD_WAIT_GROUP_COMMIT= 9,
   THD_WAIT_SYNC= 10,
-  THD_WAIT_LAST= 11 
+  THD_WAIT_LAST= 11
 } thd_wait_type;
 extern struct thd_wait_service_st {
   void (*thd_wait_begin_func)(void*, int);
@@ -118,6 +118,7 @@ struct st_mysql_plugin
   struct st_mysql_show_var *status_vars;
   struct st_mysql_sys_var **system_vars;
   void * __reserved1;
+  unsigned long flags;
 };
 #include "plugin_ftparser.h"
 struct st_mysql_daemon

=== modified file 'libmysql/authentication_win/common.cc'
--- a/libmysql/authentication_win/common.cc	2011-04-29 21:53:46 +0000
+++ b/libmysql/authentication_win/common.cc	2011-09-21 11:01:41 +0000
@@ -22,6 +22,24 @@ template <> void error_log_print<error_l
 template <> void error_log_print<error_log_level::WARNING>(const char *fmt, ...);
 template <> void error_log_print<error_log_level::ERROR>(const char *fmt, ...);
 
+/**
+  Option indicating desired level of logging. Values:
+
+  0 - no logging
+  1 - log only error messages
+  2 - additionally log warnings
+  3 - additionally log info notes
+  4 - also log debug messages
+
+  Value of this option should be taken into account in the 
+  implementation of  error_log_vprint() function (see 
+  log_client.cc).
+
+  Note: No error or debug messages are logged in production code
+  (see logging macros in common.h).
+*/
+int opt_auth_win_log_level= 2;
+
 
 /** Connection class **************************************************/
 

=== modified file 'libmysql/authentication_win/common.h'
--- a/libmysql/authentication_win/common.h	2011-04-29 21:53:46 +0000
+++ b/libmysql/authentication_win/common.h	2011-09-21 11:01:41 +0000
@@ -41,13 +41,15 @@ struct error_log_level
   typedef enum {INFO, WARNING, ERROR}  type;
 };
 
+extern "C" int opt_auth_win_log_level;
+unsigned int  get_log_level(void);
+void          set_log_level(unsigned int);
+
 
 /*
   If DEBUG_ERROR_LOG is defined then error logging happens only
   in debug-copiled code. Otherwise ERROR_LOG() expands to 
-  error_log_print() even in production code. Note that in client
-  plugin, error_log_print() will print nothing if opt_auth_win_clinet_log
-  is 0.
+  error_log_print() even in production code.
 
   Note: Macro ERROR_LOG() can use printf-like format string like this:
 
@@ -57,8 +59,6 @@ struct error_log_level
   to fprintf() (see error_log_vprint() function).
 */
 
-extern "C" int opt_auth_win_client_log;
-
 #if defined(DEBUG_ERROR_LOG) && defined(DBUG_OFF)
 #define ERROR_LOG(Level, Msg)     do {} while (0)
 #else
@@ -67,7 +67,7 @@ extern "C" int opt_auth_win_client_log;
 
 
 void error_log_vprint(error_log_level::type level,
-                        const char *fmt, va_list args);
+                      const char *fmt, va_list args);
 
 template <error_log_level::type Level>
 void error_log_print(const char *fmt, ...)
@@ -96,7 +96,7 @@ const char* get_last_error_message(Error
 
 #define DBUG_PRINT_DO(Keyword, Msg) \
   do { \
-    if (2 > opt_auth_win_client_log) break; \
+    if (4 > get_log_level()) break; \
     fprintf(stderr, "winauth: %s: ", Keyword); \
     debug_msg Msg; \
   } while (0)

=== modified file 'libmysql/authentication_win/handshake_client.cc'
--- a/libmysql/authentication_win/handshake_client.cc	2011-04-29 21:53:46 +0000
+++ b/libmysql/authentication_win/handshake_client.cc	2011-09-21 11:01:41 +0000
@@ -323,13 +323,13 @@ int win_auth_handshake_client(MYSQL_PLUG
     int opt_val= opt ? atoi(opt) : 0;
     if (opt && !opt_val)
     {
-      if (!strncasecmp("on", opt, 2))    opt_val= 1;
-      if (!strncasecmp("yes", opt, 3))   opt_val= 1;
-      if (!strncasecmp("true", opt, 4))  opt_val= 1;
-      if (!strncasecmp("debug", opt, 5)) opt_val= 2;
-      if (!strncasecmp("dbug", opt, 4))  opt_val= 2;
+      if (!strncasecmp("on", opt, 2))    opt_val= 2;
+      if (!strncasecmp("yes", opt, 3))   opt_val= 2;
+      if (!strncasecmp("true", opt, 4))  opt_val= 2;
+      if (!strncasecmp("debug", opt, 5)) opt_val= 4;
+      if (!strncasecmp("dbug", opt, 4))  opt_val= 4;
     }
-    opt_auth_win_client_log= opt_val;
+    set_log_level(opt_val);
   }
 
   ERROR_LOG(INFO, ("Authentication handshake for account %s", mysql->user));

=== modified file 'libmysql/authentication_win/log_client.cc'
--- a/libmysql/authentication_win/log_client.cc	2011-04-29 21:53:46 +0000
+++ b/libmysql/authentication_win/log_client.cc	2011-09-21 11:01:41 +0000
@@ -16,36 +16,32 @@
 #include <my_global.h>
 #include "common.h"
 
-/**
-  This option is set in win_auth_handshake_client() function 
-  in handshake_client.cc.
-
-  Values:
-  0 - no logging
-  1 - log error/warning/info messages
-  2 - also log debug messages
-
-  Note: No error or debug messages are logged in production code
-  (see logging macros in common.h).
-*/
-int opt_auth_win_client_log= 0;
-
 
 // Client-side logging function
 
 void error_log_vprint(error_log_level::type level,
                         const char *fmt, va_list args)
 {
-  if (0 == opt_auth_win_client_log)
-    return;
-
   const char *level_string= "";
+  int   log_level= get_log_level();
 
   switch (level)
   {
-  case error_log_level::INFO:    level_string= "Note"; break;
-  case error_log_level::WARNING: level_string= "Warning"; break;
-  case error_log_level::ERROR:   level_string= "ERROR"; break;
+  case error_log_level::INFO:    
+    if (3 > log_level)
+      return;
+    level_string= "Note"; 
+    break;
+  case error_log_level::WARNING: 
+    if (2 > log_level)
+      return;
+    level_string= "Warning"; 
+    break;
+  case error_log_level::ERROR:   
+    if (1 > log_level)
+      return;
+    level_string= "ERROR";
+    break;
   }
 
   fprintf(stderr, "Windows Authentication Plugin %s: ", level_string);
@@ -53,3 +49,17 @@ void error_log_vprint(error_log_level::t
   fputc('\n', stderr);
   fflush(stderr);
 }
+
+
+// Trivial implementation of log-level setting storage.
+
+void set_log_level(unsigned int level)
+{
+  opt_auth_win_log_level= level;
+}
+
+
+unsigned int  get_log_level(void)
+{
+  return opt_auth_win_log_level;
+}

=== modified file 'mysql-test/include/order_by.inc'
--- a/mysql-test/include/order_by.inc	2011-03-30 13:33:29 +0000
+++ b/mysql-test/include/order_by.inc	2011-09-21 11:01:41 +0000
@@ -1706,6 +1706,13 @@ SELECT DISTINCT a,1 FROM t1 WHERE a <> 1
 
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#11765255 58201:
+--echo # VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+--echo #
+
+select 1 order by max(1) + min(1);
+
 --echo End of 5.1 tests
 
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2011-08-30 10:49:24 +0000
+++ b/mysql-test/mysql-test-run.pl	2011-09-23 10:55:10 +0000
@@ -452,8 +452,9 @@ sub main {
   #
   read_plugin_defs("include/plugin.defs");
 
-  # Also read from any plugin local plugin.defs
-  for (glob "$basedir/plugin/*/tests/mtr/plugin.defs") {
+  # Also read from any plugin local or suite specific plugin.defs
+  for (glob "$basedir/plugin/*/tests/mtr/plugin.defs".
+            " suite/*/plugin.defs") {
     read_plugin_defs($_);
   }
 

=== modified file 'mysql-test/r/ctype_errors.result'
--- a/mysql-test/r/ctype_errors.result	2010-08-30 06:38:09 +0000
+++ b/mysql-test/r/ctype_errors.result	2011-09-21 11:01:41 +0000
@@ -29,4 +29,14 @@ SET lc_messages=cs_CZ;
 SET NAMES UTF8;
 USE nonexistant;
 ERROR 42000: Nezn-Bámá databáze 'nonexistant'
-End of 5.4 tests
+#
+# Bug#12736295: Buffer overflow for variable converted_err
+#               with non-latin1 server error message
+#
+# Connection con1
+SET lc_messages=ru_RU;
+SET NAMES latin1;
+SELECT '01234567890123456789012345678901234\';
+ERROR 42000: \0423 \0432\0430\0441 \043E\0448\0438\0431\043A\0430 \0432 \0437\0430\043F\0440\043E\0441\0435. \0418\0437\0443\0447\0438\0442\0435 \0434\043E\043A\0443\043C\0435\043D\0442\0430\0446\0438\044E \043F\043E \0438\0441\043F\043E\043B\044C\0437\0443\0435\043C\043E\0439 \0432\0435\0440\0441\0438\0438 MySQL \043D\0430 \043F\0440\0435\0434\043C\0435\0442 \043A\043E\0440\0440\0435\043A\0442\043D\043E\0433\043E \0441\0438\043D\0442\0430\043A\0441\0438\0441\0430 \043E\043A\043E\043B\043E ''012345678901234567890123456
+# Connection default
+End of 5.5 tests

=== modified file 'mysql-test/r/ctype_utf16.result'
--- a/mysql-test/r/ctype_utf16.result	2011-05-02 11:31:27 +0000
+++ b/mysql-test/r/ctype_utf16.result	2011-09-22 10:42:10 +0000
@@ -1131,7 +1131,7 @@ SELECT space(date_add(101, INTERVAL CHAR
 space(date_add(101, INTERVAL CHAR('1' USING utf16) hour_second))
 NULL
 Warnings:
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 #
 # End of 5.5 tests
 #

=== modified file 'mysql-test/r/ctype_utf32_uca.result'
--- a/mysql-test/r/ctype_utf32_uca.result	2010-11-26 11:36:39 +0000
+++ b/mysql-test/r/ctype_utf32_uca.result	2011-09-21 11:01:41 +0000
@@ -2887,6 +2887,26 @@ HEX(s1)
 00000061
 DROP TABLE t1;
 #
+# Bug #12319710 : INVALID MEMORY READ AND/OR CRASH IN 
+#   MY_UCA_CHARCMP WITH UTF32
+#
+SET collation_connection=utf32_unicode_ci;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL);
+INSERT INTO t1 VALUES ('a'), ('b');
+CREATE TABLE t2 (b VARBINARY(5) NOT NULL);
+#insert chars outside of BMP
+INSERT INTO t2 VALUEs (0x082837),(0x082837);
+#test for read-out-of-bounds with non-BMP chars as a LIKE pattern
+SELECT * FROM t1,t2 WHERE a LIKE b;
+a	b
+#test the original statement
+SELECT 1 FROM t1 AS t1_0 NATURAL LEFT OUTER JOIN t2 AS t2_0
+RIGHT JOIN t1 AS t1_1 ON t1_0.a LIKE t2_0.b;
+1
+1
+1
+DROP TABLE t1,t2;
+#
 # End of 5.5 tests
 #
 #

=== modified file 'mysql-test/r/func_str.result'
--- a/mysql-test/r/func_str.result	2011-09-20 09:17:02 +0000
+++ b/mysql-test/r/func_str.result	2011-09-22 10:42:10 +0000
@@ -845,7 +845,7 @@ explain extended select concat('*',space
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
 Warnings:
-Note	1003	/* select#1 */ select concat('*',repeat(' ',5),'*') AS `concat('*',space(5),'*')`
+Note	1003	/* select#1 */ select concat('*',space(5),'*') AS `concat('*',space(5),'*')`
 explain extended select reverse('abc');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
 1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
@@ -2084,7 +2084,7 @@ select space(4294967295);
 space(4294967295)
 NULL
 Warnings:
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select space(-4294967296);
 space(-4294967296)
 
@@ -2092,7 +2092,7 @@ select space(4294967296);
 space(4294967296)
 NULL
 Warnings:
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select space(-4294967297);
 space(-4294967297)
 
@@ -2100,7 +2100,7 @@ select space(4294967297);
 space(4294967297)
 NULL
 Warnings:
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select space(-18446744073709551615);
 space(-18446744073709551615)
 
@@ -2111,7 +2111,7 @@ select space(18446744073709551615);
 space(18446744073709551615)
 NULL
 Warnings:
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select space(-18446744073709551616);
 space(-18446744073709551616)
 
@@ -2124,7 +2124,7 @@ NULL
 Warnings:
 Warning	1292	Truncated incorrect DECIMAL value: ''
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select space(-18446744073709551617);
 space(-18446744073709551617)
 
@@ -2137,7 +2137,7 @@ NULL
 Warnings:
 Warning	1292	Truncated incorrect DECIMAL value: ''
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1301	Result of repeat() was larger than max_allowed_packet (1048576) - truncated
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
 select rpad('hello', -1, '1');
 rpad('hello', -1, '1')
 NULL
@@ -4407,6 +4407,20 @@ NULL
 Warnings:
 Warning	1301	Result of export_set() was larger than max_allowed_packet (1073741824) - truncated
 SET @@global.max_allowed_packet:= @tmp_max;
+SELECT SPACE(@@global.max_allowed_packet*2);
+SPACE(@@global.max_allowed_packet*2)
+NULL
+Warnings:
+Warning	1301	Result of space() was larger than max_allowed_packet (1048576) - truncated
+SET NAMES latin1;
+PREPARE stmt FROM "SELECT COLLATION(space(2))";
+EXECUTE stmt;
+COLLATION(space(2))
+latin1_swedish_ci
+SET NAMES latin2;
+EXECUTE stmt;
+COLLATION(space(2))
+latin2_general_ci
 #
 # End of 5.6 tests
 #

=== modified file 'mysql-test/r/order_by_all.result'
--- a/mysql-test/r/order_by_all.result	2011-08-03 11:29:20 +0000
+++ b/mysql-test/r/order_by_all.result	2011-09-21 11:01:41 +0000
@@ -2550,6 +2550,13 @@ a	1
 3	1
 2	1
 DROP TABLE t1;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 order by max(1) + min(1);
+1
+1
 End of 5.1 tests
 #
 # Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY

=== modified file 'mysql-test/r/order_by_icp_mrr.result'
--- a/mysql-test/r/order_by_icp_mrr.result	2011-08-03 11:29:20 +0000
+++ b/mysql-test/r/order_by_icp_mrr.result	2011-09-23 12:22:58 +0000
@@ -2550,6 +2550,13 @@ a	1
 3	1
 2	1
 DROP TABLE t1;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 order by max(1) + min(1);
+1
+1
 End of 5.1 tests
 #
 # Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY

=== modified file 'mysql-test/r/order_by_none.result'
--- a/mysql-test/r/order_by_none.result	2011-08-03 11:29:20 +0000
+++ b/mysql-test/r/order_by_none.result	2011-09-23 12:22:58 +0000
@@ -2549,6 +2549,13 @@ a	1
 3	1
 2	1
 DROP TABLE t1;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 order by max(1) + min(1);
+1
+1
 End of 5.1 tests
 #
 # Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY

=== modified file 'mysql-test/r/plugin_auth.result'
--- a/mysql-test/r/plugin_auth.result	2011-08-19 13:21:02 +0000
+++ b/mysql-test/r/plugin_auth.result	2011-09-23 12:22:58 +0000
@@ -49,7 +49,7 @@ ERROR 28000: Access denied for user 'plu
 ## test correct default plugin
 select USER(),CURRENT_USER();
 USER()	CURRENT_USER()
-plug@localhost	plug@%
+plug@localhost	plug_dest@%
 ## test no_auto_create_user sql mode with plugin users
 SET @@sql_mode=no_auto_create_user;
 GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
@@ -486,9 +486,31 @@ DROP USER bug12610784@localhost;
 #
 # Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN 
 #  .-> USING PASSWORD: NO 
+# Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM 
+#   AUTHENTICATION SETTINGS
 #
 # shoud contain "using password=yes"
 ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: YES)
 # shoud contain "using password=no"
 ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: NO)
+CREATE USER bug12610784@localhost;
+SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
+ERROR 28000: Access denied for user 'bug12610784'@'localhost' (using password: NO)
+DROP USER bug12610784@localhost;
+CREATE USER bug12818542@localhost 
+IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
+CREATE USER bug12818542_dest@localhost 
+IDENTIFIED BY 'bug12818542_dest_passwd';
+GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
+SELECT USER(),CURRENT_USER();
+USER()	CURRENT_USER()
+bug12818542@localhost	bug12818542_dest@localhost
+SET PASSWORD = PASSWORD('bruhaha');
+Warnings:
+Note	1699	SET PASSWORD has no significance for users authenticating via plugins
+SELECT USER(),CURRENT_USER();
+USER()	CURRENT_USER()
+bug12818542@localhost	bug12818542_dest@localhost
+DROP USER bug12818542@localhost;
+DROP USER bug12818542_dest@localhost;
 End of 5.5 tests

=== modified file 'mysql-test/r/sp-error.result'
--- a/mysql-test/r/sp-error.result	2011-07-28 08:31:36 +0000
+++ b/mysql-test/r/sp-error.result	2011-09-21 11:01:41 +0000
@@ -1707,6 +1707,22 @@ ERROR HY000: View 'test.v1' references i
 DROP PROCEDURE p1;
 DROP VIEW v1;
 DROP TABLE t1;
+#
+# Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
+#                WITH OBSCURE QUERY
+#
+SELECT very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+CALL very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+SELECT very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_func();
+ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
+CALL very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_proc();
+ERROR 42000: Incorrect database name 'very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222'
+SELECT db_name.very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+ERROR 42000: Identifier name 'very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
+CALL db_name.very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+ERROR 42000: Identifier name 'very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222' is too long
 End of 5.1 tests
 #
 # Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP

=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result	2011-08-02 08:14:26 +0000
+++ b/mysql-test/r/sp.result	2011-09-21 11:01:41 +0000
@@ -7026,6 +7026,21 @@ SET @@GLOBAL.init_connect= @old_init_con
 DROP PROCEDURE p2;
 DROP PROCEDURE p5;
 #
+# Bug#11840395 (formerly known as bug#60347):
+# The string "versiondata" seems
+# to be 'leaking' into the schema name space
+#
+DROP DATABASE IF EXISTS mixedCaseDbName;
+CREATE DATABASE mixedCaseDbName;
+CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
+CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end
+|
+call mixedCaseDbName.tryMyProc();
+select mixedCaseDbName.tryMyFunc();
+mixedCaseDbName.tryMyFunc()
+IT WORKS
+DROP DATABASE mixedCaseDbName;
+#
 # Bug#11766594  59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
 #
 CREATE TABLE t1 (a INT, b INT, KEY(b));

=== modified file 'mysql-test/r/type_float.result'
--- a/mysql-test/r/type_float.result	2010-04-11 06:52:42 +0000
+++ b/mysql-test/r/type_float.result	2011-07-18 08:27:05 +0000
@@ -431,4 +431,19 @@ SELECT f1 FROM t1;
 f1
 -1.79769313486231e308
 DROP TABLE t1;
+#
+# Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
+# 
+# Ignoring output from misc. float operations
+select format(-1.7976931348623157E+307,256) as foo;
+select least(-1.1111111111111111111111111,
+- group_concat(1.7976931348623157E+308)) as foo;
+select concat((truncate((-1.7976931348623157E+307),(0x1e))),
+(99999999999999999999999999999999999999999999999999999999999999999)) into @a;
 End of 5.0 tests
+#
+# Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
+#
+select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
+foo
+0

=== modified file 'mysql-test/r/union.result'
--- a/mysql-test/r/union.result	2011-08-03 11:29:20 +0000
+++ b/mysql-test/r/union.result	2011-09-21 11:01:41 +0000
@@ -1643,6 +1643,63 @@ b
 1
 2
 DROP TABLE t1,t2;
+#
+# Bug#11765255 58201:
+# VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+#
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+foo
+1
+prepare stmt1 from 'select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+';
+execute stmt1;
+foo
+1
+execute stmt1;
+foo
+1
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+foo
+1
+prepare stmt1 from 'select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+';
+execute stmt1;
+foo
+1
+execute stmt1;
+foo
+1
+deallocate prepare stmt1;
 End of 5.1 tests
 #
 # Bug#57986 ORDER BY clause is not used after a UNION, 

=== modified file 'mysql-test/suite/innodb/r/innodb-index.result'
--- a/mysql-test/suite/innodb/r/innodb-index.result	2011-09-01 18:59:44 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index.result	2011-09-21 00:24:59 +0000
@@ -39,10 +39,81 @@ DELETE FROM t1_purge;
 DELETE FROM t2_purge;
 DELETE FROM t3_purge;
 DELETE FROM t4_purge;
-SELECT sleep(10);
-sleep(10)
-0
-drop table t1_purge, t2_purge, t3_purge, t4_purge;
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+Table	Create Table
+t12963823	CREATE TABLE `t12963823` (
+  `a` blob,
+  `b` blob,
+  `c` blob,
+  `d` blob,
+  `e` blob,
+  `f` blob,
+  `g` blob,
+  `h` blob,
+  `i` blob,
+  `j` blob,
+  `k` blob,
+  `l` blob,
+  `m` blob,
+  `n` blob,
+  `o` blob,
+  `p` blob,
+  KEY `ndx_c` (`c`(500)),
+  KEY `ndx_d` (`d`(500)),
+  KEY `ndx_e` (`e`(500)),
+  KEY `ndx_f` (`f`(500)),
+  KEY `ndx_k` (`k`(500)),
+  KEY `ndx_l` (`l`(500)),
+  KEY `ndx_g` (`g`(500)),
+  KEY `ndx_h` (`h`(500)),
+  KEY `ndx_i` (`i`(500)),
+  KEY `ndx_j` (`j`(500)),
+  KEY `ndx_m` (`m`(500)),
+  KEY `ndx_n` (`n`(500)),
+  KEY `ndx_o` (`o`(500)),
+  KEY `ndx_p` (`p`(500))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 set global innodb_file_per_table=0;
 set global innodb_file_format=Antelope;
 create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
@@ -964,20 +1035,6 @@ ERROR HY000: Too big row
 alter table t1 row_format=compact;
 create index t1u on t1 (u(767));
 drop table t1;
-SET @r=REPEAT('a',500);
-CREATE TABLE t1(a INT,
-v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
-v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
-v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
-v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
-v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
-v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-CREATE INDEX idx1 ON t1(a,v1);
-INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
-UPDATE t1 SET a=1000;
-DELETE FROM t1;
-DROP TABLE t1;
 CREATE TABLE bug12547647(
 a INT NOT NULL, b BLOB NOT NULL, c TEXT,
 PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767))
@@ -1195,3 +1252,6 @@ a	b
 3	a
 3	b
 DROP TABLE t1,t2;
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;

=== modified file 'mysql-test/suite/innodb/t/innodb-index.test'
--- a/mysql-test/suite/innodb/t/innodb-index.test	2011-09-01 18:59:44 +0000
+++ b/mysql-test/suite/innodb/t/innodb-index.test	2011-09-21 00:24:59 +0000
@@ -9,7 +9,7 @@ let $format=`select @@innodb_file_format
 set global innodb_file_per_table=on;
 set global innodb_file_format='Barracuda';
 
-# Test an assertion failure on purge.
+# Bug #12429576 - Test an assertion failure on purge.
 CREATE TABLE t1_purge (
 A INT,
 B BLOB, C BLOB, D BLOB, E BLOB,
@@ -59,9 +59,68 @@ DELETE FROM t1_purge;
 DELETE FROM t2_purge;
 DELETE FROM t3_purge;
 DELETE FROM t4_purge;
+# Instead of doing a --sleep 10, wait until the rest of the tests in
+# this file complete before dropping the tables.  By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12637786 - Bad assert by purge thread for records with external data
+# used in secondary indexes.
+SET @r=REPEAT('a',500);
+CREATE TABLE t12637786(a INT,
+ v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
+ v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
+ v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
+ v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
+ v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
+ v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
+) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+CREATE INDEX idx1 ON t12637786(a,v1);
+INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
+UPDATE t12637786 SET a=1000;
+DELETE FROM t12637786;
+# We need to activate the purge thread at this point to make sure it does not
+# assert and is able to clean up the old versions of secondary index entries.
+# But instead of doing a --sleep 10,  wait until the rest of the tests in
+# this file complete before dropping the table.  By then, the purge thread
+# will have delt with the updates above.
+
+# Bug#12963823 - Test that the purge thread does not crash when
+# the number of indexes has changed since the UNDO record was logged.
+create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
+		       i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
+	engine=innodb row_format=dynamic;
+SET @r = repeat('a', 767);
+insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
+create index ndx_a on t12963823 (a(500));
+create index ndx_b on t12963823 (b(500));
+create index ndx_c on t12963823 (c(500));
+create index ndx_d on t12963823 (d(500));
+create index ndx_e on t12963823 (e(500));
+create index ndx_f on t12963823 (f(500));
+create index ndx_k on t12963823 (k(500));
+create index ndx_l on t12963823 (l(500));
+
+SET @r = repeat('b', 500);
+update t12963823 set a=@r,b=@r,c=@r,d=@r;
+update t12963823 set e=@r,f=@r,g=@r,h=@r;
+update t12963823 set i=@r,j=@r,k=@r,l=@r;
+update t12963823 set m=@r,n=@r,o=@r,p=@r;
+alter table t12963823 drop index ndx_a;
+alter table t12963823 drop index ndx_b;
+create index ndx_g on t12963823 (g(500));
+create index ndx_h on t12963823 (h(500));
+create index ndx_i on t12963823 (i(500));
+create index ndx_j on t12963823 (j(500));
+create index ndx_m on t12963823 (m(500));
+create index ndx_n on t12963823 (n(500));
+create index ndx_o on t12963823 (o(500));
+create index ndx_p on t12963823 (p(500));
+show create table t12963823;
+# We need to activate the purge thread at this point to see if it crashes
+# but instead of doing a --sleep 10,  wait until the rest of the tests in
+# this file complete before dropping the table.  By then, the purge thread
+# will have delt with the updates above.
 
-SELECT sleep(10);
-drop table t1_purge, t2_purge, t3_purge, t4_purge;
 
 eval set global innodb_file_per_table=$per_table;
 eval set global innodb_file_format=$format;
@@ -460,24 +519,6 @@ create index t1u on t1 (u(767));
 
 drop table t1;
 
-# Bug#12637786
-SET @r=REPEAT('a',500);
-CREATE TABLE t1(a INT,
- v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
- v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
- v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
- v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
- v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
- v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
-) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
-CREATE INDEX idx1 ON t1(a,v1);
-INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
-UPDATE t1 SET a=1000;
-DELETE FROM t1;
-# Let the purge thread clean up this file.
--- sleep 10
-DROP TABLE t1;
-
 # Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
 CREATE TABLE bug12547647(
 a INT NOT NULL, b BLOB NOT NULL, c TEXT,
@@ -636,6 +677,12 @@ disconnect b;
 
 DROP TABLE t1,t2;
 
+# Drop these tables since the purge thread must have run by now
+# and did not crash.
+DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
+DROP TABLE t12637786;
+DROP TABLE t12963823;
+
 #
 # restore environment to the state it was before this test execution
 #

=== modified file 'mysql-test/t/ctype_errors.test'
--- a/mysql-test/t/ctype_errors.test	2009-10-15 12:23:43 +0000
+++ b/mysql-test/t/ctype_errors.test	2011-07-15 11:05:30 +0000
@@ -44,4 +44,19 @@ USE nonexistant;
 disconnect con1;
 connection default;
 
---echo End of 5.4 tests
+--echo #
+--echo # Bug#12736295: Buffer overflow for variable converted_err
+--echo #               with non-latin1 server error message
+--echo #
+
+connect (con1,localhost,root,,test);
+--echo # Connection con1
+SET lc_messages=ru_RU;
+SET NAMES latin1;
+--error ER_PARSE_ERROR
+--query SELECT '01234567890123456789012345678901234\'
+disconnect con1;
+--echo # Connection default
+connection default;
+
+--echo End of 5.5 tests

=== modified file 'mysql-test/t/ctype_utf32_uca.test'
--- a/mysql-test/t/ctype_utf32_uca.test	2010-11-26 11:36:39 +0000
+++ b/mysql-test/t/ctype_utf32_uca.test	2011-09-21 11:01:41 +0000
@@ -148,6 +148,27 @@ SET collation_connection=utf32_czech_ci;
 --source include/ctype_czech.inc
 --source include/ctype_like_ignorable.inc
 
+--echo #
+--echo # Bug #12319710 : INVALID MEMORY READ AND/OR CRASH IN 
+--echo #   MY_UCA_CHARCMP WITH UTF32
+--echo #
+
+SET collation_connection=utf32_unicode_ci;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf32 COLLATE utf32_turkish_ci NOT NULL);
+INSERT INTO t1 VALUES ('a'), ('b');
+CREATE TABLE t2 (b VARBINARY(5) NOT NULL);
+
+--echo #insert chars outside of BMP
+INSERT INTO t2 VALUEs (0x082837),(0x082837);
+
+--echo #test for read-out-of-bounds with non-BMP chars as a LIKE pattern
+SELECT * FROM t1,t2 WHERE a LIKE b;
+
+--echo #test the original statement
+SELECT 1 FROM t1 AS t1_0 NATURAL LEFT OUTER JOIN t2 AS t2_0
+RIGHT JOIN t1 AS t1_1 ON t1_0.a LIKE t2_0.b;
+
+DROP TABLE t1,t2;
 
 --echo #
 --echo # End of 5.5 tests

=== modified file 'mysql-test/t/func_str.test'
--- a/mysql-test/t/func_str.test	2011-09-20 09:17:02 +0000
+++ b/mysql-test/t/func_str.test	2011-09-22 10:42:10 +0000
@@ -1626,6 +1626,23 @@ SET @@global.max_allowed_packet:= @tmp_m
 --disconnect newconn
 
 
+#
+# BUG #12735829: SPACE() FUNCTION WARNING REFERS TO REPEAT() IN ER_WARN_ALLOWED_PACKET_OVERFLOWED 
+#
+
+SELECT SPACE(@@global.max_allowed_packet*2);
+
+
+#
+# BUG #11746123-23637: CHARSET AND COLLATION OF THE FUNCTION SPACE()  
+#
+
+SET NAMES latin1;
+PREPARE stmt FROM "SELECT COLLATION(space(2))";
+EXECUTE stmt;
+SET NAMES latin2;
+EXECUTE stmt;
+
 --echo #
 --echo # End of 5.6 tests
 --echo #

=== modified file 'mysql-test/t/mysql_plugin.test'
--- a/mysql-test/t/mysql_plugin.test	2011-08-12 10:49:38 +0000
+++ b/mysql-test/t/mysql_plugin.test	2011-09-23 10:55:10 +0000
@@ -224,6 +224,7 @@ let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n
 --echo # Attempt to use bad paths - basedir
 --echo #
 let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN -n --datadir=$MYSQLD_DATADIR --basedir=/basedir_not_there/ --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+replace_result "/basedir_not_there//" "/basedir_not_there/";
 --error 1,2,256
 --exec $MYSQL_PLUGIN_CMD DISABLE daemon_example 2>&1
 

=== modified file 'mysql-test/t/plugin_auth.test'
--- a/mysql-test/t/plugin_auth.test	2011-08-17 14:07:07 +0000
+++ b/mysql-test/t/plugin_auth.test	2011-09-21 11:02:24 +0000
@@ -544,6 +544,9 @@ DROP USER bug12610784@localhost;
 --echo #
 --echo # Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN 
 --echo #  .-> USING PASSWORD: NO 
+
+--echo # Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM 
+--echo #   AUTHENTICATION SETTINGS
 --echo #
 
 --echo # shoud contain "using password=yes"
@@ -554,5 +557,29 @@ DROP USER bug12610784@localhost;
 --error 1
 --exec $MYSQL -uunknown 2>&1
 
+CREATE USER bug12818542@localhost 
+  IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
+CREATE USER bug12818542_dest@localhost 
+  IDENTIFIED BY 'bug12818542_dest_passwd';
+GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
+
+connect(bug12818542_con,localhost,bug12818542,bug12818542_dest);
+connection bug12818542_con;
+SELECT USER(),CURRENT_USER();
+
+SET PASSWORD = PASSWORD('bruhaha');
+
+connection default;
+disconnect bug12818542_con;
+
+connect(bug12818542_con2,localhost,bug12818542,bug12818542_dest);
+connection bug12818542_con2;
+SELECT USER(),CURRENT_USER();
+
+connection default;
+disconnect bug12818542_con2;
+
+DROP USER bug12818542@localhost;
+DROP USER bug12818542_dest@localhost;
 
 --echo End of 5.5 tests

=== modified file 'mysql-test/t/sp-error.test'
--- a/mysql-test/t/sp-error.test	2011-07-28 08:31:36 +0000
+++ b/mysql-test/t/sp-error.test	2011-09-21 11:01:41 +0000
@@ -2535,6 +2535,28 @@ DROP PROCEDURE p1;
 DROP VIEW v1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#12428824 - PARSER STACK OVERFLOW AND CRASH IN SP_ADD_USED_ROUTINE
+--echo #                WITH OBSCURE QUERY
+--echo #
+
+--error ER_TOO_LONG_IDENT
+SELECT very_long_fn_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+
+--error ER_TOO_LONG_IDENT
+CALL very_long_pr_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999();
+
+--error ER_WRONG_DB_NAME
+SELECT very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_func();
+
+--error ER_WRONG_DB_NAME
+CALL very_long_db_name_1111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222225555555555555555555555555577777777777777777777777777777777777777777777777777777777777777777777777788888888999999999999999999999.simple_proc();
+
+--error ER_TOO_LONG_IDENT
+SELECT db_name.very_long_fn_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
+
+--error ER_TOO_LONG_IDENT
+CALL db_name.very_long_pr_name_111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999();
 --echo End of 5.1 tests
 
 --echo #

=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test	2011-08-02 08:14:26 +0000
+++ b/mysql-test/t/sp.test	2011-09-21 11:01:41 +0000
@@ -8376,6 +8376,26 @@ SET @@GLOBAL.init_connect= @old_init_con
 DROP PROCEDURE p2;
 DROP PROCEDURE p5;
 
+
+--echo #
+--echo # Bug#11840395 (formerly known as bug#60347):
+--echo # The string "versiondata" seems
+--echo # to be 'leaking' into the schema name space
+--echo #
+--disable_warnings
+DROP DATABASE IF EXISTS mixedCaseDbName;
+--enable_warnings
+CREATE DATABASE mixedCaseDbName;
+DELIMITER |;
+CREATE PROCEDURE mixedCaseDbName.tryMyProc() begin end|
+CREATE FUNCTION mixedCaseDbName.tryMyFunc() returns text begin return 'IT WORKS'; end
+|
+DELIMITER ;|
+call mixedCaseDbName.tryMyProc();
+select mixedCaseDbName.tryMyFunc();
+DROP DATABASE mixedCaseDbName;
+
+
 --echo #
 --echo # Bug#11766594  59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
 --echo #

=== modified file 'mysql-test/t/type_float.test'
--- a/mysql-test/t/type_float.test	2010-04-11 06:52:42 +0000
+++ b/mysql-test/t/type_float.test	2011-07-18 08:27:05 +0000
@@ -307,4 +307,27 @@ INSERT INTO t1 VALUES(-1.79769313486231e
 SELECT f1 FROM t1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#12406055 BUFFER OVERFLOW OF VARIABLE 'BUFF' IN STRING::SET_REAL
+--echo # 
+
+--echo # Ignoring output from misc. float operations
+--disable_result_log
+
+let $nine_65=
+99999999999999999999999999999999999999999999999999999999999999999;
+
+select format(-1.7976931348623157E+307,256) as foo;
+select least(-1.1111111111111111111111111,
+             - group_concat(1.7976931348623157E+308)) as foo;
+eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
+                   ($nine_65)) into @a;
+--enable_result_log
+
 --echo End of 5.0 tests
+
+--echo #
+--echo # Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
+--echo #
+
+select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;

=== modified file 'mysql-test/t/union.test'
--- a/mysql-test/t/union.test	2011-01-10 12:45:53 +0000
+++ b/mysql-test/t/union.test	2011-09-21 11:01:41 +0000
@@ -1117,6 +1117,47 @@ SELECT * FROM t2 UNION SELECT * FROM t2
 DROP TABLE t1,t2;
 
 
+--echo #
+--echo # Bug#11765255 58201:
+--echo # VALGRIND/CRASH WHEN ORDERING BY MULTIPLE AGGREGATE FUNCTIONS
+--echo #
+
+let $my_stmt=
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+select 4
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+
+eval $my_stmt;
+
+eval prepare stmt1 from '$my_stmt';
+execute stmt1;
+execute stmt1;
+
+let $my_stmt=
+select 1 as foo
+union
+select 2
+union
+select 3
+union
+(select 4)
+order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
+;
+
+eval $my_stmt;
+
+eval prepare stmt1 from '$my_stmt';
+execute stmt1;
+execute stmt1;
+
+deallocate prepare stmt1;
+
 --echo End of 5.1 tests
 
 --echo #

=== modified file 'plugin/audit_null/audit_null.c'
--- a/plugin/audit_null/audit_null.c	2011-07-12 06:50:18 +0000
+++ b/plugin/audit_null/audit_null.c	2011-09-21 11:01:41 +0000
@@ -205,7 +205,8 @@ mysql_declare_plugin(audit_null)
   0x0003,                     /* version                         */
   simple_status,              /* status variables                */
   NULL,                       /* system variables                */
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/auth/auth_socket.c'
--- a/plugin/auth/auth_socket.c	2011-06-30 15:46:53 +0000
+++ b/plugin/auth/auth_socket.c	2011-08-15 18:12:11 +0000
@@ -88,7 +88,8 @@ mysql_declare_plugin(socket_auth)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c	2010-10-27 15:12:17 +0000
+++ b/plugin/auth/dialog.c	2011-08-15 18:12:11 +0000
@@ -153,7 +153,8 @@ mysql_declare_plugin(dialog)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 },
 {
   MYSQL_AUTHENTICATION_PLUGIN,
@@ -167,7 +168,8 @@ mysql_declare_plugin(dialog)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/auth/qa_auth_interface.c'
--- a/plugin/auth/qa_auth_interface.c	2010-10-20 14:56:09 +0000
+++ b/plugin/auth/qa_auth_interface.c	2011-09-23 10:19:37 +0000
@@ -61,12 +61,13 @@ static int qa_auth_interface (MYSQL_PLUG
        err= CR_ERROR;
     if (info->auth_string_length != 14)
        err= CR_ERROR;
-/* To be set by the plugin */
-//    if (strcmp(info->authenticated_as, "qa_test_1_user"))
-//       err= CR_ERROR;
-/* To be set by the plugin */
-//    if (strcmp(info->external_user, ""))
-//       err= CR_ERROR;
+/*
+  To be set by the plugin
+    if (strcmp(info->authenticated_as, "qa_test_1_user"))
+         err= CR_ERROR;
+    if (strcmp(info->external_user, ""))
+         err= CR_ERROR;
+*/
     if (info->password_used != PASSWORD_USED_YES)
        err= CR_ERROR;
     if (strcmp(info->host_or_ip, "localhost"))
@@ -87,9 +88,11 @@ static int qa_auth_interface (MYSQL_PLUG
      strcpy(info->authenticated_as, "authenticated_as");
     /* Assign with an external account, effect on @@local.EXTERNAL_USER */
      strcpy(info->external_user, "externaluser");
-    /* Overwriting will cause a core dump */
-//     strcpy(info->host_or_ip, "host_or_ip");
-//     info->host_or_ip_length= 10;
+    /*
+      Overwriting will cause a core dump
+      strcpy(info->host_or_ip, "host_or_ip");
+      info->host_or_ip_length= 10;
+    */
   }
 /* Invalid, means too high values for length */
   else if (strcmp(info->user_name, "qa_test_3_user")== 0)
@@ -126,9 +129,11 @@ static int qa_auth_interface (MYSQL_PLUG
      strcpy(info->authenticated_as, "");
 /* This assignment has no effect.*/
      strcpy(info->external_user, "");
-    /* Overwriting will cause a core dump */
-//     strcpy(info->host_or_ip, "");
-//     info->host_or_ip_length= 0;
+    /*
+      Overwriting will cause a core dump
+      strcpy(info->host_or_ip, "");
+      info->host_or_ip_length= 0;
+    */
   }
 /* Set to 'root' */
   else if (strcmp(info->user_name, "qa_test_6_user")== 0)
@@ -162,7 +167,8 @@ mysql_declare_plugin(test_plugin)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/auth/qa_auth_server.c'
--- a/plugin/auth/qa_auth_server.c	2010-10-20 14:56:09 +0000
+++ b/plugin/auth/qa_auth_server.c	2011-08-15 18:12:11 +0000
@@ -82,6 +82,7 @@ mysql_declare_plugin(test_plugin)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;

=== modified file 'plugin/auth/test_plugin.c'
--- a/plugin/auth/test_plugin.c	2011-06-30 15:50:45 +0000
+++ b/plugin/auth/test_plugin.c	2011-09-21 11:01:41 +0000
@@ -146,7 +146,8 @@ mysql_declare_plugin(test_plugin)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 },
 {
   MYSQL_AUTHENTICATION_PLUGIN,
@@ -160,7 +161,8 @@ mysql_declare_plugin(test_plugin)
   0x0100,
   NULL,
   NULL,
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/daemon_example/daemon_example.cc'
--- a/plugin/daemon_example/daemon_example.cc	2011-06-30 15:46:53 +0000
+++ b/plugin/daemon_example/daemon_example.cc	2011-08-15 18:12:11 +0000
@@ -201,6 +201,7 @@ mysql_declare_plugin(daemon_example)
   0x0100 /* 1.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;

=== modified file 'plugin/fulltext/plugin_example.c'
--- a/plugin/fulltext/plugin_example.c	2011-07-03 23:48:19 +0000
+++ b/plugin/fulltext/plugin_example.c	2011-08-15 18:12:11 +0000
@@ -267,7 +267,8 @@ mysql_declare_plugin(ftexample)
   0x0001,                     /* version                         */
   simple_status,              /* status variables                */
   simple_system_variables,    /* system variables                */
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'plugin/semisync/semisync_master_plugin.cc'
--- a/plugin/semisync/semisync_master_plugin.cc	2011-07-21 16:27:14 +0000
+++ b/plugin/semisync/semisync_master_plugin.cc	2011-09-21 11:01:41 +0000
@@ -439,6 +439,7 @@ mysql_declare_plugin(semi_sync_master)
   0x0100 /* 1.0 */,
   semi_sync_master_status_vars,	/* status variables */
   semi_sync_master_system_vars,	/* system variables */
-  NULL                        /* config options                  */
+  NULL,                         /* config options */
+  0,                            /* flags */
 }
 mysql_declare_plugin_end;

=== modified file 'plugin/semisync/semisync_slave_plugin.cc'
--- a/plugin/semisync/semisync_slave_plugin.cc	2011-05-05 23:17:47 +0000
+++ b/plugin/semisync/semisync_slave_plugin.cc	2011-09-21 11:01:41 +0000
@@ -225,6 +225,7 @@ mysql_declare_plugin(semi_sync_slave)
   0x0100 /* 1.0 */,
   semi_sync_slave_status_vars,	/* status variables */
   semi_sync_slave_system_vars,	/* system variables */
-  NULL                        /* config options                  */
+  NULL,                         /* config options */
+  0,                            /* flags */
 }
 mysql_declare_plugin_end;

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2011-08-19 13:04:28 +0000
+++ b/sql/binlog.cc	2011-09-23 12:22:58 +0000
@@ -6104,6 +6104,7 @@ mysql_declare_plugin(binlog)
   0x0100 /* 1.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,  
 }
 mysql_declare_plugin_end;

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-08-12 07:18:41 +0000
+++ b/sql/ha_ndbcluster.cc	2011-09-21 11:01:41 +0000
@@ -11136,7 +11136,8 @@ mysql_declare_plugin(ndbcluster)
   0x0100 /* 1.0 */,
   ndb_status_variables_export,/* status variables                */
   system_variables,           /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;
 

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2011-07-07 19:13:19 +0000
+++ b/sql/ha_partition.cc	2011-09-21 11:01:41 +0000
@@ -7433,7 +7433,8 @@ mysql_declare_plugin(partition)
   0x0100, /* 1.0 */
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;
 

=== modified file 'sql/item_create.cc'
--- a/sql/item_create.cc	2011-07-04 00:25:46 +0000
+++ b/sql/item_create.cc	2011-09-22 10:42:10 +0000
@@ -4909,26 +4909,7 @@ Create_func_space Create_func_space::s_s
 Item*
 Create_func_space::create(THD *thd, Item *arg1)
 {
-  /**
-    TODO: Fix Bug#23637
-    The parsed item tree should not depend on
-    <code>thd->variables.collation_connection</code>.
-  */
-  const CHARSET_INFO *cs= thd->variables.collation_connection;
-  Item *sp;
-
-  if (cs->mbminlen > 1)
-  {
-    uint dummy_errors;
-    sp= new (thd->mem_root) Item_string("", 0, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
-    sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors);
-  }
-  else
-  {
-    sp= new (thd->mem_root) Item_string(" ", 1, cs, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
-  }
-
-  return new (thd->mem_root) Item_func_repeat(sp, arg1);
+  return new (thd->mem_root) Item_func_space(arg1);
 }
 
 

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2011-07-28 10:54:44 +0000
+++ b/sql/item_strfunc.cc	2011-09-23 10:19:37 +0000
@@ -2421,7 +2421,7 @@ String *Item_func_format::val_str_ascii(
       return 0; /* purecov: inspected */
     nr= my_double_round(nr, (longlong) dec, FALSE, FALSE);
     str->set_real(nr, dec, &my_charset_numeric);
-    if (isnan(nr))
+    if (isnan(nr) || my_isinf(nr))
       return str;
     str_length=str->length();
   }
@@ -2477,6 +2477,7 @@ String *Item_func_format::val_str_ascii(
       For short values without thousands (<1000)
       replace decimal point to localized value.
     */
+    DBUG_ASSERT(dec_length <= str_length);
     ((char*) str->ptr())[str_length - dec_length]= lc->decimal_point;
   }
   return str;
@@ -2815,6 +2816,76 @@ err:
   return 0;
 }
 
+
+
+void Item_func_space::fix_length_and_dec()
+{
+  collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); 
+  if (args[0]->const_item())
+  {
+    /* must be longlong to avoid truncation */
+    longlong count= args[0]->val_int();
+    if (args[0]->null_value)
+      goto end;
+    /*
+     Assumes that the maximum length of a String is < INT_MAX32. 
+     Set here so that rest of code sees out-of-bound value as such. 
+    */
+    if (count > INT_MAX32)
+      count= INT_MAX32;
+    fix_char_length_ulonglong(count); 
+    return;
+  }
+
+end:
+  max_length= MAX_BLOB_WIDTH;
+  maybe_null= 1;
+}
+
+
+String *Item_func_space::val_str(String *str)
+{
+  uint tot_length;
+  longlong count= args[0]->val_int();
+  const CHARSET_INFO *cs= collation.collation;
+   
+  if (args[0]->null_value)
+    goto err;				// string and/or delim are null
+  null_value= 0;
+
+  if (count <= 0 && (count == 0 || !args[0]->unsigned_flag))
+    return make_empty_result();
+  /*
+   Assumes that the maximum length of a String is < INT_MAX32. 
+   Bounds check on count:  If this is triggered, we will error. 
+  */
+  if ((ulonglong) count > INT_MAX32)
+    count= INT_MAX32;
+
+  // Safe length check
+  tot_length= (uint) count * cs->mbminlen;
+  if (tot_length > current_thd->variables.max_allowed_packet)
+  {
+    push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
+                        ER_WARN_ALLOWED_PACKET_OVERFLOWED,
+                        ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
+                        func_name(),
+                        current_thd->variables.max_allowed_packet);
+    goto err;
+   }
+
+  if (str->alloc(tot_length))
+    goto err;
+  str->length(tot_length);
+  str->set_charset(cs);
+  cs->cset->fill(cs, (char*) str->ptr(), tot_length, ' ');
+  return str; 
+
+err:
+  null_value= 1;
+  return 0;
+}
+
 
 void Item_func_rpad::fix_length_and_dec()
 {

=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h	2011-07-04 00:25:46 +0000
+++ b/sql/item_strfunc.h	2011-09-22 10:42:10 +0000
@@ -617,6 +617,16 @@ public:
 };
 
 
+class Item_func_space :public Item_str_func
+{
+public:
+  Item_func_space(Item *arg1):Item_str_func(arg1) {}
+  String *val_str(String *);
+  void fix_length_and_dec();
+  const char *func_name() const { return "space"; }
+};
+
+
 class Item_func_rpad :public Item_str_func
 {
   String tmp_value, rpad_str;

=== modified file 'sql/share/errmsg-utf8.txt'
--- a/sql/share/errmsg-utf8.txt	2011-09-01 18:59:44 +0000
+++ b/sql/share/errmsg-utf8.txt	2011-09-23 10:55:10 +0000
@@ -5130,11 +5130,11 @@ ER_SP_BADSTATEMENT 0A000
         eng "%s is not allowed in stored procedures"
         ger "%s ist in gespeicherten Prozeduren nicht erlaubt"
 ER_UPDATE_LOG_DEPRECATED_IGNORED 42000 
-        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6."
-        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wird ignoriert. Diese Option wird in MySQL 5.6 entfernt."
+        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored."
+        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wird ignoriert."
 ER_UPDATE_LOG_DEPRECATED_TRANSLATED 42000 
-        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MySQL 5.6."
-        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wurde in SET SQL_LOG_BIN übersetzt. Diese Option wird in MySQL 5.6 entfernt."
+        eng "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
+        ger "Das Update-Log ist veraltet und wurde durch das Binär-Log ersetzt. SET SQL_LOG_UPDATE wurde in SET SQL_LOG_BIN übersetzt."
 ER_QUERY_INTERRUPTED 70100 
         eng "Query execution was interrupted"
         ger "Ausführung der Abfrage wurde unterbrochen"
@@ -6526,3 +6526,9 @@ ER_MTS_INCONSISTENT_DATA
 
 ER_UNDO_RECORD_TOO_BIG
   eng "Undo log record is too big."
+
+ER_PLUGIN_NO_UNINSTALL
+  eng "Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it."
+
+ER_PLUGIN_NO_INSTALL
+  eng "Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it."

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2011-08-19 13:21:02 +0000
+++ b/sql/sql_acl.cc	2011-09-21 11:49:00 +0000
@@ -1881,17 +1881,17 @@ bool change_password(THD *thd, const cha
     goto end;
   }
 
+  /* update loaded acl entry: */
+  set_user_salt(acl_user, new_password, new_password_len);
+
   if (my_strcasecmp(system_charset_info, acl_user->plugin.str,
                     native_password_plugin_name.str) &&
       my_strcasecmp(system_charset_info, acl_user->plugin.str,
                     old_password_plugin_name.str))
-  {
     push_warning(thd, Sql_condition::WARN_LEVEL_NOTE,
                  ER_SET_PASSWORD_AUTH_PLUGIN, ER(ER_SET_PASSWORD_AUTH_PLUGIN));
-  }
-  /* update loaded acl entry: */
-  set_user_salt(acl_user, new_password, new_password_len);
-  set_user_plugin(acl_user, new_password_len);
+  else
+    set_user_plugin(acl_user, new_password_len);
 
   if (update_user_table(thd, table,
 			acl_user->host.hostname ? acl_user->host.hostname : "",
@@ -8939,24 +8939,18 @@ static ulong parse_client_handshake_pack
 
 
 /**
-  Make sure that when sending plugin supplued data to the client they
+  Make sure that when sending plugin supplied data to the client they
   are not considered a special out-of-band command, like e.g. 
-  \255 (error) or \254 (change user request packet).
-  To avoid this we send plugin data packets starting with one of these
-  2 bytes "wrapped" in a command \1. 
-  For the above reason we have to wrap plugin data packets starting with
-  \1 as well.
+  \255 (error) or \254 (change user request packet) or \0 (OK).
+  To avoid this the server will send all plugin data packets "wrapped" 
+  in a command \1.
+  Note that the client will continue sending its replies unrwapped.
 */
 
-#define IS_OUT_OF_BAND_PACKET(packet,packet_len) \
-  ((packet_len) > 0 && \
-   (*(packet) == 1 || *(packet) == 255 || *(packet) == 254))
-
 static inline int 
 wrap_plguin_data_into_proper_command(NET *net, 
                                      const uchar *packet, int packet_len)
 {
-  DBUG_ASSERT(IS_OUT_OF_BAND_PACKET(packet, packet_len));
   return net_write_command(net, 1, (uchar *) "", 0, packet, packet_len);
 }
 
@@ -8993,13 +8987,8 @@ static int server_mpvio_write_packet(MYS
     res= send_server_handshake_packet(mpvio, (char*) packet, packet_len);
   else if (mpvio->status == MPVIO_EXT::RESTART)
     res= send_plugin_request_packet(mpvio, packet, packet_len);
-  else if (IS_OUT_OF_BAND_PACKET(packet, packet_len))
-    res= wrap_plguin_data_into_proper_command(mpvio->net, packet, packet_len);
   else
-  {
-    res= my_net_write(mpvio->net, packet, packet_len) ||
-         net_flush(mpvio->net);
-  }
+    res= wrap_plguin_data_into_proper_command(mpvio->net, packet, packet_len);
   mpvio->packets_written++;
   DBUG_RETURN(res);
 }
@@ -9767,7 +9756,8 @@ mysql_declare_plugin(mysql_password)
   0x0100,                                       /* Version (1.0)    */
   NULL,                                         /* status variables */
   NULL,                                         /* system variables */
-  NULL                                          /* config options   */
+  NULL,                                         /* config options   */
+  0,                                            /* flags            */
 },
 {
   MYSQL_AUTHENTICATION_PLUGIN,                  /* type constant    */
@@ -9781,7 +9771,8 @@ mysql_declare_plugin(mysql_password)
   0x0100,                                       /* Version (1.0)    */
   NULL,                                         /* status variables */
   NULL,                                         /* system variables */
-  NULL                                          /* config options   */
+  NULL,                                         /* config options   */
+  0,                                            /* flags            */
 }
 mysql_declare_plugin_end;
 

=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc	2011-07-28 10:54:44 +0000
+++ b/sql/sql_error.cc	2011-09-21 11:01:41 +0000
@@ -907,14 +907,16 @@ uint32 convert_error_message(char *to, u
   my_wc_t     wc;
   const uchar *from_end= (const uchar*) from+from_length;
   char *to_start= to;
-  uchar *to_end= (uchar*) to+to_length;
+  uchar *to_end;
   my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
   my_charset_conv_wc_mb wc_mb;
   uint error_count= 0;
   uint length;
 
   DBUG_ASSERT(to_length > 0);
+  /* Make room for the null terminator. */
   to_length--;
+  to_end= (uchar*) (to + to_length);
 
   if (!to_cs || from_cs == to_cs || to_cs == &my_charset_bin)
   {

=== modified file 'sql/sql_lex.cc'
--- a/sql/sql_lex.cc	2011-08-15 09:44:00 +0000
+++ b/sql/sql_lex.cc	2011-09-23 11:42:35 +0000
@@ -436,6 +436,7 @@ void lex_start(THD *thd)
 
   lex->is_lex_started= TRUE;
   lex->used_tables= 0;
+  lex->reset_slave_info.all= false;
   DBUG_VOID_RETURN;
 }
 
@@ -2153,6 +2154,9 @@ bool st_select_lex::setup_ref_array(THD
 
   // find_order_in_list() may need some extra space, so multiply by two.
   order_group_num*= 2;
+
+  // find_order_in_list() may need some extra space, so multiply by two.
+  order_group_num*= 2;
 
   /*
     We have to create array in prepared statement memory if it is

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2011-08-18 08:31:08 +0000
+++ b/sql/sql_plugin.cc	2011-09-21 11:01:41 +0000
@@ -539,6 +539,11 @@ static st_plugin_dl *plugin_dl_add(const
 #endif
     }
 
+    /*
+      What's the purpose of this loop? If the goal is to catch a
+      missing 0 record at the end of a list, it will fail miserably
+      since the compiler is likely to optimize this away. /Matz
+     */
     for (i= 0;
          ((struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
          i++)
@@ -567,6 +572,23 @@ static st_plugin_dl *plugin_dl_add(const
   }
   plugin_dl.plugins= (struct st_mysql_plugin *)sym;
 
+  /*
+    If report is REPORT_TO_USER, we were called from
+    mysql_install_plugin. Otherwise, we are called directly or
+    indirectly from plugin_init.
+   */
+  if (report == REPORT_TO_USER)
+  {
+    st_mysql_plugin *plugin= plugin_dl.plugins;
+    for ( ; plugin->info ; ++plugin)
+      if (plugin->flags & PLUGIN_OPT_NO_INSTALL)
+      {
+        report_error(report, ER_PLUGIN_NO_INSTALL, plugin->name);
+        free_plugin_mem(&plugin_dl);
+        DBUG_RETURN(0);
+   }
+  }
+
   /* Duplicate and convert dll name */
   plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
   if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
@@ -1894,6 +1916,16 @@ bool mysql_uninstall_plugin(THD *thd, co
     my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
     goto err;
   }
+  /*
+    Error message for ER_PLUGIN_IS_PERMANENT is not suitable for
+    plugins marked as not dynamically uninstallable, so we have a
+    separate one instead of changing the old one.
+   */
+  if (plugin->plugin->flags & PLUGIN_OPT_NO_UNINSTALL)
+  {
+    my_error(ER_PLUGIN_NO_UNINSTALL, MYF(0), plugin->plugin->name);
+    goto err;
+  }
 
   plugin->state= PLUGIN_IS_DELETED;
   if (plugin->ref_count)

=== modified file 'sql/sql_union.cc'
--- a/sql/sql_union.cc	2011-07-21 12:54:54 +0000
+++ b/sql/sql_union.cc	2011-09-21 11:01:41 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -432,7 +432,7 @@ bool st_select_lex_unit::prepare(THD *th
           Fake st_select_lex should have item list for correct ref_array
           allocation.
         */
-	fake_select_lex->item_list= item_list;
+        fake_select_lex->item_list= item_list;
 
         thd_arg->lex->current_select= fake_select_lex;
 

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2011-09-13 07:22:49 +0000
+++ b/sql/sql_yacc.yy	2011-09-23 10:55:10 +0000
@@ -8803,6 +8803,11 @@ function_call_generic:
             Create_func *builder;
             Item *item= NULL;
 
+            if (check_routine_name(&$1))
+            {
+              MYSQL_YYABORT;
+            }
+
             /*
               Implementation note:
               names are resolved with the following order:
@@ -8866,6 +8871,16 @@ function_call_generic:
               version() (a vendor can specify any schema).
             */
 
+            if (!$1.str || check_and_convert_db_name(&$1, FALSE))
+            {
+              my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
+              MYSQL_YYABORT;
+            }
+            if (check_routine_name(&$3))
+            {
+              MYSQL_YYABORT;
+            }
+
             builder= find_qualified_function_builder(thd);
             DBUG_ASSERT(builder);
             item= builder->create(thd, $1, $3, true, $5);

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2011-07-04 00:25:46 +0000
+++ b/storage/archive/ha_archive.cc	2011-09-21 11:01:41 +0000
@@ -1775,7 +1775,8 @@ mysql_declare_plugin(archive)
   0x0300 /* 3.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;
 

=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc	2011-08-19 13:04:28 +0000
+++ b/storage/blackhole/ha_blackhole.cc	2011-09-21 11:01:41 +0000
@@ -447,6 +447,7 @@ mysql_declare_plugin(blackhole)
   0x0100 /* 1.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;

=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc	2011-06-30 15:50:45 +0000
+++ b/storage/csv/ha_tina.cc	2011-09-21 11:01:41 +0000
@@ -1759,7 +1759,8 @@ mysql_declare_plugin(csv)
   0x0100 /* 1.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;
 

=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc	2011-06-30 15:50:45 +0000
+++ b/storage/example/ha_example.cc	2011-09-21 11:01:41 +0000
@@ -1001,6 +1001,7 @@ mysql_declare_plugin(example)
   0x0001 /* 0.1 */,
   func_status,                                  /* status variables */
   example_system_variables,                     /* system variables */
-  NULL                                          /* config options */
+  NULL,                                         /* config options */
+  0,                                            /* flags */
 }
 mysql_declare_plugin_end;

=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc	2011-06-30 15:50:45 +0000
+++ b/storage/federated/ha_federated.cc	2011-09-21 11:01:41 +0000
@@ -3474,6 +3474,7 @@ mysql_declare_plugin(federated)
   0x0100 /* 1.0 */,
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;

=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc	2011-07-04 00:25:46 +0000
+++ b/storage/heap/ha_heap.cc	2011-09-21 11:01:41 +0000
@@ -821,6 +821,7 @@ mysql_declare_plugin(heap)
   0x0100, /* 1.0 */
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;

=== modified file 'storage/innobase/btr/btr0pcur.c'
--- a/storage/innobase/btr/btr0pcur.c	2011-08-15 09:34:39 +0000
+++ b/storage/innobase/btr/btr0pcur.c	2011-09-23 10:55:10 +0000
@@ -358,33 +358,6 @@ btr_pcur_restore_position_func(
 	return(FALSE);
 }
 
-/**************************************************************//**
-If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
-releases the page latch and bufferfix reserved by the cursor.
-NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
-made by the current mini-transaction to the data protected by the
-cursor latch, as then the latch must not be released until mtr_commit. */
-UNIV_INTERN
-void
-btr_pcur_release_leaf(
-/*==================*/
-	btr_pcur_t*	cursor, /*!< in: persistent cursor */
-	mtr_t*		mtr)	/*!< in: mtr */
-{
-	buf_block_t*	block;
-
-	ut_a(cursor->pos_state == BTR_PCUR_IS_POSITIONED);
-	ut_ad(cursor->latch_mode != BTR_NO_LATCHES);
-
-	block = btr_pcur_get_block(cursor);
-
-	btr_leaf_page_release(block, cursor->latch_mode, mtr);
-
-	cursor->latch_mode = BTR_NO_LATCHES;
-
-	cursor->pos_state = BTR_PCUR_WAS_POSITIONED;
-}
-
 /*********************************************************//**
 Moves the persistent cursor to the first record on the next page. Releases the
 latch on the current page, and bufferunfixes it. Note that there must not be

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2011-09-01 18:59:44 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2011-09-23 10:55:10 +0000
@@ -4382,25 +4382,6 @@ field_in_record_is_null(
 	return(0);
 }
 
-/**************************************************************//**
-Sets a field in a record to SQL NULL. Uses the record format
-information in table to track the null bit in record. */
-static inline
-void
-set_field_in_record_to_null(
-/*========================*/
-	TABLE*	table,	/*!< in: MySQL table object */
-	Field*	field,	/*!< in: MySQL field object */
-	char*	record)	/*!< in: a row in MySQL format */
-{
-	int	null_offset;
-
-	null_offset = (uint) ((char*) field->null_ptr
-		    - (char*) table->record[0]);
-
-	record[null_offset] = record[null_offset] | field->null_bit;
-}
-
 /*************************************************************//**
 InnoDB uses this function to compare two data fields for which the data type
 is such that we must use MySQL code to compare them. NOTE that the prototype
@@ -13035,7 +13016,8 @@ mysql_declare_plugin(innobase)
   INNODB_VERSION_SHORT,
   innodb_status_variables_export,/* status variables             */
   innobase_system_variables, /* system variables */
-  NULL /* reserved */
+  NULL, /* reserved */
+  0,    /* flags */
 },
 i_s_innodb_trx,
 i_s_innodb_locks,

=== modified file 'storage/innobase/handler/i_s.cc'
--- a/storage/innobase/handler/i_s.cc	2011-09-08 10:05:38 +0000
+++ b/storage/innobase/handler/i_s.cc	2011-09-23 11:09:58 +0000
@@ -729,7 +729,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
@@ -995,7 +999,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
@@ -1178,7 +1186,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /*******************************************************************//**
@@ -1511,7 +1523,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 UNIV_INTERN struct st_mysql_plugin	i_s_innodb_cmp_reset =
@@ -1561,7 +1577,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table information_schema.innodb_cmpmem. */
@@ -1802,7 +1822,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 UNIV_INTERN struct st_mysql_plugin	i_s_innodb_cmpmem_reset =
@@ -1852,7 +1876,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_metrics */
@@ -2376,7 +2404,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INNODB_BUFFER_POOL_STATS. */
@@ -2893,7 +2925,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INNODB_BUFFER_POOL_PAGE. */
@@ -3582,7 +3618,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 static ST_FIELD_INFO	i_s_innodb_buf_page_lru_fields_info[] =
@@ -4124,7 +4164,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /*******************************************************************//**
@@ -4366,7 +4410,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_TABLESTATS */
@@ -4641,7 +4689,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_INDEXES */
@@ -4896,7 +4948,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.SYS_COLUMNS */
@@ -5131,7 +5187,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_fields */
 static ST_FIELD_INFO	innodb_sys_fields_fields_info[] =
@@ -5338,7 +5398,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign */
@@ -5559,7 +5623,11 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 /* Fields of the dynamic table INFORMATION_SCHEMA.innodb_sys_foreign_cols */
 static ST_FIELD_INFO	innodb_sys_foreign_cols_fields_info[] =
@@ -5773,6 +5841,10 @@ UNIV_INTERN struct st_mysql_plugin	i_s_i
 
 	/* reserved for dependency checking */
 	/* void* */
-	STRUCT_FLD(__reserved1, NULL)
+	STRUCT_FLD(__reserved1, NULL),
+
+	/* Plugin flags */
+	/* unsigned long */
+	STRUCT_FLD(flags, 0UL),
 };
 

=== modified file 'storage/innobase/include/btr0pcur.h'
--- a/storage/innobase/include/btr0pcur.h	2011-03-22 12:34:16 +0000
+++ b/storage/innobase/include/btr0pcur.h	2011-09-21 11:01:41 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -245,18 +245,6 @@ btr_pcur_restore_position_func(
 	mtr_t*		mtr);		/*!< in: mtr */
 #define btr_pcur_restore_position(l,cur,mtr)				\
 	btr_pcur_restore_position_func(l,cur,__FILE__,__LINE__,mtr)
-/**************************************************************//**
-If the latch mode of the cursor is BTR_LEAF_SEARCH or BTR_LEAF_MODIFY,
-releases the page latch and bufferfix reserved by the cursor.
-NOTE! In the case of BTR_LEAF_MODIFY, there should not exist changes
-made by the current mini-transaction to the data protected by the
-cursor latch, as then the latch must not be released until mtr_commit. */
-UNIV_INTERN
-void
-btr_pcur_release_leaf(
-/*==================*/
-	btr_pcur_t*	cursor, /*!< in: persistent cursor */
-	mtr_t*		mtr);	/*!< in: mtr */
 /*********************************************************//**
 Gets the rel_pos field for a cursor whose position has been stored.
 @return	BTR_PCUR_ON, ... */
@@ -267,10 +255,9 @@ btr_pcur_get_rel_pos(
 	const btr_pcur_t*	cursor);/*!< in: persistent cursor */
 /**************************************************************//**
 Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
-that is, the cursor becomes detached. If there have been modifications
-to the page where pcur is positioned, this can be used instead of
-btr_pcur_release_leaf. Function btr_pcur_store_position should be used
-before calling this, if restoration of cursor is wanted later. */
+that is, the cursor becomes detached.
+Function btr_pcur_store_position should be used before calling this,
+if restoration of cursor is wanted later. */
 UNIV_INLINE
 void
 btr_pcur_commit_specify_mtr(

=== modified file 'storage/innobase/include/btr0pcur.ic'
--- a/storage/innobase/include/btr0pcur.ic	2011-03-22 12:34:16 +0000
+++ b/storage/innobase/include/btr0pcur.ic	2011-09-21 11:01:41 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -369,10 +369,9 @@ btr_pcur_move_to_next(
 
 /**************************************************************//**
 Commits the mtr and sets the pcur latch mode to BTR_NO_LATCHES,
-that is, the cursor becomes detached. If there have been modifications
-to the page where pcur is positioned, this can be used instead of
-btr_pcur_release_leaf. Function btr_pcur_store_position should be used
-before calling this, if restoration of cursor is wanted later. */
+that is, the cursor becomes detached.
+Function btr_pcur_store_position should be used before calling this,
+if restoration of cursor is wanted later. */
 UNIV_INLINE
 void
 btr_pcur_commit_specify_mtr(

=== modified file 'storage/innobase/include/mtr0mtr.h'
--- a/storage/innobase/include/mtr0mtr.h	2011-08-29 08:45:30 +0000
+++ b/storage/innobase/include/mtr0mtr.h	2011-09-23 10:55:10 +0000
@@ -218,16 +218,6 @@ ulint
 mtr_set_savepoint(
 /*==============*/
 	mtr_t*	mtr);	/*!< in: mtr */
-/**********************************************************//**
-Releases the latches stored in an mtr memo down to a savepoint.
-NOTE! The mtr must not have made changes to buffer pages after the
-savepoint, as these can be handled only by mtr_commit. */
-UNIV_INTERN
-void
-mtr_rollback_to_savepoint(
-/*======================*/
-	mtr_t*	mtr,		/*!< in: mtr */
-	ulint	savepoint);	/*!< in: savepoint */
 #ifndef UNIV_HOTBACKUP
 /**********************************************************//**
 Releases the (index tree) s-latch stored in an mtr memo after a

=== modified file 'storage/innobase/include/srv0mon.h'
--- a/storage/innobase/include/srv0mon.h	2011-08-10 06:26:39 +0000
+++ b/storage/innobase/include/srv0mon.h	2011-09-22 07:44:19 +0000
@@ -528,6 +528,33 @@ on the counters */
 		}							\
 	}
 
+#ifdef HAVE_ATOMIC_BUILTINS
+
+# define MONITOR_ATOMIC_INC(monitor)					\
+	if (MONITOR_IS_ON(monitor)) {					\
+		ib_int64_t	value;					\
+		value  = (ib_int64_t) os_atomic_increment_ulint(	\
+			&MONITOR_VALUE(monitor), 1);			\
+		/* Note: This is not 100% accurate because of the	\
+		inherent race, we ignore it due to performance. */	\
+		if (value > MONITOR_MAX_VALUE(monitor)) {		\
+			MONITOR_MAX_VALUE(monitor) = value;		\
+		}							\
+	}
+
+# define MONITOR_ATOMIC_DEC(monitor)					\
+	if (MONITOR_IS_ON(monitor)) {					\
+		ib_int64_t	value;					\
+		value = (ib_int64_t) os_atomic_decrement_ulint(		\
+			&MONITOR_VALUE(monitor), 1);			\
+		/* Note: This is not 100% accurate because of the	\
+		inherent race, we ignore it due to performance. */	\
+		if (value < MONITOR_MIN_VALUE(monitor)) {		\
+			MONITOR_MIN_VALUE(monitor) = value;		\
+		}							\
+	}
+#endif /* HAVE_ATOMIC_BUILTINS */
+
 #define	MONITOR_DEC(monitor)						\
 	if (MONITOR_IS_ON(monitor)) {					\
 		MONITOR_VALUE(monitor)--;				\

=== modified file 'storage/innobase/include/ut0mem.h'
--- a/storage/innobase/include/ut0mem.h	2010-10-02 19:12:58 +0000
+++ b/storage/innobase/include/ut0mem.h	2011-09-21 11:01:41 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -210,43 +210,6 @@ ut_strlcpy_rev(
 	ulint		size);	/*!< in: size of destination buffer */
 
 /**********************************************************************//**
-Compute strlen(ut_strcpyq(str, q)).
-@return	length of the string when quoted */
-UNIV_INLINE
-ulint
-ut_strlenq(
-/*=======*/
-	const char*	str,	/*!< in: null-terminated string */
-	char		q);	/*!< in: the quote character */
-
-/**********************************************************************//**
-Make a quoted copy of a NUL-terminated string.	Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_memcpyq().
-@return	pointer to end of dest */
-UNIV_INTERN
-char*
-ut_strcpyq(
-/*=======*/
-	char*		dest,	/*!< in: output buffer */
-	char		q,	/*!< in: the quote character */
-	const char*	src);	/*!< in: null-terminated string */
-
-/**********************************************************************//**
-Make a quoted copy of a fixed-length string.  Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_strcpyq().
-@return	pointer to end of dest */
-UNIV_INTERN
-char*
-ut_memcpyq(
-/*=======*/
-	char*		dest,	/*!< in: output buffer */
-	char		q,	/*!< in: the quote character */
-	const char*	src,	/*!< in: string to be quoted */
-	ulint		len);	/*!< in: length of src */
-
-/**********************************************************************//**
 Return the number of times s2 occurs in s1. Overlapping instances of s2
 are only counted once.
 @return	the number of times s2 occurs in s1 */

=== modified file 'storage/innobase/include/ut0mem.ic'
--- a/storage/innobase/include/ut0mem.ic	2010-07-16 21:00:50 +0000
+++ b/storage/innobase/include/ut0mem.ic	2011-09-21 11:01:41 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -99,27 +99,6 @@ ut_strcmp(const char* str1, const char*
 }
 
 /**********************************************************************//**
-Compute strlen(ut_strcpyq(str, q)).
-@return	length of the string when quoted */
-UNIV_INLINE
-ulint
-ut_strlenq(
-/*=======*/
-	const char*	str,	/*!< in: null-terminated string */
-	char		q)	/*!< in: the quote character */
-{
-	ulint len;
-
-	for (len = 0; *str; len++, str++) {
-		if (*str == q) {
-			len++;
-		}
-	}
-
-	return(len);
-}
-
-/**********************************************************************//**
 Converts a raw binary data to a NUL-terminated hex string. The output is
 truncated if there is not enough space in "hex", make sure "hex_size" is at
 least (2 * raw_size + 1) if you do not want this to happen. Returns the

=== modified file 'storage/innobase/mtr/mtr0mtr.c'
--- a/storage/innobase/mtr/mtr0mtr.c	2011-08-29 08:45:30 +0000
+++ b/storage/innobase/mtr/mtr0mtr.c	2011-09-23 10:55:10 +0000
@@ -312,44 +312,6 @@ mtr_commit(
 }
 
 #ifndef UNIV_HOTBACKUP
-/**********************************************************//**
-Releases the latches stored in an mtr memo down to a savepoint.
-NOTE! The mtr must not have made changes to buffer pages after the
-savepoint, as these can be handled only by mtr_commit. */
-UNIV_INTERN
-void
-mtr_rollback_to_savepoint(
-/*======================*/
-	mtr_t*	mtr,		/*!< in: mtr */
-	ulint	savepoint)	/*!< in: savepoint */
-{
-	mtr_memo_slot_t* slot;
-	dyn_array_t*	memo;
-	ulint		offset;
-
-	ut_ad(mtr);
-	ut_ad(mtr->magic_n == MTR_MAGIC_N);
-	ut_ad(mtr->state == MTR_ACTIVE);
-
-	memo = &(mtr->memo);
-
-	offset = dyn_array_get_data_size(memo);
-	ut_ad(offset >= savepoint);
-
-	while (offset > savepoint) {
-		offset -= sizeof(mtr_memo_slot_t);
-
-		slot = dyn_array_get_element(memo, offset);
-
-		ut_ad(slot->type != MTR_MEMO_MODIFY);
-
-		/* We do not call mtr_memo_slot_note_modification()
-		because there MUST be no changes made to the buffer
-		pages after the savepoint */
-		mtr_memo_slot_release(mtr, slot);
-	}
-}
-
 /***************************************************//**
 Releases an object in the memo stack. */
 UNIV_INTERN

=== modified file 'storage/innobase/os/os0file.c'
--- a/storage/innobase/os/os0file.c	2011-07-19 00:25:20 +0000
+++ b/storage/innobase/os/os0file.c	2011-09-22 07:44:19 +0000
@@ -288,10 +288,12 @@ UNIV_INTERN time_t	os_last_printout;
 
 UNIV_INTERN ibool	os_has_said_disk_full	= FALSE;
 
-#ifndef UNIV_HOTBACKUP
+#if !defined(UNIV_HOTBACKUP)	\
+    && (!defined(HAVE_ATOMIC_BUILTINS) || UNIV_WORD_SIZE < 8)
 /** The mutex protecting the following counts of pending I/O operations */
 static os_mutex_t	os_file_count_mutex;
-#endif /* !UNIV_HOTBACKUP */
+#endif /* !UNIV_HOTBACKUP && (!HAVE_ATOMIC_BUILTINS || UNIV_WORD_SIZE < 8) */
+
 /** Number of pending os_file_pread() operations */
 UNIV_INTERN ulint	os_file_n_pending_preads  = 0;
 /** Number of pending os_file_pwrite() operations */
@@ -747,7 +749,9 @@ os_io_init_simple(void)
 {
 	ulint	i;
 
+#if !defined(HAVE_ATOMIC_BUILTINS) || UNIV_WORD_SIZE < 8
 	os_file_count_mutex = os_mutex_create();
+#endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD_SIZE < 8 */
 
 	for (i = 0; i < OS_FILE_N_SEEK_MUTEXES; i++) {
 		os_file_seek_mutexes[i] = os_mutex_create();
@@ -2212,19 +2216,31 @@ os_file_pread(
 	os_n_file_reads++;
 
 #if defined(HAVE_PREAD) && !defined(HAVE_BROKEN_PREAD)
+#if defined(HAVE_ATOMIC_BUILTINS) && UNIV_WORD_SIZE == 8
+	(void) os_atomic_increment_ulint(&os_n_pending_reads, 1);
+	(void) os_atomic_increment_ulint(&os_file_n_pending_preads, 1);
+	MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_READS);
+#else
 	os_mutex_enter(os_file_count_mutex);
 	os_file_n_pending_preads++;
 	os_n_pending_reads++;
 	MONITOR_INC(MONITOR_OS_PENDING_READS);
 	os_mutex_exit(os_file_count_mutex);
+#endif /* HAVE_ATOMIC_BUILTINS && UNIV_WORD == 8 */
 
-	n_bytes = pread(file, buf, (ssize_t)n, offs);
+	n_bytes = pread(file, buf, n, offs);
 
+#if defined(HAVE_ATOMIC_BUILTINS) && UNIV_WORD_SIZE == 8
+	(void) os_atomic_decrement_ulint(&os_n_pending_reads, 1);
+	(void) os_atomic_decrement_ulint(&os_file_n_pending_preads, 1);
+	MONITOR_ATOMIC_DEC(MONITOR_OS_PENDING_READS);
+#else
 	os_mutex_enter(os_file_count_mutex);
 	os_file_n_pending_preads--;
 	os_n_pending_reads--;
 	MONITOR_DEC(MONITOR_OS_PENDING_READS);
 	os_mutex_exit(os_file_count_mutex);
+#endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD == 8 */
 
 	return(n_bytes);
 #else
@@ -2235,11 +2251,15 @@ os_file_pread(
 		ulint	i;
 #endif /* !UNIV_HOTBACKUP */
 
+#if defined(HAVE_ATOMIC_BUILTINS) && UNIV_WORD_SIZE == 8
+		(void) os_atomic_increment_ulint(&os_n_pending_reads, 1);
+		MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_READS);
+#else
 		os_mutex_enter(os_file_count_mutex);
 		os_n_pending_reads++;
 		MONITOR_INC(MONITOR_OS_PENDING_READS);
 		os_mutex_exit(os_file_count_mutex);
-
+#endif /* HAVE_ATOMIC_BUILTINS && UNIV_WORD == 8 */
 #ifndef UNIV_HOTBACKUP
 		/* Protect the seek / read operation with a mutex */
 		i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
@@ -2259,10 +2279,15 @@ os_file_pread(
 		os_mutex_exit(os_file_seek_mutexes[i]);
 #endif /* !UNIV_HOTBACKUP */
 
+#if defined(HAVE_ATOMIC_BUILTINS) && UNIV_WORD_SIZE == 8
+		(void) os_atomic_decrement_ulint(&os_n_pending_reads, 1);
+		MONITOR_ATOIC_DEC(MONITOR_OS_PENDING_READS);
+#else
 		os_mutex_enter(os_file_count_mutex);
 		os_n_pending_reads--;
 		MONITOR_DEC(MONITOR_OS_PENDING_READS);
 		os_mutex_exit(os_file_count_mutex);
+#endif /* HAVE_ATOMIC_BUILTINS && UNIV_WORD_SIZE == 8 */
 
 		return(ret);
 	}
@@ -2301,19 +2326,31 @@ os_file_pwrite(
 	os_n_file_writes++;
 
 #if defined(HAVE_PWRITE) && !defined(HAVE_BROKEN_PREAD)
+#if !defined(HAVE_ATOMIC_BUILTINS) || UNIV_WORD_SIZE < 8
 	os_mutex_enter(os_file_count_mutex);
 	os_file_n_pending_pwrites++;
 	os_n_pending_writes++;
 	MONITOR_INC(MONITOR_OS_PENDING_WRITES);
 	os_mutex_exit(os_file_count_mutex);
+#else
+	(void) os_atomic_increment_ulint(&os_n_pending_writes, 1);
+	(void) os_atomic_increment_ulint(&os_file_n_pending_pwrites, 1);
+	MONITOR_ATOMIC_INC(MONITOR_OS_PENDING_WRITES);
+#endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD < 8 */
 
 	ret = pwrite(file, buf, (ssize_t)n, offs);
 
+#if !defined(HAVE_ATOMIC_BUILTINS) || UNIV_WORD_SIZE < 8
 	os_mutex_enter(os_file_count_mutex);
 	os_file_n_pending_pwrites--;
 	os_n_pending_writes--;
 	MONITOR_DEC(MONITOR_OS_PENDING_WRITES);
 	os_mutex_exit(os_file_count_mutex);
+#else
+	(void) os_atomic_decrement_ulint(&os_n_pending_writes, 1);
+	(void) os_atomic_decrement_ulint(&os_file_n_pending_pwrites, 1);
+	MONITOR_ATOMIC_DEC(MONITOR_OS_PENDING_WRITES);
+#endif /* !HAVE_ATOMIC_BUILTINS || UNIV_WORD < 8 */
 
 # ifdef UNIV_DO_FLUSH
 	if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC

=== modified file 'storage/innobase/read/read0read.c'
--- a/storage/innobase/read/read0read.c	2011-08-11 20:23:10 +0000
+++ b/storage/innobase/read/read0read.c	2011-09-22 06:35:38 +0000
@@ -394,7 +394,10 @@ read_view_open_now_low(
 		view->up_limit_id = view->low_limit_id;
 	}
 
-	read_view_add(view);
+	/* Purge views are not added to the view list. */
+	if (cr_trx_id > 0) {
+		read_view_add(view);
+	}
 
 	return(view);
 }
@@ -461,6 +464,8 @@ read_view_purge_open(
 
 	ut_ad(read_view_validate(oldest_view));
 
+	mutex_exit(&trx_sys->mutex);
+
 	ut_a(oldest_view->creator_trx_id > 0);
 	creator_trx_id = oldest_view->creator_trx_id;
 
@@ -489,8 +494,6 @@ read_view_purge_open(
 		view->trx_ids[i] = oldest_view->trx_ids[i - 1];
 	}
 
-	ut_ad(read_view_validate(view));
-
 	view->creator_trx_id = 0;
 
 	view->low_limit_no = oldest_view->low_limit_no;
@@ -504,10 +507,6 @@ read_view_purge_open(
 		view->up_limit_id = oldest_view->up_limit_id;
 	}
 
-	read_view_add(view);
-
-	mutex_exit(&trx_sys->mutex);
-
 	return(view);
 }
 

=== modified file 'storage/innobase/row/row0purge.c'
--- a/storage/innobase/row/row0purge.c	2011-08-17 04:42:00 +0000
+++ b/storage/innobase/row/row0purge.c	2011-09-21 00:24:59 +0000
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied w
 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
 
 *****************************************************************************/
 
@@ -516,7 +516,8 @@ row_purge_upd_exist_or_extern_func(
 
 	ut_ad(node);
 
-	if (node->rec_type == TRX_UNDO_UPD_DEL_REC) {
+	if ((node->rec_type == TRX_UNDO_UPD_DEL_REC)
+	    || (node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
 
 		goto skip_secondaries;
 	}
@@ -650,13 +651,12 @@ row_purge_parse_undo_rec(
 	roll_ptr_t	roll_ptr;
 	ulint		info_bits;
 	ulint		type;
-	ulint		cmpl_info;
 
 	ut_ad(node && thr);
 
 	ptr = trx_undo_rec_get_pars(
-		undo_rec, &type, &cmpl_info, updated_extern,
-		&undo_no, &table_id);
+		undo_rec, &type, &node->cmpl_info,
+		updated_extern, &undo_no, &table_id);
 
 	node->rec_type = type;
 
@@ -670,7 +670,8 @@ row_purge_parse_undo_rec(
 	node->table = NULL;
 
 	if (type == TRX_UNDO_UPD_EXIST_REC
-	    && (cmpl_info & UPD_NODE_NO_ORD_CHANGE) && !*updated_extern) {
+	    && node->cmpl_info & UPD_NODE_NO_ORD_CHANGE
+	    && !(*updated_extern)) {
 
 		/* Purge requires no changes to indexes: we may return */
 
@@ -723,7 +724,7 @@ err_exit:
 
 	/* Read to the partial row the fields that occur in indexes */
 
-	if (!(cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
+	if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
 		ptr = trx_undo_rec_get_partial_row(
 			ptr, clust_index, &node->row,
 			type == TRX_UNDO_UPD_DEL_REC,

=== modified file 'storage/innobase/trx/trx0purge.c'
--- a/storage/innobase/trx/trx0purge.c	2011-07-26 03:21:33 +0000
+++ b/storage/innobase/trx/trx0purge.c	2011-09-22 06:35:38 +0000
@@ -180,11 +180,7 @@ trx_purge_sys_close(void)
 
 	purge_sys->sess = NULL;
 
-	if (purge_sys->view != NULL) {
-		read_view_remove(purge_sys->view);
-
-		purge_sys->view = NULL;
-	}
+	purge_sys->view = NULL;
 
 	rw_lock_free(&purge_sys->latch);
 	mutex_free(&purge_sys->bh_mutex);
@@ -1204,8 +1200,6 @@ trx_purge(
 
 	rw_lock_x_lock(&purge_sys->latch);
 
-	read_view_remove(purge_sys->view);
-
 	purge_sys->view = NULL;
 
 	mem_heap_empty(purge_sys->heap);

=== modified file 'storage/innobase/ut/ut0mem.c'
--- a/storage/innobase/ut/ut0mem.c	2011-02-15 09:40:34 +0000
+++ b/storage/innobase/ut/ut0mem.c	2011-09-21 11:01:41 +0000
@@ -1,6 +1,6 @@
 /*****************************************************************************
 
-Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
+Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free Software
@@ -488,53 +488,6 @@ ut_strlcpy_rev(
 	return(src_size);
 }
 
-/**********************************************************************//**
-Make a quoted copy of a NUL-terminated string.	Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_memcpyq().
-@return	pointer to end of dest */
-UNIV_INTERN
-char*
-ut_strcpyq(
-/*=======*/
-	char*		dest,	/*!< in: output buffer */
-	char		q,	/*!< in: the quote character */
-	const char*	src)	/*!< in: null-terminated string */
-{
-	while (*src) {
-		if ((*dest++ = *src++) == q) {
-			*dest++ = q;
-		}
-	}
-
-	return(dest);
-}
-
-/**********************************************************************//**
-Make a quoted copy of a fixed-length string.  Leading and trailing
-quotes will not be included; only embedded quotes will be escaped.
-See also ut_strlenq() and ut_strcpyq().
-@return	pointer to end of dest */
-UNIV_INTERN
-char*
-ut_memcpyq(
-/*=======*/
-	char*		dest,	/*!< in: output buffer */
-	char		q,	/*!< in: the quote character */
-	const char*	src,	/*!< in: string to be quoted */
-	ulint		len)	/*!< in: length of src */
-{
-	const char*	srcend = src + len;
-
-	while (src < srcend) {
-		if ((*dest++ = *src++) == q) {
-			*dest++ = q;
-		}
-	}
-
-	return(dest);
-}
-
 #ifndef UNIV_HOTBACKUP
 /**********************************************************************//**
 Return the number of times s2 occurs in s1. Overlapping instances of s2

=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc	2011-09-06 12:45:57 +0000
+++ b/storage/myisam/ha_myisam.cc	2011-09-21 11:01:41 +0000
@@ -2216,7 +2216,8 @@ mysql_declare_plugin(myisam)
   0x0100, /* 1.0 */
   NULL,                       /* status variables                */
   myisam_sysvars,             /* system variables                */
-  NULL
+  NULL,
+  0,
 }
 mysql_declare_plugin_end;
 

=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc	2011-07-22 15:52:42 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc	2011-09-21 11:01:41 +0000
@@ -1680,6 +1680,7 @@ mysql_declare_plugin(myisammrg)
   0x0100, /* 1.0 */
   NULL,                       /* status variables                */
   NULL,                       /* system variables                */
-  NULL                        /* config options                  */
+  NULL,                       /* config options                  */
+  0,                          /* flags                           */
 }
 mysql_declare_plugin_end;

=== modified file 'storage/perfschema/ha_perfschema.cc'
--- a/storage/perfschema/ha_perfschema.cc	2011-08-11 03:11:58 +0000
+++ b/storage/perfschema/ha_perfschema.cc	2011-09-21 11:01:41 +0000
@@ -185,7 +185,8 @@ mysql_declare_plugin(perfschema)
   0x0001 /* 0.1 */,
   pfs_status_vars,                              /* status variables */
   NULL,                                         /* system variables */
-  NULL                                          /* config options */
+  NULL,                                         /* config options */
+  0,                                            /* flags */
 }
 mysql_declare_plugin_end;
 

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-09-14 10:42:54 +0000
+++ b/storage/perfschema/pfs.cc	2011-09-21 15:41:50 +0000
@@ -3710,6 +3710,8 @@ static void end_table_io_wait_v1(PSI_tab
       insert_events_waits_history_long(wait);
     thread->m_events_waits_count--;
   }
+
+  table->m_has_io_stats= true;
 }
 
 /**
@@ -3787,6 +3789,8 @@ static void end_table_lock_wait_v1(PSI_t
       insert_events_waits_history_long(wait);
     thread->m_events_waits_count--;
   }
+
+  table->m_has_lock_stats= true;
 }
 
 static void start_file_wait_v1(PSI_file_locker *locker,

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2011-08-25 07:53:21 +0000
+++ b/storage/perfschema/pfs_instr.cc	2011-09-21 15:41:50 +0000
@@ -1302,6 +1302,8 @@ PFS_table* create_table(PFS_table_share
         pfs->m_lock_enabled= share->m_enabled &&
           flag_global_instrumentation && global_table_lock_class.m_enabled;
         pfs->m_lock_timed= share->m_timed && global_table_lock_class.m_timed;
+        pfs->m_has_io_stats= false;
+        pfs->m_has_lock_stats= false;
         share->inc_refcount();
         pfs->m_table_stat.reset();
         pfs->m_thread_owner= opening_thread;
@@ -1323,24 +1325,35 @@ void PFS_table::sanitized_aggregate(void
   */
   PFS_table_share *safe_share= sanitize_table_share(m_share);
   PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
-  if (safe_share != NULL && safe_thread != NULL)
+  if ((safe_share != NULL && safe_thread != NULL) &&
+      (m_has_io_stats || m_has_lock_stats))
+  {
     safe_aggregate(& m_table_stat, safe_share, safe_thread);
+    m_has_io_stats= false;
+    m_has_lock_stats= false;
+  }
 }
 
 void PFS_table::sanitized_aggregate_io(void)
 {
   PFS_table_share *safe_share= sanitize_table_share(m_share);
   PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
-  if (safe_share != NULL && safe_thread != NULL)
+  if (safe_share != NULL && safe_thread != NULL && m_has_io_stats)
+  {
     safe_aggregate_io(& m_table_stat, safe_share, safe_thread);
+    m_has_io_stats= false;
+  }
 }
 
 void PFS_table::sanitized_aggregate_lock(void)
 {
   PFS_table_share *safe_share= sanitize_table_share(m_share);
   PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
-  if (safe_share != NULL && safe_thread != NULL)
+  if (safe_share != NULL && safe_thread != NULL && m_has_lock_stats)
+  {
     safe_aggregate_lock(& m_table_stat, safe_share, safe_thread);
+    m_has_lock_stats= false;
+  }
 }
 
 void PFS_table::safe_aggregate(PFS_table_stat *table_stat,
@@ -1357,11 +1370,17 @@ void PFS_table::safe_aggregate(PFS_table
     uint index;
     event_name_array= thread->m_instr_class_waits_stats;
 
-    /* Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME (for wait/io/table/sql/handler) */
+    /*
+      Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+      (for wait/io/table/sql/handler)
+    */
     index= global_table_io_class.m_event_name_index;
     table_stat->sum_io(& event_name_array[index]);
 
-    /* Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME (for wait/lock/table/sql/handler) */
+    /*
+      Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+      (for wait/lock/table/sql/handler)
+    */
     index= global_table_lock_class.m_event_name_index;
     table_stat->sum_lock(& event_name_array[index]);
   }
@@ -1385,7 +1404,10 @@ void PFS_table::safe_aggregate_io(PFS_ta
     uint index;
     event_name_array= thread->m_instr_class_waits_stats;
 
-    /* Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME (for wait/io/table/sql/handler) */
+    /*
+      Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+      (for wait/io/table/sql/handler)
+    */
     index= global_table_io_class.m_event_name_index;
     table_stat->sum_io(& event_name_array[index]);
   }
@@ -1409,7 +1431,10 @@ void PFS_table::safe_aggregate_lock(PFS_
     uint index;
     event_name_array= thread->m_instr_class_waits_stats;
 
-    /* Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME (for wait/lock/table/sql/handler) */
+    /*
+      Aggregate to EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+      (for wait/lock/table/sql/handler)
+    */
     index= global_table_lock_class.m_event_name_index;
     table_stat->sum_lock(& event_name_array[index]);
   }

=== modified file 'storage/perfschema/pfs_instr.h'
--- a/storage/perfschema/pfs_instr.h	2011-09-13 20:58:14 +0000
+++ b/storage/perfschema/pfs_instr.h	2011-09-21 15:41:50 +0000
@@ -180,6 +180,12 @@ struct PFS_table
   */
   bool m_lock_timed;
 
+  /** True if table io statistics have been collected. */
+  bool m_has_io_stats;
+
+  /** True if table lock statistics have been collected. */
+  bool m_has_lock_stats;
+
 public:
   /**
     Aggregate this table handle statistics to the parents.
@@ -188,8 +194,12 @@ public:
   */
   void aggregate(void)
   {
-    if (likely(m_thread_owner != NULL))
+    if (likely((m_thread_owner != NULL) && (m_has_io_stats || m_has_lock_stats)))
+    {
       safe_aggregate(& m_table_stat, m_share, m_thread_owner);
+      m_has_io_stats= false;
+      m_has_lock_stats= false;
+    }
   }
 
   /**

=== modified file 'strings/dtoa.c'
--- a/strings/dtoa.c	2011-09-20 09:17:02 +0000
+++ b/strings/dtoa.c	2011-09-21 11:55:14 +0000
@@ -1009,6 +1009,7 @@ static Bigint *pow5mult(Bigint *b, int k
   Bigint *b1, *p5, *p51=NULL;
   int i;
   static int p05[3]= { 5, 25, 125 };
+  my_bool overflow= FALSE;
 
   if ((i= k & 3))
     b= multadd(b, p05[i-1], 0, alloc);
@@ -1027,16 +1028,19 @@ static Bigint *pow5mult(Bigint *b, int k
     if (!(k>>= 1))
       break;
     /* Calculate next power of 5 */
-    if (p5 < p5_a + P5A_MAX)
-      ++p5;
-    else if (p5 == p5_a + P5A_MAX)
-      p5= mult(p5, p5, alloc);
-    else
+    if (overflow)
     {
       p51= mult(p5, p5, alloc);
       Bfree(p5, alloc);
       p5= p51;
     }
+    else if (p5 < p5_a + P5A_MAX)
+      ++p5;
+    else if (p5 == p5_a + P5A_MAX)
+    {
+      p5= mult(p5, p5, alloc);
+      overflow= TRUE;
+    }
   }
   if (p51)
     Bfree(p51, alloc);

=== modified file 'support-files/CMakeLists.txt'
--- a/support-files/CMakeLists.txt	2010-12-17 23:03:23 +0000
+++ b/support-files/CMakeLists.txt	2011-09-20 12:35:54 +0000
@@ -49,8 +49,7 @@ ENDFOREACH()
 
 IF(UNIX)
   SET(prefix ${CMAKE_INSTALL_PREFIX})
-  FOREACH(script  mysqld_multi.server mysql-log-rotate binary-configure
-    config.medium.ini config.small.ini config.huge.ini ndb-config-2-node.ini)
+  FOREACH(script  mysqld_multi.server mysql-log-rotate binary-configure)
     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh 
                    ${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY )
 

=== removed file 'support-files/config.huge.ini.sh'
--- a/support-files/config.huge.ini.sh	2011-06-30 15:37:13 +0000
+++ b/support-files/config.huge.ini.sh	1970-01-01 00:00:00 +0000
@@ -1,228 +0,0 @@
-# Copyright (c) 2008 MySQL AB
-# Use is subject to license terms.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-######################################################
-# MySQL NDB Cluster Huge Sample Configuration File   #
-######################################################
-# This files assumes that you are using at least 9   #
-# hosts for running the cluster. Hostnames and paths #
-# listed below should be changed to match your setup #
-######################################################
-
-[NDBD DEFAULT]
-NoOfReplicas: 2
-DataDir: /add/path/here
-FileSystemPath: /add/path/here
-
-# Data Memory, Index Memory, and String Memory #
-DataMemory: 6000M
-IndexMemory: 1500M
-StringMemory: 5
-
-# Transaction Parameters #
-MaxNoOfConcurrentTransactions: 4096
-MaxNoOfConcurrentOperations: 100000
-MaxNoOfLocalOperations: 100000
-
-# Transaction Temporary Storage #
-MaxNoOfConcurrentIndexOperations: 8192
-MaxNoOfFiredTriggers: 4000
-TransactionBufferMemory: 1M
-
-# Scans and buffering #
-MaxNoOfConcurrentScans: 300
-MaxNoOfLocalScans: 32
-BatchSizePerLocalScan: 64
-LongMessageBuffer: 1M
-
-# Logging and Checkpointing #
-NoOfFragmentLogFiles: 300
-FragmentLogFileSize: 16M
-MaxNoOfOpenFiles: 40
-InitialNoOfOpenFiles: 27
-MaxNoOfSavedMessages: 25
-
-# Metadata Objects #
-MaxNoOfAttributes: 1500
-MaxNoOfTables: 400
-MaxNoOfOrderedIndexes: 200
-MaxNoOfUniqueHashIndexes: 200
-MaxNoOfTriggers: 770
-
-# Boolean Parameters #
-LockPagesInMainMemory: 0
-StopOnError: 1
-Diskless: 0
-ODirect: 0
-
-# Controlling Timeouts, Intervals, and Disk Paging #
-TimeBetweenWatchDogCheck: 6000
-TimeBetweenWatchDogCheckInitial: 6000
-StartPartialTimeout: 30000
-StartPartitionedTimeout: 60000
-StartFailureTimeout: 1000000
-HeartbeatIntervalDbDb: 2000
-HeartbeatIntervalDbApi: 3000
-TimeBetweenLocalCheckpoints: 20
-TimeBetweenGlobalCheckpoints: 2000
-TransactionInactiveTimeout: 0
-TransactionDeadlockDetectionTimeout: 1200
-DiskSyncSize: 4M
-DiskCheckpointSpeed: 10M
-DiskCheckpointSpeedInRestart: 100M
-ArbitrationTimeout: 10
-
-# Buffering and Logging #
-UndoIndexBuffer: 2M
-UndoDataBuffer: 1M
-RedoBuffer: 32M
-LogLevelStartup: 15
-LogLevelShutdown: 3
-LogLevelStatistic: 0
-LogLevelCheckpoint: 0
-LogLevelNodeRestart: 0
-LogLevelConnection: 0
-LogLevelError: 15
-LogLevelCongestion: 0
-LogLevelInfo: 3
-MemReportFrequency: 0
-
-# Backup Parameters #
-BackupDataBufferSize: 2M
-BackupLogBufferSize: 2M
-BackupMemory: 64M
-BackupWriteSize: 32K
-BackupMaxWriteSize: 256K
-
-[MGM DEFAULT]
-PortNumber: 1186
-DataDir: /add/path/here
-
-[TCP DEFAULT]
-SendBufferMemory: 2M
-
-#######################################
-# Change HOST1 to the name of the NDB_MGMD host
-# Change HOST2 to the name of the NDB_MGMD host
-# Change HOST3 to the name of the NDB_MGMD host
-# Change HOST4 to the name of the NDBD host
-# Change HOST5 to the name of the NDBD host
-# Change HOST6 to the name of the NDBD host
-# Change HOST7 to the name of the NDBD host
-# Change HOST8 to the name of the NDBD host
-# Change HOST9 to the name of the NDBD host
-#######################################
-
-[NDB_MGMD]
-Id: 1
-HostName: HOST1
-ArbitrationRank: 1
-
-[NDB_MGMD]
-Id: 2
-HostName: HOST2
-ArbitrationRank: 1
-
-[NDB_MGMD]
-Id: 3
-HostName: HOST3
-ArbitrationRank: 1
-
-[NDBD]
-Id: 4
-HostName: HOST4
-
-[NDBD]
-Id: 5
-HostName: HOST5
-
-[NDBD]
-Id: 6
-HostName: HOST6
-
-[NDBD]
-Id: 7
-HostName: HOST7
-
-[NDBD]
-Id: 8
-HostName: HOST8
-
-[NDBD]
-Id: 9
-HostName: HOST9
-
-######################################################
-# Note: The following can be MySQLD connections or   #
-#      NDB API application connecting to the cluster #
-######################################################
-
-[API]
-Id: 10
-HostName: HOST1
-ArbitrationRank: 2
-
-[API]
-Id: 11
-HostName: HOST2
-ArbitrationRank: 2
-
-[API]
-Id: 12
-HostName: HOST3
-
-[API]
-Id: 13
-HostName: HOST4
-
-[API]
-Id: 14
-HostName: HOST5
-
-[API]
-Id: 15
-HostName: HOST6
-
-[API]
-Id: 16
-HostName: HOST7
-
-[API]
-Id: 17
-HostName: HOST8
-
-[API]
-Id: 19
-HostName: HOST9
-
-[API]
-Id: 20
-
-[API]
-Id: 21
-
-[API]
-Id: 22
-
-[API]
-Id: 23
-
-[API]
-Id: 24
-
-[API]
-Id: 25
-

=== removed file 'support-files/config.medium.ini.sh'
--- a/support-files/config.medium.ini.sh	2011-06-30 15:37:13 +0000
+++ b/support-files/config.medium.ini.sh	1970-01-01 00:00:00 +0000
@@ -1,139 +0,0 @@
-# Copyright (c) 2008 MySQL AB
-# Use is subject to license terms.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# MySQL NDB Cluster Medium Sample Configuration File
-#
-# This files assumes that you are using at least 6
-# hosts for running the cluster. Hostnames and paths
-# listed below should be changed to match your setup
-#
-
-[NDBD DEFAULT]
-NoOfReplicas: 2
-DataDir: /add/path/here
-FileSystemPath: /add/path/here
-
-
-# Data Memory, Index Memory, and String Memory
-
-DataMemory: 3000M
-IndexMemory: 800M
-BackupMemory: 64M
-
-# Transaction Parameters
-
-MaxNoOfConcurrentOperations: 100000
-MaxNoOfLocalOperations: 100000
-
-# Buffering and Logging
-
-RedoBuffer: 16M
-
-# Logging and Checkpointing
-
-NoOfFragmentLogFiles: 200
-
-# Metadata Objects
-
-MaxNoOfAttributes: 500
-MaxNoOfTables: 100
-
-# Scans and Buffering
-
-MaxNoOfConcurrentScans: 100
-
-
-[MGM DEFAULT]
-PortNumber: 1186
-DataDir: /add/path/here
-
-#
-# Change HOST1 to the name of the NDB_MGMD host
-# Change HOST2 to the name of the NDB_MGMD host
-# Change HOST3 to the name of the NDBD host
-# Change HOST4 to the name of the NDBD host
-# Change HOST5 to the name of the NDBD host
-# Change HOST6 to the name of the NDBD host
-#
-
-[NDB_MGMD]
-Id: 1
-HostName: HOST1
-ArbitrationRank: 1
-
-[NDB_MGMD]
-Id: 2
-HostName: HOST2
-ArbitrationRank: 1
-
-[NDBD]
-Id: 3
-HostName: HOST3
-
-[NDBD]
-Id: 4
-HostName: HOST4
-
-[NDBD]
-Id: 5
-HostName: HOST5
-
-[NDBD]
-Id: 6
-HostName: HOST6
-
-#
-# Note: The following can be MySQLD connections or
-#      NDB API application connecting to the cluster
-#
-
-[API]
-Id: 7
-HostName: HOST1
-ArbitrationRank: 2
-
-[API]
-Id: 8
-HostName: HOST2
-ArbitrationRank: 2
-
-[API]
-Id: 9
-HostName: HOST3
-ArbitrationRank: 2
-
-[API]
-Id: 10
-HostName: HOST4
-
-[API]
-Id: 11
-HostName: HOST5
-
-[API]
-Id: 12
-HostName: HOST6
-
-[API]
-Id: 13
-
-[API]
-Id: 14
-
-[API]
-Id: 15
-
-

=== removed file 'support-files/config.small.ini.sh'
--- a/support-files/config.small.ini.sh	2011-06-30 15:37:13 +0000
+++ b/support-files/config.small.ini.sh	1970-01-01 00:00:00 +0000
@@ -1,80 +0,0 @@
-# Copyright (c) 2008 MySQL AB
-# Use is subject to license terms.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# MySQL NDB Cluster Small Sample Configuration File
-#
-# This files assumes that you are using 1 to 3 hosts
-# for running the cluster. Hostnames and paths listed
-# below should be changed to match your setup.
-#
-# Note: You can change localhost for a different host
-#
-
-[NDBD DEFAULT]
-NoOfReplicas: 2
-DataDir: /add/path/here
-FileSystemPath: /add/path/here
-
-# Data Memory, Index Memory, and String Memory
-
-DataMemory: 600M
-IndexMemory: 100M
-BackupMemory: 64M
-
-[MGM DEFAULT]
-PortNumber: 1186
-DataDir: /add/path/here
-
-[NDB_MGMD]
-Id: 1
-HostName: localhost
-ArbitrationRank: 1
-
-[NDBD]
-Id: 2
-HostName: localhost
-
-[NDBD]
-Id: 3
-HostName: localhost
-
-#
-# Note: The following can be MySQLD connections or
-#      NDB API application connecting to the cluster
-#
-
-[API]
-Id: 4
-HostName: localhost
-ArbitrationRank: 2
-
-[API]
-Id: 5
-HostName: localhost
-
-[API]
-Id: 6
-HostName: localhost
-
-[API]
-Id: 7
-
-[API]
-Id: 8
-
-[API]
-Id: 9
-

=== modified file 'support-files/mysql.spec.sh'
--- a/support-files/mysql.spec.sh	2011-09-20 15:49:37 +0000
+++ b/support-files/mysql.spec.sh	2011-09-23 10:55:10 +0000
@@ -961,7 +961,7 @@ echo "====="
 #  Files section
 ##############################################################################
 
-%files -n MySQL-server%{product_suffix}
+%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files
 %defattr(-,root,root,0755)
 
 %if %{defined license_files_server}
@@ -1002,6 +1002,7 @@ echo "====="
 %doc %attr(644, root, man) %{_mandir}/man1/replace.1*
 %doc %attr(644, root, man) %{_mandir}/man1/resolve_stack_dump.1*
 %doc %attr(644, root, man) %{_mandir}/man1/resolveip.1*
+%doc %attr(644, root, man) %{_mandir}/man1/mysql_plugin.1*
 
 %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
 
@@ -1019,6 +1020,7 @@ echo "====="
 %attr(755, root, root) %{_bindir}/mysql_setpermission
 %attr(755, root, root) %{_bindir}/mysql_tzinfo_to_sql
 %attr(755, root, root) %{_bindir}/mysql_upgrade
+%attr(755, root, root) %{_bindir}/mysql_plugin
 %attr(755, root, root) %{_bindir}/mysql_zap
 %attr(755, root, root) %{_bindir}/mysqlbug
 %attr(755, root, root) %{_bindir}/mysqld_multi
@@ -1034,29 +1036,7 @@ echo "====="
 %attr(755, root, root) %{_sbindir}/mysqld
 %attr(755, root, root) %{_sbindir}/mysqld-debug
 %attr(755, root, root) %{_sbindir}/rcmysql
-%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
 %attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
-%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
-%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
 
 %if %{WITH_TCMALLOC}
 %attr(755, root, root) %{_libdir}/mysql/%{malloc_lib_target}
@@ -1162,6 +1142,10 @@ echo "====="
 
 - "make_win_bin_dist" and its manual are dropped, cmake does it different.
 
+* Thu Sep 08 2011 Daniel Fischer <daniel.fischer@stripped>
+
+- Add mysql_plugin man page.
+
 * Tue Aug 30 2011 Joerg Bruehe <joerg.bruehe@stripped>
 
 - Add the manual page for "mysql_plugin" to the server package.
@@ -1171,6 +1155,10 @@ echo "====="
 - Null-upmerge the fix of bug#37165: This spec file is not affected.
 - Replace "/var/lib/mysql" by the spec file variable "%{mysqldatadir}".
 
+* Fri Aug 12 2011 Daniel Fischer <daniel.fischer@stripped>
+
+- Source plugin library files list from cmake-generated file.
+
 * Mon Jul 25 2011 Chuck Bell <chuck.bell@stripped>
 
 - Added the mysql_plugin client - enables or disables plugins.

=== removed file 'support-files/ndb-config-2-node.ini.sh'
--- a/support-files/ndb-config-2-node.ini.sh	2011-06-30 15:46:53 +0000
+++ b/support-files/ndb-config-2-node.ini.sh	1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
-# 
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-# 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-# 
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Example Ndbcluster storage engine config file.
-#
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentOperations= 10000
-DataMemory= 80M
-IndexMemory= 24M
-TimeBetweenWatchDogCheck= 30000
-DataDir= /var/lib/mysql-cluster
-MaxNoOfOrderedIndexes= 512
-
-[ndb_mgmd default]
-DataDir= /var/lib/mysql-cluster
-
-[ndb_mgmd]
-Id=1
-HostName= localhost
-
-[ndbd]
-Id= 2
-HostName= localhost
-
-[ndbd]
-Id= 3
-HostName= localhost
-
-[mysqld]
-Id= 4
-
-[mysqld]
-Id= 5
-
-[mysqld]
-Id= 6
-
-[mysqld]
-Id= 7
-
-# choose an unused port number
-# in this configuration 63132, 63133, and 63134
-# will be used
-[tcp default]
-PortNumber= 63132

=== modified file 'tests/mysql_client_test.c'
--- a/tests/mysql_client_test.c	2011-08-03 14:02:33 +0000
+++ b/tests/mysql_client_test.c	2011-09-20 14:24:18 +0000
@@ -2190,22 +2190,24 @@ static void test_wl4435_3()
 
   puts("");
 
-  // The following types are not supported:
-  //   - ENUM
-  //   - SET
-  //
-  // The following types are supported but can not be used for
-  // OUT-parameters:
-  //   - MEDIUMINT;
-  //   - BIT(..);
-  //
-  // The problem is that those types are not supported for IN-parameters,
-  // and OUT-parameters should be bound as IN-parameters before execution.
-  //
-  // The following types should not be used:
-  //   - MYSQL_TYPE_YEAR (use MYSQL_TYPE_SHORT instead);
-  //   - MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB
-  //     (use MYSQL_TYPE_BLOB instead);
+  /*
+    The following types are not supported:
+     - ENUM
+     - SET
+
+    The following types are supported but can not be used for
+    OUT-parameters:
+     - MEDIUMINT;
+     - BIT(..);
+
+    The problem is that those types are not supported for IN-parameters,
+    and OUT-parameters should be bound as IN-parameters before execution
+
+    The following types should not be used:
+     - MYSQL_TYPE_YEAR (use MYSQL_TYPE_SHORT instead);
+     - MYSQL_TYPE_TINY_BLOB, MYSQL_TYPE_MEDIUM_BLOB, MYSQL_TYPE_LONG_BLOB
+       (use MYSQL_TYPE_BLOB instead);
+  */
 
   WL4435_TEST("TINYINT", "127",
               MYSQL_TYPE_TINY, MYSQL_TYPE_TINY,

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marc.alff:3420 to 3421) Marc Alff28 Sep