summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-04-04 15:27:16 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2019-04-04 15:27:16 +0100
commit37bf7b195c7a42e7c4bbc05c877147789f7cba29 (patch)
treef6c24d4ebc8d755f13cfd839be713084a3072d5d /sql
parent6e71dde8b8f70087f06beb7d6fa172a7580a80c2 (diff)
downloadmariadb-git-37bf7b195c7a42e7c4bbc05c877147789f7cba29.tar.gz
MDEV-17610 Unexpected connection abort after certain operations from
within stored procedure Always set SERVER_MORE_RESULTS_EXIST when executing stored procedure. statements If statements produce a result, EOF packet needs this flag (SP ends with an OK packet). IF statetement does not produce a result, affected rows count are part of the final OK packet.
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_head.cc1
-rw-r--r--sql/sql_parse.cc15
2 files changed, 8 insertions, 8 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 4e886e29a63..f26115efd8b 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -243,6 +243,7 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_EXPLAIN:
case SQLCOM_SHOW_FIELDS:
case SQLCOM_SHOW_FUNC_CODE:
+ case SQLCOM_SHOW_GENERIC:
case SQLCOM_SHOW_GRANTS:
case SQLCOM_SHOW_ENGINE_STATUS:
case SQLCOM_SHOW_ENGINE_LOGS:
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1f060305d4f..6649c60f827 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2442,15 +2442,14 @@ static bool do_execute_sp(THD *thd, sp_head *sp)
my_error(ER_SP_BADSELECT, MYF(0), sp->m_qname.str);
return 1;
}
- /*
- If SERVER_MORE_RESULTS_EXISTS is not set,
- then remember that it should be cleared
- */
- bits_to_be_cleared= (~thd->server_status &
- SERVER_MORE_RESULTS_EXISTS);
- thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
}
-
+ /*
+ If SERVER_MORE_RESULTS_EXISTS is not set,
+ then remember that it should be cleared
+ */
+ bits_to_be_cleared= (~thd->server_status &
+ SERVER_MORE_RESULTS_EXISTS);
+ thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
ha_rows select_limit= thd->variables.select_limit;
thd->variables.select_limit= HA_POS_ERROR;