diff options
author | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-03-03 10:24:53 +0100 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@sun.com> | 2010-03-03 10:24:53 +0100 |
commit | b0ab907b4290cd3aa24a9305387ed5aaeaf5d213 (patch) | |
tree | 2ed7d716d0bc5e01e03f30e506158c1bc8eaff8c /mysql-test/t/sp-destruct.test | |
parent | c843f58f0470b8be4228adaf97f628e2342e73f2 (diff) | |
download | mariadb-git-b0ab907b4290cd3aa24a9305387ed5aaeaf5d213.tar.gz |
Bug #51376 Assert `! is_set()' failed in
Diagnostics_area::set_ok_status on DROP FUNCTION
This assert tests that the server is not trying to send "ok" to
the client if an error has occured during statement processing.
In this case, the assert was triggered by lock timeout errors when
accessing system tables to do an implicit REVOKE after executing
DROP FUNCTION/PROCEDURE. In practice, this was only likely to
happen with very low values for "lock_wait_timeout" (in the bug report
1 second was used). These errors were ignored and the server tried
to send "ok" to the client, triggering the assert.
The patch for Bug#45225 introduced lock timeouts for metadata locks.
This made it possible to get timeouts when accessing system tables.
Note that a followup patch for Bug#45225 pushed after this
bug was reported, changed accessing of system tables such
that the user-supplied timeout value is ignored and the maximum
timeout value is used instead. This exact bug was therefore
only noticeable in the period between the initial Bug#45225 patch
and the followup patch.
However, the same problem could occur for any errors during revoking
of privileges - not just timeouts. This patch fixes the problem by
making sure that any errors during revoking of privileges are
reported to the client.
Test case added to sp-destruct.test. Since the original bug is not
reproducable now that system tables are accessed using a a long
timeout value, this test instead calls DROP FUNCTION with a grant
system table missing.
Diffstat (limited to 'mysql-test/t/sp-destruct.test')
-rw-r--r-- | mysql-test/t/sp-destruct.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 720c24b2c24..b7090c01f1e 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -197,3 +197,28 @@ SHOW PROCEDURE STATUS; DROP TABLE mysql.proc; RENAME TABLE proc_backup TO mysql.proc; FLUSH TABLE mysql.proc; + + +--echo # +--echo # Bug#51376 Assert `! is_set()' failed in +--echo # Diagnostics_area::set_ok_status on DROP FUNCTION +--echo # + +--disable_warnings +DROP FUNCTION IF EXISTS f1; +--enable_warnings + +CREATE FUNCTION f1() RETURNS INT RETURN 1; + +--echo # Backup the procs_priv table +RENAME TABLE mysql.procs_priv TO procs_priv_backup; +FLUSH TABLE mysql.procs_priv; + +# DROP FUNCTION used to cause an assert. +--error ER_NO_SUCH_TABLE +DROP FUNCTION f1; +SHOW WARNINGS; + +--echo # Restore the procs_priv table +RENAME TABLE procs_priv_backup TO mysql.procs_priv; +FLUSH TABLE mysql.procs_priv; |