List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:April 24 2006 10:02pm
Subject:bk commit into 5.1 tree (cmiller:1.2364)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller 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.2364 06/04/24 18:02:12 cmiller@zippy.(none) +9 -0
  Merge zippy.(none):/home/cmiller/work/mysql/merge/igor-merge
  into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new

  sql/item_sum.cc
    1.177 06/04/24 18:02:08 cmiller@zippy.(none) +6 -7
    Manual merge.

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
    1.12 06/04/24 17:57:13 cmiller@zippy.(none) +0 -0
    Auto merged

  storage/ndb/src/kernel/SimBlockList.cpp
    1.16 06/04/24 17:57:12 cmiller@zippy.(none) +0 -0
    Auto merged

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp
    1.5.6.2 06/04/24 17:57:12 cmiller@zippy.(none) +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/24 17:57:12 cmiller@zippy.(none) +0 -0
    Merge rename: ndb/src/kernel/SimBlockList.cpp -> storage/ndb/src/kernel/SimBlockList.cpp

  sql/unireg.h
    1.48 06/04/24 17:57:12 cmiller@zippy.(none) +0 -0
    Auto merged

  sql/sql_select.cc
    1.397 06/04/24 17:57:12 cmiller@zippy.(none) +1 -1
    Auto merged

  sql/lock.cc
    1.91 06/04/24 17:57:12 cmiller@zippy.(none) +1 -1
    Auto merged

  sql/item_func.cc
    1.286 06/04/24 17:57:12 cmiller@zippy.(none) +0 -1
    Auto merged

  mysys/mf_keycache.c
    1.57 06/04/24 17:57:12 cmiller@zippy.(none) +0 -0
    Auto merged

  mysql-test/r/func_gconcat.result
    1.56 06/04/24 17:57:12 cmiller@zippy.(none) +0 -0
    Auto merged

# 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:	cmiller
# Host:	zippy.(none)
# Root:	/home/cmiller/work/mysql/merge/mysql-5.1-new/RESYNC

--- 1.56/mysys/mf_keycache.c	2006-03-29 09:03:56 -05:00
+++ 1.57/mysys/mf_keycache.c	2006-04-24 17:57:12 -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 05:23:48 -04:00
+++ 1.177/sql/item_sum.cc	2006-04-24 18:02:08 -04:00
@@ -380,13 +380,13 @@
     field= new Field_longlong(max_length, maybe_null, name, unsigned_flag);
     break;
   case STRING_RESULT:
-    if (max_length <= 255 || !convert_blob_length)
-      return make_string_field(table);
-    field= new Field_varstring(convert_blob_length, maybe_null,
-                               name, table->s, collation.collation);
-    break;
+    if (max_length/collation.collation->mbmaxlen > 255 && convert_blob_length)
+      return new Field_varstring(convert_blob_length, maybe_null,
+                                 name, table,
+                                 collation.collation);
+    return make_string_field(table);
   case DECIMAL_RESULT:
-    field= new Field_new_decimal(max_length, maybe_null, name,
+    return new Field_new_decimal(max_length, maybe_null, name, table,
                                  decimals, unsigned_flag);
     break;
   case ROW_RESULT:

--- 1.90/sql/lock.cc	2006-04-05 09:00:24 -04:00
+++ 1.91/sql/lock.cc	2006-04-24 17:57:12 -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.5.6.1/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2006-04-19 19:22:53 -04:00
+++ 1.12/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp	2006-04-24 17:57:13 -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-19 19:22:53 -04:00
+++ 1.16/storage/ndb/src/kernel/SimBlockList.cpp	2006-04-24 17:57:12 -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 05:23:48 -04:00
+++ 1.56/mysql-test/r/func_gconcat.result	2006-04-24 17:57:12 -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 (cmiller:1.2364)Chad MILLER25 Apr