diff options
author | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-09-07 15:53:46 +0700 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-09-07 15:53:46 +0700 |
commit | d6f6db6f4cb02fb5a4c6225747af0673bd91ea94 (patch) | |
tree | c8eb3dcb0911e08facc0443d29a06726e0390312 /mysql-test/r/trigger_notembedded.result | |
parent | 446cc653c0ab13a6fec8ab54de9f5596389b08bc (diff) | |
download | mariadb-git-d6f6db6f4cb02fb5a4c6225747af0673bd91ea94.tar.gz |
Fixed bug #55421 - Protocol::end_statement(): Assertion `0' on
multi-table UPDATE IGNORE.
The problem was that if there was an active SELECT statement
during trigger execution, an error risen during the execution
may cause a crash. The fix is to temporary reset LEX::current_select
before trigger execution and restore it afterwards. This way
errors risen during the trigger execution are processed as
if there was no active SELECT.
mysql-test/r/trigger_notembedded.result:
added test case result for bug #55421.
mysql-test/t/trigger_notembedded.test:
added test case for bug #55421.
sql/sql_trigger.cc:
Reset thd->lex->current_select before start trigger execution
and restore its original value after execution is finished.
This is neccessery in order to set error status in
diagnostic_area in case of trigger execution failure.
Diffstat (limited to 'mysql-test/r/trigger_notembedded.result')
-rw-r--r-- | mysql-test/r/trigger_notembedded.result | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result index d66308a9bd7..cba41660ced 100644 --- a/mysql-test/r/trigger_notembedded.result +++ b/mysql-test/r/trigger_notembedded.result @@ -474,4 +474,25 @@ SHOW CREATE TRIGGER db1.trg; ERROR 42000: Access denied; you need the TRIGGER privilege for this operation DROP USER 'no_rights'@'localhost'; DROP DATABASE db1; +DROP DATABASE IF EXISTS mysqltest_db1; +CREATE DATABASE mysqltest_db1; +USE mysqltest_db1; +GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost; +CREATE TABLE t1 ( +a1 int, +a2 int +); +INSERT INTO t1 VALUES (1, 20); +CREATE TRIGGER mysqltest_db1.upd_t1 +BEFORE UPDATE ON t1 FOR EACH ROW SET new.a2 = 200; +CREATE TABLE t2 ( +a1 int +); +INSERT INTO t2 VALUES (2); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost; +UPDATE IGNORE t1, t2 SET t1.a1 = 2, t2.a1 = 3 WHERE t1.a1 = 1 AND t2.a1 = 2; +ERROR 42000: TRIGGER command denied to user 'mysqltest_u1'@'localhost' for table 't1' +DROP DATABASE mysqltest_db1; +DROP USER mysqltest_u1@localhost; +USE test; End of 5.1 tests. |