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

ChangeSet@stripped, 2006-11-29 15:44:09+01:00, msvensson@shellback.(none) +35 -0
  Merge shellback.(none):/home/msvensson/mysql/mysql-5.1
  into  shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
  MERGE: 1.2349.1.25

  BitKeeper/etc/ignore@stripped, 2006-11-29 15:28:15+01:00, msvensson@shellback.(none) +0 -0
    auto-union
    MERGE: 1.262.1.2

  Makefile.am@stripped, 2006-11-29 15:28:30+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.101.1.4

  client/mysql.cc@stripped, 2006-11-29 15:28:30+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.243.1.2

  client/mysql_upgrade.c@stripped, 2006-11-29 15:28:30+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.12.1.1

  client/mysqltest.c@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.246.1.3

  extra/yassl/src/ssl.cpp@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0
-0
    Auto merged
    MERGE: 1.22.1.1

  extra/yassl/taocrypt/include/algebra.hpp@stripped, 2006-11-29 15:44:05+01:00,
msvensson@shellback.(none) +0 -1
    Remove fix as it conflicts with "import from yassl" and it's been
    fixed there
    MERGE: 1.4.1.1

  mysql-test/lib/mtr_report.pl@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none)
+0 -0
    Auto merged
    MERGE: 1.39.1.1

  mysql-test/mysql-test-run-shell.sh@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.334.1.2

  mysql-test/mysql-test-run.pl@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.227.1.10

  mysql-test/r/query_cache.result@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.82.1.1

  mysql-test/r/udf.result@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0
-0
    Auto merged
    MERGE: 1.8.1.1

  mysql-test/t/alter_table.test@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.51.1.1

  mysql-test/t/disabled.def@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none)
+0 -0
    Auto merged
    MERGE: 1.212.2.1

  mysql-test/t/limit.test@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0
-0
    Auto merged
    MERGE: 1.11.1.1

  mysql-test/t/mysql.test@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0
-0
    Auto merged
    MERGE: 1.27.1.2

  mysql-test/t/mysqldump.test@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none)
+0 -0
    Auto merged
    MERGE: 1.124.1.1

  mysql-test/t/query_cache.test@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.63.1.1

  mysql-test/t/system_mysql_db_fix30020.test@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.26.1.2

  mysql-test/t/system_mysql_db_fix30020.test@stripped, 2006-11-29 15:28:30+01:00,
msvensson@shellback.(none) +0 -0
    Merge rename: mysql-test/t/system_mysql_db_fix.test ->
mysql-test/t/system_mysql_db_fix30020.test

  mysql-test/t/udf.test@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.9.1.1

  mysql-test/t/view_grant.test@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none)
+0 -0
    Auto merged
    MERGE: 1.22.1.1

  mysys/Makefile.am@stripped, 2006-11-29 15:28:31+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.84.1.1

  scripts/mysql_fix_privilege_tables.sql@stripped, 2006-11-29 15:28:31+01:00,
msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.45.2.1

  sql-common/my_time.c@stripped, 2006-11-29 15:28:34+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.28.2.4

  sql/ha_ndbcluster.cc@stripped, 2006-11-29 15:44:05+01:00, msvensson@shellback.(none) +0 -44
    Merge fix of warnings
    MERGE: 1.369.1.2

  sql/item.cc@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.217.1.1

  sql/item_func.cc@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.329.1.3

  sql/item_func.h@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.152.1.2

  sql/item_timefunc.cc@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.137.7.5

  sql/mysql_priv.h@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.457.3.1

  sql/mysqld.cc@stripped, 2006-11-29 15:28:32+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.589.1.4

  sql/sql_base.cc@stripped, 2006-11-29 15:44:05+01:00, msvensson@shellback.(none) +0 -0
    Merge
    MERGE: 1.360.2.1

  sql/sql_handler.cc@stripped, 2006-11-29 15:28:33+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.86.1.1

  sql/sql_parse.cc@stripped, 2006-11-29 15:28:33+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.595.3.4

  sql/sql_table.cc@stripped, 2006-11-29 15:28:34+01:00, msvensson@shellback.(none) +0 -0
    Auto merged
    MERGE: 1.372.1.2

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	shellback.(none)
# Root:	/home/msvensson/mysql/mysql-5.1-maint/RESYNC

--- 1.102/Makefile.am	2006-11-29 15:44:17 +01:00
+++ 1.103/Makefile.am	2006-11-29 15:44:17 +01:00
@@ -142,10 +142,15 @@
 test-force-full:
 	$(MAKE) force=--force test-full
 
+#used by autopush.pl to run memory based tests
+test-force-mem:
+	$(MAKE) 'force=--force --mem' test
+
 # Keep these for a while
 test-pl:	test
 test-full-pl:	test-full
 test-force-pl:	test-force
+test-force-pl-mem:  test-force-mem
 test-force-full-pl: test-force-full
 
 # Don't update the files from bitkeeper

--- 1.244/client/mysql.cc	2006-11-29 15:44:17 +01:00
+++ 1.245/client/mysql.cc	2006-11-29 15:44:17 +01:00
@@ -829,10 +829,23 @@
     default_charset_used= 1;
     break;
   case OPT_DELIMITER:
-    if (argument == disabled_my_option)
+    if (argument == disabled_my_option) 
+    {
       strmov(delimiter, DEFAULT_DELIMITER);
-    else
-      strmake(delimiter, argument, sizeof(delimiter) - 1);
+    }
+    else 
+    {
+      /* Check that delimiter does not contain a backslash */
+      if (!strstr(argument, "\\")) 
+      {
+        strmake(delimiter, argument, sizeof(delimiter) - 1);
+      }
+      else 
+      {
+        put_info("DELIMITER cannot contain a backslash character", INFO_ERROR);
+        return 0;
+      } 
+    }
     delimiter_length= (uint)strlen(delimiter);
     delimiter_str= delimiter;
     break;
@@ -3031,6 +3044,14 @@
     put_info("DELIMITER must be followed by a 'delimiter' character or string",
 	     INFO_ERROR);
     return 0;
+  }
+  else
+  {
+    if (strstr(tmp, "\\")) 
+    {
+      put_info("DELIMITER cannot contain a backslash character", INFO_ERROR);
+      return 0;
+    }
   }
   strmake(delimiter, tmp, sizeof(delimiter) - 1);
   delimiter_length= (int)strlen(delimiter);

--- 1.85/mysys/Makefile.am	2006-11-29 15:44:17 +01:00
+++ 1.86/mysys/Makefile.am	2006-11-29 15:44:17 +01:00
@@ -20,7 +20,7 @@
 INCLUDES =		@ZLIB_INCLUDES@ -I$(top_builddir)/include \
 			-I$(top_srcdir)/include -I$(srcdir)
 pkglib_LIBRARIES =	libmysys.a
-LDADD =			libmysys.a $(top_builddir)/strings/libmystrings.a
+LDADD =			libmysys.a $(top_builddir)/strings/libmystrings.a
$(top_builddir)/dbug/libdbug.a
 noinst_HEADERS =	mysys_priv.h my_static.h
 libmysys_a_SOURCES =    my_init.c my_getwd.c mf_getdate.c my_mmap.c \
 			mf_path.c mf_loadpath.c my_file.c \

--- 1.220/sql/item.cc	2006-11-29 15:44:17 +01:00
+++ 1.221/sql/item.cc	2006-11-29 15:44:17 +01:00
@@ -5566,6 +5566,7 @@
                             ER(ER_NO_DEFAULT_FOR_FIELD),
                             field_arg->field_name);
       }
+      field_arg->set_default();
       return 1;
     }
     field_arg->set_default();

--- 1.335/sql/item_func.cc	2006-11-29 15:44:17 +01:00
+++ 1.336/sql/item_func.cc	2006-11-29 15:44:17 +01:00
@@ -961,7 +961,14 @@
   longlong value;
   int error;
 
-  if (args[0]->cast_to_int_type() != STRING_RESULT)
+  if (args[0]->cast_to_int_type() == DECIMAL_RESULT)
+  {
+    my_decimal tmp, *dec= args[0]->val_decimal(&tmp);
+    if (!(null_value= args[0]->null_value))
+      my_decimal2int(E_DEC_FATAL_ERROR, dec, 1, &value);
+    return value;
+  }
+  else if (args[0]->cast_to_int_type() != STRING_RESULT)
   {
     value= args[0]->val_int();
     null_value= args[0]->null_value; 
@@ -2911,6 +2918,20 @@
 }
 
 
+void Item_udf_func::print(String *str)
+{
+  str->append(func_name());
+  str->append('(');
+  for (uint i=0 ; i < arg_count ; i++)
+  {
+    if (i != 0)
+      str->append(',');
+    args[i]->print_item_w_name(str);
+  }
+  str->append(')');
+}
+
+
 double Item_func_udf_float::val_real()
 {
   DBUG_ASSERT(fixed == 1);
@@ -5068,7 +5089,7 @@
 {
   Field *field;
   DBUG_ENTER("Item_func_sp::result_type");
-  DBUG_PRINT("info", ("m_sp = %p", m_sp));
+  DBUG_PRINT("info", ("m_sp: 0x%lx", (long) m_sp));
 
   if (result_field)
     DBUG_RETURN(result_field->result_type());

--- 1.154/sql/item_func.h	2006-11-29 15:44:17 +01:00
+++ 1.155/sql/item_func.h	2006-11-29 15:44:17 +01:00
@@ -1316,10 +1316,10 @@
 class Item_func_inet_aton : public Item_int_func
 {
 public:
-   Item_func_inet_aton(Item *a) :Item_int_func(a) {}
-   longlong val_int();
-   const char *func_name() const { return "inet_aton"; }
-   void fix_length_and_dec() { decimals = 0; max_length = 21; maybe_null=1;}
+  Item_func_inet_aton(Item *a) :Item_int_func(a) {}
+  longlong val_int();
+  const char *func_name() const { return "inet_aton"; }
+  void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag=
1;}
   bool check_partition_func_processor(byte *int_arg) {return FALSE;}
 };
 

--- 1.141/sql/item_timefunc.cc	2006-11-29 15:44:17 +01:00
+++ 1.142/sql/item_timefunc.cc	2006-11-29 15:44:17 +01:00
@@ -290,15 +290,16 @@
 
   for (; ptr != end && val != val_end; ptr++)
   {
+    /* Skip pre-space between each argument */
+    while (val != val_end && my_isspace(cs, *val))
+      val++;
+
     if (*ptr == '%' && ptr+1 != end)
     {
       int val_len;
       char *tmp;
 
       error= 0;
-      /* Skip pre-space between each argument */
-      while (val != val_end && my_isspace(cs, *val))
-	val++;
 
       val_len= (uint) (val_end - val);
       switch (*++ptr) {
@@ -3194,7 +3195,9 @@
   date_time_format.format.str=    (char*) format->ptr();
   date_time_format.format.length= format->length();
   if (extract_date_time(&date_time_format, val->ptr(), val->length(),
-			ltime, cached_timestamp_type, 0, "datetime"))
+			ltime, cached_timestamp_type, 0, "datetime") ||
+      ((fuzzy_date & TIME_NO_ZERO_DATE) &&
+       (ltime->year == 0 || ltime->month == 0 || ltime->day == 0)))
     goto null_date;
   if (cached_timestamp_type == MYSQL_TIMESTAMP_TIME && ltime->day)
   {
@@ -3231,8 +3234,13 @@
 
 bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
 {
-  if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE))
+  if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
+      (ltime->month == 0))
+  {
+    null_value= 1;
     return 1;
+  }
+  null_value= 0;
   uint month_idx= ltime->month-1;
   ltime->day= days_in_month[month_idx];
   if ( month_idx == 1 && calc_days_in_year(ltime->year) == 366)

--- 1.460/sql/mysql_priv.h	2006-11-29 15:44:17 +01:00
+++ 1.461/sql/mysql_priv.h	2006-11-29 15:44:17 +01:00
@@ -1112,6 +1112,7 @@
                    List<Item> *,enum ha_rkey_function,Item *,ha_rows,ha_rows);
 int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags,
                    bool is_locked);
+void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table);
 /* mysql_ha_flush mode_flags bits */
 #define MYSQL_HA_CLOSE_FINAL        0x00
 #define MYSQL_HA_REOPEN_ON_USAGE    0x01

--- 1.593/sql/mysqld.cc	2006-11-29 15:44:18 +01:00
+++ 1.594/sql/mysqld.cc	2006-11-29 15:44:18 +01:00
@@ -1610,7 +1610,7 @@
     if (strlen(mysqld_unix_port) > (sizeof(UNIXaddr.sun_path) - 1))
     {
       sql_print_error("The socket file path is too long (> %u): %s",
-                      sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
+                      (uint) sizeof(UNIXaddr.sun_path) - 1, mysqld_unix_port);
       unireg_abort(1);
     }
     if ((unix_sock= socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
@@ -2121,7 +2121,7 @@
 #ifdef HAVE_STACKTRACE
   if (!(test_flags & TEST_NO_STACKTRACE))
   {
-    fprintf(stderr,"thd=%p\n",thd);
+    fprintf(stderr,"thd: 0x%lx\n",(long) thd);
     print_stacktrace(thd ? (gptr) thd->thread_stack : (gptr) 0,
 		     thread_stack);
   }
@@ -3219,7 +3219,7 @@
     using_update_log=1;
   }
 
-  if (plugin_init(0))
+  if (plugin_init(opt_bootstrap))
   {
     sql_print_error("Failed to init plugins.");
     return 1;
@@ -3537,7 +3537,7 @@
     if (stack_size && stack_size < thread_stack)
     {
       if (global_system_variables.log_warnings)
-	sql_print_warning("Asked for %ld thread stack, but got %ld",
+	sql_print_warning("Asked for %lu thread stack, but got %ld",
 			  thread_stack, (long) stack_size);
 #if defined(__ia64__) || defined(__ia64)
       thread_stack= stack_size*2;
@@ -4083,7 +4083,7 @@
       int error;
       thread_created++;
       threads.append(thd);
-      DBUG_PRINT("info",(("creating thread %d"), thd->thread_id));
+      DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id));
       thd->connect_time = time(NULL);
       if ((error=pthread_create(&thd->real_id,&connection_attrib,
 				handle_one_connection,
@@ -5347,7 +5347,8 @@
    (gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \
 --skip-merge.",
-   (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
+   (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
+   0},
   {"myisam-recover", OPT_MYISAM_RECOVER,
    "Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP,
FORCE or QUICK.",
    (gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,

--- 1.363/sql/sql_base.cc	2006-11-29 15:44:18 +01:00
+++ 1.364/sql/sql_base.cc	2006-11-29 15:44:18 +01:00
@@ -1089,6 +1089,13 @@
 
   DBUG_PRINT("info", ("thd->open_tables: 0x%lx", (long) thd->open_tables));
 
+  /* 
+    End open index scans and table scans and remove references to the tables 
+    from the handler tables hash. After this preparation it is safe to close 
+    the tables.
+  */
+  mysql_ha_mark_tables_for_reopen(thd, thd->open_tables);
+
   found_old_table= 0;
   while (thd->open_tables)
     found_old_table|= close_thread_table(thd, &thd->open_tables);

--- 1.599/sql/sql_parse.cc	2006-11-29 15:44:18 +01:00
+++ 1.600/sql/sql_parse.cc	2006-11-29 15:44:18 +01:00
@@ -57,10 +57,6 @@
    (LP)->sql_command == SQLCOM_DROP_FUNCTION ? \
    "FUNCTION" : "PROCEDURE")
 
-#ifdef SOLARIS
-extern "C" int gethostname(char *name, int namelen);
-#endif
-
 static void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
 #ifndef NO_EMBEDDED_ACCESS_CHECKS
 static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
@@ -2626,10 +2622,11 @@
     if (opt_readonly &&
 	!(thd->security_ctx->master_access & SUPER_ACL) &&
 	(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) &&
-	!((lex->sql_command == SQLCOM_CREATE_TABLE) &&
-	  (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
-	((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
-	 some_non_temp_table_to_be_updated(thd, all_tables)))
+        !((lex->sql_command == SQLCOM_CREATE_TABLE) &&
+          (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
+        !((lex->sql_command == SQLCOM_DROP_TABLE) && lex->drop_temporary)
&&
+        ((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
+          some_non_temp_table_to_be_updated(thd, all_tables)))
     {
       my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
       DBUG_RETURN(-1);
@@ -4673,8 +4670,6 @@
 	select_limit= thd->variables.select_limit;
 	thd->variables.select_limit= HA_POS_ERROR;
 
-        thd->row_count_func= 0;
-        
         /* 
           We never write CALL statements into binlog:
            - If the mode is non-prelocked, each statement will be logged

--- 1.375/sql/sql_table.cc	2006-11-29 15:44:18 +01:00
+++ 1.376/sql/sql_table.cc	2006-11-29 15:44:18 +01:00
@@ -5442,13 +5442,35 @@
   if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) &&
       !table->s->tmp_table) // no need to touch frm
   {
-    error=0;
     VOID(pthread_mutex_lock(&LOCK_open));
-    if (new_name != table_name || new_db != db)
+
+    switch (alter_info->keys_onoff) {
+    case LEAVE_AS_IS:
+      error= 0;
+      break;
+    case ENABLE:
+      wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
+      error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
+      /* COND_refresh will be signaled in close_thread_tables() */
+      break;
+    case DISABLE:
+      wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
+      error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
+      /* COND_refresh will be signaled in close_thread_tables() */
+      break;
+    }
+    if (error == HA_ERR_WRONG_COMMAND)
+    {
+      push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+			  ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
+			  table->alias);
+      error= 0;
+    }
+
+    if (!error && (new_name != table_name || new_db != db))
     {
       thd->proc_info="rename";
       /* Then do a 'simple' rename of the table */
-      error=0;
       if (!access(new_name_buff,F_OK))
       {
 	my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
@@ -5471,31 +5493,14 @@
       }
     }
 
-    if (!error)
-    {
-      switch (alter_info->keys_onoff) {
-      case LEAVE_AS_IS:
-        break;
-      case ENABLE:
-        wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
-        error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
-        /* COND_refresh will be signaled in close_thread_tables() */
-        break;
-      case DISABLE:
-        wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
-        error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
-        /* COND_refresh will be signaled in close_thread_tables() */
-        break;
-      }
-    }
-
     if (error == HA_ERR_WRONG_COMMAND)
     {
       push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
 			  ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
 			  table->alias);
-      error=0;
+      error= 0;
     }
+
     if (!error)
     {
       write_bin_log(thd, TRUE, thd->query, thd->query_length);
@@ -5508,7 +5513,7 @@
       error= -1;
     }
     VOID(pthread_mutex_unlock(&LOCK_open));
-    table_list->table=0;				// For query cache
+    table_list->table= NULL;                    // For query cache
     query_cache_invalidate3(thd, table_list, 0);
     DBUG_RETURN(error);
   }

--- 1.17/client/mysql_upgrade.c	2006-11-29 15:44:18 +01:00
+++ 1.18/client/mysql_upgrade.c	2006-11-29 15:44:18 +01:00
@@ -638,7 +638,7 @@
   if (upgrade_defaults_created)
     my_delete(upgrade_defaults_path, MYF(0));
   
-  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
+  my_end(info_flag ? MY_CHECK_ERROR : 0);
   return ret;
 }
 

--- 1.23/mysql-test/t/view_grant.test	2006-11-29 15:44:18 +01:00
+++ 1.24/mysql-test/t/view_grant.test	2006-11-29 15:44:18 +01:00
@@ -806,7 +806,7 @@
 CREATE TABLE t1 (a INT PRIMARY KEY);
 INSERT INTO t1 VALUES (1), (2), (3);
 CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
---warning 1448
+#--warning 1448
 SHOW CREATE VIEW v;
 --error 1449
 SELECT * FROM v;

--- 1.40/mysql-test/lib/mtr_report.pl	2006-11-29 15:44:18 +01:00
+++ 1.41/mysql-test/lib/mtr_report.pl	2006-11-29 15:44:18 +01:00
@@ -43,7 +43,7 @@
 
   my $reject_file=  "r/$tname.reject";
   my $result_file=  "r/$tname.result";
-  my $log_file=  "r/$tname.log";
+  my $log_file=     "$::opt_vardir/log/$tname.log";
   my $eval_file=    "r/$tname.eval";
 
   if ( $::opt_suite ne "main" )
@@ -248,6 +248,7 @@
       foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x",
 			    "InnoDB: Warning", "missing DBUG_RETURN",
 			    "mysqld: Warning",
+			    "allocated at line",
 			    "Attempting backtrace", "Assertion .* failed" )
       {
         foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )

--- 1.242/mysql-test/mysql-test-run.pl	2006-11-29 15:44:18 +01:00
+++ 1.243/mysql-test/mysql-test-run.pl	2006-11-29 15:44:18 +01:00
@@ -203,6 +203,7 @@
 our $opt_manual_gdb;
 our $opt_manual_ddd;
 our $opt_manual_debug;
+our $opt_mtr_build_thread=0;
 our $opt_debugger;
 our $opt_client_debugger;
 
@@ -217,6 +218,11 @@
 
 our $instance_manager;
 
+our $opt_master_myport;
+our $opt_slave_myport;
+our $im_port;
+our $im_mysqld1_port;
+our $im_mysqld2_port;
 our $opt_ndbcluster_port;
 our $opt_ndbconnectstring;
 our $opt_ndbcluster_port_slave;
@@ -311,6 +317,7 @@
 sub main ();
 sub initial_setup ();
 sub command_line_setup ();
+sub set_mtr_build_thread_ports($);
 sub datadir_setup ();
 sub executable_setup ();
 sub environment_setup ();
@@ -453,45 +460,17 @@
   $opt_suite=        "main";    # Special default suite
   my $opt_comment;
 
-  my $opt_master_myport=       9306;
-  my $opt_slave_myport=        9308;
+  $opt_master_myport=          9306;
+  $opt_slave_myport=           9308;
   $opt_ndbcluster_port=        9310;
   $opt_ndbcluster_port_slave=  9311;
-  my $im_port=                 9312;
-  my $im_mysqld1_port=         9313;
-  my $im_mysqld2_port=         9314;
+  $im_port=                    9312;
+  $im_mysqld1_port=            9313;
+  $im_mysqld2_port=            9314;
 
-  #
-  # To make it easier for different devs to work on the same host,
-  # an environment variable can be used to control all ports. A small
-  # number is to be used, 0 - 16 or similar.
-  #
-  # Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
-  # versions of this script, else a 4.0 test run might conflict with a
-  # 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
-  # all port numbers might not be used in this version of the script.
-  #
-  # Also note the limiteation of ports we are allowed to hand out. This
-  # differs between operating systems and configuration, see
-  # http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
-  # But a fairly safe range seems to be 5001 - 32767
   if ( $ENV{'MTR_BUILD_THREAD'} )
   {
-    # Up to two masters, up to three slaves
-    $opt_master_myport=         $ENV{'MTR_BUILD_THREAD'} * 10 + 10000; # and 1
-    $opt_slave_myport=          $opt_master_myport + 2;  # and 3 4
-    $opt_ndbcluster_port=       $opt_master_myport + 5;
-    $opt_ndbcluster_port_slave= $opt_master_myport + 6;
-    $im_port=                   $opt_master_myport + 7;
-    $im_mysqld1_port=           $opt_master_myport + 8;
-    $im_mysqld2_port=           $opt_master_myport + 9;
-  }
-
-  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
-  {
-    mtr_error("MTR_BUILD_THREAD number results in a port",
-              "outside 5001 - 32767",
-              "($opt_master_myport - $opt_master_myport + 10)");
+    set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
   }
 
   # This is needed for test log evaluation in "gen-build-status-page"
@@ -543,6 +522,7 @@
              'im-port=i'                => \$im_port, # Instance Manager port.
              'im-mysqld1-port=i'        => \$im_mysqld1_port, # Port of mysqld,
controlled by IM
              'im-mysqld2-port=i'        => \$im_mysqld2_port, # Port of mysqld,
controlled by IM
+	     'mtr-build-thread=i'       => \$opt_mtr_build_thread,
 
              # Test case authoring
              'record'                   => \$opt_record,
@@ -623,6 +603,15 @@
 
   $glob_scriptname=  basename($0);
 
+  if ($opt_mtr_build_thread != 0)
+  {
+    set_mtr_build_thread_ports($opt_mtr_build_thread)
+  }
+  elsif ($ENV{'MTR_BUILD_THREAD'})
+  {
+    $opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
+  }
+
   # We require that we are in the "mysql-test" directory
   # to run mysql-test-run
   if (! -f $glob_scriptname)
@@ -771,7 +760,7 @@
       {
 	mtr_report("Using tmpfs in $fs");
 	$opt_mem= "$fs/var";
-	$opt_mem .= $ENV{'MTR_BUILD_THREAD'} if $ENV{'MTR_BUILD_THREAD'};
+	$opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
 	last;
       }
     }
@@ -1216,6 +1205,43 @@
   $path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
 }
 
+#
+# To make it easier for different devs to work on the same host,
+# an environment variable can be used to control all ports. A small
+# number is to be used, 0 - 16 or similar.
+#
+# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
+# versions of this script, else a 4.0 test run might conflict with a
+# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
+# all port numbers might not be used in this version of the script.
+#
+# Also note the limitation of ports we are allowed to hand out. This
+# differs between operating systems and configuration, see
+# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
+# But a fairly safe range seems to be 5001 - 32767
+#
+
+sub set_mtr_build_thread_ports($) {
+  my $mtr_build_thread= shift;
+
+  # Up to two masters, up to three slaves
+  $opt_master_myport=         $mtr_build_thread * 10 + 10000; # and 1
+  $opt_slave_myport=          $opt_master_myport + 2;  # and 3 4
+  $opt_ndbcluster_port=       $opt_master_myport + 5;
+  $opt_ndbcluster_port_slave= $opt_master_myport + 6;
+  $im_port=                   $opt_master_myport + 7;
+  $im_mysqld1_port=           $opt_master_myport + 8;
+  $im_mysqld2_port=           $opt_master_myport + 9;
+
+  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
+  {
+    mtr_error("MTR_BUILD_THREAD number results in a port",
+              "outside 5001 - 32767",
+              "($opt_master_myport - $opt_master_myport + 10)");
+  }
+}
+
+
 sub datadir_setup () {
 
   # Make a list of all data_dirs
@@ -1505,7 +1531,7 @@
 sub generate_cmdline_mysqldump ($) {
   my($mysqld) = @_;
   return
-    "$exe_mysqldump --no-defaults -uroot " .
+    "$exe_mysqldump --no-defaults --debug-info -uroot " .
       "--port=$mysqld->{'port'} " .
       "--socket=$mysqld->{'path_sock'} --password=";
 }
@@ -1601,7 +1627,8 @@
   if ( $source_dist )
   {
     push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
-                            "$glob_basedir/libmysql_r/.libs/");
+                            "$glob_basedir/libmysql_r/.libs/",
+                            "$glob_basedir/zlib.libs/");
   }
   else
   {
@@ -1680,7 +1707,7 @@
   $ENV{'IM_PATH_SOCK'}=       $instance_manager->{path_sock};
   $ENV{'IM_USERNAME'}=        $instance_manager->{admin_login};
   $ENV{'IM_PASSWORD'}=        $instance_manager->{admin_password};
-  $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
+  $ENV{MTR_BUILD_THREAD}=      $opt_mtr_build_thread;
 
   $ENV{'EXE_MYSQL'}=          $exe_mysql;
 
@@ -1741,7 +1768,7 @@
   # Setup env so childs can execute mysqlcheck
   # ----------------------------------------------------
   my $cmdline_mysqlcheck=
-    "$exe_mysqlcheck --no-defaults -uroot " .
+    "$exe_mysqlcheck --no-defaults --debug-info -uroot " .
     "--port=$master->[0]->{'port'} " .
     "--socket=$master->[0]->{'path_sock'} --password=";
 
@@ -1792,7 +1819,7 @@
   # Setup env so childs can execute mysqlimport
   # ----------------------------------------------------
   my $cmdline_mysqlimport=
-    "$exe_mysqlimport -uroot " .
+    "$exe_mysqlimport --debug-info -uroot " .
     "--port=$master->[0]->{'port'} " .
     "--socket=$master->[0]->{'path_sock'} --password=";
 
@@ -1808,7 +1835,7 @@
   # Setup env so childs can execute mysqlshow
   # ----------------------------------------------------
   my $cmdline_mysqlshow=
-    "$exe_mysqlshow -uroot " .
+    "$exe_mysqlshow --debug-info -uroot " .
     "--port=$master->[0]->{'port'} " .
     "--socket=$master->[0]->{'path_sock'} --password=";
 
@@ -1824,7 +1851,7 @@
   # ----------------------------------------------------
   my $cmdline_mysqlbinlog=
     "$exe_mysqlbinlog" .
-      " --no-defaults --local-load=$opt_tmpdir";
+      " --no-defaults --debug-info --local-load=$opt_tmpdir";
   if ( $mysql_version_id >= 50000 )
   {
     $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
@@ -1841,7 +1868,7 @@
   # Setup env so childs can execute mysql
   # ----------------------------------------------------
   my $cmdline_mysql=
-    "$exe_mysql --no-defaults --host=localhost  --user=root --password= " .
+    "$exe_mysql --no-defaults --debug-info --host=localhost  --user=root --password= " .
     "--port=$master->[0]->{'port'} " .
     "--socket=$master->[0]->{'path_sock'} ".
     "--character-sets-dir=$path_charsetsdir";
@@ -2087,6 +2114,12 @@
     }
     closedir(DIR);
   }
+
+  # Remove old log files
+  foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
+  {
+    unlink($name);
+  }
 }
 
 
@@ -2467,8 +2500,8 @@
 
 sub rm_ndbcluster_tables ($) {
   my $dir=       shift;
-  foreach my $bin ( glob("$dir/cluster/apply_status*"),
-                    glob("$dir/cluster/schema*") )
+  foreach my $bin ( glob("$dir/mysql/apply_status*"),
+                    glob("$dir/mysql/schema*"))
   {
     unlink($bin);
   }
@@ -3020,10 +3053,6 @@
   # Save info from this testcase run to mysqltest.log
   mtr_appendfile_to_file($path_timefile, $path_mysqltest_log)
     if -f $path_timefile;
-
-  # Remove the file that mysqltest writes info to
-  unlink($path_timefile);
-
 }
 
 
@@ -3031,14 +3060,14 @@
 {
   my ($tinfo)= @_;
 
-  # Open mysqltest.log
+  # Open mysqltest-time
   my $F= IO::File->new($path_timefile) or
     mtr_error("can't open file \"$path_timefile\": $!");
   my $reason;
 
   while ( my $line= <$F> )
   {
-    # Look for "reason: <reason fo skiping test>"
+    # Look for "reason: <reason for skipping test>"
     if ( $line =~ /reason: (.*)/ )
     {
       $reason= $1;
@@ -3173,6 +3202,9 @@
 
     my $res= run_mysqltest($tinfo);
     mtr_report_test_name($tinfo);
+
+    do_after_run_mysqltest($tinfo);
+
     if ( $res == 0 )
     {
       mtr_report_test_passed($tinfo);
@@ -3206,10 +3238,11 @@
 	"mysqltest returned unexpected code $res, it has probably crashed";
       report_failure_and_restart($tinfo);
     }
-
-    do_after_run_mysqltest($tinfo);
   }
 
+  # Remove the file that mysqltest writes info to
+  unlink($path_timefile);
+
   # ----------------------------------------------------------------------
   # Stop Instance Manager if we are processing an IM-test case.
   # ----------------------------------------------------------------------
@@ -4138,12 +4171,12 @@
 	# tables ok FIXME This is a workaround so that only one mysqld
 	# create the tables
 	if ( ! sleep_until_file_created(
-		  "$master->[0]->{'path_myddir'}/cluster/apply_status.ndb",
+		  "$master->[0]->{'path_myddir'}/mysql/apply_status.ndb",
 					$master->[0]->{'start_timeout'},
 					$master->[0]->{'pid'}))
 	{
 
-	  $tinfo->{'comment'}= "Failed to create 'cluster/apply_status' table";
+	  $tinfo->{'comment'}= "Failed to create 'mysql/apply_status' table";
 	  return 1;
 	}
       }
@@ -4342,6 +4375,7 @@
   mtr_add_arg($args, "--skip-safemalloc");
   mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir);
   mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
+  mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
 
   if ($tinfo->{'component_id'} eq 'im')
   {
@@ -4791,6 +4825,8 @@
   slave_port=PORT       Specify the port number used by the first slave
   ndbcluster-port=PORT  Specify the port number used by cluster
   ndbcluster-port-slave=PORT  Specify the port number used by slave cluster
+  mtr-build-thread=#    Specify unique collection of ports. Can also be set by
+                        setting the environment variable MTR_BUILD_THREAD.
 
 Options for test case authoring
 
@@ -4869,4 +4905,3 @@
   mtr_exit(1);
 
 }
-

--- 1.217/mysql-test/t/disabled.def	2006-11-29 15:44:18 +01:00
+++ 1.218/mysql-test/t/disabled.def	2006-11-29 15:44:18 +01:00
@@ -28,7 +28,6 @@
 rpl_ndb_innodb2ndb       : Bug #19710  Cluster replication to partition table fails on
DELETE FROM statement
 rpl_ndb_myisam2ndb       : Bug #19710  Cluster replication to partition table fails on
DELETE FROM statement
 rpl_row_blob_innodb      : BUG#18980 2006-04-10 kent    Test fails randomly
-rpl_sp                   : BUG#16456 2006-02-16 jmiller
 rpl_multi_engine         : BUG#22583 2006-09-23 lars
 synchronization          : Bug#24529  	Test 'synchronization' fails on Mac pushbuild;
Also on Linux 64 bit.
 

--- 1.31/sql-common/my_time.c	2006-11-29 15:44:18 +01:00
+++ 1.32/sql-common/my_time.c	2006-11-29 15:44:18 +01:00
@@ -411,7 +411,9 @@
   if (number_of_fields < 3 ||
       l_time->year > 9999 || l_time->month > 12 ||
       l_time->day > 31 || l_time->hour > 23 ||
-      l_time->minute > 59 || l_time->second > 59)
+      l_time->minute > 59 || l_time->second > 59 ||
+      (l_time->year == 0 && l_time->month == 0 && l_time->day ==
0 && 
+       (l_time->hour != 0 || l_time->minute != 0 || l_time->second != 0)))
   {
     /* Only give warning for a zero date if there is some garbage after */
     if (!not_zero_date)                         /* If zero date */
@@ -780,7 +782,7 @@
 */
 my_time_t
 my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone,
-                  bool *in_dst_time_gap)
+                  my_bool *in_dst_time_gap)
 {
   uint loop;
   time_t tmp= 0;

--- 1.372/sql/ha_ndbcluster.cc	2006-11-29 15:44:18 +01:00
+++ 1.373/sql/ha_ndbcluster.cc	2006-11-29 15:44:18 +01:00
@@ -413,7 +413,8 @@
     thd_ndb_share->stat.no_uncommitted_rows_count= 0;
     thd_ndb_share->stat.records= ~(ha_rows)0;
   }
-  DBUG_PRINT("exit", ("thd_ndb_share: %p  key: %p", thd_ndb_share, key));
+  DBUG_PRINT("exit", ("thd_ndb_share: 0x%lx  key: 0x%lx",
+                      (long) thd_ndb_share, (long) key));
   DBUG_RETURN(thd_ndb_share);
 }
 
@@ -761,8 +762,8 @@
         blob_ptr= (char*)"";
       }
 
-      DBUG_PRINT("value", ("set blob ptr=%p len=%u",
-                           blob_ptr, blob_len));
+      DBUG_PRINT("value", ("set blob ptr: 0x%lx  len: %u",
+                           (long) blob_ptr, blob_len));
       DBUG_DUMP("value", (char*)blob_ptr, min(blob_len, 26));
 
       if (set_blob_value)
@@ -847,8 +848,8 @@
           uint32 len= 0xffffffff;  // Max uint32
           if (ndb_blob->readData(buf, len) != 0)
             ERR_RETURN(ndb_blob->getNdbError());
-          DBUG_PRINT("info", ("[%u] offset=%u buf=%p len=%u [ptrdiff=%d]",
-                              i, offset, buf, len, (int)ptrdiff));
+          DBUG_PRINT("info", ("[%u] offset: %u  buf: 0x%lx  len=%u  [ptrdiff=%d]",
+                              i, offset, (long) buf, len, (int)ptrdiff));
           DBUG_ASSERT(len == len64);
           // Ugly hack assumes only ptr needs to be changed
           field_blob->ptr+= ptrdiff;
@@ -1171,8 +1172,8 @@
       index= dict->getIndexGlobal(index_name, *m_table);
       if (!index)
         ERR_RETURN(dict->getNdbError());
-      DBUG_PRINT("info", ("index: %p  id: %d  version: %d.%d  status: %d",
-                          index,
+      DBUG_PRINT("info", ("index: 0x%lx  id: %d  version: %d.%d  status: %d",
+                          (long) index,
                           index->getObjectId(),
                           index->getObjectVersion() & 0xFFFFFF,
                           index->getObjectVersion() >> 24,
@@ -1215,8 +1216,8 @@
       index= dict->getIndexGlobal(unique_index_name, *m_table);
       if (!index)
         ERR_RETURN(dict->getNdbError());
-      DBUG_PRINT("info", ("index: %p  id: %d  version: %d.%d  status: %d",
-                          index,
+      DBUG_PRINT("info", ("index: 0x%lx  id: %d  version: %d.%d  status: %d",
+                          (long) index,
                           index->getObjectId(),
                           index->getObjectVersion() & 0xFFFFFF,
                           index->getObjectVersion() >> 24,
@@ -2072,7 +2073,7 @@
         all pending update or delete operations should 
         be sent to NDB
       */
-      DBUG_PRINT("info", ("ops_pending: %llu", m_ops_pending));
+      DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));    
       if (m_ops_pending)
       {
         if (m_transaction_on)
@@ -2305,7 +2306,7 @@
       // Set bound if not done with this key
       if (p.key != NULL)
       {
-        DBUG_PRINT("info", ("key %d:%d offset=%d length=%d last=%d bound=%d",
+        DBUG_PRINT("info", ("key %d:%d  offset: %d  length: %d  last: %d  bound: %d",
                             j, i, tot_len, part_len, p.part_last, p.bound_type));
         DBUG_DUMP("info", (const char*)p.part_ptr, part_store_len);
 
@@ -2462,7 +2463,7 @@
     part_spec.start_part= 0;
     part_spec.end_part= m_part_info->get_tot_partitions() - 1;
     prune_partition_set(table, &part_spec);
-    DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+    DBUG_PRINT("info", ("part_spec.start_part: %u  part_spec.end_part: %u",
                         part_spec.start_part, part_spec.end_part));
     /*
       If partition pruning has found no partition in set
@@ -2658,7 +2659,7 @@
   {
     // Send rows to NDB
     DBUG_PRINT("info", ("Sending inserts to NDB, "\
-                        "rows_inserted:%d, bulk_insert_rows: %d", 
+                        "rows_inserted: %d  bulk_insert_rows: %d", 
                         (int)m_rows_inserted, (int)m_bulk_insert_rows));
 
     m_bulk_insert_not_flushed= FALSE;
@@ -3108,7 +3109,8 @@
           char* ptr;
           field_blob->get_ptr(&ptr, row_offset);
           uint32 len= field_blob->get_length(row_offset);
-          DBUG_PRINT("info",("[%u] SET ptr=%p len=%u", col_no, ptr, len));
+          DBUG_PRINT("info",("[%u] SET ptr: 0x%lx  len: %u",
+                             col_no, (long) ptr, len));
 #endif
         }
       }
@@ -3350,7 +3352,7 @@
   if (m_use_partition_function)
   {
     get_partition_set(table, buf, active_index, start_key, &part_spec);
-    DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+    DBUG_PRINT("info", ("part_spec.start_part: %u  part_spec.end_part: %u",
                         part_spec.start_part, part_spec.end_part));
     /*
       If partition pruning has found no partition in set
@@ -3480,7 +3482,7 @@
       Take over any pending transactions to the 
       deleteing/updating transaction before closing the scan    
     */
-    DBUG_PRINT("info", ("ops_pending: %llu", m_ops_pending));
+    DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));    
     if (execute_no_commit(this,trans,false) != 0) {
       no_uncommitted_rows_execute_failure();
       DBUG_RETURN(ndb_err(trans));
@@ -3876,7 +3878,7 @@
     NdbTransaction *trans= m_active_trans;
     // Send rows to NDB
     DBUG_PRINT("info", ("Sending inserts to NDB, "\
-                        "rows_inserted:%d, bulk_insert_rows: %d", 
+                        "rows_inserted: %d  bulk_insert_rows: %d", 
                         (int) m_rows_inserted, (int) m_bulk_insert_rows)); 
     m_bulk_insert_not_flushed= FALSE;
     if (m_transaction_on)
@@ -4286,8 +4288,8 @@
   while ((share= it++))
   {
     pthread_mutex_lock(&share->mutex);
-    DBUG_PRINT("info", ("Invalidate commit_count for %s, commit_count: %llu ",
-			share->key, share->commit_count));
+    DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu",
+                        share->table_name, (ulong) share->commit_count));
     share->commit_count= 0;
     share->commit_count_lock++;
     pthread_mutex_unlock(&share->mutex);
@@ -4690,8 +4692,7 @@
     my_free((char*)data, MYF(0));
     DBUG_RETURN(2);
   }
-
-  DBUG_PRINT("info", ("setFrm data=%p  len=%d", pack_data, pack_length));
+  DBUG_PRINT("info", ("setFrm data: 0x%lx  len: %d", (long) pack_data, pack_length));
   tab.setFrm(pack_data, pack_length);      
   my_free((char*)data, MYF(0));
   my_free((char*)pack_data, MYF(0));
@@ -5102,13 +5103,12 @@
 int ha_ndbcluster::add_index(TABLE *table_arg, 
                              KEY *key_info, uint num_of_keys)
 {
-  DBUG_ENTER("ha_ndbcluster::add_index");
-  DBUG_PRINT("info", ("ha_ndbcluster::add_index to table %s",
-                      table_arg->s->table_name.str));
   int error= 0;
   uint idx;
-
+  DBUG_ENTER("ha_ndbcluster::add_index");
+  DBUG_PRINT("enter", ("table %s", table_arg->s->table_name.str));
   DBUG_ASSERT(m_share->state == NSS_ALTERED);
+
   for (idx= 0; idx < num_of_keys; idx++)
   {
     KEY *key= key_info + idx;
@@ -6664,7 +6664,7 @@
 void ha_ndbcluster::print_error(int error, myf errflag)
 {
   DBUG_ENTER("ha_ndbcluster::print_error");
-  DBUG_PRINT("enter", ("error = %d", error));
+  DBUG_PRINT("enter", ("error: %d", error));
 
   if (error == HA_ERR_NO_PARTITION_FOUND)
     m_part_info->print_no_partition_found(table);
@@ -7797,7 +7797,7 @@
       get_partition_set(table, curr, active_index,
                         &multi_range_curr->start_key,
                         &part_spec);
-      DBUG_PRINT("info", ("part_spec.start_part = %u, part_spec.end_part = %u",
+      DBUG_PRINT("info", ("part_spec.start_part: %u  part_spec.end_part: %u",
                           part_spec.start_part, part_spec.end_part));
       /*
         If partition pruning has found no partition in set
@@ -8247,7 +8247,7 @@
                            &abstime);
     pthread_mutex_unlock(&LOCK_ndb_util_thread);
 #ifdef NDB_EXTRA_DEBUG_UTIL_THREAD
-    DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d",
+    DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu",
                                    ndb_cache_check_time));
 #endif
     if (abort_loop)
@@ -8325,8 +8325,8 @@
                                      ndbtab_g.get_table(), &stat) == 0)
         {
           char buff[22], buff2[22];
-          DBUG_PRINT("ndb_util_thread",
-                     ("Table: %s, commit_count: %s, rows: %s",
+          DBUG_PRINT("info",
+                     ("Table: %s  commit_count: %s  rows: %s",
                       share->key,
                       llstr(stat.commit_count, buff),
                       llstr(stat.row_count, buff2)));
@@ -9167,7 +9167,7 @@
           if (context->expecting(Item::INT_ITEM)) 
           {
             Item_int *int_item= (Item_int *) item;      
-            DBUG_PRINT("info", ("value %llu", int_item->value));
+            DBUG_PRINT("info", ("value %ld", (long) int_item->value));
             NDB_ITEM_QUALIFICATION q;
             q.value_type= Item::INT_ITEM;
             curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);

--- 1.52/mysql-test/t/alter_table.test	2006-11-29 15:44:18 +01:00
+++ 1.53/mysql-test/t/alter_table.test	2006-11-29 15:44:18 +01:00
@@ -402,6 +402,24 @@
 use test;
 drop table t1;
 
+#
+# Bug#24219 - ALTER TABLE ... RENAME TO ... , DISABLE KEYS leads to crash
+#
+--disable_warnings
+DROP TABLE IF EXISTS bug24219;
+DROP TABLE IF EXISTS bug24219_2;
+--enable_warnings
+
+CREATE TABLE bug24219 (a INT, INDEX(a));
+
+SHOW INDEX FROM bug24219;
+
+ALTER TABLE bug24219 RENAME TO bug24219_2, DISABLE KEYS;
+
+SHOW INDEX FROM bug24219_2;
+
+DROP TABLE bug24219_2;
+
 # End of 4.1 tests
 
 #

--- 1.12/mysql-test/t/limit.test	2006-11-29 15:44:18 +01:00
+++ 1.13/mysql-test/t/limit.test	2006-11-29 15:44:18 +01:00
@@ -7,7 +7,7 @@
 --enable_warnings
 
 create table t1 (a int not null default 0 primary key, b int not null default 0);
-insert into t1 () values ();		-- Testing default values
+insert into t1 () values ();		# Testing default values
 insert into t1 values (1,1),(2,1),(3,1);
 update t1 set a=4 where b=1 limit 1;
 select * from t1;

--- 1.83/mysql-test/r/query_cache.result	2006-11-29 15:44:18 +01:00
+++ 1.84/mysql-test/r/query_cache.result	2006-11-29 15:44:18 +01:00
@@ -1278,3 +1278,51 @@
 Last_query_cost	0.000000
 drop table t1;
 SET GLOBAL query_cache_size=0;
+set global query_cache_size=1024*1024;
+flush status;
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3);
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name	Value
+Qcache_hits	0
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name	Value
+Qcache_hits	1
+create table t2 like t1;
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name	Value
+Qcache_hits	2
+insert into t2 select * from t1;
+select * from t1;
+a
+1
+2
+3
+show status like 'Qcache_hits';
+Variable_name	Value
+Qcache_hits	3
+drop table t1, t2;
+create table t1(c1 int);
+create table t2(c1 int);
+create table t3(c1 int);
+create view v1 as select t3.c1 as c1 from t3,t2 where t3.c1 = t2.c1;
+start transaction;
+insert into t1(c1) select c1 from v1;
+drop table t1, t2, t3;
+drop view v1;
+set global query_cache_size=0;

--- 1.64/mysql-test/t/query_cache.test	2006-11-29 15:44:18 +01:00
+++ 1.65/mysql-test/t/query_cache.test	2006-11-29 15:44:18 +01:00
@@ -879,3 +879,32 @@
 show status like 'last_query_cost';
 drop table t1;
 SET GLOBAL query_cache_size=0;
+
+#
+# Bug #20045: Server crash on INSERT ... SELECT ... FROM non-mergeable view
+#
+set global query_cache_size=1024*1024;
+flush status;
+create table t1 (a int);
+insert into t1 (a) values (1), (2), (3);
+select * from t1;
+show status like 'Qcache_hits';
+select * from t1;
+show status like 'Qcache_hits';
+create table t2 like t1;
+select * from t1;
+show status like 'Qcache_hits';
+insert into t2 select * from t1;
+select * from t1;
+show status like 'Qcache_hits';
+drop table t1, t2;
+
+create table t1(c1 int);
+create table t2(c1 int);
+create table t3(c1 int);
+create view v1 as select t3.c1 as c1 from t3,t2 where t3.c1 = t2.c1;
+start transaction;
+insert into t1(c1) select c1 from v1;
+drop table t1, t2, t3;
+drop view v1;
+set global query_cache_size=0;

--- 1.49/scripts/mysql_fix_privilege_tables.sql	2006-11-29 15:44:18 +01:00
+++ 1.50/scripts/mysql_fix_privilege_tables.sql	2006-11-29 15:44:18 +01:00
@@ -1,13 +1,13 @@
--- This script converts any old privilege tables to privilege tables suitable
--- for this version of MySQL
+# This script converts any old privilege tables to privilege tables suitable
+# for this version of MySQL
 
--- You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
--- because these just mean that your tables are already up to date.
--- This script is safe to run even if your tables are already up to date!
-
--- On unix, you should use the mysql_fix_privilege_tables script to execute
--- this sql script.
--- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
+# You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
+# because these just mean that your tables are already up to date.
+# This script is safe to run even if your tables are already up to date!
+
+# On unix, you should use the mysql_fix_privilege_tables script to execute
+# this sql script.
+# On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
 
 set storage_engine=MyISAM;
 
@@ -27,7 +27,7 @@
 
 ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
 
--- Detect whether or not we had the Grant_priv column
+# Detect whether or not we had the Grant_priv column
 SET @hadGrantPriv:=0;
 SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';
 
@@ -35,14 +35,14 @@
 ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y')
COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT
NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL;
 ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add
References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv
enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE
utf8_general_ci NOT NULL;
 
--- Fix privileges for old tables
+# Fix privileges for old tables
 UPDATE user SET
Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv
WHERE @hadGrantPriv = 0;
 UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv
WHERE @hadGrantPriv = 0;
 UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv
WHERE @hadGrantPriv = 0;
 
---
--- The second alter changes ssl_type to new 4.0.2 format
--- Adding columns needed by GRANT .. REQUIRE (openssl)"
+#
+# The second alter changes ssl_type to new 4.0.2 format
+# Adding columns needed by GRANT .. REQUIRE (openssl)"
 
 ALTER TABLE user
 ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL,
@@ -51,9 +51,9 @@
 ADD x509_subject BLOB NOT NULL;
 ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
 
---
---  Create tables_priv and columns_priv if they don't exists
---
+#
+#  Create tables_priv and columns_priv if they don't exists
+#
 
 CREATE TABLE IF NOT EXISTS tables_priv (
   Host char(60) binary DEFAULT '' NOT NULL,
@@ -66,7 +66,7 @@
   Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci
DEFAULT '' NOT NULL,
   PRIMARY KEY (Host,Db,User,Table_name)
 ) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
+# Fix collation of set fields
 ALTER TABLE tables_priv
   modify Table_priv
set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter')
COLLATE utf8_general_ci DEFAULT '' NOT NULL,
   modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci
DEFAULT '' NOT NULL;
@@ -88,26 +88,26 @@
   Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci
DEFAULT '' NOT NULL,
   PRIMARY KEY (Host,Db,User,Table_name,Column_name)
 ) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
+# Fix collation of set fields
 ALTER TABLE columns_priv
   MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci
DEFAULT '' NOT NULL;
 
 
---
--- Name change of Type -> Column_priv from MySQL 3.22.12
---
+#
+# Name change of Type -> Column_priv from MySQL 3.22.12
+#
 
 ALTER TABLE columns_priv change Type Column_priv
set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
 
---
---  Add the new 'type' column to the func table.
---
+#
+#  Add the new 'type' column to the func table.
+#
 
 ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
 
---
---  Change the user,db and host tables to MySQL 4.0 format
---
+#
+#  Change the user,db and host tables to MySQL 4.0 format
+#
 
 # Detect whether we had Show_db_priv
 SET @hadShowDbPriv:=0;
@@ -122,22 +122,22 @@
 ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER
Execute_priv,
 ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER
Repl_slave_priv;
 
--- Convert privileges so that users have similar privileges as before
+# Convert privileges so that users have similar privileges as before
 
 UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv,
Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y',
Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND
@hadShowDbPriv = 0;
 
 
---  Add fields that can be used to limit number of questions and connections
---  for some users.
+#  Add fields that can be used to limit number of questions and connections
+#  for some users.
 ALTER TABLE user
 ADD max_questions int(11) NOT NULL DEFAULT 0 AFTER x509_subject,
 ADD max_updates   int(11) unsigned NOT NULL DEFAULT 0 AFTER max_questions,
 ADD max_connections int(11) unsigned NOT NULL DEFAULT 0 AFTER max_updates;
 
 
---
---  Add Create_tmp_table_priv and Lock_tables_priv to db and host
---
+#
+#  Add Create_tmp_table_priv and Lock_tables_priv to db and host
+#
 
 ALTER TABLE db
 ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
@@ -156,8 +156,8 @@
 alter table tables_priv comment='Table privileges';
 alter table columns_priv comment='Column privileges';
 
--- Convert all tables to UTF-8 with binary collation
--- and reset all char columns to correct width
+# Convert all tables to UTF-8 with binary collation
+# and reset all char columns to correct width
 ALTER TABLE user
   MODIFY Host char(60) NOT NULL default '',
   MODIFY User char(16) NOT NULL default '',
@@ -412,7 +412,7 @@
 Use_leap_seconds  enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
 PRIMARY KEY TzId (Time_zone_id) 
 ) CHARACTER SET utf8 comment='Time zones';
--- Make enum field case-insensitive
+# Make enum field case-insensitive
 ALTER TABLE time_zone
   MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
 
@@ -554,9 +554,9 @@
                   MODIFY comment
                          char(64) collate utf8_bin DEFAULT '' NOT NULL;
 
---
--- Create missing log tables (5.1)
---
+#
+# Create missing log tables (5.1)
+#
 
 delimiter //
 CREATE PROCEDURE create_log_tables()
@@ -704,9 +704,9 @@
 UPDATE user SET Event_priv=Super_priv WHERE @hadEventPriv = 0;
 ALTER TABLE event MODIFY name char(64) CHARACTER SET utf8 NOT NULL default '';
 
---
--- TRIGGER privilege
---
+#
+# TRIGGER privilege
+#
 
 SET @hadTriggerPriv := 0;
 SELECT @hadTriggerPriv :=1 FROM user WHERE Trigger_priv LIKE '%';
@@ -723,6 +723,8 @@
 ALTER TABLE tables_priv MODIFY Table_priv
set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create
View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
 
 UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
+
+CREATE TABLE IF NOT EXISTS binlog_index (Position BIGINT UNSIGNED NOT NULL, File
VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL,
updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT
UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
 
 # Activate the new, possible modified privilege tables
 # This should not be needed, but gives us some extra testing that the above

--- 1.10/mysql-test/r/udf.result	2006-11-29 15:44:18 +01:00
+++ 1.11/mysql-test/r/udf.result	2006-11-29 15:44:18 +01:00
@@ -194,3 +194,38 @@
 DROP FUNCTION lookup;
 DROP FUNCTION reverse_lookup;
 DROP FUNCTION avgcost;
+CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
+select
+is_const(3) as const,
+is_const(3.14) as const,
+is_const('fnord') as const,
+is_const(2+3) as const,
+is_const(rand()) as 'nc rand()',
+is_const(sin(3.14)) as const,
+is_const(upper('test')) as const;
+const	const	const	const	nc rand()	const	const
+const	const	const	const	not const	const	const
+create table bug18761 (n int);
+insert into bug18761 values (null),(2);
+select
+is_const(3) as const,
+is_const(3.14) as const,
+is_const('fnord') as const,
+is_const(2+3) as const,
+is_const(2+n) as 'nc  2+n  ',
+is_const(sin(n)) as 'nc sin(n)',
+is_const(sin(3.14)) as const,
+is_const(upper('test')) as const,
+is_const(rand()) as 'nc rand()',
+is_const(n) as 'nc   n   ',
+is_const(is_const(n)) as 'nc ic?(n)',
+is_const(is_const('c')) as const
+from
+bug18761;
+const	const	const	const	nc  2+n  	nc sin(n)	const	const	nc rand()	nc   n   	nc
ic?(n)	const
+const	const	const	const	not const	not const	const	const	not const	not const	not
const	const
+const	const	const	const	not const	not const	const	const	not const	not const	not
const	const
+drop table bug18761;
+select is_const((1,2,3));
+ERROR 21000: Operand should contain 1 column(s)
+drop function if exists is_const;

--- 1.10/mysql-test/t/udf.test	2006-11-29 15:44:18 +01:00
+++ 1.11/mysql-test/t/udf.test	2006-11-29 15:44:18 +01:00
@@ -187,4 +187,41 @@
 DROP FUNCTION reverse_lookup;
 DROP FUNCTION avgcost;
 
+#
+# Bug#18761: constant expression as UDF parameters not passed in as constant
+#
+--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
+eval CREATE FUNCTION is_const RETURNS STRING SONAME "$UDF_EXAMPLE_LIB";
 
+select
+  is_const(3) as const,
+  is_const(3.14) as const,
+  is_const('fnord') as const,
+  is_const(2+3) as const,
+  is_const(rand()) as 'nc rand()',
+  is_const(sin(3.14)) as const,
+  is_const(upper('test')) as const;
+
+create table bug18761 (n int);
+insert into bug18761 values (null),(2);
+select
+  is_const(3) as const,
+  is_const(3.14) as const,
+  is_const('fnord') as const,
+  is_const(2+3) as const,
+  is_const(2+n) as 'nc  2+n  ',
+  is_const(sin(n)) as 'nc sin(n)',
+  is_const(sin(3.14)) as const,
+  is_const(upper('test')) as const,
+  is_const(rand()) as 'nc rand()',
+  is_const(n) as 'nc   n   ',
+  is_const(is_const(n)) as 'nc ic?(n)',
+  is_const(is_const('c')) as const
+from
+  bug18761;
+drop table bug18761;
+
+--error 1241
+select is_const((1,2,3));
+
+drop function if exists is_const;

--- 1.28/mysql-test/t/mysql.test	2006-11-29 15:44:18 +01:00
+++ 1.29/mysql-test/t/mysql.test	2006-11-29 15:44:18 +01:00
@@ -52,10 +52,10 @@
 --exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
 
 # its usage to switch internally in mysql to requested charset
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ソ'; create
table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ソ'); select * from
t1;  drop table t1;"
---exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ソ'"
---exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set
character_set_client= cp932; select 'ソ'"
---exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set
character_set_client= cp932; select 'ソ'"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ツソ'; create
table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('ツソ'); select * from
t1;  drop table t1;"
+--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select 'ツソ'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set
character_set_client= cp932; select 'ツソ'"
+--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set
character_set_client= cp932; select 'ツソ'"
 
 #
 # Bug#16859 -- NULLs in columns must not truncate data as if a C-language "string".
@@ -240,5 +240,24 @@
 --replace_regex /\([0-9]*\)/(errno)/
 --error 1
 --exec $MYSQL test -e "\r  test
cyrils_superlonghostnameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
2>&1
+
+
+#
+# Bug #21412: mysql cmdline client allows backslash(es) 
+# as delimiter but can't recognize them
+#
+
+# This should work just fine...
+--exec echo "DELIMITER /" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec echo "SELECT 1/"   >> $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL             < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+
+# This should give an error...
+--exec echo "DELIMITER \\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL             < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+
+# As should this...
+--exec echo "DELIMITER \\\\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
+--exec $MYSQL             < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
 
 --echo End of 5.0 tests

--- 1.250/client/mysqltest.c	2006-11-29 15:44:18 +01:00
+++ 1.251/client/mysqltest.c	2006-11-29 15:44:18 +01:00
@@ -4201,8 +4201,9 @@
   /* List of string patterns to match in order to find paths */
   const char* paths[] = { "$MYSQL_TEST_DIR",
                           "$MYSQL_TMP_DIR",
-                          "./test/", 0 };
-  int num_paths= 3;
+                          "$MYSQLTEST_VARDIR",
+                          "./test/" };
+  int num_paths= sizeof(paths)/sizeof(char*);
   int i;
   char* p;
 
@@ -4222,6 +4223,13 @@
     else
       p= my_strdup(paths[i], MYF(MY_FAE));
 
+    /* Don't insert zero length strings in patterns array */
+    if (strlen(p) == 0)
+    {
+      my_free(p, MYF(0));
+      continue;
+    }
+
     if (insert_dynamic(&patterns, (gptr) &p))
       die(NullS);
 
@@ -4271,7 +4279,7 @@
   {
     const char** pattern= dynamic_element(&patterns, i, const char**);
     DBUG_PRINT("info", ("pattern: %s", *pattern));
-    if (strlen(*pattern) == 0) continue;
+
     /* Search for the path in string */
     while ((p= strstr(val, *pattern)))
     {
@@ -6524,7 +6532,7 @@
 {
   my_regex_t r;
   my_regmatch_t *subs;
-  char *buf_end, *replace_end;
+  char *replace_end;
   char *buf= *buf_p;
   int len;
   int buf_len, need_buf_len;
@@ -6543,8 +6551,6 @@
   res_p= buf;
 
   SECURE_REG_BUF
-
-    buf_end= buf + buf_len;
 
   if (icase)
     cflags|= REG_ICASE;

--- 1.125/mysql-test/t/mysqldump.test	2006-11-29 15:44:18 +01:00
+++ 1.126/mysql-test/t/mysqldump.test	2006-11-29 15:44:18 +01:00
@@ -1394,6 +1394,9 @@
 drop user myDB_User@localhost;
 drop database mysqldump_myDB;
 use test;
+connection default;
+disconnect root;
+disconnect user1;
 
 --echo #
 --echo # BUG#13926: --order-by-primary fails if PKEY contains quote character

--- 1.263/BitKeeper/etc/ignore	2006-11-29 15:44:18 +01:00
+++ 1.264/BitKeeper/etc/ignore	2006-11-29 15:44:18 +01:00
@@ -379,6 +379,7 @@
 client/ssl_test
 client/thimble
 client/thread_test
+client/tmp.diff
 client_debug/*
 client_release/*
 client_test
@@ -1325,10 +1326,12 @@
 mysql-test/r/slave-stopped.eval
 mysql-test/r/symlink.log
 mysql-test/r/system_mysql_db.log
+mysql-test/r/tmp.result
 mysql-test/r/udf.log
 mysql-test/share/mysql
 mysql-test/std_data/*.pem
 mysql-test/t/index_merge.load
+mysql-test/t/tmp.test
 mysql-test/var
 mysql-test/var/*
 mysql.kdevprj

--- 1.87/sql/sql_handler.cc	2006-11-29 15:44:18 +01:00
+++ 1.88/sql/sql_handler.cc	2006-11-29 15:44:18 +01:00
@@ -757,3 +757,41 @@
 
   DBUG_RETURN(0);
 }
+
+
+/*
+  Mark tables for reopen.
+
+  SYNOPSIS
+    mysql_ha_mark_tables_for_reopen()
+    thd                         Thread identifier.
+    table                       Table list to mark for reopen.
+
+  DESCRIPTION
+    For each table found in the handler hash mark it as closed
+    (ready for reopen) and end all index/table scans.
+
+  NOTE
+    The caller must lock LOCK_open.
+*/
+
+void mysql_ha_mark_tables_for_reopen(THD *thd, TABLE *table)
+{
+  DBUG_ENTER("mysql_ha_mark_tables_for_reopen");
+
+  safe_mutex_assert_owner(&LOCK_open);
+  for (; table; table= table->next)
+  {
+    TABLE_LIST *hash_tables;
+    if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash,
+                                                (byte*) table->alias,
+                                                strlen(table->alias) + 1)))
+    {
+      /* Mark table as ready for reopen. */
+      hash_tables->table= NULL;
+      /* End open index/table scans. */
+      table->file->ha_index_or_rnd_end();
+    }
+  }
+  DBUG_VOID_RETURN;
+}

--- 1.23/extra/yassl/src/ssl.cpp	2006-11-29 15:44:18 +01:00
+++ 1.24/extra/yassl/src/ssl.cpp	2006-11-29 15:44:18 +01:00
@@ -184,10 +184,22 @@
 }
 
 
+SSL_METHOD* TLSv1_1_server_method()
+{
+    return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2));
+}
+
+
+SSL_METHOD* TLSv1_1_client_method()
+{
+    return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2));
+}
+
+
 SSL_METHOD* SSLv23_server_method()
 {
     // compatibility only, no version 2 support, but does SSL 3 and TLS 1
-    return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,1), true);
+    return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,2), true);
 }
 
 
@@ -196,7 +208,7 @@
     // compatibility only, no version 2 support, but does SSL 3 and TLS 1
     // though it sends TLS1 hello not SSLv2 so SSLv3 only servers will decline
     // TODO: maybe add support to send SSLv2 hello ???
-    return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,1), true);
+    return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,2), true);
 }
 
 
@@ -407,7 +419,6 @@
     Alert alert(warning, close_notify);
     sendAlert(*ssl, alert);
     ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true);
-    ssl->useSocket().closeSocket();
 
     GetErrors().Remove();
 
@@ -415,8 +426,21 @@
 }
 
 
+/* on by default but allow user to turn off */
+long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode)
+{
+    if (mode == SSL_SESS_CACHE_OFF)
+        ctx->SetSessionCacheOff();
+
+    return SSL_SUCCESS;
+}
+
+
 SSL_SESSION* SSL_get_session(SSL* ssl)
 {
+    if (ssl->getSecurity().GetContext()->GetSessionCacheOff())
+        return 0;
+
     return GetSessions().lookup(
         ssl->getSecurity().get_connection().sessionID_);
 }
@@ -424,6 +448,9 @@
 
 int SSL_set_session(SSL* ssl, SSL_SESSION* session)
 {
+    if (ssl->getSecurity().GetContext()->GetSessionCacheOff())
+        return SSL_FAILURE;
+
     ssl->set_session(session);
     return SSL_SUCCESS;
 }
@@ -512,6 +539,19 @@
 }
 
 
+
+/* turn on yaSSL zlib compression
+   returns 0 for success, else error (not built in)
+   only need to turn on for client, becuase server on by default if built in
+   but calling for server will tell you whether it's available or not
+*/
+int SSL_set_compression(SSL* ssl)
+{
+    return ssl->SetCompression();
+}
+
+
+
 X509* SSL_get_peer_certificate(SSL* ssl)
 {
     return ssl->getCrypto().get_certManager().get_peerX509();
@@ -1359,6 +1399,56 @@
 }
 
 
+void SSL_CTX_set_default_passwd_cb(SSL_CTX* ctx, pem_password_cb cb)
+{
+    ctx->SetPasswordCb(cb);
+}
+
+
+int SSLeay_add_ssl_algorithms()  // compatibility only
+{
+    return 1;
+}
+
+
+void ERR_remove_state(unsigned long)
+{
+    GetErrors().Remove();
+}
+
+
+int ERR_GET_REASON(int l)
+{
+    return l & 0xfff;
+}
+
+
+unsigned long err_helper(bool peek = false)
+{
+    int ysError = GetErrors().Lookup(peek);
+
+    // translate cert error for libcurl, it uses OpenSSL hex code
+    switch (ysError) {
+    case TaoCrypt::SIG_OTHER_E:
+        return CERTFICATE_ERROR;
+        break;
+    default :
+        return 0;
+    }
+}
+
+
+unsigned long ERR_peek_error()
+{
+    return err_helper(true);
+}
+
+
+unsigned long ERR_get_error()
+{
+    return err_helper();
+}
+
 
     // functions for stunnel
 
@@ -1477,13 +1567,6 @@
     }
 
 
-    long SSL_CTX_set_session_cache_mode(SSL_CTX*, long)
-    {
-        // TDOD:
-        return SSL_SUCCESS;
-    }
-
-
     long SSL_CTX_set_timeout(SSL_CTX*, long)
     {
         // TDOD:
@@ -1498,12 +1581,6 @@
     }
 
 
-    void SSL_CTX_set_default_passwd_cb(SSL_CTX* ctx, pem_password_cb cb)
-    {
-        ctx->SetPasswordCb(cb);
-    }
-
-
     int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX*, const char*, int)
     {
         // TDOD:
@@ -1554,49 +1631,6 @@
         return 0;
     }
 
-
-    int SSLeay_add_ssl_algorithms()  // compatibility only
-    {
-        return 1;
-    }
-
-
-    void ERR_remove_state(unsigned long)
-    {
-        GetErrors().Remove();
-    }
-
-
-    int ERR_GET_REASON(int l)
-    {
-        return l & 0xfff;
-    }
-
-    unsigned long err_helper(bool peek = false)
-    {
-        int ysError = GetErrors().Lookup(peek);
-
-        // translate cert error for libcurl, it uses OpenSSL hex code
-        switch (ysError) {
-        case TaoCrypt::SIG_OTHER_E:
-            return CERTFICATE_ERROR;
-            break;
-        default :
-            return 0;
-        }
-    }
-
-
-    unsigned long ERR_peek_error()
-    {
-        return err_helper(true);
-    }
-
-
-    unsigned long ERR_get_error()
-    {
-        return err_helper();
-    }
 
 
     // end stunnel needs

--- 1.5/extra/yassl/taocrypt/include/algebra.hpp	2006-11-29 15:44:18 +01:00
+++ 1.6/extra/yassl/taocrypt/include/algebra.hpp	2006-11-29 15:44:18 +01:00
@@ -75,7 +75,8 @@
     typedef Integer Element;
 
     AbstractRing() : AbstractGroup() {m_mg.m_pRing = this;}
-    AbstractRing(const AbstractRing &source) :AbstractGroup() {m_mg.m_pRing = this;}
+    AbstractRing(const AbstractRing &source) : AbstractGroup()
+                                                {m_mg.m_pRing = this;}
     AbstractRing& operator=(const AbstractRing &source) {return *this;}
 
     virtual bool IsUnit(const Element &a) const =0;

--- 1.26.1.1/mysql-test/t/system_mysql_db_fix.test	2006-11-29 15:44:18 +01:00
+++ 1.29/mysql-test/t/system_mysql_db_fix30020.test	2006-11-29 15:44:18 +01:00
@@ -10,9 +10,11 @@
 
 #
 # This is the test for mysql_fix_privilege_tables
+# It checks that a system tables from mysql 3.20
+# can be upgraded to current system table format
 #
 # Note: If this test fails, don't be confused about the errors reported
-# by mysql-test-run; This shows warnings from generated by
+# by mysql-test-run This shows warnings generated by
 # mysql_fix_system_tables which should be ignored.
 # Instead, concentrate on the errors in r/system_mysql_db.reject
 
@@ -85,7 +87,7 @@
 INSERT INTO user VALUES ('localhost','',    '','N','N','N','N','N','N','N','N','N');
 
 # Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
--- system $MYSQL_FIX_SYSTEM_TABLES --database=test > /dev/null
+-- system $MYSQL_FIX_SYSTEM_TABLES --database=test >
$MYSQLTEST_VARDIR/log/system_mysql_db_fix30020.log 2>&1
 -- enable_query_log
 -- enable_result_log
 
Thread
bk commit into 5.1 tree (msvensson:1.2390)msvensson29 Nov