1--source include/have_ndb.inc
2
3# ======= TEST CONCURRENCY
4# =======
5#
6# Issue simultaneous ACL statements from many servers.
7#
8# ACL changes are executed *without* holding the Global Schema lock,
9# but the locking inside Ndb_schema_dist_client::acl_notify() serializes
10# ACL changes on a single server, and each server has a distinct name that
11# is used part of the primary key in ndb_schema.
12#
13
14#
15# Set up environment
16#
17CREATE TABLE t1 (pk INT PRIMARY KEY, a INT) engine = ndb;
18CREATE USER 'priv_test_U'@'localhost' IDENTIFIED by 'priv_test_pass';
19GRANT NDB_STORED_USER ON *.* to 'priv_test_U'@'localhost';
20
21disable_query_log;
22
23connect (conn1,127.0.0.1,root,,test,$MASTER_MYPORT,);
24connect (conn2,127.0.0.1,root,,test,$MASTER_MYPORT,);
25connect (conn3,127.0.0.1,root,,test,$MASTER_MYPORT1,);
26connect (conn4,127.0.0.1,root,,test,$MASTER_MYPORT1,);
27connect (conn5,127.0.0.1,root,,test,$MASTER_MYPORT2,);
28connect (conn6,127.0.0.1,root,,test,$MASTER_MYPORT2,);
29connect (conn7,127.0.0.1,root,,test,$MASTER_MYPORT3,);
30connect (conn8,127.0.0.1,root,,test,$MASTER_MYPORT3,);
31
32#
33# Issue a simple ACL change simultaneously on all 8 connections
34#
35
36connection conn1;
37send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
38connection conn2;
39send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
40connection conn3;
41send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
42connection conn4;
43send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
44connection conn5;
45send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
46connection conn6;
47send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
48connection conn7;
49send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
50connection conn8;
51send GRANT SELECT ON test.t1 to 'priv_test_U'@'localhost';
52
53connection conn1;
54reap;
55connection conn2;
56reap;
57connection conn3;
58reap;
59connection conn4;
60reap;
61connection conn5;
62reap;
63connection conn6;
64reap;
65connection conn7;
66reap;
67connection conn8;
68reap;
69
70#
71# Clean up
72#
73
74connection default;
75drop user priv_test_U@localhost;
76drop table t1;
77