mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
245b9ad4b3
mysql-test/extra/rpl_tests/rpl_row_func003.test: Fix spelling error mysql-test/extra/rpl_tests/rpl_row_tabledefs.test: Restore sql_mode after test mysql-test/r/events_logs_tests.result: Turn even_scheduleroff before test ends mysql-test/r/events_scheduling.result: Turn even_scheduleroff before test ends mysql-test/r/insert.result: Drop tables t1 before test ends mysql-test/r/rpl_read_only.result: Set read_only flag back to default mysql-test/r/rpl_row_NOW.result: Drop database mysqltest1 before test ends mysql-test/r/rpl_row_USER.result: Drop users created by test mysql-test/r/rpl_row_basic_11bugs.result: Drop table and set query_cache_size back to default mysql-test/r/rpl_row_func002.result: Drop table created by test mysql-test/r/rpl_row_sp008.result: Drop table created by test mysql-test/r/rpl_row_sp012.result: Drop user created by test mysql-test/r/rpl_row_tabledefs_2myisam.result: Restore sql_mode mysql-test/r/rpl_row_tabledefs_3innodb.result: Restore sql_mode mysql-test/r/rpl_row_tabledefs_7ndb.result: Restore sql_mode mysql-test/r/rpl_row_view01.result: Drop database created by test mysql-test/r/rpl_slave_status.result: Remove created users mysql-test/r/rpl_switch_stm_row_mixed.result: Reset binlog_format to default mysql-test/r/sp.result: Drop procedure created by test mysql-test/r/varbinary.result: Drop table created by test mysql-test/r/variables.result: Reset changed variables to their defaults mysql-test/t/events_logs_tests.test: Turn off event_scheduler before test ends mysql-test/t/events_scheduling.test: Turn off event_scheduler mysql-test/t/insert.test: Drop table created by test mysql-test/t/rpl_read_only.test: Reset read_only flag mysql-test/t/rpl_row_NOW.test: Drop db created by test mysql-test/t/rpl_row_USER.test: Drop users created mysql-test/t/rpl_row_basic_11bugs.test: Drop tables created by test mysql-test/t/rpl_row_func002.test: Drop table created by test mysql-test/t/rpl_row_sp008.test: Drop table created by test mysql-test/t/rpl_row_sp012.test: Drop user created by test mysql-test/t/rpl_row_view01.test: Drop db created by test mysql-test/t/rpl_slave_status.test: Remove users created by test mysql-test/t/rpl_switch_stm_row_mixed.test: Reset binlog_format mysql-test/t/sp.test: Drop procedure created by test mysql-test/t/varbinary.test: Drop tables created by test mysql-test/t/variables.test: Restore variables to their default before test ends
75 lines
2.2 KiB
Text
75 lines
2.2 KiB
Text
#############################################################################
|
|
# Original Author: JBM #
|
|
# Original Date: Aug/22/2005 #
|
|
# Update: 08/29/2005 Added save pos and sync #
|
|
#############################################################################
|
|
#TEST: SP to test security and current_user and user #
|
|
#############################################################################
|
|
|
|
|
|
# Includes
|
|
-- source include/have_binlog_format_row.inc
|
|
-- source include/not_embedded.inc
|
|
-- source include/master-slave.inc
|
|
|
|
|
|
# Begin clean up test section
|
|
connection master;
|
|
--disable_warnings
|
|
DROP PROCEDURE IF EXISTS test.p1;
|
|
DROP PROCEDURE IF EXISTS test.p2;
|
|
DROP PROCEDURE IF EXISTS test.p3;
|
|
|
|
|
|
# Begin test section 1
|
|
# Create user user1 with no particular access rights
|
|
grant usage on *.* to user1@localhost;
|
|
flush privileges;
|
|
|
|
SELECT CURRENT_USER();
|
|
SELECT USER();
|
|
CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
|
|
CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
|
|
CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
|
|
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
|
|
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
|
|
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
|
|
|
|
# Need to wait for the rights to be applied at the slave
|
|
sync_slave_with_master;
|
|
|
|
let $message=<******** Master user1 p3 & p2 calls *******>;
|
|
--source include/show_msg.inc
|
|
connect (muser1,localhost,user1,,);
|
|
connection muser1;
|
|
SELECT CURRENT_USER();
|
|
SELECT USER();
|
|
CALL test.p3();
|
|
CALL test.p2();
|
|
|
|
let $message=<******** Slave user1 p3 & p2 calls *******>;
|
|
--source include/show_msg.inc
|
|
connect (suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,);
|
|
|
|
connection master;
|
|
save_master_pos;
|
|
connection suser1;
|
|
sync_with_master;
|
|
|
|
SELECT CURRENT_USER();
|
|
SELECT USER();
|
|
CALL test.p3();
|
|
CALL test.p2();
|
|
|
|
# Cleanup
|
|
connection master;
|
|
DROP PROCEDURE IF EXISTS test.p1;
|
|
DROP PROCEDURE IF EXISTS test.p3;
|
|
DROP PROCEDURE IF EXISTS test.p2;
|
|
DROP TABLE IF EXISTS test.t1;
|
|
DROP TABLE IF EXISTS test.t2;
|
|
DROP USER user1@localhost;
|
|
sync_slave_with_master;
|
|
|
|
# End of 5.0 test case
|
|
|