File: rpl_grant_plugin.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (53 lines) | stat: -rw-r--r-- 2,141 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Only needs to be run once. Make it row format,
# because row runs are included in all pb2 platforms,
# whereas statement (for instance) is not.
#
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
-- source include/have_plugin_auth.inc

--let $offset_of_query_event= 2
#
# BUG#59708: 'CREATE USER ... IDENTIFIED WITH ..' statement is
#            binlogged wrongly
#
# The test case checks that the statement in the binary log matches
# the one that was issued. Assertions are added for 'CREATE USER ...'
# as well for 'GRANT ALL ...'
#
--disable_query_log
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
--let $assert_text= Logged query must match the one issued.

--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
--let $binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1)
--eval $query
--let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_position, Info, $offset_of_query_event)
--let $assert_cond= `SELECT "$logged_query" LIKE "%$query /* xid=% */"`
--source include/assert.inc

--source include/sync_slave_sql_with_master.inc
-- connection master

## testing with escaped characters
--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
--let $binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1)
--eval $query
--let $logged_query= query_get_value(SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_position, Info, $offset_of_query_event)
--let $assert_cond= `SELECT "$logged_query" LIKE "%$query /* xid=% */"`
--let $assert_text= Logged query must match the one issued but properly escaped.
--source include/assert.inc

--source include/sync_slave_sql_with_master.inc
-- connection master

DROP USER b59708_user1;
DROP USER 'b59708_user\''@'localhost\'';

--source include/sync_slave_sql_with_master.inc
-- connection master

--enable_query_log

-- source include/rpl_end.inc