mirror of
https://github.com/MariaDB/server.git
synced 2025-06-13 13:01:51 +03:00
References lp:1034621 - Merge up to mysql-5.5.25 level
merged codership-mysql/5.5 revisions: bzr diff -r3759..3767 merged codership-mysql/5.5 revisions: bzr diff -r3768..3771
This commit is contained in:
@ -2401,6 +2401,11 @@ mysql_execute_command(THD *thd)
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
/*
|
||||
Execute deferred events first
|
||||
*/
|
||||
if (slave_execute_deferred_events(thd))
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2447,12 +2452,33 @@ mysql_execute_command(THD *thd)
|
||||
* allow SET and SHOW queries
|
||||
*/
|
||||
if (thd->variables.wsrep_on && !thd->wsrep_applier && !wsrep_ready &&
|
||||
lex->sql_command != SQLCOM_SET_OPTION &&
|
||||
!is_show_query(lex->sql_command))
|
||||
lex->sql_command != SQLCOM_SET_OPTION &&
|
||||
!is_show_query(lex->sql_command))
|
||||
{
|
||||
#if DIRTY_HACK
|
||||
/* Dirty hack for lp:1002714 - trying to recognize mysqldump connection
|
||||
* and allow it to continue. Actuall mysqldump_magic_str may be longer
|
||||
* and is obviously version dependent and may be issued by any client
|
||||
* connection after which connection becomes non-replicating. */
|
||||
static char const mysqldump_magic_str[]=
|
||||
"SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL";
|
||||
static const size_t mysqldump_magic_str_len= sizeof(mysqldump_magic_str) -1;
|
||||
if (SQLCOM_SELECT != lex->sql_command ||
|
||||
thd->query_length() < mysqldump_magic_str_len ||
|
||||
strncmp(thd->query(), mysqldump_magic_str, mysqldump_magic_str_len))
|
||||
{
|
||||
#endif /* DIRTY_HACK */
|
||||
my_error(ER_UNKNOWN_COM_ERROR, MYF(0),
|
||||
"WSREP has not yet prepared node for application use");
|
||||
goto error;
|
||||
#if DIRTY_HACK
|
||||
}
|
||||
else
|
||||
{
|
||||
/* mysqldump connection, allow all further queries to pass */
|
||||
thd->variables.wsrep_on= FALSE;
|
||||
}
|
||||
#endif /* DIRTY_HACK */
|
||||
}
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
@ -3074,7 +3100,7 @@ end_with_restore_list:
|
||||
goto error;
|
||||
#else
|
||||
{
|
||||
if (check_global_access(thd, SUPER_ACL))
|
||||
if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
|
||||
goto error;
|
||||
res = show_binlogs(thd);
|
||||
break;
|
||||
@ -3348,8 +3374,9 @@ end_with_restore_list:
|
||||
break;
|
||||
#ifdef WITH_WSREP
|
||||
if (lex->sql_command == SQLCOM_INSERT_SELECT &&
|
||||
thd->wsrep_consistency_check)
|
||||
thd->wsrep_consistency_check == CONSISTENCY_CHECK_DECLARED)
|
||||
{
|
||||
thd->wsrep_consistency_check = CONSISTENCY_CHECK_RUNNING;
|
||||
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL);
|
||||
}
|
||||
|
||||
@ -4978,7 +5005,7 @@ finish:
|
||||
close_thread_tables(thd);
|
||||
#ifdef WITH_WSREP
|
||||
WSREP_TO_ISOLATION_END
|
||||
thd->wsrep_consistency_check= FALSE;
|
||||
thd->wsrep_consistency_check= NO_CONSISTENCY_CHECK;
|
||||
#endif /* WITH_WSREP */
|
||||
thd_proc_info(thd, 0);
|
||||
|
||||
@ -6669,6 +6696,7 @@ TABLE_LIST *st_select_lex::end_nested_join(THD *thd)
|
||||
embedded->embedding= embedding;
|
||||
join_list->push_front(embedded);
|
||||
ptr= embedded;
|
||||
embedded->lifted= 1;
|
||||
}
|
||||
else if (nested_join->join_list.elements == 0)
|
||||
{
|
||||
@ -8408,11 +8436,16 @@ int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, my_bool signal)
|
||||
THD *bf_thd = (THD *) bf_thd_ptr;
|
||||
DBUG_ENTER("wsrep_abort_thd");
|
||||
|
||||
if (WSREP(bf_thd) && victim_thd)
|
||||
if ( (WSREP(bf_thd) ||
|
||||
(WSREP_ON && bf_thd->wsrep_exec_mode == TOTAL_ORDER)) && victim_thd)
|
||||
{
|
||||
WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", (bf_thd) ?
|
||||
(long long)bf_thd->real_id : 0, (long long)victim_thd->real_id);
|
||||
ha_wsrep_abort_transaction(bf_thd, victim_thd, signal);
|
||||
}
|
||||
else
|
||||
{
|
||||
WSREP_DEBUG("wsrep_abort_thd not effective: %p %p", bf_thd, victim_thd);
|
||||
}
|
||||
|
||||
DBUG_RETURN(1);
|
||||
|
Reference in New Issue
Block a user