~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to plugin/transaction_log/tests/t/transaction_log_schema.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# transaction_log_schema
2
 
# Test of CREATE / DROP /ALTER SCHEMA statements and how the transaction log
3
 
# captures / represents them
4
 
 
5
 
# Ignore startup/shutdown events
6
 
--disable_query_log
7
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
8
 
--enable_query_log
9
 
 
10
 
 
11
 
--echo Simple CREATE / DROP test
12
 
--echo Testing simple CREATE SCHEMA 
13
 
CREATE SCHEMA my_test_schema;
14
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
15
 
--echo
16
 
 
17
 
--echo Testing simple DROP SCHEMA
18
 
DROP SCHEMA my_test_schema;
19
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
20
 
--echo
21
 
 
22
 
# Truncate the log file to reset for the next test
23
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
24
 
--echo
25
 
 
26
 
--echo Testing DROP SCHEMA on non-empty schema
27
 
CREATE SCHEMA my_test_schema;
28
 
CREATE TABLE my_test_schema.t1 (a int not null, primary key(a));
29
 
CREATE TABLE my_test_schema.t2 LIKE my_test_schema.t1;
30
 
CREATE TABLE my_test_schema.t3 LIKE my_test_schema.t2;
31
 
 
32
 
--echo We truncate the log to simplify test validation
33
 
--echo we are mainly concerned that we see 4 new entries 
34
 
--echo once we have issued the DROP SCHEMA statement
35
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
36
 
--echo
37
 
 
38
 
 
39
 
DROP SCHEMA my_test_schema;
40
 
# We check to see that t1,t2,t3 are DROPped as well
41
 
--echo The implied DROP TABLE statements for t1->t3
42
 
--echo do not come in any deterministic order t1 may or may not be first
43
 
--echo ,therefore we have to satisfy ourselves that we have 4 items in the log
44
 
--echo after issuing the DROP SCHEMA
45
 
--echo We do check the first entry (OFFSET=0) as this should be the first of 3 DROP TABLE messages
46
 
 
47
 
--replace_regex /start_timestamp: [0-9]+/START_TIMESTAMP/g /end_timestamp: [0-9]+/END_TIMESTAMP/g /creation_timestamp: [0-9]+/CREATE_TIMESTAMP/ /update_timestamp: [0-9]+/UPDATE_TIMESTAMP/ /table_name: "t[1|2|3]"/table_name:  TABLE_NAME/ /transaction_id: [0-9]+/TRANSACTION_ID/
48
 
SELECT PRINT_TRANSACTION_MESSAGE('transaction.log',0);
49
 
 
50
 
 
51
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
52
 
--echo
53
 
 
54
 
# Truncate the log file to reset for the next test
55
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
56
 
--echo
57
 
 
58
 
--echo Testing simple CREATE SCHEMA
59
 
CREATE SCHEMA my_test_schema;
60
 
USE my_test_schema;
61
 
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b CHAR(50), PRIMARY KEY(a));
62
 
ALTER SCHEMA my_test_schema COLLATE utf8_turkish_ci; 
63
 
SHOW CREATE TABLE t1;
64
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
65
 
--echo
66
 
CREATE TABLE t2 LIKE t1;
67
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
68
 
--echo
69
 
DROP SCHEMA my_test_schema;
70
 
 
71
 
# Truncate the log file to reset for the next test
72
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
73
 
--echo
74
 
 
75
 
 
76
 
 
77
 
 
78