summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2020-09-17 19:05:08 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2020-09-22 17:18:37 +0530
commit9c2570e6c42a5ff4965a7d7ee122ad1ae9e73428 (patch)
tree63db1b4aec0ed520cedce14dc9f610d9929a0bf9
parent5768f57d243e3fa945d79fcdc1a3eacb1e4ebb0d (diff)
downloadmariadb-git-bb-10.1-MDEV-22422.tar.gz
MDEV-22422: Assertion `! is_set()' failed in Diagnostics_area::set_eof_statusbb-10.1-MDEV-22422
Analysis: The error is not returned when the statement can't be used. And so we still go on to search for keywords. Fix: Return the error state.
-rw-r--r--mysql-test/r/errors.result14
-rw-r--r--mysql-test/t/errors.test19
-rw-r--r--sql/sql_help.cc3
3 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index e1d494d3324..044fb3ebfa6 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -172,3 +172,17 @@ set max_session_mem_used = 50000;
select * from seq_1_to_1000;
set max_session_mem_used = 8192;
select * from seq_1_to_1000;
+#
+# 10.1 Test
+#
+# MDEV-22422: Assertion `! is_set()' failed in
+# Diagnostics_area::set_eof_status
+#
+SET @saved_max_session_mem_used = @@max_session_mem_used;
+SET max_session_mem_used = 50000;
+help 'it is going to crash';
+ERROR HY000: The MariaDB server is running with the --max-thread-mem-used=50000 option so it cannot execute this statement
+SET @@max_session_mem_used=@saved_max_session_mem_used;
+#
+# End of 10.1 Test
+#
diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
index 55461002fd4..e2b10559299 100644
--- a/mysql-test/t/errors.test
+++ b/mysql-test/t/errors.test
@@ -213,3 +213,22 @@ select * from seq_1_to_1000;
--enable_result_log
# We may not be able to execute any more queries with this connection
# because of too little memory#
+
+--echo #
+--echo # 10.1 Test
+--echo #
+--echo # MDEV-22422: Assertion `! is_set()' failed in
+--echo # Diagnostics_area::set_eof_status
+--echo #
+
+SET @saved_max_session_mem_used = @@max_session_mem_used;
+
+SET max_session_mem_used = 50000;
+--error ER_OPTION_PREVENTS_STATEMENT
+help 'it is going to crash';
+
+SET @@max_session_mem_used=@saved_max_session_mem_used;
+
+--echo #
+--echo # End of 10.1 Test
+--echo #
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index cd9da566e51..654a3915b29 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -736,6 +736,9 @@ static bool mysqld_help_internal(THD *thd, const char *mask)
&name, &description, &example);
delete select;
+ if (thd->is_error())
+ goto error;
+
if (count_topics == 0)
{
int UNINIT_VAR(key_id);