mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	This patch also fixes Bug#55452 "SET PASSWORD is replicated twice in RBR mode". The goal of this patch is to remove the release of metadata locks from close_thread_tables(). This is necessary to not mistakenly release the locks in the course of a multi-step operation that involves multiple close_thread_tables() or close_tables_for_reopen(). On the same token, move statement commit outside close_thread_tables(). Other cleanups: Cleanup COM_FIELD_LIST. Don't call close_thread_tables() in COM_SHUTDOWN -- there are no open tables there that can be closed (we leave the locked tables mode in THD destructor, and this close_thread_tables() won't leave it anyway). Make open_and_lock_tables() and open_and_lock_tables_derived() call close_thread_tables() upon failure. Remove the calls to close_thread_tables() that are now unnecessary. Simplify the back off condition in Open_table_context. Streamline metadata lock handling in LOCK TABLES implementation. Add asserts to ensure correct life cycle of statement transaction in a session. Remove a piece of dead code that has also become redundant after the fix for Bug 37521.
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
/* Copyright (C) 2000-2006 MySQL AB
 | 
						|
   
 | 
						|
   This program is free software; you can redistribute it and/or modify
 | 
						|
   it under the terms of the GNU General Public License as published by
 | 
						|
   the Free Software Foundation; version 2 of the License.
 | 
						|
   
 | 
						|
   This program is distributed in the hope that it will be useful,
 | 
						|
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
						|
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
						|
   GNU General Public License for more details.
 | 
						|
   
 | 
						|
   You should have received a copy of the GNU General Public License
 | 
						|
   along with this program; if not, write to the Free Software
 | 
						|
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 | 
						|
 | 
						|
 | 
						|
/* Execute DO statement */
 | 
						|
 | 
						|
#include "sql_priv.h"
 | 
						|
#include "transaction.h"
 | 
						|
#include "unireg.h"
 | 
						|
#include "sql_do.h"
 | 
						|
#include "sql_base.h"                           // setup_fields
 | 
						|
#include "sql_select.h"                         // free_underlaid_joins
 | 
						|
 | 
						|
bool mysql_do(THD *thd, List<Item> &values)
 | 
						|
{
 | 
						|
  List_iterator<Item> li(values);
 | 
						|
  Item *value;
 | 
						|
  DBUG_ENTER("mysql_do");
 | 
						|
  if (setup_fields(thd, 0, values, MARK_COLUMNS_NONE, 0, 0))
 | 
						|
    DBUG_RETURN(TRUE);
 | 
						|
  while ((value = li++))
 | 
						|
    value->val_int();
 | 
						|
  free_underlaid_joins(thd, &thd->lex->select_lex);
 | 
						|
 | 
						|
  if (thd->is_error())
 | 
						|
  {
 | 
						|
    /*
 | 
						|
      Rollback the effect of the statement, since next instruction
 | 
						|
      will clear the error and the rollback in the end of
 | 
						|
      mysql_execute_command() won't work.
 | 
						|
    */
 | 
						|
    if (! thd->in_sub_stmt)
 | 
						|
      trans_rollback_stmt(thd);
 | 
						|
    thd->clear_error(); // DO always is OK
 | 
						|
  }
 | 
						|
  my_ok(thd);
 | 
						|
  DBUG_RETURN(FALSE);
 | 
						|
}
 |