polardbxengine/mysql-test/suite/xengine_binlog/r/binlog_rewrite.result

75 lines
5.8 KiB
Plaintext

RESET MASTER;
CREATE USER user1@localhost IDENTIFIED BY 'secret';
CREATE USER user2@localhost IDENTIFIED BY 'secret';
SET PASSWORD FOR user1@localhost = 'secret';
# Test the password is encrypted in binary log
# with alter user
ALTER USER user1@localhost IDENTIFIED BY 'secret';
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2' /*before with*/WITH/*after with*/MAX_QUERIES_PER_HOUR 90;
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2' /*before require*/REQUIRE SSL/*after require*/ /*before with*/WITH/*after with*/MAX_QUERIES_PER_HOUR 90;
ALTER USER user1@localhost IDENTIFIED BY 'secret', user2@localhost IDENTIFIED BY 'secret2';
GRANT UPDATE ON *.* TO user1@localhost WITH GRANT OPTION;
GRANT UPDATE ON *.* /*before to*/TO/*after to*/ user1@localhost;
GRANT UPDATE ON *.* /*before to*/TO/*after to*/ user1@localhost;
GRANT UPDATE ON *.* TO user1@localhost, user2@localhost;
REVOKE UPDATE ON *.* FROM user1@localhost, user2@localhost;
CREATE PROCEDURE p1() SQL SECURITY INVOKER SELECT 1;
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost, user2@localhost;
GRANT EXECUTE ON PROCEDURE p1 /*before to*/TO/*after to*/ user1@localhost, user2@localhost;
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost, user2@localhost;
REVOKE EXECUTE ON PROCEDURE p1 FROM user1@localhost, user2@localhost;
CREATE FUNCTION f1() RETURNS INT RETURN 123;
GRANT EXECUTE ON FUNCTION f1 /*before to*/TO/*after to*/ user1@localhost/*!10000 , user2@localhost*/ /*!99999 THIS_WOULD_BREAK */;
REVOKE EXECUTE ON FUNCTION f1 FROM user1@localhost, user2@localhost;
DROP USER user1@localhost, user2@localhost;
DROP FUNCTION f1;
DROP PROCEDURE p1;
CREATE USER test_user1 IDENTIFIED BY 'azundris1';
GRANT ALL on *.* TO test_user1;
CREATE USER test_user2 IDENTIFIED BY 'azundris2';
CHANGE MASTER TO MASTER_PASSWORD='azundris3';
Warnings:
Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
CREATE USER 'test_user4'@'localhost';
SET PASSWORD FOR 'test_user4'@'localhost' = 'azundris4';
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
binlog.000001 # Query # # use `test`; CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; CREATE USER 'user2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>' WITH MAX_QUERIES_PER_HOUR 90
binlog.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>' REQUIRE SSL WITH MAX_QUERIES_PER_HOUR 90
binlog.000001 # Query # # use `test`; ALTER USER 'user1'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; GRANT UPDATE ON *.* TO 'user1'@'localhost' WITH GRANT OPTION
binlog.000001 # Query # # use `test`; GRANT UPDATE ON *.* TO 'user1'@'localhost'
binlog.000001 # Query # # use `test`; GRANT UPDATE ON *.* TO 'user1'@'localhost'
binlog.000001 # Query # # use `test`; GRANT UPDATE ON *.* TO 'user1'@'localhost','user2'@'localhost'
binlog.000001 # Query # # use `test`; REVOKE UPDATE ON *.* FROM user1@localhost, user2@localhost
binlog.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SQL SECURITY INVOKER
SELECT 1
binlog.000001 # Query # # use `test`; GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user1'@'localhost','user2'@'localhost'
binlog.000001 # Query # # use `test`; GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user1'@'localhost','user2'@'localhost'
binlog.000001 # Query # # use `test`; GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user1'@'localhost','user2'@'localhost'
binlog.000001 # Query # # use `test`; REVOKE EXECUTE ON PROCEDURE p1 FROM user1@localhost, user2@localhost
binlog.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 123
binlog.000001 # Query # # use `test`; GRANT EXECUTE ON FUNCTION `test`.`f1` TO 'user1'@'localhost','user2'@'localhost'
binlog.000001 # Query # # use `test`; REVOKE EXECUTE ON FUNCTION f1 FROM user1@localhost, user2@localhost
binlog.000001 # Query # # use `test`; DROP USER user1@localhost, user2@localhost
binlog.000001 # Query # # use `test`; DROP FUNCTION f1
binlog.000001 # Query # # use `test`; DROP PROCEDURE p1
binlog.000001 # Query # # use `test`; CREATE USER 'test_user1'@'%' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; GRANT ALL PRIVILEGES ON *.* TO 'test_user1'@'%'
binlog.000001 # Query # # use `test`; CREATE USER 'test_user2'@'%' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
binlog.000001 # Query # # use `test`; CREATE USER 'test_user4'@'localhost' IDENTIFIED WITH 'caching_sha2_password'
binlog.000001 # Query # # use `test`; ALTER USER 'test_user4'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS '<non-deterministic-password-hash>'
DROP USER 'test_user4'@'localhost';
DROP USER test_user2;
DROP USER test_user1;
RESET MASTER;
RESET SLAVE;
End of 5.6 tests!