List:Commits« Previous MessageNext Message »
From:gkodinov Date:November 28 2006 4:14pm
Subject:bk commit into 5.1 tree (gkodinov:1.2373)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gkodinov. When gkodinov 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-28 17:14:16+01:00, gkodinov@stripped +30 -0
  Merge bk-internal:/home/bk/mysql-5.1
  into  dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE/mysql-5.1-opt
  MERGE: 1.2366.1.13

  client/mysqltest.c@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.246.1.3

  libmysql/libmysql.c@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.258.2.2

  mysql-test/r/information_schema.result@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.137.1.1

  mysql-test/t/disabled.def@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -1
    Auto merged
    MERGE: 1.212.1.3

  mysql-test/t/information_schema.test@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.87.1.1

  mysql-test/t/subselect.test@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.133.1.1

  mysql-test/t/type_newdecimal.test@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.43.1.1

  sql-common/client.c@stripped, 2006-11-28 17:14:12+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.113.1.2

  sql-common/my_time.c@stripped, 2006-11-28 17:14:12+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.28.1.1

  sql/field.cc@stripped, 2006-11-28 17:14:05+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.352.1.2

  sql/field.h@stripped, 2006-11-28 17:14:06+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.190.1.3

  sql/filesort.cc@stripped, 2006-11-28 17:14:08+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.115.1.1

  sql/handler.cc@stripped, 2006-11-28 17:14:08+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.279.1.2

  sql/item_cmpfunc.cc@stripped, 2006-11-28 17:14:08+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.226.1.2

  sql/item_func.cc@stripped, 2006-11-28 17:14:09+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.329.1.1

  sql/item_subselect.cc@stripped, 2006-11-28 17:14:09+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.131.2.1

  sql/item_sum.cc@stripped, 2006-11-28 17:14:09+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.198.1.1

  sql/item_timefunc.cc@stripped, 2006-11-28 17:14:09+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.137.1.8

  sql/mysql_priv.h@stripped, 2006-11-28 17:14:09+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.457.1.2

  sql/opt_range.cc@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.245.1.1

  sql/sql_base.cc@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.360.1.1

  sql/sql_class.h@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.326.1.3

  sql/sql_lex.cc@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.207.1.2

  sql/sql_lex.h@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.245.1.8

  sql/sql_parse.cc@stripped, 2006-11-28 17:14:10+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.595.1.1

  sql/sql_select.cc@stripped, 2006-11-28 17:14:11+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.465.1.2

  sql/sql_table.cc@stripped, 2006-11-28 17:14:11+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.372.1.2

  sql/sql_yacc.yy@stripped, 2006-11-28 17:14:11+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.514.1.4

  sql/table.cc@stripped, 2006-11-28 17:14:12+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.252.1.3

  strings/decimal.c@stripped, 2006-11-28 17:14:12+01:00, gkodinov@stripped +0 -0
    Auto merged
    MERGE: 1.73.1.1

# 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:	gkodinov
# Host:	dl145s.mysql.com
# Root:	/data0/bk/team_tree_merge/MERGE/mysql-5.1-opt/RESYNC

--- 1.261/libmysql/libmysql.c	2006-11-19 19:19:48 +01:00
+++ 1.262/libmysql/libmysql.c	2006-11-28 17:14:05 +01:00
@@ -176,16 +176,15 @@ void STDCALL mysql_server_end()
   end_embedded_server();
 #endif
   /* If library called my_init(), free memory allocated by it */
+  finish_client_errs();
   if (!org_my_init_done)
   {
     my_end(MY_DONT_FREE_DBUG);
-  /* Remove TRACING, if enabled by mysql_debug() */
+    /* Remove TRACING, if enabled by mysql_debug() */
     DBUG_POP();
   }
   else
     mysql_thread_end();
-  finish_client_errs();
-  free_charsets();
   vio_end();
   mysql_client_init= org_my_init_done= 0;
 #ifdef EMBEDDED_SERVER
@@ -2094,7 +2093,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, con
   }
   stmt->bind= stmt->params + stmt->param_count;
   stmt->state= MYSQL_STMT_PREPARE_DONE;
-  DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count));
+  DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count));
   DBUG_RETURN(0);
 }
 
@@ -2437,10 +2436,10 @@ static my_bool store_param(MYSQL_STMT *s
 {
   NET *net= &stmt->mysql->net;
   DBUG_ENTER("store_param");
-  DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu  is_null: %d",
+  DBUG_PRINT("enter",("type: %d  buffer: 0x%lx  length: %lu  is_null: %d",
 		      param->buffer_type,
-		      param->buffer ? param->buffer : "0", *param->length,
-		      *param->is_null));
+		      (long) (param->buffer ? param->buffer : NullS),
+                      *param->length, *param->is_null));
 
   if (*param->is_null)
     store_param_null(net, param);
@@ -3319,8 +3318,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *st
   MYSQL_BIND *param;
   DBUG_ENTER("mysql_stmt_send_long_data");
   DBUG_ASSERT(stmt != 0);
-  DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
-		      param_number, data, length));
+  DBUG_PRINT("enter",("param no: %d  data: 0x%lx, length : %ld",
+		      param_number, (long) data, length));
 
   /*
     We only need to check for stmt->param_count, if it's not null
@@ -4403,7 +4402,7 @@ my_bool STDCALL mysql_stmt_bind_result(M
   ulong       bind_count= stmt->field_count;
   uint        param_count= 0;
   DBUG_ENTER("mysql_stmt_bind_result");
-  DBUG_PRINT("enter",("field_count: %d", bind_count));
+  DBUG_PRINT("enter",("field_count: %lu", bind_count));
 
   if (!bind_count)
   {

--- 1.354/sql/field.cc	2006-11-19 19:19:49 +01:00
+++ 1.355/sql/field.cc	2006-11-28 17:14:05 +01:00
@@ -1237,12 +1237,6 @@ Field::Field(char *ptr_arg,uint32 length
 }
 
 
-uint Field::offset()
-{
-  return (uint) (ptr - (char*) table->record[0]);
-}
-
-
 void Field::hash(ulong *nr, ulong *nr2)
 {
   if (is_null())
@@ -8221,8 +8215,8 @@ Field_bit::do_last_null_byte() const
     bits. On systems with CHAR_BIT > 8 (not very common), the storage
     will lose the extra bits.
   */
-  DBUG_PRINT("debug", ("bit_ofs=%d, bit_len=%d, bit_ptr=%p",
-                       bit_ofs, bit_len, bit_ptr));
+  DBUG_PRINT("test", ("bit_ofs: %d, bit_len: %d  bit_ptr: 0x%lx",
+                      bit_ofs, bit_len, (long) bit_ptr));
   uchar *result;
   if (bit_len == 0)
     result= null_ptr;

--- 1.193/sql/field.h	2006-11-19 19:19:49 +01:00
+++ 1.194/sql/field.h	2006-11-28 17:14:06 +01:00
@@ -239,7 +239,7 @@ public:
    */
   my_size_t last_null_byte() const {
     my_size_t bytes= do_last_null_byte();
-    DBUG_PRINT("debug", ("last_null_byte() ==> %d", bytes));
+    DBUG_PRINT("debug", ("last_null_byte() ==> %ld", (long) bytes));
     DBUG_ASSERT(bytes <= table->s->null_bytes);
     return bytes;
   }
@@ -342,7 +342,10 @@ public:
   virtual int pack_cmp(const char *b, uint key_length_arg,
                        my_bool insert_or_update)
   { return cmp(ptr,b); }
-  uint offset();			// Should be inline ...
+  uint offset(byte *record)
+  {
+    return (uint) (ptr - (char*) record);
+  }
   void copy_from_tmp(int offset);
   uint fill_cache_field(struct st_cache_field *copy);
   virtual bool get_date(TIME *ltime,uint fuzzydate);

--- 1.117/sql/filesort.cc	2006-11-22 11:50:47 +01:00
+++ 1.118/sql/filesort.cc	2006-11-28 17:14:08 +01:00
@@ -315,7 +315,7 @@ ha_rows filesort(THD *thd, TABLE *table,
   DBUG_POP();			/* Ok to DBUG */
 #endif
   memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO));
-  DBUG_PRINT("exit",("records: %ld",records));
+  DBUG_PRINT("exit",("records: %ld", (long) records));
   DBUG_RETURN(error ? HA_POS_ERROR : records);
 } /* filesort */
 

--- 1.281/sql/handler.cc	2006-11-19 19:19:49 +01:00
+++ 1.282/sql/handler.cc	2006-11-28 17:14:08 +01:00
@@ -1513,7 +1513,7 @@ int handler::ha_open(TABLE *table_arg, c
   DBUG_ENTER("handler::ha_open");
   DBUG_PRINT("enter",
              ("name: %s  db_type: %d  db_stat: %d  mode: %d  lock_test: %d",
-              name, table_share->db_type, table_arg->db_stat, mode,
+              name, ht->db_type, table_arg->db_stat, mode,
               test_if_locked));
 
   table= table_arg;
@@ -1654,7 +1654,7 @@ prev_insert_id(ulonglong nr, struct syst
     */
     DBUG_PRINT("info",("auto_increment: nr: %lu cannot honour "
                        "auto_increment_offset: %lu",
-                       nr, variables->auto_increment_offset));
+                       (ulong) nr, variables->auto_increment_offset));
     return nr;
   }
   if (variables->auto_increment_increment == 1)
@@ -1927,8 +1927,8 @@ int handler::update_auto_increment()
 void handler::column_bitmaps_signal()
 {
   DBUG_ENTER("column_bitmaps_signal");
-  DBUG_PRINT("info", ("read_set: 0x%lx  write_set: 0x%lx", table->read_set,
-                      table->write_set));
+  DBUG_PRINT("info", ("read_set: 0x%lx  write_set: 0x%lx", (long) table->read_set,
+                      (long) table->write_set));
   DBUG_VOID_RETURN;
 }
 
@@ -3507,8 +3507,10 @@ namespace
   int write_locked_table_maps(THD *thd)
   {
     DBUG_ENTER("write_locked_table_maps");
-    DBUG_PRINT("enter", ("thd=%p, thd->lock=%p, thd->locked_tables=%p, thd->extra_lock",
-                         thd, thd->lock, thd->locked_tables, thd->extra_lock));
+    DBUG_PRINT("enter", ("thd: 0x%lx  thd->lock: 0x%lx  thd->locked_tables: 0x%lx  "
+                         "thd->extra_lock: 0x%lx",
+                         (long) thd, (long) thd->lock,
+                         (long) thd->locked_tables, (long) thd->extra_lock));
 
     if (thd->get_binlog_table_maps() == 0)
     {
@@ -3528,7 +3530,7 @@ namespace
              ++table_ptr)
         {
           TABLE *const table= *table_ptr;
-          DBUG_PRINT("info", ("Checking table %s", table->s->table_name));
+          DBUG_PRINT("info", ("Checking table %s", table->s->table_name.str));
           if (table->current_lock == F_WRLCK &&
               check_table_binlog_row_based(thd, table))
           {

--- 1.227/sql/item_cmpfunc.cc	2006-11-17 15:29:33 +01:00
+++ 1.228/sql/item_cmpfunc.cc	2006-11-28 17:14:08 +01:00
@@ -2261,7 +2261,7 @@ cmp_item* cmp_item_row::make_same()
 cmp_item_row::~cmp_item_row()
 {
   DBUG_ENTER("~cmp_item_row");
-  DBUG_PRINT("enter",("this: 0x%lx", this));
+  DBUG_PRINT("enter",("this: 0x%lx", (long) this));
   if (comparators)
   {
     for (uint i= 0; i < n; i++)
@@ -3093,7 +3093,7 @@ longlong Item_is_not_null_test::val_int(
   if (!used_tables_cache)
   {
     owner->was_null|= (!cached_value);
-    DBUG_PRINT("info", ("cached :%d", cached_value));
+    DBUG_PRINT("info", ("cached: %ld", (long) cached_value));
     DBUG_RETURN(cached_value);
   }
   if (args[0]->is_null())

--- 1.331/sql/item_func.cc	2006-11-19 19:19:50 +01:00
+++ 1.332/sql/item_func.cc	2006-11-28 17:14:09 +01:00
@@ -5065,7 +5065,7 @@ Item_func_sp::result_type() const
 {
   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.200/sql/item_sum.cc	2006-11-19 19:19:50 +01:00
+++ 1.201/sql/item_sum.cc	2006-11-28 17:14:09 +01:00
@@ -2950,13 +2950,14 @@ int group_concat_key_cmp_with_distinct(v
     */
     Field *field= (*field_item)->get_tmp_table_field();
     /* 
-      If field_item is a const item then either get_tp_table_field returns 0
+      If field_item is a const item then either get_tmp_table_field returns 0
       or it is an item over a const table. 
     */
     if (field && !(*field_item)->const_item())
     {
       int res;
-      uint offset= field->offset() - table->s->null_bytes;
+      uint offset= (field->offset(field->table->record[0]) - 
+                    table->s->null_bytes);
       if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
 	return res;
     }
@@ -2994,7 +2995,8 @@ int group_concat_key_cmp_with_order(void
     if (field && !item->const_item())
     {
       int res;
-      uint offset= field->offset() - table->s->null_bytes;
+      uint offset= (field->offset(field->table->record[0]) -
+                    table->s->null_bytes);
       if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
         return (*order_item)->asc ? res : -res;
     }
@@ -3062,7 +3064,8 @@ int dump_leaf_key(byte* key, element_cou
         because it contains both order and arg list fields.
       */
       Field *field= (*arg)->get_tmp_table_field();
-      uint offset= field->offset() - table->s->null_bytes;
+      uint offset= (field->offset(field->table->record[0]) -
+                    table->s->null_bytes);
       DBUG_ASSERT(offset < table->s->reclength);
       res= field->val_str(&tmp, (char *) key + offset);
     }

--- 1.140/sql/item_timefunc.cc	2006-11-27 13:00:52 +01:00
+++ 1.141/sql/item_timefunc.cc	2006-11-28 17:14:09 +01:00
@@ -1392,17 +1392,6 @@ String *Item_date::val_str(String *str)
 }
 
 
-int Item_date::save_in_field(Field *field, bool no_conversions)
-{
-  TIME ltime;
-  if (get_date(&ltime, TIME_FUZZY_DATE))
-    return set_field_to_null(field);
-  field->set_notnull();
-  field->store_time(&ltime, MYSQL_TIMESTAMP_DATE);
-  return 0;
-}
-
-
 longlong Item_date::val_int()
 {
   DBUG_ASSERT(fixed == 1);

--- 1.459/sql/mysql_priv.h	2006-11-27 13:00:52 +01:00
+++ 1.460/sql/mysql_priv.h	2006-11-28 17:14:09 +01:00
@@ -1804,7 +1804,7 @@ ha_rows filesort(THD *thd, TABLE *form,s
 		 uint s_length, SQL_SELECT *select,
 		 ha_rows max_rows, bool sort_positions,
                  ha_rows *examined_rows);
-void filesort_free_buffers(TABLE *table);
+void filesort_free_buffers(TABLE *table, bool full);
 void change_double_for_sort(double nr,byte *to);
 double my_double_round(double value, int dec, bool truncate);
 int get_quick_record(SQL_SELECT *select);

--- 1.247/sql/opt_range.cc	2006-11-27 00:47:27 +01:00
+++ 1.248/sql/opt_range.cc	2006-11-28 17:14:10 +01:00
@@ -11056,7 +11056,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::dbug_du
 #endif /* NOT_USED */
 
 /*****************************************************************************
-** Instantiate templates
+** Instantiate templates 
 *****************************************************************************/
 
 #ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION

--- 1.362/sql/sql_base.cc	2006-11-19 19:19:51 +01:00
+++ 1.363/sql/sql_base.cc	2006-11-28 17:14:10 +01:00
@@ -1087,7 +1087,7 @@ void close_thread_tables(THD *thd, bool 
   if (!lock_in_use)
     VOID(pthread_mutex_lock(&LOCK_open));
 
-  DBUG_PRINT("info", ("thd->open_tables: %p", thd->open_tables));
+  DBUG_PRINT("info", ("thd->open_tables: 0x%lx", (long) thd->open_tables));
 
   found_old_table= 0;
   while (thd->open_tables)
@@ -1177,6 +1177,16 @@ static inline uint  tmpkeyval(THD *thd, 
 void close_temporary_tables(THD *thd)
 {
   TABLE *table;
+  TABLE *next;
+ /*
+   TODO: 5.1 maintains prev link in temporary_tables
+   double-linked list so we could fix it. But it is not necessary
+   at this time when the list is being destroyed
+ */
+  TABLE *prev_table;
+  /* Assume thd->options has OPTION_QUOTE_SHOW_CREATE */
+  bool was_quote_show= TRUE;
+
   if (!thd->temporary_tables)
     return;
 
@@ -1192,12 +1202,7 @@ void close_temporary_tables(THD *thd)
     return;
   }
 
-  TABLE *next,
-    *prev_table /* TODO: 5.1 maintaines prev link in temporary_tables
-                   double-linked list so we could fix it. But it is not necessary
-                   at this time when the list is being destroyed */;
-  bool was_quote_show= true; /* to assume thd->options has OPTION_QUOTE_SHOW_CREATE */
-  // Better add "if exists", in case a RESET MASTER has been done
+  /* Better add "if exists", in case a RESET MASTER has been done */
   const char stub[]= "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ";
   uint stub_len= sizeof(stub) - 1;
   char buf[256];
@@ -1303,7 +1308,7 @@ void close_temporary_tables(THD *thd)
     }
   }
   if (!was_quote_show)
-    thd->options &= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */
+    thd->options&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */
   thd->temporary_tables=0;
 }
 
@@ -2069,7 +2074,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *
       VOID(pthread_mutex_unlock(&LOCK_open));
       DBUG_RETURN(0); // VIEW
     }
-    DBUG_PRINT("info", ("inserting table %p into the cache", table));
+    DBUG_PRINT("info", ("inserting table 0x%lx into the cache", (long) table));
     VOID(my_hash_insert(&open_cache,(byte*) table));
   }
 
@@ -2400,7 +2405,7 @@ bool table_is_used(TABLE *table, bool wa
     {
       DBUG_PRINT("info", ("share: 0x%lx  locked_by_logger: %d "
                           "locked_by_flush: %d  locked_by_name: %d "
-                          "db_stat: %u  version: %u",
+                          "db_stat: %u  version: %lu",
                           (ulong) search->s, search->locked_by_logger,
                           search->locked_by_flush, search->locked_by_name,
                           search->db_stat,

--- 1.328/sql/sql_class.h	2006-11-27 13:00:53 +01:00
+++ 1.329/sql/sql_class.h	2006-11-28 17:14:10 +01:00
@@ -844,6 +844,12 @@ public:
   struct st_mysql_data **data_tail;
   void clear_data_list();
   struct st_mysql_data *alloc_new_dataset();
+  /*
+    In embedded server it points to the statement that is processed
+    in the current query. We store some results directly in statement
+    fields then.
+  */
+  struct st_mysql_stmt *current_stmt;
 #endif
   NET	  net;				// client connection descriptor
   MEM_ROOT warn_root;			// For warnings and errors

--- 1.209/sql/sql_lex.cc	2006-11-27 13:00:53 +01:00
+++ 1.210/sql/sql_lex.cc	2006-11-28 17:14:10 +01:00
@@ -164,6 +164,7 @@ void lex_start(THD *thd, const uchar *bu
   lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc;
   lex->select_lex.group_list.empty();
   lex->select_lex.order_list.empty();
+  lex->select_lex.udf_list.empty();
   lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
   lex->sql_command= SQLCOM_END;
   lex->duplicates= DUP_ERROR;
@@ -1175,6 +1176,7 @@ void st_select_lex::init_select()
   braces= 0;
   when_list.empty();
   expr_list.empty();
+  udf_list.empty();
   interval_list.empty();
   use_index.empty();
   ftfunc_list_alloc.empty();
@@ -1188,7 +1190,7 @@ void st_select_lex::init_select()
   select_limit= 0;      /* denotes the default limit = HA_POS_ERROR */
   offset_limit= 0;      /* denotes the default offset = 0 */
   with_sum_func= 0;
-
+  is_correlated= 0;
 }
 
 /*
@@ -1382,6 +1384,8 @@ void st_select_lex::mark_as_dependent(SE
       SELECT_LEX_UNIT *munit= s->master_unit();
       munit->uncacheable|= UNCACHEABLE_DEPENDENT;
     }
+  is_correlated= TRUE;
+  this->master_unit()->item->is_correlated= TRUE;
 }
 
 bool st_select_lex_node::set_braces(bool value)      { return 1; }

--- 1.247/sql/sql_lex.h	2006-11-16 13:30:05 +01:00
+++ 1.248/sql/sql_lex.h	2006-11-28 17:14:10 +01:00
@@ -496,7 +496,7 @@ public:
   void set_thd(THD *thd_arg) { thd= thd_arg; }
 
   friend void lex_start(THD *thd, const uchar *buf, uint length);
-  friend int subselect_union_engine::exec();
+  friend int subselect_union_engine::exec(bool);
 
   List<Item> *get_unit_column_types();
 };
@@ -588,6 +588,8 @@ public:
     query processing end even if we use temporary table
   */
   bool subquery_in_having;
+  /* TRUE <=> this SELECT is correlated w.r.t. some ancestor select */
+  bool is_correlated;
   /*
     This variable is required to ensure proper work of subqueries and
     stored procedures. Generally, one should use the states of
@@ -606,6 +608,8 @@ public:
   bool no_wrap_view_item;
   /* exclude this select from check of unique_table() */
   bool exclude_from_table_unique_test;
+
+  List<udf_func>     udf_list;                  /* udf function calls stack */
 
   void init_query();
   void init_select();

--- 1.597/sql/sql_parse.cc	2006-11-27 13:00:53 +01:00
+++ 1.598/sql/sql_parse.cc	2006-11-28 17:14:10 +01:00
@@ -3511,8 +3511,12 @@ end_with_restore_list:
         if (first_table->lock_type ==  TL_WRITE_CONCURRENT_INSERT &&
             thd->lock)
         {
+          /* INSERT ... SELECT should invalidate only the very first table */
+          TABLE_LIST *save_table= first_table->next_local;
+          first_table->next_local= 0;
           mysql_unlock_tables(thd, thd->lock);
           query_cache_invalidate3(thd, first_table, 1);
+          first_table->next_local= save_table;
           thd->lock=0;
         }
         delete result;

--- 1.468/sql/sql_select.cc	2006-11-21 10:59:51 +01:00
+++ 1.469/sql/sql_select.cc	2006-11-28 17:14:11 +01:00
@@ -9557,7 +9557,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
       bool maybe_null=(*cur_group->item)->maybe_null;
       key_part_info->null_bit=0;
       key_part_info->field=  field;
-      key_part_info->offset= field->offset();
+      key_part_info->offset= field->offset(table->record[0]);
       key_part_info->length= (uint16) field->key_length();
       key_part_info->type=   (uint8) field->key_type();
       key_part_info->key_type =
@@ -9654,7 +9654,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
     {
       key_part_info->null_bit=0;
       key_part_info->field=    *reg_field;
-      key_part_info->offset=   (*reg_field)->offset();
+      key_part_info->offset=   (*reg_field)->offset(table->record[0]);
       key_part_info->length=   (uint16) (*reg_field)->pack_length();
       key_part_info->type=     (uint8) (*reg_field)->key_type();
       key_part_info->key_type =
@@ -10246,7 +10246,7 @@ do_select(JOIN *join,List<Item> *fields,
       if (join->result->send_eof())
 	rc= 1;                                  // Don't send error
     }
-    DBUG_PRINT("info",("%ld records output",join->send_records));
+    DBUG_PRINT("info",("%ld records output", (long) join->send_records));
   }
   else
     rc= -1;
@@ -12634,8 +12634,9 @@ remove_duplicates(JOIN *join, TABLE *ent
     DBUG_RETURN(0);
   }
   Field **first_field=entry->field+entry->s->fields - field_count;
-  offset= field_count ? 
-          entry->field[entry->s->fields - field_count]->offset() : 0;
+  offset= (field_count ? 
+           entry->field[entry->s->fields - field_count]->
+           offset(entry->record[0]) : 0);
   reclength=entry->s->reclength-offset;
 
   free_io_cache(entry);				// Safety

--- 1.374/sql/sql_table.cc	2006-11-27 13:00:54 +01:00
+++ 1.375/sql/sql_table.cc	2006-11-28 17:14:11 +01:00
@@ -4168,7 +4168,6 @@ static bool mysql_admin_table(THD* thd, 
       goto send_result;
     }
 
-    table->table->pos_in_table_list= table;
     if ((table->table->db_stat & HA_READ_ONLY) && open_for_modify)
     {
       char buff[FN_REFLEN + MYSQL_ERRMSG_SIZE];
@@ -6788,8 +6787,6 @@ bool mysql_checksum_table(THD *thd, TABL
     }
     else
     {
-      t->pos_in_table_list= table;
-
       if (t->file->ha_table_flags() & HA_HAS_CHECKSUM &&
 	  !(check_opt->flags & T_EXTEND))
 	protocol->store((ulonglong)t->file->checksum());

--- 1.515/sql/sql_yacc.yy	2006-11-16 13:30:06 +01:00
+++ 1.516/sql/sql_yacc.yy	2006-11-28 17:14:11 +01:00
@@ -797,8 +797,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
 
 %type <item_list>
 	expr_list udf_expr_list udf_expr_list2 when_list
-	ident_list ident_list_arg
-        expr_list_opt
+	ident_list ident_list_arg opt_expr_list
 
 %type <var_type>
         option_type opt_var_type opt_var_ident_type
@@ -6364,11 +6363,11 @@ function_call_generic:
         {
 #ifdef HAVE_DLOPEN
           udf_func *udf= 0;
+          LEX *lex= Lex;
           if (using_udf_functions &&
               (udf= find_udf($1.str, $1.length)) &&
               udf->type == UDFTYPE_AGGREGATE)
           {
-            LEX *lex= Lex;
             if (lex->current_select->inc_in_sum_expr())
             {
               yyerror(ER(ER_SYNTAX_ERROR));
@@ -6376,10 +6375,10 @@ function_call_generic:
             }
           }
           /* Temporary placing the result of find_udf in $3 */
-          $<udf>$= udf;
+          lex->current_select->udf_list.push_front(udf);
 #endif
         }
-        expr_list_opt ')'
+        udf_expr_list ')'
         {
           THD *thd= YYTHD;
           LEX *lex= Lex;
@@ -6404,9 +6403,10 @@ function_call_generic:
           {
 #ifdef HAVE_DLOPEN
             /* Retrieving the result of find_udf */
-            udf_func *udf= $<udf>3;
+            udf_func *udf;
+            LEX *lex= Lex;
 
-            if (udf)
+            if (NULL != (udf= lex->current_select->udf_list.pop()))
             {
               if (udf->type == UDFTYPE_AGGREGATE)
               {
@@ -6429,7 +6429,7 @@ function_call_generic:
             YYABORT;
           }
         }
-	| ident '.' ident '(' udf_expr_list ')'
+	| ident '.' ident '(' opt_expr_list ')'
 	{
           THD *thd= YYTHD;
           Create_qfunc *builder;
@@ -6502,12 +6502,29 @@ udf_expr_list3:
 udf_expr:
 	remember_name expr remember_end select_alias
 	{
+          udf_func *udf= Select->udf_list.head();
+          /*
+           Use Item::name as a storage for the attribute value of user
+           defined function argument. It is safe to use Item::name
+           because the syntax will not allow having an explicit name here.
+           See WL#1017 re. udf attributes.
+          */
 	  if ($4.str)
           {
+            if (!udf)
+            {
+              /*
+                Disallow using AS to specify explicit names for the arguments
+                of stored routine calls
+              */
+              yyerror(ER(ER_SYNTAX_ERROR));
+              YYABORT;
+            }
+
             $2->is_autogenerated_name= FALSE;
 	    $2->set_name($4.str, $4.length, system_charset_info);
           }
-	  else
+	  else if (udf)
 	    $2->set_name($1, (uint) ($3 - $1), YYTHD->charset());
 	  $$= $2;
 	}
@@ -6668,12 +6685,10 @@ cast_type:
         | DECIMAL_SYM float_options { $$=ITEM_CAST_DECIMAL; Lex->charset= NULL; }
 	;
 
-expr_list_opt:
-        /* empty */
-          { $$ = NULL; }
-        | expr_list
-          { $$ = $1;}
-        ;
+opt_expr_list:
+	/* empty */ { $$= NULL; }
+	| expr_list { $$= $1;}
+	;
 
 expr_list:
 	{ Select->expr_list.push_front(new List<Item>); }

--- 1.255/sql/table.cc	2006-11-27 13:00:54 +01:00
+++ 1.256/sql/table.cc	2006-11-28 17:14:12 +01:00
@@ -4092,6 +4092,23 @@ void st_table_list::reinit_before_use(TH
          embedding->nested_join->join_list.head() == embedded);
 }
 
+/*
+  Return subselect that contains the FROM list this table is taken from
+
+  SYNOPSIS
+    st_table_list::containing_subselect()
+ 
+  RETURN
+    Subselect item for the subquery that contains the FROM list
+    this table is taken from if there is any
+    0 - otherwise
+
+*/
+
+Item_subselect *st_table_list::containing_subselect()
+{    
+  return (select_lex ? select_lex->master_unit()->item : 0);
+}
 
 /*****************************************************************************
 ** Instansiate templates

--- 1.136/mysql-test/t/subselect.test	2006-11-19 19:19:49 +01:00
+++ 1.137/mysql-test/t/subselect.test	2006-11-28 17:14:05 +01:00
@@ -108,7 +108,7 @@ select * from t3 where a in (select a,b 
 -- error 1241
 select * from t3 where a in (select * from t2);
 insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10);
--- empty set
+# empty set
 select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b);
 insert into t2 values (2,10);
 select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b);
@@ -2280,11 +2280,11 @@ drop table t1;
 # Bug#19700: subselect returning BIGINT always returned it as SIGNED
 #
 CREATE TABLE t1 (i BIGINT UNSIGNED);
-INSERT INTO t1 VALUES (10000000000000000000); -- > MAX SIGNED BIGINT 9323372036854775807
+INSERT INTO t1 VALUES (10000000000000000000); # > MAX SIGNED BIGINT 9323372036854775807
 INSERT INTO t1 VALUES (1);
 
 CREATE TABLE t2 (i BIGINT UNSIGNED);
-INSERT INTO t2 VALUES (10000000000000000000); -- same as first table
+INSERT INTO t2 VALUES (10000000000000000000); # same as first table
 INSERT INTO t2 VALUES (1);
 
 /* simple test */

--- 1.135/sql/item_subselect.cc	2006-11-19 19:19:50 +01:00
+++ 1.136/sql/item_subselect.cc	2006-11-28 17:14:09 +01:00
@@ -54,7 +54,7 @@ void Item_subselect::init(st_select_lex 
 {
 
   DBUG_ENTER("Item_subselect::init");
-  DBUG_PRINT("enter", ("select_lex: 0x%x", (ulong) select_lex));
+  DBUG_PRINT("enter", ("select_lex: 0x%lx", (long) select_lex));
   unit= select_lex->master_unit();
 
   if (unit->item)

--- 1.139/mysql-test/r/information_schema.result	2006-11-21 13:44:59 +01:00
+++ 1.140/mysql-test/r/information_schema.result	2006-11-28 17:14:05 +01:00
@@ -14,7 +14,6 @@ NULL	test	latin1	latin1_swedish_ci	NULL
 select schema_name from information_schema.schemata;
 schema_name
 information_schema
-cluster
 mysql
 test
 show databases like 't%';
@@ -23,7 +22,6 @@ test
 show databases;
 Database
 information_schema
-cluster
 mysql
 test
 show databases where `database` = 't%';
@@ -35,7 +33,7 @@ create table t3(a int, KEY a_data (a));
 create table mysqltest.t4(a int);
 create table t5 (id int auto_increment primary key);
 insert into t5 values (10);
-create view v1 (c) as select table_name from information_schema.TABLES where table_schema!='cluster';
+create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status';
 select * from v1;
 c
 CHARACTER_SETS
@@ -352,7 +350,6 @@ create view v0 (c) as select schema_name
 select * from v0;
 c
 information_schema
-cluster
 mysql
 test
 explain select * from v0;
@@ -852,7 +849,7 @@ VIEWS	TABLE_NAME	select
 delete from mysql.user where user='mysqltest_4';
 delete from mysql.db where user='mysqltest_4';
 flush privileges;
-SELECT table_schema, count(*) FROM information_schema.TABLES where TABLE_SCHEMA!='cluster' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status' GROUP BY TABLE_SCHEMA;
 table_schema	count(*)
 information_schema	27
 mysql	21

--- 1.88/mysql-test/t/information_schema.test	2006-11-21 11:04:37 +01:00
+++ 1.89/mysql-test/t/information_schema.test	2006-11-28 17:14:05 +01:00
@@ -37,7 +37,7 @@ create table t3(a int, KEY a_data (a));
 create table mysqltest.t4(a int);
 create table t5 (id int auto_increment primary key);
 insert into t5 values (10);
-create view v1 (c) as select table_name from information_schema.TABLES where table_schema!='cluster';
+create view v1 (c) as select table_name from information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status';
 select * from v1;
 
 select c,table_name from v1 
@@ -528,7 +528,7 @@ flush privileges;
 # Bug #9404  information_schema: Weird error messages
 # with SELECT SUM() ... GROUP BY queries
 #
-SELECT table_schema, count(*) FROM information_schema.TABLES where TABLE_SCHEMA!='cluster' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES where table_name<>'binlog_index' AND table_name<>'apply_status' GROUP BY TABLE_SCHEMA;
 
 
 #

--- 1.45/mysql-test/t/type_newdecimal.test	2006-11-19 19:26:26 +01:00
+++ 1.46/mysql-test/t/type_newdecimal.test	2006-11-28 17:14:05 +01:00
@@ -613,7 +613,7 @@ select truncate(99.999999999999999999999
 #-- should return 99.9999999999999999999999999999999
 #
 select truncate(99999999999999999999999999999999999999,-31);
--- should return 90000000000000000000000000000000
+# should return 90000000000000000000000000000000
 #
 #-- 6. Set functions (AVG, SUM, COUNT) should work.
 #
@@ -810,7 +810,7 @@ select 1 / 0;
 #BUG#6048 Stored procedure causes operating system reboot
 #BUG#6053 DOUBLE PRECISION literal
 
--- Tests from 'traditional' mode tests
+# Tests from 'traditional' mode tests
 #
 set sql_mode='ansi,traditional';
 #

--- 1.115/sql-common/client.c	2006-11-19 19:19:54 +01:00
+++ 1.116/sql-common/client.c	2006-11-28 17:14:12 +01:00
@@ -593,7 +593,7 @@ cli_safe_read(MYSQL *mysql)
 
   if (len == packet_error || len == 0)
   {
-    DBUG_PRINT("error",("Wrong connection or packet. fd: %s  len: %d",
+    DBUG_PRINT("error",("Wrong connection or packet. fd: %s  len: %lu",
 			vio_description(net->vio),len));
 #ifdef MYSQL_SERVER
     if (net->vio && vio_was_interrupted(net->vio))
@@ -748,6 +748,29 @@ void set_mysql_error(MYSQL *mysql, int e
   DBUG_VOID_RETURN;
 }
 
+
+static void set_mysql_extended_error(MYSQL *mysql, int errcode,
+                                     const char *sqlstate,
+                                     const char *format, ...)
+{
+  NET *net;
+  va_list args;
+  DBUG_ENTER("set_mysql_extended_error");
+  DBUG_PRINT("enter", ("error :%d '%s'", errcode, format));
+  DBUG_ASSERT(mysql != 0);
+
+  net= &mysql->net;
+  net->last_errno= errcode;
+  va_start(args, format);
+  my_vsnprintf(net->last_error, sizeof(net->last_error)-1,
+               format, args);
+  va_end(args);
+  strmov(net->sqlstate, sqlstate);
+
+  DBUG_VOID_RETURN;
+}
+
+
 /*
   Flush result set sent from server
 */
@@ -845,6 +868,7 @@ static int check_license(MYSQL *mysql)
 
 void end_server(MYSQL *mysql)
 {
+  int save_errno= errno;
   DBUG_ENTER("end_server");
   if (mysql->net.vio != 0)
   {
@@ -857,6 +881,7 @@ void end_server(MYSQL *mysql)
   }
   net_end(&mysql->net);
   free_old_query(mysql);
+  errno= save_errno;
   DBUG_VOID_RETURN;
 }
 
@@ -865,7 +890,7 @@ void STDCALL
 mysql_free_result(MYSQL_RES *result)
 {
   DBUG_ENTER("mysql_free_result");
-  DBUG_PRINT("enter",("mysql_res: %lx",result));
+  DBUG_PRINT("enter",("mysql_res: 0x%lx", (long) result));
   if (result)
   {
     MYSQL *mysql= result->handle;
@@ -1363,7 +1388,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,M
     DBUG_PRINT("info",("status: %u  warning_count:  %u",
 		       mysql->server_status, mysql->warning_count));
   }
-  DBUG_PRINT("exit",("Got %d rows",result->rows));
+  DBUG_PRINT("exit", ("Got %lu rows", (ulong) result->rows));
   DBUG_RETURN(result);
 }
 
@@ -2028,7 +2053,10 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
   if (mysql->options.connect_timeout &&
       vio_poll_read(net->vio, mysql->options.connect_timeout))
   {
-    set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+    set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                             ER(CR_SERVER_LOST_EXTENDED),
+                             "waiting for initial communication packet",
+                             errno);
     goto error;
   }
 
@@ -2037,8 +2065,14 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
   */
 
   if ((pkt_length=cli_safe_read(mysql)) == packet_error)
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "reading initial communication packet",
+                               errno);
     goto error;
-
+  }
   /* Check if version of protocol matches current one */
 
   mysql->protocol_version= net->read_pos[0];
@@ -2172,7 +2206,10 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
     */
     if (my_net_write(net,buff,(uint) (end-buff)) || net_flush(net))
     {
-      set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "sending connection information to server",
+                               errno);
       goto error;
     }
 
@@ -2251,7 +2288,10 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
   /* Write authentication package */
   if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
   {
-    set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+    set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                             ER(CR_SERVER_LOST_EXTENDED),
+                             "sending authentication information",
+                             errno);
     goto error;
   }
   
@@ -2261,7 +2301,14 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
   */
 
   if ((pkt_length=cli_safe_read(mysql)) == packet_error)
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "reading authorization packet",
+                               errno);
     goto error;
+  }
 
   if (pkt_length == 1 && net->read_pos[0] == 254 && 
       mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
@@ -2273,12 +2320,22 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
     scramble_323(buff, mysql->scramble, passwd);
     if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
     {
-      set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "sending password information",
+                               errno);
       goto error;
     }
     /* Read what server thinks about out new auth message report */
     if (cli_safe_read(mysql) == packet_error)
+    {
+      if (mysql->net.last_errno == CR_SERVER_LOST)
+        set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                                 ER(CR_SERVER_LOST_EXTENDED),
+                                 "reading final connect information",
+                                 errno);
       goto error;
+    }
   }
 
   if (client_flag & CLIENT_COMPRESS)		/* We will use compression */
@@ -2289,8 +2346,15 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
     goto error;
 #endif
 
-  if (db && mysql_select_db(mysql,db))
+  if (db && mysql_select_db(mysql, db))
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+        set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                                 ER(CR_SERVER_LOST_EXTENDED),
+                                 "Setting intital database",
+                                 errno);
     goto error;
+  }
 
   if (mysql->options.init_commands)
   {
@@ -2321,7 +2385,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,cons
     goto error;
 #endif
 
-  DBUG_PRINT("exit",("Mysql handler: %lx",mysql));
+  DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
   reset_sigpipe(mysql);
   DBUG_RETURN(mysql);
 
@@ -2694,7 +2758,7 @@ int STDCALL
 mysql_real_query(MYSQL *mysql, const char *query, ulong length)
 {
   DBUG_ENTER("mysql_real_query");
-  DBUG_PRINT("enter",("handle: %lx",mysql));
+  DBUG_PRINT("enter",("handle: 0x%lx", (long) mysql));
   DBUG_PRINT("query",("Query = '%-.4096s'",query));
 
   if (mysql_send_query(mysql,query,length))

--- 1.216/mysql-test/t/disabled.def	2006-11-20 11:46:40 +01:00
+++ 1.217/mysql-test/t/disabled.def	2006-11-28 17:14:05 +01:00
@@ -16,6 +16,9 @@ concurrent_innodb        : BUG#21579 200
 ndb_autodiscover         : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 ndb_autodiscover2        : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
 ndb_load                 : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
+ndb_restore_partition    : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
+rpl_ndb_sync             : Problem with cluster/def/schema table that is in std_data/ndb_backup51; Pekka will schdule this to someone
+
 partition_03ndb          : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
 ps_7ndb                  : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
 rpl_ndb_2innodb          : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
@@ -27,6 +30,7 @@ rpl_ndb_myisam2ndb       : Bug #19710  C
 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.
 
 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
 #ndb_binlog_ddl_multi     : BUG#18976 2006-04-10 kent    CRBR: multiple binlog, second binlog may miss schema log events

--- 1.30/sql-common/my_time.c	2006-11-19 19:19:54 +01:00
+++ 1.31/sql-common/my_time.c	2006-11-28 17:14:12 +01:00
@@ -963,7 +963,7 @@ my_system_gmt_sec(const MYSQL_TIME *t_sr
   */
   if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
     tmp= 0;
-end:
+
   return (my_time_t) tmp;
 } /* my_system_gmt_sec */
 

--- 1.249/client/mysqltest.c	2006-11-19 19:19:48 +01:00
+++ 1.250/client/mysqltest.c	2006-11-28 17:14:05 +01:00
@@ -81,12 +81,13 @@ enum {
   OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_PS_PROTOCOL,
   OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
   OPT_SSL_VERIFY_SERVER_CERT, OPT_MAX_CONNECT_RETRIES,
-  OPT_MARK_PROGRESS, OPT_CHARSETS_DIR
+  OPT_MARK_PROGRESS, OPT_CHARSETS_DIR, OPT_LOG_DIR, OPT_DEBUG_INFO
 };
 
 static int record= 0, opt_sleep= -1;
 static char *db= 0, *pass= 0;
 const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./";
+const char *opt_logdir= "";
 const char *opt_include= 0, *opt_charsets_dir;
 static int port= 0;
 static int opt_max_connect_retries;
@@ -98,6 +99,7 @@ static my_bool sp_protocol= 0, sp_protoc
 static my_bool view_protocol= 0, view_protocol_enabled= 0;
 static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
 static my_bool parsing_disabled= 0;
+static my_bool info_flag;
 static my_bool display_result_vertically= FALSE, display_metadata= FALSE;
 static my_bool disable_query_log= 0, disable_result_log= 0;
 static my_bool disable_warnings= 0, disable_ps_warnings= 0;
@@ -807,7 +809,7 @@ void die(const char *fmt, ...)
 
   /* Clean up and exit */
   free_used_memory();
-  my_end(MY_CHECK_ERROR);
+  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
 
   if (!silent)
     printf("not ok\n");
@@ -847,7 +849,7 @@ void abort_not_supported_test(const char
 
   /* Clean up and exit */
   free_used_memory();
-  my_end(MY_CHECK_ERROR);
+  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
 
   if (!silent)
     printf("skipped\n");
@@ -946,8 +948,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, c
     die(NullS);
   if (!eval_result && (uint) stat_info.st_size != ds->length)
   {
-    DBUG_PRINT("info",("Size differs:  result size: %u  file size: %llu",
-		       ds->length, stat_info.st_size));
+    DBUG_PRINT("info",("Size differs:  result size: %u  file size: %lu",
+		       ds->length, (ulong) stat_info.st_size));
     DBUG_PRINT("info",("result: '%s'", ds->str));
     DBUG_RETURN(RESULT_LENGTH_MISMATCH);
   }
@@ -3130,14 +3132,14 @@ void do_connect(struct st_command *comma
     else if (!strncmp(con_options, "COMPRESS", 8))
       con_compress= 1;
     else
-      die("Illegal option to connect: %.*s", end - con_options, con_options);
+      die("Illegal option to connect: %.*s", (int) (end - con_options), con_options);
     /* Process next option */
     con_options= end;
   }
 
   if (next_con == connections_end)
-    die("Connection limit exhausted, you can have max %d connections",
-        (sizeof(connections)/sizeof(struct st_connection)));
+    die("Connection limit exhausted, you can have max %ld connections",
+        (long) (sizeof(connections)/sizeof(struct st_connection)));
 
   if (find_connection_by_name(ds_connection_name.str))
     die("Connection %s already exists", ds_connection_name.str);
@@ -3855,12 +3857,16 @@ static struct my_option my_long_options[
   {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
 #endif
+  {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
+   (gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
    (gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+  {"logdir", OPT_LOG_DIR, "Directory for log files", (gptr*) &opt_logdir,
+   (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"mark-progress", OPT_MARK_PROGRESS,
-   "Write linenumber and elapsed time to <testname>.progress ",
+   "Write linenumber and elapsed time to <testname>.progress",
    (gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0,
    GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
@@ -4141,7 +4147,8 @@ void dump_result_to_reject_file(char *bu
 void dump_result_to_log_file(char *buf, int size)
 {
   char log_file[FN_REFLEN];
-  str_to_file(fn_format(log_file, result_file_name, "", ".log",
+  str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".log",
+                        *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT:
                         MY_REPLACE_EXT),
               buf, size);
 }
@@ -4149,8 +4156,9 @@ void dump_result_to_log_file(char *buf, 
 void dump_progress(void)
 {
   char log_file[FN_REFLEN];
-  str_to_file(fn_format(log_file, result_file_name, "", ".progress",
-                        MY_REPLACE_EXT),
+  str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".progress",
+                        *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT:
+                          MY_REPLACE_EXT),
               ds_progress.str, ds_progress.length);
 }
 
@@ -5978,7 +5986,7 @@ int main(int argc, char **argv)
 
   timer_output();
   free_used_memory();
-  my_end(MY_CHECK_ERROR);
+  my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
 
   /* Yes, if we got this far the test has suceeded! Sakila smiles */
   if (!silent)

--- 1.74/strings/decimal.c	2006-11-06 08:00:24 +01:00
+++ 1.75/strings/decimal.c	2006-11-28 17:14:12 +01:00
@@ -1354,7 +1354,7 @@ int bin2decimal(char *from, decimal_t *t
     }
     from+=i;
     *buf=x ^ mask;
-    if (((ulonglong)*buf) >=  (ulonglong) powers10[intg0x+1])
+    if (((ulonglong)*buf) >= (ulonglong) powers10[intg0x+1])
       goto err;
     if (buf > to->buf || *buf != 0)
       buf++;
Thread
bk commit into 5.1 tree (gkodinov:1.2373)gkodinov28 Nov