1CREATE USER test2@localhost;
2GRANT USAGE ON *.* TO test2@localhost;
3GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
4connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
5USE test;
6SHOW GRANTS FOR CURRENT_USER;
7Grants for test2@localhost
8GRANT USAGE ON *.* TO 'test2'@'localhost'
9GRANT SELECT, INSERT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
10ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
11SELECT * FROM t_10;
12a	b
132	Two
144	Four
156	Six
168	Eight
17SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
18a	b
191	One
203	Three
215	Five
229	Nine
23Warning	1287	The partition engine, used by table 'test.tp', is deprecated and will be removed in a future release. Please use native partitioning instead.
24Warnings:
25ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
26SELECT * FROM t_10;
27a	b
281	One
293	Three
305	Five
319	Nine
32SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
33a	b
342	Two
354	Four
366	Six
378	Eight
38Warning	1287	The partition engine, used by table 'test.tp', is deprecated and will be removed in a future release. Please use native partitioning instead.
39Warnings:
40ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
41SELECT * FROM tsp_00;
42a	b
43SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
44a	b
452	Two
464	Four
475	Five
486	Six
498	Eight
50Warning	1287	The partition engine, used by table 'test.tsp', is deprecated and will be removed in a future release. Please use native partitioning instead.
51Warnings:
52ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
53SELECT * FROM tsp_00;
54a	b
555	Five
56SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
57a	b
582	Two
594	Four
606	Six
618	Eight
62Warning	1287	The partition engine, used by table 'test.tsp', is deprecated and will be removed in a future release. Please use native partitioning instead.
63Warnings:
64disconnect test2;
65connection default;
66REVOKE INSERT ON test.* FROM test2@localhost;
67connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
68USE test;
69SHOW GRANTS FOR CURRENT_USER;
70Grants for test2@localhost
71GRANT USAGE ON *.* TO 'test2'@'localhost'
72GRANT SELECT, UPDATE, CREATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
73ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
74ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 'tp'
75disconnect test2;
76connection default;
77GRANT INSERT ON test.* TO test2@localhost;
78REVOKE CREATE ON test.* FROM test2@localhost;
79connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
80USE test;
81SHOW GRANTS FOR CURRENT_USER;
82Grants for test2@localhost
83GRANT USAGE ON *.* TO 'test2'@'localhost'
84GRANT SELECT, INSERT, UPDATE, DROP, ALTER ON `test`.* TO 'test2'@'localhost'
85ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
86ERROR 42000: CREATE command denied to user 'test2'@'localhost' for table 'tsp'
87disconnect test2;
88connection default;
89GRANT CREATE ON test.* TO test2@localhost;
90REVOKE DROP ON test.* FROM test2@localhost;
91connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
92USE test;
93SHOW GRANTS FOR CURRENT_USER;
94Grants for test2@localhost
95GRANT USAGE ON *.* TO 'test2'@'localhost'
96GRANT SELECT, INSERT, UPDATE, CREATE, ALTER ON `test`.* TO 'test2'@'localhost'
97ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
98ERROR 42000: DROP command denied to user 'test2'@'localhost' for table 'tp'
99disconnect test2;
100connection default;
101DROP TABLE IF EXISTS t_10;
102DROP TABLE IF EXISTS t_100;
103DROP TABLE IF EXISTS t_1000;
104DROP TABLE IF EXISTS tp;
105DROP TABLE IF EXISTS tsp;
106DROP TABLE IF EXISTS tsp_00;
107DROP TABLE IF EXISTS tsp_01;
108DROP TABLE IF EXISTS tsp_02;
109DROP TABLE IF EXISTS tsp_03;
110DROP TABLE IF EXISTS tsp_04;
111DROP TABLE IF EXISTS t_empty;
112DROP TABLE IF EXISTS t_null;
113DROP USER test2@localhost;
114