List:Internals« Previous MessageNext Message »
From:Mats Kindahl Date:February 15 2005 10:02am
Subject:bk commit into 4.0 tree (mats:1.2024)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of mats. When mats 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2024 05/02/15 11:02:01 mats@stripped +2 -0
  Bug#7879: Using TL_READ_NO_INSERT locks instead of TL_READ locks when 
  reading tables in "complex" SQL statements. If inserts happen in a
  table being read, the statements have no serialization order and the
  change can therefore not be reproduced on the slave.

  sql/sql_yacc.yy
    1.233 05/02/15 11:01:58 mats@stripped +2 -2
    Switching to using T_READ_NO_INSERT when the binlog is used.

  sql/sql_update.cc
    1.106 05/02/15 11:01:58 mats@stripped +4 -1
    Switching to using T_READ_NO_INSERT when the binlog is used.

# 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:	mats
# Host:	romeo.kindahl.net
# Root:	/home/bk/b7879-mysql-4.0

--- 1.105/sql/sql_update.cc	2004-12-18 03:34:06 +01:00
+++ 1.106/sql/sql_update.cc	2005-02-15 11:01:58 +01:00
@@ -479,7 +479,10 @@
       else
       {
 	DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias));
-	tl->lock_type= TL_READ;
+	// If we are using the binary log, we need TL_READ_NO_INSERT to get
+	// correct order of statements. Otherwise, we use a TL_READ lock to
+	// improve performance.
+	tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ;
 	tl->updating= 0;
 	wants= SELECT_ACL;
       }

--- 1.232/sql/sql_yacc.yy	2004-10-03 01:20:46 +02:00
+++ 1.233/sql/sql_yacc.yy	2005-02-15 11:01:58 +01:00
@@ -822,7 +822,7 @@
           SELECT_SYM
           {
 	    LEX *lex=Lex;
-	    lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
+	    lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ;
 	    if (lex->sql_command == SQLCOM_INSERT)
 	      lex->sql_command= SQLCOM_INSERT_SELECT;
 	    else if (lex->sql_command == SQLCOM_REPLACE)
@@ -1532,7 +1532,7 @@
 	{
 	  LEX *lex=Lex;
 	  lex->lock_option=TL_READ;
-	   mysql_init_select(lex);
+          mysql_init_select(lex);
 	}
 	select_options select_item_list select_into select_lock_type;
 
Thread
bk commit into 4.0 tree (mats:1.2024)Mats Kindahl15 Feb