GIF89a;
Direktori : /usr/share/mysql-test/r/ |
Current File : //usr/share/mysql-test/r/rewrite_general_log.result |
TRUNCATE TABLE mysql.general_log; --------------- general log --------------------------------------- SET @old_log_output= @@global.log_output; SET @old_general_log= @@global.general_log; SET @old_general_log_file= @@global.general_log_file; SET GLOBAL general_log_file = '.../log/rewrite_general.log'; SET GLOBAL log_output = 'FILE,TABLE'; SET GLOBAL general_log= 'ON'; set character set 'hebrew'; set charset default,@dummy='A'; set names 'latin1',@dummy='B'; set names 'latin1' collate 'latin1_german2_ci'; set names default,@dummy='c'; CREATE TABLE t1(f1 INT, f2 INT, f3 INT, f4 INT); CREATE PROCEDURE proc_rewrite_1() INSERT INTO test.t1 VALUES ("hocus pocus"); CREATE FUNCTION func_rewrite_1(i INT) RETURNS INT DETERMINISTIC RETURN i+1; GRANT SELECT(f2), INSERT(f3), INDEX, UPDATE(f1,f3, f2, f4), ALTER on test.t1 TO test_user1 IDENTIFIED BY 'azundris1'; GRANT ALL ON PROCEDURE test.proc_rewrite_1 TO test_user1 IDENTIFIED BY 'meow'; GRANT EXECUTE ON FUNCTION test.func_rewrite_1 TO test_user1 IDENTIFIED BY 'meow'; GRANT USAGE ON TABLE test.* TO test_user3@localhost IDENTIFIED BY 'meow' REQUIRE SSL; GRANT SELECT,USAGE ON test.* TO test_user3@localhost IDENTIFIED BY 'meow' REQUIRE X509 WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3 MAX_USER_CONNECTIONS 4; GRANT SELECT ON test.* TO test_user3@localhost IDENTIFIED BY 'maus' REQUIRE NONE WITH GRANT OPTION; DROP PROCEDURE proc_rewrite_1; DROP FUNCTION func_rewrite_1; DROP TABLE t1; CREATE USER test_user2 IDENTIFIED BY 'azundris2'; CHANGE MASTER TO MASTER_PASSWORD='azundris3'; CREATE USER 'test_user4'@'localhost'; SET PASSWORD FOR 'test_user4'@'localhost' = PASSWORD('azundris4'); SET GLOBAL general_log= 'OFF'; DROP USER 'test_user4'@'localhost'; DROP USER 'test_user3'@'localhost'; DROP USER test_user2; DROP USER test_user1; CREATE TABLE test_log (argument TEXT); LOAD DATA LOCAL INFILE '.../log/rewrite_general.log' INTO TABLE test_log FIELDS TERMINATED BY '\n' LINES TERMINATED BY '\n'; This line should be followed by two SELECTs with empty result sets SELECT argument FROM test_log WHERE argument LIKE CONCAT('%azun','dris%'); argument SELECT argument FROM mysql.general_log WHERE argument LIKE CONCAT('%azun','dris%'); argument Show that we logged stuff at all: ------ from file ------ SELECT TRIM(LEADING '\t' FROM MID(argument,LOCATE('Query',argument)+5)) FROM test_log WHERE argument LIKE '%PASSWORD %'; TRIM(LEADING '\t' FROM MID(argument,LOCATE('Query',argument)+5)) GRANT SELECT (f2), INSERT (f3), UPDATE (f2, f3, f1, f4), INDEX, ALTER ON `test`.`t1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*8D15E74BC850D11573A52BE84B504DD0BA40C1E3' GRANT ALL PRIVILEGES ON PROCEDURE `test`.`proc_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT EXECUTE ON FUNCTION `test`.`func_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT USAGE ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE SSL GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE X509 WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3 MAX_USER_CONNECTIONS 4 GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*6251A8E13A7DDD42A078C59C1CF7CD307BFFC895' REQUIRE NONE WITH GRANT OPTION CREATE USER 'test_user2'@'%' IDENTIFIED BY PASSWORD '*A142844DBF024D282D88FE19CB4D3FA13B1E96E0' CHANGE MASTER TO MASTER_PASSWORD = <secret> SET PASSWORD FOR `test_user4`@`localhost`=<secret> ------ from table ------ SELECT argument FROM mysql.general_log WHERE argument LIKE '%PASSWORD %'; argument GRANT SELECT (f2), INSERT (f3), UPDATE (f2, f3, f1, f4), INDEX, ALTER ON `test`.`t1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*8D15E74BC850D11573A52BE84B504DD0BA40C1E3' GRANT ALL PRIVILEGES ON PROCEDURE `test`.`proc_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT EXECUTE ON FUNCTION `test`.`func_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT USAGE ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE SSL GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE X509 WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3 MAX_USER_CONNECTIONS 4 GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*6251A8E13A7DDD42A078C59C1CF7CD307BFFC895' REQUIRE NONE WITH GRANT OPTION CREATE USER 'test_user2'@'%' IDENTIFIED BY PASSWORD '*A142844DBF024D282D88FE19CB4D3FA13B1E96E0' CHANGE MASTER TO MASTER_PASSWORD = <secret> SET PASSWORD FOR `test_user4`@`localhost`=<secret> ------ done ------ ------ rewrite ------ SELECT argument FROM mysql.general_log WHERE argument LIKE 'SET CHARACTER SET %'; argument set character set 'hebrew' SELECT argument FROM mysql.general_log WHERE argument LIKE 'SET NAMES %'; argument set names 'latin1',@dummy='B' set names 'latin1' collate 'latin1_german2_ci' set names default,@dummy='c' SELECT argument FROM mysql.general_log WHERE argument LIKE 'GRANT %'; argument GRANT SELECT (f2), INSERT (f3), UPDATE (f2, f3, f1, f4), INDEX, ALTER ON `test`.`t1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*8D15E74BC850D11573A52BE84B504DD0BA40C1E3' GRANT ALL PRIVILEGES ON PROCEDURE `test`.`proc_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT EXECUTE ON FUNCTION `test`.`func_rewrite_1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' GRANT USAGE ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE SSL GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*82DC221D557298F6CE9961037DB1C90604792F5C' REQUIRE X509 WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 2 MAX_CONNECTIONS_PER_HOUR 3 MAX_USER_CONNECTIONS 4 GRANT SELECT ON `test`.* TO 'test_user3'@'localhost' IDENTIFIED BY PASSWORD '*6251A8E13A7DDD42A078C59C1CF7CD307BFFC895' REQUIRE NONE WITH GRANT OPTION ------ done ------ see log_tables.test for more proof! :) SELECT argument FROM mysql.general_log WHERE argument LIKE 'GRANT SELECT%' AND argument LIKE CONCAT('%', PASSWORD('azundris1'), '%'); argument GRANT SELECT (f2), INSERT (f3), UPDATE (f2, f3, f1, f4), INDEX, ALTER ON `test`.`t1` TO 'test_user1'@'%' IDENTIFIED BY PASSWORD '*8D15E74BC850D11573A52BE84B504DD0BA40C1E3' Bug#13958454 -- show we print SET @a:=5, but SELECT (@a:=5) EXPLAIN EXTENDED SELECT @a=5,@b:=10,@c:=20,@d:=40+5,(@e:=80)+5; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 /* select#1 */ select ((@`a`) = 5) AS `@a=5`,(@b:=10) AS `@b:=10`,(@c:=20) AS `@c:=20`,(@d:=(40 + 5)) AS `@d:=40+5`,((@e:=80) + 5) AS `(@e:=80)+5` # # Bug#16953758: PREPARED STATEMENT IS WRITTEN TO GENERAL QUERY LOG AFTER ITS EXECUTION IS FINISH # TRUNCATE TABLE mysql.general_log; SET GLOBAL general_log='ON'; SET @sql='SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%"'; PREPARE stmt FROM @sql; EXECUTE stmt; command_type argument Query SET @sql='SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%"' Prepare SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%" Execute SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%" DEALLOCATE PREPARE stmt; # # Bug#18616826: PREPARED STATEMENTS WHOSE EXECUTION FAIL ARE NOT LOGGED TO THE GENERAL LOG # TRUNCATE TABLE mysql.general_log; SET @sql='DROP TABLE 18616826_does_not_exist'; PREPARE stmt FROM @sql; EXECUTE stmt; ERROR 42S02: Unknown table 'test.18616826_does_not_exist' DEALLOCATE PREPARE stmt; SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "DROP TABLE 18616826_does_not_exist"; command_type argument Prepare DROP TABLE 18616826_does_not_exist Execute DROP TABLE 18616826_does_not_exist DROP TABLE test_log; SET GLOBAL general_log_file= @old_general_log_file; SET GLOBAL general_log= @old_general_log; SET GLOBAL log_output= @old_log_output; End of 5.6 tests!