Debian Codegraph @

mysql-test/suite/ndb/t/stored_grants_binlog_setup.test

raw
1 --source include/have_debug.inc
2 --source include/have_multi_ndb.inc
3
4 #
5 # Bug#31680765 FAILURE TO ADD NDB_STORED_USER
6 #
7 # Set ndb_binlog_setup_slow, then drop ndb_apply_status. The binlog thread
8 # will sleep for 10 seconds before setting up. When it reaches 'Waiting for
9 # ndbcluster to start', GRANT NDB_STORED_USER to a user. This should produce
10 # a client warning message that schema distribution is not available. When
11 # the status reaches 'Waiting for event from ndbcluster', SHOW GRANTS FOR USER
12 # must succeed rather than returning an error.
13 #
14
15 ## Common parameters for wait_show_condition.inc:
16 let $show_statement= SHOW PROCESSLIST;
17 let $field= State;
18
19 ##
20 ### Setup
21 ##
22 disable_query_log;
23 set @save_debug= @@global.debug;
24 set global debug = "+d,ndb_binlog_setup_slow";
25 CREATE USER mcm0765@localhost;
26
27 ##
28 ### Wait for 'Waiting for ndbcluster to start'
29 ##
30 exec $NDB_DROP_TABLE -d mysql ndb_apply_status >> $NDB_TOOLS_OUTPUT;
31 let $condition= = 'Waiting for ndbcluster to start';
32 source include/wait_show_condition.inc;
33
34 ##
35 ### This GRANT statement should produce a warning
36 ##
37 enable_query_log ONCE;
38 GRANT NDB_STORED_USER ON *.* TO mcm0765@localhost;
39 SHOW WARNINGS;
40
41 ##
42 ### Wait for 'Waiting for event from ndbcluster'
43 ##
44 let $condition= = 'Waiting for event from ndbcluster';
45 source include/wait_show_condition.inc;
46
47 ##
48 ### SHOW GRANTS must not fail
49 ##
50 disable_result_log;
51 SHOW GRANTS FOR mcm0765@localhost;
52
53 # Grant again (after schema distribution is running) to bring the system
54 # back to normal.
55 GRANT NDB_STORED_USER ON *.* TO mcm0765@localhost;
56
57 # Cleanup
58 --connection server2
59 call mtr.add_suppression("cluster disconnect An incident event has been written");
60 --connection default
61 call mtr.add_suppression("cluster disconnect An incident event has been written");
62 call mtr.add_suppression("Failed to distribute");
63 DROP USER mcm0765@localhost;
64 set global debug= @save_debug;
65 remove_file $NDB_TOOLS_OUTPUT;
66