~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/transaction_log/tests/t/rollback_statement.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
 
#
2
 
# Tests simple INSERT statements and the transaction log
3
 
#
4
 
 
5
 
# Ignore startup/shutdown events
6
 
--disable_query_log
7
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
8
 
 
9
 
--disable_warnings
10
 
DROP TABLE IF EXISTS t1;
11
 
 
12
 
--enable_warnings
13
 
 
14
 
CREATE TABLE src (
15
 
  pk int auto_increment primary key,
16
 
  d varchar(16000)
17
 
);
18
 
 
19
 
CREATE TABLE dst (
20
 
  pk int primary key,
21
 
  d varchar(16000) NOT NULL
22
 
);
23
 
 
24
 
insert into src (d) values (repeat("B",16000));
25
 
insert into src (d) values (repeat("B",16000));
26
 
insert into src (d) values (repeat("B",16000));
27
 
insert into src (d) values (repeat("B",16000));
28
 
insert into src (d) values (repeat("B",16000));
29
 
insert into src (d) values (repeat("B",16000));
30
 
insert into src (d) values (repeat("B",16000));
31
 
insert into src (d) values (repeat("B",16000));
32
 
insert into src (d) values (repeat("B",16000));
33
 
insert into src (d) values (repeat("B",16000));
34
 
insert into src (d) values (repeat("B",16000));
35
 
insert into src (d) values (repeat("B",16000));
36
 
insert into src (d) values (NULL);
37
 
 
38
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
39
 
--enable_query_log
40
 
 
41
 
START TRANSACTION;
42
 
--error ER_BAD_NULL_ERROR
43
 
INSERT into dst SELECT * from src ORDER BY pk ASC;
44
 
COMMIT;
45
 
 
46
 
--echo
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/ /transaction_id: [0-9]+/TRANSACTION_ID/ /$DRIZZLETEST_VARDIR/VARDIR/
48
 
--exec ../plugin/transaction_log/utilities/transaction_reader --raw $DRIZZLETEST_VARDIR/master-data/local/transaction.log
49
 
 
50
 
--echo
51
 
--replace_result $DRIZZLETEST_VARDIR VARDIR
52
 
--exec ../plugin/transaction_log/utilities/transaction_reader $DRIZZLETEST_VARDIR/master-data/local/transaction.log
53
 
 
54
 
--disable_query_log
55
 
DROP TABLE src;
56
 
DROP TABLE dst;
57
 
 
58
 
CREATE TABLE src (pk int auto_increment primary key, d varchar(5));
59
 
CREATE TABLE dst (pk int auto_increment primary key, d varchar(5) not null);
60
 
 
61
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
62
 
 
63
 
--enable_query_log
64
 
 
65
 
--echo
66
 
START TRANSACTION;
67
 
INSERT INTO src (d) VALUES ('aaa'), ('bbb'), (NULL);
68
 
--error ER_BAD_NULL_ERROR
69
 
INSERT INTO dst (d) SELECT d FROM src ORDER BY pk;
70
 
INSERT INTO dst (d) VALUES ('xyz');
71
 
COMMIT;
72
 
 
73
 
--echo
74
 
SELECT * FROM src;
75
 
--echo
76
 
SELECT * FROM dst;
77
 
 
78
 
--echo
79
 
--source ../plugin/transaction_log/tests/t/check_transaction_log.inc
80
 
 
81
 
# Truncate the log file to reset for the next test
82
 
--disable_query_log
83
 
DROP TABLE src;
84
 
DROP TABLE dst;
85
 
--source ../plugin/transaction_log/tests/t/truncate_log.inc
86
 
--enable_query_log