| 1 |
# |
| 2 |
# Only needs to be run once. Make it row format, |
| 3 |
# because row runs are included in all pb2 platforms, |
| 4 |
# whereas statement (for instance) is not. |
| 5 |
# |
| 6 |
-- source include/have_binlog_format_row.inc |
| 7 |
-- source include/master-slave.inc |
| 8 |
-- source include/have_plugin_auth.inc |
| 9 |
|
| 10 |
--let $offset_of_query_event= 2 |
| 11 |
# |
| 12 |
# BUG#59708: 'CREATE USER ... IDENTIFIED WITH ..' statement is |
| 13 |
# binlogged wrongly |
| 14 |
# |
| 15 |
# The test case checks that the statement in the binary log matches |
| 16 |
# the one that was issued. Assertions are added for 'CREATE USER ...' |
| 17 |
# as well for 'GRANT ALL ...' |
| 18 |
# |
| 19 |
--disable_query_log |
| 20 |
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1) |
| 21 |
--let $assert_text= Logged query must match the one issued. |
| 22 |
|
| 23 |
--let $query= CREATE USER 'b59708_user1'@'%' IDENTIFIED WITH 'test_plugin_server' AS 'CN=analyst, OU=division1, O=oracle, C=US' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
| 24 |
--let $binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1) |
| 25 |
--eval $query |
| 26 |
--let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_position, Info, $offset_of_query_event) |
| 27 |
--let $assert_cond= `SELECT "$logged_query" LIKE "%$query /* xid=% */"` |
| 28 |
--source include/assert.inc |
| 29 |
|
| 30 |
--source include/sync_slave_sql_with_master.inc |
| 31 |
-- connection master |
| 32 |
|
| 33 |
## testing with escaped characters |
| 34 |
--let $query= CREATE USER 'b59708_user\''@'localhost\'' IDENTIFIED WITH 'test_plugin_server' AS '\'CN=analyst, OU=division1, O=oracle, C=US' PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
| 35 |
--let $binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1) |
| 36 |
--eval $query |
| 37 |
--let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_position, Info, $offset_of_query_event) |
| 38 |
--let $assert_cond= `SELECT "$logged_query" LIKE "%$query /* xid=% */"` |
| 39 |
--let $assert_text= Logged query must match the one issued but properly escaped. |
| 40 |
--source include/assert.inc |
| 41 |
|
| 42 |
--source include/sync_slave_sql_with_master.inc |
| 43 |
-- connection master |
| 44 |
|
| 45 |
DROP USER b59708_user1; |
| 46 |
DROP USER 'b59708_user\''@'localhost\''; |
| 47 |
|
| 48 |
--source include/sync_slave_sql_with_master.inc |
| 49 |
-- connection master |
| 50 |
|
| 51 |
--enable_query_log |
| 52 |
|
| 53 |
-- source include/rpl_end.inc |