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
|
connect (con1, localhost, drizzle,,);
connection con1;
--disable_warnings
DROP TABLE IF EXISTS a;
--enable_warnings
CREATE TABLE a (i int, PRIMARY KEY (i));
INSERT INTO a VALUES (1);
disconnect con1;
connect (con2, localhost, drizzle,,);
connection con2;
INSERT INTO a VALUES (2);
UPDATE a SET i=9 WHERE i=2;
SELECT * FROM a ORDER BY i;
disconnect con2;
connect (con3, localhost, drizzle_test,,);
connection con3;
INSERT INTO a VALUES (3);
SELECT * FROM a ORDER BY i;
UPDATE a SET i=10 WHERE i=3;
DELETE FROM a WHERE i=10;
disconnect con3;
connection default;
# The statistics are incremented after the statements have already returned
# so its possible a query could be missed if we do not wait
--sorted_result
--sleep 1
SELECT IF(COUNT_SELECT, "YES", "NO"), IF(COUNT_UPDATE, "YES", "NO"), IF(COUNT_INSERT, "YES", "NO") FROM DATA_DICTIONARY.CUMULATIVE_SQL_COMMANDS WHERE USERNAME != "root" ORDER BY USERNAME;
SELECT USERNAME, IF(DENIED_CONNECTIONS, "NO", "YES"), IF(LOST_CONNECTIONS, "YES", "NO"), IF(DENIED_CONNECTIONS, "YES", "NO"), IF(ROWS_FETCHED, "YES", "NO"), IF(ROWS_UPDATED, "YES", "NO"), IF(ROWS_INSERTED, "YES", "NO") FROM DATA_DICTIONARY.CUMULATIVE_USER_STATS WHERE USERNAME != "root" ORDER BY USERNAME;
DROP TABLE a;
|