1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for BUG#16266: Definer is not fully qualified error during replication.

The idea of the fix is to extend support of non-SUID triggers for backward
compatibility. Formerly non-SUID triggers were appeared when "new" server
is being started against "old" database. Now, they are also created when
"new" slave receives updates from "old" master.


mysql-test/r/rpl_trigger.result:
  Updated the result file with the results of the test for BUG#16266.
mysql-test/t/rpl_trigger.test:
  Added the test case for BUG#16266.
sql/mysql_priv.h:
  Added an utility operation to be used from sql_yacc.yy.
sql/sql_parse.cc:
  Add a utility operation to be used from sql_yacc.yy.
sql/sql_trigger.cc:
  Extend support of non-SUID triggers.
sql/sql_view.cc:
  Initialize LEX::definer if DEFINER-clause is missing.
sql/sql_yacc.yy:
  Extended support of non-SUID triggers.
mysql-test/std_data/bug16266.000001:
  A new binlog file for testing a patch for BUG#16266.
This commit is contained in:
unknown
2006-03-01 14:13:07 +03:00
parent 2efabfd11a
commit a44a924a40
8 changed files with 264 additions and 52 deletions

View File

@ -855,3 +855,44 @@ f3
drop trigger trg11;
drop table t21,t31;
drop table t11;
STOP SLAVE;
FLUSH LOGS;
RESET SLAVE;
START SLAVE;
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
MASTER_POS_WAIT('master-bin.000001', 513) >= 0
1
SHOW TABLES;
Tables_in_test
t1
t2
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1 INSERT t1 INSERT INTO t2 VALUES(CURRENT_USER()) AFTER NULL
SELECT * FROM t1;
c
1
SELECT * FROM t2;
s
@
INSERT INTO t1 VALUES(2);
SELECT * FROM t1;
c
1
2
SELECT * FROM t2;
s
@
root@localhost
DROP TRIGGER trg1;
Warnings:
Warning 1454 No definer attribute for trigger 'test'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
DROP TABLE t1;
DROP TABLE t2;
STOP SLAVE;
RESET SLAVE;
SHOW TABLES;
Tables_in_test
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer
RESET MASTER;