1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mariarocks

This commit is contained in:
Sergei Petrunia
2017-03-11 20:12:15 +00:00
1755 changed files with 63733 additions and 53790 deletions

View File

@@ -171,8 +171,8 @@ const LEX_STRING command_name[257]={
{ C_STRING_WITH_LEN("Set option") }, //27
{ C_STRING_WITH_LEN("Fetch") }, //28
{ C_STRING_WITH_LEN("Daemon") }, //29
{ 0, 0 }, //30
{ 0, 0 }, //31
{ C_STRING_WITH_LEN("Unimpl get tid") }, //30
{ C_STRING_WITH_LEN("Reset connection") },//31
{ 0, 0 }, //32
{ 0, 0 }, //33
{ 0, 0 }, //34
@@ -523,7 +523,9 @@ void init_update_queries(void)
server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS | CF_SKIP_WSREP_CHECK;
server_command_flags[COM_STMT_EXECUTE]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_STMT_SEND_LONG_DATA]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_REGISTER_SLAVE]= CF_SKIP_WSREP_CHECK;
server_command_flags[COM_MULTI]= CF_SKIP_WSREP_CHECK | CF_NO_COM_MULTI;
server_command_flags[CF_NO_COM_MULTI]= CF_NO_COM_MULTI;
/* Initialize the sql command flags array. */
memset(sql_command_flags, 0, sizeof(sql_command_flags));
@@ -1083,9 +1085,10 @@ void do_handle_bootstrap(THD *thd)
handle_bootstrap_impl(thd);
end:
in_bootstrap= FALSE;
delete thd;
mysql_mutex_lock(&LOCK_thread_count);
in_bootstrap = FALSE;
mysql_cond_broadcast(&COND_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
@@ -1567,7 +1570,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
wsrep_client_rollback(thd);
}
if (thd->wsrep_conflict_state== ABORTED)
/* We let COM_QUIT and COM_STMT_CLOSE to execute even if wsrep aborted. */
if (thd->wsrep_conflict_state == ABORTED &&
command != COM_STMT_CLOSE && command != COM_QUIT)
{
my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction");
WSREP_DEBUG("Deadlock error for: %s", thd->query());
@@ -1670,6 +1675,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
#endif
case COM_RESET_CONNECTION:
{
thd->status_var.com_other++;
thd->change_user();
thd->clear_error(); // if errors from rollback
my_ok(thd, 0, 0, 0);
break;
}
case COM_CHANGE_USER:
{
int auth_rc;
@@ -2306,6 +2319,7 @@ com_multi_end:
case COM_TIME: // Impossible from client
case COM_DELAYED_INSERT:
case COM_END:
case COM_UNIMPLEMENTED:
default:
my_message(ER_UNKNOWN_COM_ERROR, ER_THD(thd, ER_UNKNOWN_COM_ERROR),
MYF(0));
@@ -2317,6 +2331,12 @@ com_multi_end:
if (WSREP(thd))
{
/*
MDEV-10812
In the case of COM_QUIT/COM_STMT_CLOSE thread status should be disabled.
*/
DBUG_ASSERT((command != COM_QUIT && command != COM_STMT_CLOSE)
|| thd->get_stmt_da()->is_disabled());
/* wsrep BF abort in query exec phase */
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
do_end_of_statement= thd->wsrep_conflict_state != REPLAYING &&
@@ -3080,7 +3100,7 @@ mysql_execute_command(THD *thd)
} /* endif unlikely slave */
#endif
#ifdef WITH_WSREP
if (WSREP(thd))
if (wsrep && WSREP(thd))
{
/*
change LOCK TABLE WRITE to transaction
@@ -3108,7 +3128,7 @@ mysql_execute_command(THD *thd)
/*
Bail out if DB snapshot has not been installed. SET and SHOW commands,
however, are always allowed.
Select query is also allowed if it does not access any table.
We additionally allow all other commands that do not change data in
case wsrep_dirty_reads is enabled.
*/
@@ -3116,6 +3136,8 @@ mysql_execute_command(THD *thd)
!wsrep_is_show_query(lex->sql_command) &&
!(thd->variables.wsrep_dirty_reads &&
!is_update_query(lex->sql_command)) &&
!(lex->sql_command == SQLCOM_SELECT &&
!all_tables) &&
!wsrep_node_is_ready(thd))
goto error;
}
@@ -5963,11 +5985,8 @@ end_with_restore_list:
}
case SQLCOM_SHOW_CREATE_TRIGGER:
{
if (lex->spname->m_name.length > NAME_LEN)
{
my_error(ER_TOO_LONG_IDENT, MYF(0), lex->spname->m_name.str);
if (check_ident_length(&lex->spname->m_name))
goto error;
}
#ifdef WITH_WSREP
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
@@ -9667,6 +9686,18 @@ bool check_string_char_length(LEX_STRING *str, uint err_msg,
return TRUE;
}
bool check_ident_length(LEX_STRING *ident)
{
if (check_string_char_length(ident, 0, NAME_CHAR_LEN, system_charset_info, 1))
{
my_error(ER_TOO_LONG_IDENT, MYF(0), ident->str);
return 1;
}
return 0;
}
C_MODE_START
/*