Merge lp:~stewart/drizzle/bug911643 into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Merged
Approved by: Mark Atwood
Approved revision: 2480
Merged at revision: 2493
Proposed branch: lp:~stewart/drizzle/bug911643
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 140 lines (+102/-2)
5 files modified
plugin/transaction_log/hexdump_transaction_message.cc (+1/-1)
plugin/transaction_log/print_transaction_message.cc (+1/-1)
plugin/transaction_log/tests/r/bug911643.result (+71/-0)
plugin/transaction_log/tests/t/bug911643-master.opt (+1/-0)
plugin/transaction_log/tests/t/bug911643.test (+28/-0)
To merge this branch: bzr merge lp:~stewart/drizzle/bug911643
Reviewer Review Type Date Requested Status
Mark Atwood Pending
Drizzle Merge Team Pending
David Shrewsbury Pending
Review via email: mp+88628@code.launchpad.net

This proposal supersedes a proposal from 2012-01-04.

Description of the change

yet another odd thing I've hit with the CATALOG work :)

and this time, fixed so that "make distcheck" works - namely because we were using test/ as directory for txn log, which doesn't work when (without restarting server) you try and DROP SCHEMA test (a whole bunch later in drizzledump_restore test).

i.e. thi sshould merge okay now

To post a comment you must log in.
Revision history for this message
David Shrewsbury (dshrews) wrote : Posted in a previous version of this proposal

Good catch.

review: Approve
Revision history for this message
Mark Atwood (fallenpegasus) wrote : Posted in a previous version of this proposal

Fails in Jenkins build testing

http://jenkins.drizzle.org/view/Drizzle-build/job/drizzle-build-ubuntu10.10-32bit/1168/console

main.drizzledump_restore [ fail ]
ERROR 1006 (HY000) at line 11: Can't create schema 'test' (errno: 17)
drizzletest: At line 123: command "$DRIZZLE < $drizzledumpfile" failed

The result from queries just before the failure was:
< snip >
#
# Bug#550091 in Drizzle: "drizzledump dumps data_dictionary"
#
CREATE TABLE t1 (a char(100), b int);
INSERT INTO t1 values ('a',100);
INSERT INTO t1 values ('b',200);
CREATE SCHEMA drizzledump_test;
USE drizzledump_test;
CREATE TABLE t1 (a int, b char(100));
INSERT INTO t1 VALUES (1, 'abbazabba');
DROP original schemas
DROP DATABASE test;
DROP DATABASE drizzledump_test;
Ensure we don't have those tables (verify we restored something)
SELECT * FROM test.t1;
Got one of the listed errors
SELECT * FROM drizzledump_test.t1;
Got one of the listed errors
Restoring from dumpfile
exec of './tests/var/../../client/drizzle --no-defaults --host=localhost --user=root --password= --port=9090 < /home/hudson/hudson/workspace/drizzle-build-ubuntu10.10-32bit/drizzle7-2011.11.29.2488/_build/tests/var/tmp/drizzledumpfile.sql' failed, error: 256, status: 1, errno: 11

More results from queries before failure can be found in /home/hudson/hudson/workspace/drizzle-build-ubuntu10.10-32bit/drizzle7-2011.11.29.2488/_build/tests/var/log/drizzledump_restore.log

Stopping All Servers
Restoring snapshot of databases
Resuming Tests

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/transaction_log/hexdump_transaction_message.cc'
2--- plugin/transaction_log/hexdump_transaction_message.cc 2011-08-22 19:14:08 +0000
3+++ plugin/transaction_log/hexdump_transaction_message.cc 2012-01-16 00:41:25 +0000
4@@ -99,7 +99,7 @@
5 * a pool of TransactionLogReader objects that can be
6 * re-used.
7 */
8- const string &filename= transaction_log->getLogFilename();
9+ const string &filename= transaction_log->getLogFilepath();
10 int log_file= open(filename.c_str(), O_RDONLY);
11 if (log_file == -1)
12 {
13
14=== modified file 'plugin/transaction_log/print_transaction_message.cc'
15--- plugin/transaction_log/print_transaction_message.cc 2011-04-14 21:56:22 +0000
16+++ plugin/transaction_log/print_transaction_message.cc 2012-01-16 00:41:25 +0000
17@@ -99,7 +99,7 @@
18 * a pool of TransactionLogReader objects that can be
19 * re-used.
20 */
21- const string &filename= transaction_log->getLogFilename();
22+ const string &filename= transaction_log->getLogFilepath();
23 int log_file= open(filename.c_str(), O_RDONLY);
24 if (log_file == -1)
25 {
26
27=== added file 'plugin/transaction_log/tests/r/bug911643.result'
28--- plugin/transaction_log/tests/r/bug911643.result 1970-01-01 00:00:00 +0000
29+++ plugin/transaction_log/tests/r/bug911643.result 2012-01-16 00:41:25 +0000
30@@ -0,0 +1,71 @@
31+CREATE TABLE t1 (
32+pk INT NOT NULL AUTO_INCREMENT,
33+col_int1 INT,
34+col_int2 INT,
35+col_int_not_null INT NOT NULL,
36+PRIMARY KEY (pk));
37+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
38+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
39+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
40+SET GLOBAL transaction_log_truncate_debug= true;
41+BEGIN;
42+UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
43+ERROR 23000: Column 'col_int_not_null' cannot be null
44+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (5,5,5);
45+COMMIT;
46+
47+We should have a Transaction with a single insert Statement
48+SELECT PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
49+PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS))
50+transaction_context {
51+ server_id: 1
52+ TRANSACTION_ID
53+ START_TIMESTAMP
54+ END_TIMESTAMP
55+}
56+statement {
57+ type: INSERT
58+ START_TIMESTAMP
59+ END_TIMESTAMP
60+ insert_header {
61+ table_metadata {
62+ schema_name: "test"
63+ table_name: "t1"
64+ }
65+ field_metadata {
66+ type: INTEGER
67+ name: "pk"
68+ }
69+ field_metadata {
70+ type: INTEGER
71+ name: "col_int1"
72+ }
73+ field_metadata {
74+ type: INTEGER
75+ name: "col_int2"
76+ }
77+ field_metadata {
78+ type: INTEGER
79+ name: "col_int_not_null"
80+ }
81+ }
82+ insert_data {
83+ segment_id: 1
84+ end_segment: true
85+ record {
86+ insert_value: "4"
87+ insert_value: "5"
88+ insert_value: "5"
89+ insert_value: "5"
90+ is_null: false
91+ is_null: false
92+ is_null: false
93+ is_null: false
94+ }
95+ }
96+}
97+segment_id: 1
98+end_segment: true
99+
100+DROP TABLE t1;
101+SET GLOBAL transaction_log_truncate_debug= true;
102
103=== added file 'plugin/transaction_log/tests/t/bug911643-master.opt'
104--- plugin/transaction_log/tests/t/bug911643-master.opt 1970-01-01 00:00:00 +0000
105+++ plugin/transaction_log/tests/t/bug911643-master.opt 2012-01-16 00:41:25 +0000
106@@ -0,0 +1,1 @@
107+--transaction-log.enable --scheduler=multi_thread --transaction-message-threshold=131072 --allow-all-authentication.allow_anonymous=true --transaction-log.file=../local/transaction.log
108
109=== added file 'plugin/transaction_log/tests/t/bug911643.test'
110--- plugin/transaction_log/tests/t/bug911643.test 1970-01-01 00:00:00 +0000
111+++ plugin/transaction_log/tests/t/bug911643.test 2012-01-16 00:41:25 +0000
112@@ -0,0 +1,28 @@
113+CREATE TABLE t1 (
114+ pk INT NOT NULL AUTO_INCREMENT,
115+ col_int1 INT,
116+ col_int2 INT,
117+ col_int_not_null INT NOT NULL,
118+ PRIMARY KEY (pk));
119+
120+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
121+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
122+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
123+
124+SET GLOBAL transaction_log_truncate_debug= true;
125+
126+--test with no previous Statement message
127+BEGIN;
128+--ERROR ER_BAD_NULL_ERROR
129+UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
130+INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (5,5,5);
131+COMMIT;
132+
133+--echo
134+--echo We should have a Transaction with a single insert Statement
135+--replace_regex /transaction_id: [0-9]+/TRANSACTION_ID/ /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/
136+
137+SELECT PRINT_TRANSACTION_MESSAGE('test/transaction.log',(select max(entry_offset) from DATA_DICTIONARY.TRANSACTION_LOG_TRANSACTIONS));
138+
139+DROP TABLE t1;
140+SET GLOBAL transaction_log_truncate_debug= true;