~drizzle-trunk/drizzle/development

1320.4.1 by Joe Daly
scoreboard implementation for statistics
1
--disable_warnings
2
DROP TABLE IF EXISTS a;
1320.5.27 by Joe Daly
merge trunk, and add drop table calls and end of logging_stats tests where needed
3
DROP TABLE IF EXISTS b;
1320.4.1 by Joe Daly
scoreboard implementation for statistics
4
--enable_warnings
5
CREATE TABLE a (i int,  PRIMARY KEY (i));
6
ALTER TABLE a ADD COLUMN j int;
1320.4.2 by Joe Daly
add tests and get them working
7
DROP TABLE A;
1320.4.1 by Joe Daly
scoreboard implementation for statistics
8
CREATE TABLE a (i int,  PRIMARY KEY (i));
9
INSERT INTO a VALUES (1);
10
DELETE FROM a WHERE i=1;
1320.4.2 by Joe Daly
add tests and get them working
11
START TRANSACTION;
12
INSERT INTO a VALUES (1);
13
ROLLBACK;
14
START TRANSACTION;
15
INSERT INTO a VALUES (1);
16
COMMIT;
1320.4.1 by Joe Daly
scoreboard implementation for statistics
17
1320.4.2 by Joe Daly
add tests and get them working
18
# The statistics are incremented after the statements have already returned
19
# so its possible a query could be missed if we do not wait
20
--sleep 1 
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
21
--sorted_result
2029.1.26 by Brian Aker
Merge in work for reserved words in SQL standard.
22
SELECT USERNAME, COUNT_SELECT, COUNT_DELETE, COUNT_UPDATE, COUNT_INSERT, COUNT_ROLLBACK, COUNT_COMMIT, COUNT_CREATE, COUNT_ALTER, COUNT_DROP, COUNT_ADMIN  FROM DATA_DICTIONARY.CURRENT_SQL_COMMANDS WHERE USERNAME != "root";
1320.4.1 by Joe Daly
scoreboard implementation for statistics
23
24
# disable the plugin
25
set global logging_stats_enable=false;
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
26
--sorted_result
2029.1.26 by Brian Aker
Merge in work for reserved words in SQL standard.
27
SELECT USERNAME, COUNT_SELECT, COUNT_DELETE, COUNT_UPDATE, COUNT_INSERT, COUNT_ROLLBACK, COUNT_COMMIT, COUNT_CREATE, COUNT_ALTER, COUNT_DROP, COUNT_ADMIN FROM DATA_DICTIONARY.CURRENT_SQL_COMMANDS WHERE USERNAME != "root";
1320.4.1 by Joe Daly
scoreboard implementation for statistics
28
# renable it
29
set global logging_stats_enable=true;
30
1491.4.7 by Joe Daly
add tests for SESSION_STATEMENTS_NEW and GLOBAL_STATEMENTS_NEW table
31
32
#check the stats for the current session
1491.4.25 by Joe Daly
disable logging_stats plugin and rename GLOBAL_STATEMENTS and SESSION_STATEMENTS tables to remove NEW tag
33
SHOW CREATE TABLE data_dictionary.SESSION_STATEMENTS;
34
--replace_column 1 #
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
35
--sorted_result
1491.4.25 by Joe Daly
disable logging_stats plugin and rename GLOBAL_STATEMENTS and SESSION_STATEMENTS tables to remove NEW tag
36
SELECT count(*) FROM data_dictionary.SESSION_STATEMENTS;
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
37
--sorted_result
1491.4.25 by Joe Daly
disable logging_stats plugin and rename GLOBAL_STATEMENTS and SESSION_STATEMENTS tables to remove NEW tag
38
SELECT * FROM data_dictionary.SESSION_STATEMENTS;
1491.4.7 by Joe Daly
add tests for SESSION_STATEMENTS_NEW and GLOBAL_STATEMENTS_NEW table
39
40
#check stats for all active sessions
1320.4.2 by Joe Daly
add tests and get them working
41
connect (con1, localhost, root,,);
42
CREATE TABLE b (i int,  PRIMARY KEY (i));
43
INSERT INTO b VALUES (1);
44
connect (con2, localhost, drizzle,,);
45
INSERT INTO b VALUES (2);
1320.4.1 by Joe Daly
scoreboard implementation for statistics
46
1491.4.7 by Joe Daly
add tests for SESSION_STATEMENTS_NEW and GLOBAL_STATEMENTS_NEW table
47
48
1320.4.2 by Joe Daly
add tests and get them working
49
--sleep 1
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
50
--sorted_result
2029.1.26 by Brian Aker
Merge in work for reserved words in SQL standard.
51
SELECT USERNAME, COUNT_SELECT, COUNT_DELETE, COUNT_UPDATE, COUNT_INSERT, COUNT_ROLLBACK, COUNT_COMMIT, COUNT_CREATE, COUNT_ALTER, COUNT_DROP, COUNT_ADMIN FROM DATA_DICTIONARY.CURRENT_SQL_COMMANDS  WHERE USERNAME != "root";
1435.1.2 by Stewart Smith
fix logging_stats.command test to not leave tables a and b around that was causing a failure in any test case run after it that did SHOW TABLES (e.g embedded innodb)
52
1711.7.3 by Joseph Daly
test fixes
53
#dont select memory usage it will vary between 32/64 bit and compilers
1999.1.3 by Brian Aker
Merge in Monty. Two changes were made:
54
--sorted_result
1711.7.3 by Joseph Daly
test fixes
55
SELECT SCOREBOARD_SIZE, NUMBER_OF_RANGE_LOCKS, MAX_USERS_LOGGED FROM DATA_DICTIONARY.SCOREBOARD_STATISTICS;
56
1435.1.2 by Stewart Smith
fix logging_stats.command test to not leave tables a and b around that was causing a failure in any test case run after it that did SHOW TABLES (e.g embedded innodb)
57
DROP TABLE a,b;