List:Commits« Previous MessageNext Message »
From:eugene Date:April 25 2006 11:04am
Subject:bk commit into 5.1 tree (evgen:1.2365)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of evgen. When evgen 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
  1.2365 06/04/25 13:04:39 evgen@stripped +21 -0
  Manually merged

  sql/item_sum.cc
    1.177 06/04/25 13:04:36 evgen@stripped +2 -3
    Manually merged

  mysql-test/r/rpl_deadlock_innodb.result
    1.10 06/04/25 13:04:36 evgen@stripped +0 -3
    Manually merged

  mysql-test/extra/rpl_tests/rpl_deadlock.test
    1.13 06/04/25 13:04:36 evgen@stripped +1 -2
    Manually merged

  configure.in
    1.341 06/04/25 13:04:36 evgen@stripped +0 -0
    Manually merged

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
    1.12 06/04/25 12:57:28 evgen@stripped +0 -0
    Auto merged

  storage/ndb/src/kernel/SimBlockList.cpp
    1.16 06/04/25 12:57:28 evgen@stripped +0 -0
    Auto merged

  sql/unireg.h
    1.48 06/04/25 12:57:28 evgen@stripped +0 -0
    Auto merged

  sql/sql_yacc.yy
    1.471 06/04/25 12:57:28 evgen@stripped +0 -0
    Auto merged

  sql/sql_union.cc
    1.132 06/04/25 12:57:27 evgen@stripped +0 -0
    Auto merged

  sql/sql_select.cc
    1.397 06/04/25 12:57:27 evgen@stripped +1 -1
    Auto merged

  sql/sql_parse.cc
    1.540 06/04/25 12:57:27 evgen@stripped +0 -0
    Auto merged

  sql/sql_lex.h
    1.226 06/04/25 12:57:27 evgen@stripped +0 -0
    Auto merged

  sql/lock.cc
    1.91 06/04/25 12:57:27 evgen@stripped +1 -1
    Auto merged

  sql/item_func.cc
    1.286 06/04/25 12:57:27 evgen@stripped +0 -1
    Auto merged

  mysql-test/t/rpl_stm_until.test
    1.23 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-innodb_unsafe_binlog-master.opt~9cbe1bb3d8696c5b
    1.3 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
    1.5.6.2 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp ->
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp

  storage/ndb/src/kernel/SimBlockList.cpp
    1.5.5.2 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: ndb/src/kernel/SimBlockList.cpp ->
storage/ndb/src/kernel/SimBlockList.cpp

  mysys/mf_keycache.c
    1.57 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  mysql-test/t/rpl_stm_until.test
    1.21.1.2 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: mysql-test/t/rpl_until.test -> mysql-test/t/rpl_stm_until.test

  mysql-test/t/rpl_relayrotate.test
    1.19 06/04/25 12:57:26 evgen@stripped +0 -3
    Auto merged

  mysql-test/r/rpl_deadlock_innodb.result
    1.8.1.3 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: mysql-test/r/rpl_deadlock.result ->
mysql-test/r/rpl_deadlock_innodb.result

  mysql-test/r/func_gconcat.result
    1.56 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  mysql-test/mysql-test-run.sh
    1.319 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  mysql-test/extra/rpl_tests/rpl_deadlock.test
    1.11.1.2 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: mysql-test/t/rpl_deadlock.test ->
mysql-test/extra/rpl_tests/rpl_deadlock.test

  client/mysql.cc
    1.204 06/04/25 12:57:26 evgen@stripped +0 -0
    Auto merged

  BitKeeper/deleted/.del-innodb_unsafe_binlog-master.opt~9cbe1bb3d8696c5b
    1.1.1.2 06/04/25 12:57:26 evgen@stripped +0 -0
    Merge rename: mysql-test/t/innodb_unsafe_binlog-master.opt ->
BitKeeper/deleted/.del-innodb_unsafe_binlog-master.opt~9cbe1bb3d8696c5b

# 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:	evgen
# Host:	moonbone.local
# Root:	/work/tmp_merge-5.1-new-mysql/RESYNC

--- 1.318/mysql-test/mysql-test-run.sh	2006-04-21 16:00:38 +04:00
+++ 1.319/mysql-test/mysql-test-run.sh	2006-04-25 12:57:26 +04:00
@@ -669,7 +669,9 @@
 [ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
 [ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
 [ -d $MYSQL_TEST_DIR/var/log ] || mkdir $MYSQL_TEST_DIR/var/log
-if ! test -L $MYSQL_TEST_DIR/var/std_data_ln ; then
+
+# Use 'test', not '[' as the shell builtin might not have '-L
+if test ! -L "$MYSQL_TEST_DIR/var/std_data_ln" ; then
   ln -s $MYSQL_TEST_DIR/std_data/ $MYSQL_TEST_DIR/var/std_data_ln
 fi
 

--- 1.56/mysys/mf_keycache.c	2006-03-29 18:03:56 +04:00
+++ 1.57/mysys/mf_keycache.c	2006-04-25 12:57:26 +04:00
@@ -1805,6 +1805,7 @@
     uint status;
     int page_st;
 
+    offset= (uint) (filepos & (keycache->key_cache_block_size-1));
     /* Read data in key_cache_block_size increments */
     do
     {
@@ -1814,7 +1815,6 @@
 	keycache_pthread_mutex_unlock(&keycache->cache_lock);
 	goto no_key_cache;
       }
-      offset= (uint) (filepos & (keycache->key_cache_block_size-1));
       filepos-= offset;
       read_length= length;
       set_if_smaller(read_length, keycache->key_cache_block_size-offset);
@@ -1890,6 +1890,7 @@
 #endif
       buff+= read_length;
       filepos+= read_length+offset;
+      offset= 0;
 
     } while ((length-= read_length));
     DBUG_RETURN(start);
@@ -1941,17 +1942,17 @@
     uint read_length;
     int page_st;
     int error;
+    uint offset;
 
+    offset= (uint) (filepos & (keycache->key_cache_block_size-1));
     do
     {
-      uint offset;
       keycache_pthread_mutex_lock(&keycache->cache_lock);
       if (!keycache->can_be_used)
       {
 	keycache_pthread_mutex_unlock(&keycache->cache_lock);
 	DBUG_RETURN(0);
       }
-      offset= (uint) (filepos & (keycache->key_cache_block_size-1));
       /* Read data into key cache from buff in key_cache_block_size incr. */
       filepos-= offset;
       read_length= length;
@@ -2009,6 +2010,7 @@
 
       buff+= read_length;
       filepos+= read_length+offset;
+      offset= 0;
 
     } while ((length-= read_length));
   }
@@ -2075,17 +2077,17 @@
     /* Key cache is used */
     uint read_length;
     int page_st;
+    uint offset;
 
+    offset= (uint) (filepos & (keycache->key_cache_block_size-1));
     do
     {
-      uint offset;
       keycache_pthread_mutex_lock(&keycache->cache_lock);
       if (!keycache->can_be_used)
       {
 	keycache_pthread_mutex_unlock(&keycache->cache_lock);
 	goto no_key_cache;
       }
-      offset= (uint) (filepos & (keycache->key_cache_block_size-1));
       /* Write data in key_cache_block_size increments */
       filepos-= offset;
       read_length= length;

--- 1.176/sql/item_sum.cc	2006-04-07 13:23:48 +04:00
+++ 1.177/sql/item_sum.cc	2006-04-25 13:04:36 +04:00
@@ -380,7 +380,7 @@
     field= new Field_longlong(max_length, maybe_null, name, unsigned_flag);
     break;
   case STRING_RESULT:
-    if (max_length <= 255 || !convert_blob_length)
+    if (max_length/collation.collation->mbmaxlen <= 255 || !convert_blob_length)
       return make_string_field(table);
     field= new Field_varstring(convert_blob_length, maybe_null,
                                name, table->s, collation.collation);

--- 1.90/sql/lock.cc	2006-04-05 17:00:24 +04:00
+++ 1.91/sql/lock.cc	2006-04-25 12:57:27 +04:00
@@ -78,6 +78,7 @@
 
 static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count,
 				 uint flags, TABLE **write_locked);
+static void reset_lock_data(MYSQL_LOCK *sql_lock);
 static int lock_external(THD *thd, TABLE **table,uint count);
 static int unlock_external(THD *thd, TABLE **table,uint count);
 static void print_lock_error(int error, const char *);
@@ -135,12 +136,16 @@
       */
       if (wait_if_global_read_lock(thd, 1, 1))
       {
+        /* Clear the lock type of all lock data to avoid reusage. */
+        reset_lock_data(sql_lock);
 	my_free((gptr) sql_lock,MYF(0));
 	sql_lock=0;
 	break;
-      }	
+      }
       if (thd->version != refresh_version)
       {
+        /* Clear the lock type of all lock data to avoid reusage. */
+        reset_lock_data(sql_lock);
 	my_free((gptr) sql_lock,MYF(0));
 	goto retry;
       }
@@ -150,6 +155,8 @@
     DBUG_PRINT("info", ("thd->proc_info %s", thd->proc_info));
     if (lock_external(thd, tables, count))
     {
+      /* Clear the lock type of all lock data to avoid reusage. */
+      reset_lock_data(sql_lock);
       my_free((gptr) sql_lock,MYF(0));
       sql_lock=0;
       break;
@@ -720,7 +727,10 @@
       *write_lock_used=table;
       if (table->db_stat & HA_READ_ONLY)
       {
-	my_error(ER_OPEN_AS_READONLY, MYF(0), table->alias);
+	my_error(ER_OPEN_AS_READONLY,MYF(0),table->alias);
+        /* Clear the lock type of the lock data that are stored already. */
+        sql_lock->lock_count= locks - sql_lock->locks;
+        reset_lock_data(sql_lock);
 	my_free((gptr) sql_lock,MYF(0));
 	DBUG_RETURN(0);
       }
@@ -742,6 +752,48 @@
 	(*org_locks)->debug_print_param= (void *) table;
   }
   DBUG_RETURN(sql_lock);
+}
+
+
+/*
+  Reset lock type in lock data.
+
+  SYNOPSIS
+    reset_lock_data()
+      sql_lock                  The MySQL lock.
+
+  DESCRIPTION
+
+    After a locking error we want to quit the locking of the table(s).
+    The test case in the bug report for Bug #18544 has the following
+    cases: 1. Locking error in lock_external() due to InnoDB timeout.
+    2. Locking error in get_lock_data() due to missing write permission.
+    3. Locking error in wait_if_global_read_lock() due to lock conflict.
+
+    In all these cases we have already set the lock type into the lock
+    data of the open table(s). If the table(s) are in the open table
+    cache, they could be reused with the non-zero lock type set. This
+    could lead to ignoring a different lock type with the next lock.
+
+    Clear the lock type of all lock data. This ensures that the next
+    lock request will set its lock type properly.
+
+  RETURN
+    void
+*/
+
+static void reset_lock_data(MYSQL_LOCK *sql_lock)
+{
+  THR_LOCK_DATA **ldata;
+  THR_LOCK_DATA **ldata_end;
+
+  for (ldata= sql_lock->locks, ldata_end= ldata + sql_lock->lock_count;
+       ldata < ldata_end;
+       ldata++)
+  {
+    /* Reset lock type. */
+    (*ldata)->type= TL_UNLOCK;
+  }
 }
 
 

--- 1.225/sql/sql_lex.h	2006-03-30 22:55:48 +04:00
+++ 1.226/sql/sql_lex.h	2006-04-25 12:57:27 +04:00
@@ -479,6 +479,7 @@
 
   void print(String *str);
 
+  bool add_fake_select_lex(THD *thd);
   void init_prepare_fake_select_lex(THD *thd);
   inline bool is_prepared() { return prepared; }
   bool change_result(select_subselect *result, select_subselect *old_result);

--- 1.539/sql/sql_parse.cc	2006-04-23 04:04:29 +04:00
+++ 1.540/sql/sql_parse.cc	2006-04-25 12:57:27 +04:00
@@ -5723,48 +5723,17 @@
   }
   else
   {
-    Name_resolution_context *outer_context;
     if (lex->current_select->order_list.first &&
!lex->current_select->braces)
     {
       my_error(ER_WRONG_USAGE, MYF(0), "UNION", "ORDER BY");
       DBUG_RETURN(1);
     }
     select_lex->include_neighbour(lex->current_select);
-    /*
-      we are not sure that we have one level of SELECTs above, so we take
-      outer_context address from first select of unit
-    */
-    outer_context=
-      select_lex->master_unit()->first_select()->context.outer_context;
-    SELECT_LEX_UNIT *unit= select_lex->master_unit();
-    SELECT_LEX *fake= unit->fake_select_lex;
-    if (!fake)
-    {
-      /*
-	as far as we included SELECT_LEX for UNION unit should have
-	fake SELECT_LEX for UNION processing
-      */
-      if (!(fake= unit->fake_select_lex= new (thd->mem_root) SELECT_LEX()))
-        DBUG_RETURN(1);
-      fake->include_standalone(unit,
-			       (SELECT_LEX_NODE**)&unit->fake_select_lex);
-      fake->select_number= INT_MAX;
-      fake->parent_lex= lex; /* Used in init_query. */
-      fake->make_empty_select();
-      fake->linkage= GLOBAL_OPTIONS_TYPE;
-      fake->select_limit= 0;
-
-      fake->context.outer_context= outer_context;
-      /* allow item list resolving in fake select for ORDER BY */
-      fake->context.resolve_in_select_list= TRUE;
-      fake->context.select_lex= fake;
-      /*
-        Remove the name resolution context of the fake select from the
-        context stack.
-       */
-      lex->pop_context();
-    }
-    select_lex->context.outer_context= outer_context;
+    SELECT_LEX_UNIT *unit= select_lex->master_unit();                              
+    if (!unit->fake_select_lex && unit->add_fake_select_lex(lex->thd))
+      DBUG_RETURN(1);
+    select_lex->context.outer_context= 
+                unit->first_select()->context.outer_context;
   }
 
   select_lex->master_unit()->global_parameters= select_lex;
@@ -6545,6 +6514,68 @@
     tables->updating=  for_update;
   }
   DBUG_VOID_RETURN;
+}
+
+
+/*
+  Create a fake SELECT_LEX for a unit
+
+  SYNOPSIS:
+    add_fake_select_lex()
+    thd			   thread handle
+
+  DESCRIPTION
+    The method create a fake SELECT_LEX object for a unit.
+    This object is created for any union construct containing a union
+    operation and also for any single select union construct of the form
+    (SELECT ... ORDER BY order_list [LIMIT n]) ORDER BY ... 
+    or of the form
+    (SELECT ... ORDER BY LIMIT n) ORDER BY ...
+  
+  NOTES
+    The object is used to retrieve rows from the temporary table
+    where the result on the union is obtained.
+
+  RETURN VALUES
+    1     on failure to create the object
+    0     on success
+*/
+
+bool st_select_lex_unit::add_fake_select_lex(THD *thd)
+{
+  SELECT_LEX *first_sl= first_select();
+  DBUG_ENTER("add_fake_select_lex");
+  DBUG_ASSERT(!fake_select_lex);
+
+  if (!(fake_select_lex= new (thd->mem_root) SELECT_LEX()))
+      DBUG_RETURN(1);
+  fake_select_lex->include_standalone(this, 
+                                      (SELECT_LEX_NODE**)&fake_select_lex);
+  fake_select_lex->select_number= INT_MAX;
+  fake_select_lex->parent_lex= thd->lex; /* Used in init_query. */
+  fake_select_lex->make_empty_select();
+  fake_select_lex->linkage= GLOBAL_OPTIONS_TYPE;
+  fake_select_lex->select_limit= 0;
+
+  fake_select_lex->context.outer_context=first_sl->context.outer_context;
+  /* allow item list resolving in fake select for ORDER BY */
+  fake_select_lex->context.resolve_in_select_list= TRUE;
+  fake_select_lex->context.select_lex= fake_select_lex;
+
+  if (!first_sl->next_select())
+  {
+    /* 
+      This works only for 
+      (SELECT ... ORDER BY list [LIMIT n]) ORDER BY order_list [LIMIT m],
+      (SELECT ... LIMIT n) ORDER BY order_list [LIMIT m]
+      just before the parser starts processing order_list
+    */ 
+    global_parameters= fake_select_lex;
+    fake_select_lex->no_table_names_allowed= 1;
+    thd->lex->current_select= fake_select_lex;
+  }
+  thd->lex->pop_context();
+  DBUG_RETURN(0);
 }
 
 

--- 1.396/sql/sql_select.cc	2006-04-04 08:04:30 +04:00
+++ 1.397/sql/sql_select.cc	2006-04-25 12:57:27 +04:00
@@ -224,7 +224,7 @@
   register SELECT_LEX *select_lex = &lex->select_lex;
   DBUG_ENTER("handle_select");
 
-  if (select_lex->next_select())
+  if (select_lex->next_select() || select_lex->master_unit()->fake_select_lex)
     res= mysql_union(thd, lex, result, &lex->unit, setup_tables_done_option);
   else
   {

--- 1.470/sql/sql_yacc.yy	2006-04-23 04:00:05 +04:00
+++ 1.471/sql/sql_yacc.yy	2006-04-25 12:57:28 +04:00
@@ -7363,14 +7363,32 @@
 	ORDER_SYM BY
         {
 	  LEX *lex=Lex;
-	  if (lex->current_select->linkage != GLOBAL_OPTIONS_TYPE &&
-	      lex->current_select->olap !=
-	      UNSPECIFIED_OLAP_TYPE)
+          SELECT_LEX *sel= lex->current_select;
+          SELECT_LEX_UNIT *unit= sel-> master_unit();
+	  if (sel->linkage != GLOBAL_OPTIONS_TYPE &&
+	      sel->olap != UNSPECIFIED_OLAP_TYPE)
 	  {
 	    my_error(ER_WRONG_USAGE, MYF(0),
                      "CUBE/ROLLUP", "ORDER BY");
 	    YYABORT;
 	  }
+          if (lex->sql_command != SQLCOM_ALTER_TABLE &&
!unit->fake_select_lex)
+          {
+            /*
+              A query of the of the form (SELECT ...) ORDER BY order_list is
+              executed in the same way as the query
+              SELECT ... ORDER BY order_list
+              unless the SELECT construct contains ORDER BY or LIMIT clauses.
+              Otherwise we create a fake SELECT_LEX if it has not been created
+              yet.
+            */
+            SELECT_LEX *first_sl= unit->first_select();
+            if (!first_sl->next_select() &&
+                (first_sl->order_list.elements || 
+                 first_sl->select_limit) &&            
+                unit->add_fake_select_lex(lex->thd))
+              YYABORT;
+          }
 	} order_list;
 
 order_list:

--- 1.131/sql/sql_union.cc	2005-12-22 07:10:57 +03:00
+++ 1.132/sql/sql_union.cc	2006-04-25 12:57:27 +04:00
@@ -202,7 +202,7 @@
   
   thd_arg->lex->current_select= sl= first_sl;
   found_rows_for_union= first_sl->options & OPTION_FOUND_ROWS;
-  is_union= test(first_sl->next_select());
+  is_union= first_sl->next_select() || fake_select_lex;
 
   /* Global option */
 

--- 1.21.1.1/mysql-test/t/rpl_until.test	2006-04-13 22:47:00 +04:00
+++ 1.23/mysql-test/t/rpl_stm_until.test	2006-04-25 12:57:26 +04:00
@@ -1,4 +1,7 @@
-source include/master-slave.inc;
+-- source include/have_binlog_format_statement.inc
+-- source include/master-slave.inc
+
+# Test is dependent on binlog positions
 
 # prepare version for substitutions
 let $VERSION=`select version()`;
@@ -19,12 +22,10 @@
 insert into t2 values (1),(2);
 insert into t2 values (3),(4);
 drop table t2;
---replace_result $VERSION VERSION
-show binlog events;
 
 # try to replicate all queries until drop of t1
 connection slave;
-start slave until master_log_file='master-bin.000001', master_log_pos=319;
+start slave until master_log_file='master-bin.000001', master_log_pos=323;
 sleep 2;
 wait_for_slave_to_stop;
 # here table should be still not deleted
@@ -43,7 +44,7 @@
 --replace_column 1 # 9 # 11 # 23 # 33 #
 show slave status;
 
-# try replicate all until second insert to t2;
+# try replicate all up to and not including the second insert to t2;
 start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
 sleep 2;
 wait_for_slave_to_stop;

--- 1.8.1.2/mysql-test/r/rpl_deadlock.result	2006-04-20 21:41:02 +04:00
+++ 1.10/mysql-test/r/rpl_deadlock_innodb.result	2006-04-25 13:04:36 +04:00
@@ -4,10 +4,10 @@
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-create table t1 (a int not null, key(a)) engine=innodb;
-create table t2 (a int not null, key(a)) engine=innodb;
-create table t3 (a int) engine=innodb;
-create table t4 (a int) engine=innodb;
+CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+CREATE TABLE t3 (a INT) ENGINE=innodb;
+CREATE TABLE t4 (a INT) ENGINE=innodb;
 show variables like 'slave_transaction_retries';
 Variable_name	Value
 slave_transaction_retries	10
@@ -78,7 +78,7 @@
 Master_SSL_Key	
 Seconds_Behind_Master	#
 stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
 begin;
 select * from t2 for update;
 a
@@ -128,7 +128,7 @@
 Seconds_Behind_Master	#
 set global max_relay_log_size=0;
 stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
 begin;
 select * from t2 for update;
 a

--- 1.11.1.1/mysql-test/t/rpl_deadlock.test	2006-04-13 22:47:00 +04:00
+++ 1.13/mysql-test/extra/rpl_tests/rpl_deadlock.test	2006-04-25 13:04:36 +04:00
@@ -10,14 +10,13 @@
 # We don't 'show status like 'slave_retried_transactions'' because this
 # is not repeatable (depends on sleeps).
 
-source include/have_innodb.inc;
-source include/master-slave.inc;
+-- source include/master-slave.inc
 
 connection master;
-create table t1 (a int not null, key(a)) engine=innodb;
-create table t2 (a int not null, key(a)) engine=innodb;
-create table t3 (a int) engine=innodb;
-create table t4 (a int) engine=innodb;
+eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
+eval CREATE TABLE t3 (a INT) ENGINE=$engine_type;
+eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
 show variables like 'slave_transaction_retries';
 sync_slave_with_master;
 
@@ -65,7 +64,7 @@
 select * from t1; # check that slave succeeded finally
 select * from t2;
 # check that no error is reported
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
 --replace_result $MASTER_MYPORT MASTER_MYPORT
 --vertical_results
 show slave status;
@@ -74,7 +73,7 @@
 # 2) Test lock wait timeout
 
 stop slave;
-change master to master_log_pos=532; # the BEGIN log event
+change master to master_log_pos=536; # the BEGIN log event
 begin;
 select * from t2 for update; # hold lock
 start slave;
@@ -84,7 +83,7 @@
 select * from t1; # check that slave succeeded finally
 select * from t2;
 # check that no error is reported
---replace_column 1 # 8 # 9 # 11 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
 --replace_result $MASTER_MYPORT MASTER_MYPORT
 --vertical_results
 show slave status;
@@ -97,7 +96,7 @@
 
 # This is really copy-paste of 2) of above
 stop slave;
-change master to master_log_pos=532;
+change master to master_log_pos=536;
 begin;
 select * from t2 for update;
 start slave;
@@ -106,7 +105,7 @@
 sync_with_master;
 select * from t1;
 select * from t2;
---replace_column 1 # 8 # 9 # 11 # 23 # 33 #
+--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
 --replace_result $MASTER_MYPORT MASTER_MYPORT
 --vertical_results
 show slave status;

--- 1.5.6.1/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2006-04-20 03:22:53 +04:00
+++ 1.12/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2006-04-25 12:57:28 +04:00
@@ -38,8 +38,8 @@
   // Records with dynamic sizes
 }//Ndbcntr::initRecords()
 
-Ndbcntr::Ndbcntr(const class Configuration & conf):
-  SimulatedBlock(NDBCNTR, conf),
+Ndbcntr::Ndbcntr(Block_context& ctx):
+  SimulatedBlock(NDBCNTR, ctx),
   cnoWaitrep6(0),
   cnoWaitrep7(0),
   c_stopRec(* this),
@@ -58,6 +58,7 @@
   addRecSignal(GSN_CNTR_START_CONF, &Ndbcntr::execCNTR_START_CONF);
   addRecSignal(GSN_CNTR_WAITREP, &Ndbcntr::execCNTR_WAITREP);
   addRecSignal(GSN_CNTR_START_REP, &Ndbcntr::execCNTR_START_REP);
+  addRecSignal(GSN_API_START_REP, &Ndbcntr::execAPI_START_REP, true);
   addRecSignal(GSN_NODE_FAILREP, &Ndbcntr::execNODE_FAILREP);
   addRecSignal(GSN_SYSTEM_ERROR , &Ndbcntr::execSYSTEM_ERROR);
   

--- 1.5.5.1/ndb/src/kernel/SimBlockList.cpp	2006-04-20 03:22:53 +04:00
+++ 1.16/storage/ndb/src/kernel/SimBlockList.cpp	2006-04-25 12:57:28 +04:00
@@ -15,6 +15,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include "SimBlockList.hpp"
+#include <Emulator.hpp>
 #include <SimulatedBlock.hpp>
 #include <Cmvmi.hpp>
 #include <Ndbfs.hpp>
@@ -31,6 +32,10 @@
 #include <DbUtil.hpp>
 #include <Suma.hpp>
 #include <Dbtux.hpp>
+#include <tsman.hpp>
+#include <lgman.hpp>
+#include <pgman.hpp>
+#include <restore.hpp>
 #include <NdbEnv.h>
 
 #ifndef VM_TRACE
@@ -65,45 +70,49 @@
 #endif
 
 void 
-SimBlockList::load(const Configuration & conf){
-  noOfBlocks = 16;
+SimBlockList::load(EmulatorData& data){
+  noOfBlocks = NO_OF_BLOCKS;
   theList = new SimulatedBlock * [noOfBlocks];
   Dbdict* dbdict = 0;
   Dbdih* dbdih = 0;
+  Pgman* pg = 0;
+  Lgman* lg = 0;
+  Tsman* ts = 0;
 
+  Block_context ctx(*data.theConfiguration, *data.m_mem_manager);
+  
   SimulatedBlock * fs = 0;
   {
     Uint32 dl;
-    const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
+    const ndb_mgm_configuration_iterator * p = 
+      ctx.m_config.getOwnConfigIterator();
     if(p && !ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) &&
dl){
-      fs = NEW_BLOCK(VoidFs)(conf);
+      fs = NEW_BLOCK(VoidFs)(ctx);
     } else { 
-      fs = NEW_BLOCK(Ndbfs)(conf);
+      fs = NEW_BLOCK(Ndbfs)(ctx);
     }
   }
   
-  theList[0]  = NEW_BLOCK(Dbacc)(conf);
-  theList[1]  = NEW_BLOCK(Cmvmi)(conf);
-  theList[2]  = fs;
-  theList[3]  = dbdict = NEW_BLOCK(Dbdict)(conf);
-  theList[4]  = dbdih = NEW_BLOCK(Dbdih)(conf);
-  theList[5]  = NEW_BLOCK(Dblqh)(conf);
-  theList[6]  = NEW_BLOCK(Dbtc)(conf);
-  theList[7]  = NEW_BLOCK(Dbtup)(conf);
-  theList[8]  = NEW_BLOCK(Ndbcntr)(conf);
-  theList[9]  = NEW_BLOCK(Qmgr)(conf);
-  theList[10] = NEW_BLOCK(Trix)(conf);
-  theList[11] = NEW_BLOCK(Backup)(conf);
-  theList[12] = NEW_BLOCK(DbUtil)(conf);
-  theList[13] = NEW_BLOCK(Suma)(conf);
-  theList[14] = 0; //NEW_BLOCK(Grep)(conf);
-  theList[15] = NEW_BLOCK(Dbtux)(conf);
-
-  // Metadata common part shared by block instances
-  ptrMetaDataCommon = new MetaData::Common(*dbdict, *dbdih);
-  for (int i = 0; i < noOfBlocks; i++)
-    if(theList[i])
-      theList[i]->setMetaDataCommon(ptrMetaDataCommon);
+  theList[0]  = pg = NEW_BLOCK(Pgman)(ctx);
+  theList[1]  = lg = NEW_BLOCK(Lgman)(ctx);
+  theList[2]  = ts = NEW_BLOCK(Tsman)(ctx, pg, lg);
+  theList[3]  = NEW_BLOCK(Dbacc)(ctx);
+  theList[4]  = NEW_BLOCK(Cmvmi)(ctx);
+  theList[5]  = fs;
+  theList[6]  = dbdict = NEW_BLOCK(Dbdict)(ctx);
+  theList[7]  = dbdih = NEW_BLOCK(Dbdih)(ctx);
+  theList[8]  = NEW_BLOCK(Dblqh)(ctx);
+  theList[9]  = NEW_BLOCK(Dbtc)(ctx);
+  theList[10] = NEW_BLOCK(Dbtup)(ctx, pg);
+  theList[11] = NEW_BLOCK(Ndbcntr)(ctx);
+  theList[12] = NEW_BLOCK(Qmgr)(ctx);
+  theList[13] = NEW_BLOCK(Trix)(ctx);
+  theList[14] = NEW_BLOCK(Backup)(ctx);
+  theList[15] = NEW_BLOCK(DbUtil)(ctx);
+  theList[16] = NEW_BLOCK(Suma)(ctx);
+  theList[17] = NEW_BLOCK(Dbtux)(ctx);
+  theList[18] = NEW_BLOCK(Restore)(ctx);
+  assert(NO_OF_BLOCKS == 19);
 }
 
 void
@@ -121,9 +130,7 @@
       }
     }
     delete [] theList;
-    delete ptrMetaDataCommon;
     theList    = 0;
     noOfBlocks = 0;
-    ptrMetaDataCommon = 0;
   }
 }

--- 1.55/mysql-test/r/func_gconcat.result	2006-04-07 13:23:48 +04:00
+++ 1.56/mysql-test/r/func_gconcat.result	2006-04-25 12:57:26 +04:00
@@ -611,6 +611,16 @@
 1
 3
 drop table t1;
+create table t1 (f1 int unsigned, f2 varchar(255));
+insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
+select f2,group_concat(f1) from t1 group by f2;
+Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max
length	Is_null	Flags	Decimals	Charsetnr
+def	test	t1	t1	f2	f2	253	255	255	Y	0	0	8
+def					group_concat(f1)	253	400	1	Y	128	0	63
+f2	group_concat(f1)
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa	1
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb	2
+drop table t1;
 set names latin1;
 create table t1 (a char, b char);
 insert into t1 values ('a', 'a'), ('a', 'b'), ('b', 'a'), ('b', 'b');
Thread
bk commit into 5.1 tree (evgen:1.2365)eugene28 Apr