summaryrefslogtreecommitdiff
path: root/sql/sql_servers.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2010-01-13 12:39:00 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2010-01-13 12:39:00 +0100
commitda877f64fe83b0abf36607fe763e4db56c5556bb (patch)
treea9737c2a19850c10398e9f47d40c82ee4deefbe2 /sql/sql_servers.cc
parentdbe02e6d4a5be73a9422b2004ad059cdd44e2d28 (diff)
downloadmariadb-git-da877f64fe83b0abf36607fe763e4db56c5556bb.tar.gz
Bug#33982 debug assertion and crash reloading grant tables after sighup or kill
In certain rare cases when a process was interrupted during a FLUSH PRIVILEGES operation the diagnostic area would be set to an error state but the function responsible for the operation would still signal success. This would lead to a debug assertion error later on when the server would attempt to reset the DA before sending the error message. This patch fixes the issue by assuring that reload_acl_and_cache() always fails if an error condition is raised. The second issue was that a KILL could cause a console error message which referred to a DA state without first making sure that such a state existed. This patch fixes this issue in two different palces by first checking DA state before fetching the error message.
Diffstat (limited to 'sql/sql_servers.cc')
-rw-r--r--sql/sql_servers.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc
index f8a8dea18ff..1655426bb4a 100644
--- a/sql/sql_servers.cc
+++ b/sql/sql_servers.cc
@@ -241,8 +241,14 @@ bool servers_reload(THD *thd)
if (simple_open_n_lock_tables(thd, tables))
{
- sql_print_error("Can't open and lock privilege tables: %s",
- thd->main_da.message());
+ /*
+ Execution might have been interrupted; only print the error message
+ if an error condition has been raised.
+ */
+ if (thd->main_da.is_error())
+ sql_print_error("Can't open and lock privilege tables: %s",
+ thd->main_da.message());
+ return_val= FALSE;
goto end;
}