mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-30 04:26:45 +03:00 
			
		
		
		
	into neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var-integration mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/rpl000001.result: Auto merged mysql-test/r/rpl_loaddata.result: Auto merged mysql-test/r/rpl_loaddata_rule_m.result: Auto merged mysql-test/r/rpl_loaddata_rule_s.result: Auto merged mysql-test/r/rpl_misc_functions.result: Auto merged mysql-test/r/rpl_replicate_do.result: Auto merged mysql-test/r/sp-security.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/r/view_grant.result: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/rpl000001.test: Auto merged mysql-test/t/rpl_loaddata.test: Auto merged mysql-test/t/rpl_loaddata_rule_m.test: Auto merged mysql-test/t/rpl_loaddata_rule_s.test: Auto merged mysql-test/t/rpl_misc_functions.test: Auto merged mysql-test/t/rpl_replicate_do.test: Auto merged mysql-test/t/sp-security.test: Auto merged mysql-test/t/trigger-compat.test: Auto merged mysql-test/r/trigger-compat.result: Merge
		
			
				
	
	
		
			97 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			97 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Test case(s) in this file contain(s) GRANT/REVOKE statements, which are not
 | |
| # supported in embedded server. So, this test should not be run on embedded
 | |
| # server.
 | |
| 
 | |
| -- source include/not_embedded.inc
 | |
| 
 | |
| ###########################################################################
 | |
| #
 | |
| # Tests for WL#2818:
 | |
| #   - Check that triggers created w/o DEFINER information work well:
 | |
| #     - create the first trigger;
 | |
| #     - manually remove definer information from corresponding TRG file;
 | |
| #     - create the second trigger (the first trigger will be reloaded; check
 | |
| #       that we receive a warning);
 | |
| #     - check that the triggers loaded correctly;
 | |
| #
 | |
| ###########################################################################
 | |
| 
 | |
| #
 | |
| # Prepare environment.
 | |
| #
 | |
| 
 | |
| DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
 | |
| DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
 | |
| DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
 | |
| DELETE FROM mysql.columns_priv WHERE User LIKE 'mysqltest_%';
 | |
| FLUSH PRIVILEGES;
 | |
| 
 | |
| --disable_warnings
 | |
| DROP DATABASE IF EXISTS mysqltest_db1;
 | |
| --enable_warnings
 | |
| 
 | |
| CREATE DATABASE mysqltest_db1;
 | |
| 
 | |
| CREATE USER mysqltest_dfn@localhost;
 | |
| CREATE USER mysqltest_inv@localhost;
 | |
| 
 | |
| GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
 | |
| GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
 | |
| 
 | |
| #
 | |
| # Create a table and the first trigger.
 | |
| #
 | |
| 
 | |
| --connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
 | |
| --connection wl2818_definer_con
 | |
| --echo
 | |
| --echo ---> connection: wl2818_definer_con
 | |
| 
 | |
| CREATE TABLE t1(num_value INT);
 | |
| CREATE TABLE t2(user_str TEXT);
 | |
| 
 | |
| CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
 | |
|   FOR EACH ROW
 | |
|     INSERT INTO t2 VALUES(CURRENT_USER());
 | |
| 
 | |
| #
 | |
| # Remove definers from TRG file.
 | |
| #
 | |
| 
 | |
| --echo
 | |
| --echo ---> patching t1.TRG...
 | |
| 
 | |
| --exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
 | |
| --exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
 | |
| 
 | |
| #
 | |
| # Create a new trigger.
 | |
| #
 | |
| 
 | |
| --echo
 | |
| 
 | |
| CREATE TRIGGER wl2818_trg2 AFTER INSERT ON t1
 | |
|   FOR EACH ROW
 | |
|     INSERT INTO t2 VALUES(CURRENT_USER());
 | |
| 
 | |
| --echo
 | |
| 
 | |
| SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
 | |
| 
 | |
| --echo
 | |
| 
 | |
| SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
 | |
| 
 | |
| # Clean up
 | |
| DROP TRIGGER wl2818_trg1;
 | |
| DROP TRIGGER wl2818_trg2;
 | |
| disconnect wl2818_definer_con;
 | |
| connection default;
 | |
| use mysqltest_db1;
 | |
| DROP TABLE t1;
 | |
| DROP TABLE t2;
 | |
| DROP USER mysqltest_dfn@localhost;
 | |
| DROP USER mysqltest_inv@localhost;
 | |
| DROP DATABASE mysqltest_db1;
 | |
| 
 |