mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Initial merge result with mariaDB 10: lp:maria
This commit is contained in:
@ -61,6 +61,10 @@
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
#include "wsrep_mysqld.h"
|
||||
|
||||
#endif // WITH_WSREP
|
||||
|
||||
bool
|
||||
No_such_table_error_handler::handle_condition(THD *,
|
||||
@ -4115,7 +4119,7 @@ thr_lock_type read_lock_type_for_table(THD *thd,
|
||||
*/
|
||||
bool log_on= mysql_bin_log.is_open() && thd->variables.sql_log_bin;
|
||||
ulong binlog_format= thd->variables.binlog_format;
|
||||
if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) ||
|
||||
if ((log_on == FALSE) || (WSREP_FORMAT(binlog_format) == BINLOG_FORMAT_ROW) ||
|
||||
(table_list->table->s->table_category == TABLE_CATEGORY_LOG) ||
|
||||
(table_list->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) ||
|
||||
!(is_update_query(prelocking_ctx->sql_command) ||
|
||||
@ -5066,6 +5070,22 @@ restart:
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef WITH_WSREP
|
||||
if ((thd->lex->sql_command== SQLCOM_INSERT ||
|
||||
thd->lex->sql_command== SQLCOM_INSERT_SELECT ||
|
||||
thd->lex->sql_command== SQLCOM_REPLACE ||
|
||||
thd->lex->sql_command== SQLCOM_REPLACE_SELECT ||
|
||||
thd->lex->sql_command== SQLCOM_UPDATE ||
|
||||
thd->lex->sql_command== SQLCOM_UPDATE_MULTI ||
|
||||
thd->lex->sql_command== SQLCOM_LOAD ||
|
||||
thd->lex->sql_command== SQLCOM_DELETE) &&
|
||||
wsrep_replicate_myisam &&
|
||||
(*start)->table && (*start)->table->file->ht->db_type == DB_TYPE_MYISAM)
|
||||
{
|
||||
WSREP_TO_ISOLATION_BEGIN(NULL, NULL, (*start));
|
||||
}
|
||||
error:
|
||||
#endif
|
||||
|
||||
err:
|
||||
free_root(&new_frm_mem, MYF(0)); // Free pre-alloced block
|
||||
@ -5780,7 +5800,7 @@ bool lock_tables(THD *thd, TABLE_LIST *tables, uint count,
|
||||
We can solve these problems in mixed mode by switching to binlogging
|
||||
if at least one updated table is used by sub-statement
|
||||
*/
|
||||
if (thd->variables.binlog_format != BINLOG_FORMAT_ROW && tables &&
|
||||
if (WSREP_FORMAT(thd->variables.binlog_format) != BINLOG_FORMAT_ROW && tables &&
|
||||
has_write_table_with_auto_increment(thd->lex->first_not_own_table()))
|
||||
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS);
|
||||
}
|
||||
@ -9253,7 +9273,19 @@ bool mysql_notify_thread_having_shared_lock(THD *thd, THD *in_use,
|
||||
(e.g. see partitioning code).
|
||||
*/
|
||||
if (!thd_table->needs_reopen())
|
||||
#ifdef WITH_WSREP
|
||||
{
|
||||
signalled|= mysql_lock_abort_for_thread(thd, thd_table);
|
||||
if (thd && WSREP(thd) && wsrep_thd_is_brute_force((void *)thd))
|
||||
{
|
||||
WSREP_DEBUG("remove_table_from_cache: %llu",
|
||||
(unsigned long long) thd->real_id);
|
||||
wsrep_abort_thd((void *)thd, (void *)in_use, FALSE);
|
||||
}
|
||||
}
|
||||
#else
|
||||
signalled|= mysql_lock_abort_for_thread(thd, thd_table);
|
||||
#endif
|
||||
}
|
||||
mysql_mutex_unlock(&in_use->LOCK_thd_data);
|
||||
}
|
||||
|
Reference in New Issue
Block a user