~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-63

« back to all changes in this revision

Viewing changes to plugin/logging_query/tests/r/update.result

  • Committer: Continuous Integration
  • Date: 2012-10-08 22:32:23 UTC
  • mfrom: (2596.1.1 trunk-bug-723915-fix)
  • Revision ID: ci@drizzle.org-20121008223223-pdgsrtwdhlkm9ge4
Merge lp:~sharan-monikantan/drizzle/trunk-bug-723915-fixed Build: jenkins-Drizzle-Builder-63

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET GLOBAL logging_query_filename="DRIZZLETEST_VARDIR/logging_query.log";
 
2
Log file exists
 
3
Number of queries logged : 1
 
4
preparing the test bed...
 
5
# The logging_query plugin is not enabled and hence none of the queries in prepare phase should be logged
 
6
CREATE SCHEMA Test_Update;
 
7
USE Test_Update;
 
8
CREATE TABLE test_info (id INT, name CHAR(10));
 
9
INSERT INTO test_info VALUES (1,"create"),(2,"select"),(3,"insert"),(4,"update"),(5,"delete");
 
10
# This should print 1 indicating that the log file is still empty
 
11
Number of queries logged : 1
 
12
 
 
13
UPDATE test in progress...
 
14
# The logging_query plugin is not enabled and the following update query should not be logged
 
15
UPDATE test_info SET name="CREATE" WHERE id=1;
 
16
# This should print 1 indicating that the log file is still empty
 
17
Number of queries logged : 1
 
18
 
 
19
# Enabling the logging_query plugin
 
20
SET GLOBAL logging_query_enable=true;
 
21
 
 
22
# The logging_query plugin is enabled and the following update query should be logged
 
23
UPDATE test_info SET name="SELECT" WHERE id=2;
 
24
# This should print 3 indicating that the above query is logged
 
25
Number of queries logged : 1
 
26
 
 
27
# Enabling the logging_query plugin to log only select queries
 
28
SET GLOBAL logging_query_pcre="SELECT.+";
 
29
 
 
30
# The following UPDATE query should not be logged
 
31
UPDATE test_info SET name="INSERT" WHERE id=3;
 
32
SELECT * FROM test_info;
 
33
id      name
 
34
1       CREATE
 
35
2       SELECT
 
36
3       INSERT
 
37
4       update
 
38
5       delete
 
39
# This should print 5 indicating that, only the UPDATE query is NOT logged
 
40
Number of queries logged : 2
 
41
 
 
42
# Enabling the logging_query plugin to log UPDATE queries 
 
43
SET GLOBAL logging_query_pcre="UPDATE.+";
 
44
 
 
45
# The followihng UPDATE query should be logged
 
46
UPDATE test_info SET name="UPDATE" WHERE id=6;
 
47
# The above query will not update the table since a tuple with id=6 does not exist
 
48
SELECT * FROM test_info;
 
49
id      name
 
50
1       CREATE
 
51
2       SELECT
 
52
3       INSERT
 
53
4       update
 
54
5       delete
 
55
# This should print 7 indicating that, only the UPDATE query is logged and not the select query
 
56
Number of queries logged : 2
 
57
 
 
58
cleaning up...
 
59
SET GLOBAL logging_query_enable=false;
 
60
SET GLOBAL logging_query_pcre=".+";
 
61
DROP SCHEMA Test_Update;
 
62
***done***