summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-11 09:45:34 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-11 09:45:34 +0100
commitf3914d10b61eb4bc4184b2a9aa92a998e1abd779 (patch)
tree0f973c0dc2fb1f667ed852e4177b17938e28b6b9 /sql/sql_parse.cc
parent559345806216369bad999539018bd3943860a5d5 (diff)
parent2195bb4e416232ab807ff67eecf03b1223bf6bff (diff)
downloadmariadb-git-f3914d10b61eb4bc4184b2a9aa92a998e1abd779.tar.gz
Merge branch 'bb-10.2-serg-merge' into 10.2
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e413b73f62c..b41f6ffd0f0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1570,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());
@@ -2329,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 &&
@@ -5975,11 +5983,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;
@@ -9679,6 +9684,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
/*