MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:klewis Date:December 28 2007 5:59am
Subject:bk commit into 6.0 tree (klewis:1.2766) BUG#33191
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of . When  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, 2007-12-27 23:58:44-06:00, klewis@klewis-mysql. +1 -0
  Bug#33191 - Serialization of delete operations where trigers are involved 
  occured in the MySQL server.  StorageInterface::store_lock() was not 
  changing the lock_type to TL_WRITE_ALLOW_WRITE because the conditional 
  statement was incorrect.  This lower lock type allows multiple threads
  to do triggered deletes in Falcon concurrently.
  The condition is now like InnoDB except for allowing concurrent truncates,
  which Falcon can do.

  storage/falcon/ha_falcon.cpp@stripped, 2007-12-27 23:58:27-06:00, klewis@klewis-mysql. +12 -5
    Bug#33191 - Serialization of delete operations where trigers are involved 
    occured in the MySQL server.  StorageInterface::store_lock() was not 
    changing the lock_type to TL_WRITE_ALLOW_WRITE because the conditional 
    statement was incorrect.  This lower lock type allows multiple threads
    to do triggered deletes in Falcon concurrently.
    The condition is now like InnoDB except for allowing concurrent truncates,
    which Falcon can do.

diff -Nrup a/storage/falcon/ha_falcon.cpp b/storage/falcon/ha_falcon.cpp
--- a/storage/falcon/ha_falcon.cpp	2007-12-19 17:26:17 -06:00
+++ b/storage/falcon/ha_falcon.cpp	2007-12-27 23:58:27 -06:00
@@ -816,13 +816,20 @@ THR_LOCK_DATA **StorageInterface::store_
 		{
 		/*
 		  Here is where we get into the guts of a row level lock.
-		  If TL_UNLOCK is set
-		  If we are not doing a LOCK TABLE or DISCARD/IMPORT
-		  TABLESPACE, then allow multiple writers
+		  MySQL server will serialize write access to tables unless 
+		  we tell it differently.  Falcon can handle concurrent changes
+		  for most operations.  But allow the server to set its own 
+		  lock type for certain SQL commands.
 		*/
 
-		if ( (lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) &&
-		     !thd_in_lock_tables(thd))
+		const uint sql_command = thd_sql_command(thd);
+		if (    (lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE)
+		    && !(thd_in_lock_tables(thd) && sql_command == SQLCOM_LOCK_TABLES)
+		    && !(thd_tablespace_op(thd))
+		    //&&  (sql_command != SQLCOM_TRUNCATE)	// we can serialize this.
+		    &&  (sql_command != SQLCOM_OPTIMIZE)
+		    &&  (sql_command != SQLCOM_CREATE_TABLE)
+		   )
 			lock_type = TL_WRITE_ALLOW_WRITE;
 
 		/*
Thread
bk commit into 6.0 tree (klewis:1.2766) BUG#33191klewis28 Dec