1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Backout the patch for bug#11758263.

This commit is contained in:
Rohit Kalhans
2012-02-08 12:10:55 +05:30
parent de85a60049
commit b7430d73e4
27 changed files with 26 additions and 153 deletions

View File

@ -214,8 +214,7 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list);
static void free_cache_entry(TABLE *entry);
static bool
has_write_table_with_auto_increment(TABLE_LIST *tables);
static bool
has_write_table_with_auto_increment_and_select(TABLE_LIST *tables);
uint cached_open_tables(void)
{
@ -5684,11 +5683,6 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
/* We have to emulate LOCK TABLES if we are statement needs prelocking. */
if (thd->lex->requires_prelocking())
{
if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
has_write_table_with_auto_increment_and_select(tables))
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_WRITE_AUTOINC_SELECT);
/*
A query that modifies autoinc column in sub-statement can make the
master and slave inconsistent.
@ -9086,39 +9080,6 @@ has_write_table_with_auto_increment(TABLE_LIST *tables)
return 0;
}
/*
checks if the tables have select tables in the table list and write tables
with auto-increment column.
SYNOPSIS
has_two_write_locked_tables_with_auto_increment_and_select
tables Table list
RETURN VALUES
-true if the table list has atleast one table with auto-increment column
and atleast one table to select from.
-false otherwise
*/
static bool
has_write_table_with_auto_increment_and_select(TABLE_LIST *tables)
{
bool has_select= false;
bool has_auto_increment_tables = has_write_table_with_auto_increment(tables);
for(TABLE_LIST *table= tables; table; table= table->next_global)
{
if (!table->placeholder() &&
(table->lock_type <= TL_READ_NO_INSERT))
{
has_select= true;
break;
}
}
return(has_select && has_auto_increment_tables);
}
/*
Open and lock system tables for read.