Transaction log retaining partial information from an aborted transaction
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
High
|
David Shrewsbury | ||
7.0 |
Fix Released
|
High
|
David Shrewsbury |
Bug Description
The transaction log is retaining partial information for a failed query that didn't change the data of the master server.
This appears to be related to:
https:/
But to the opposite extreme.
In the example below (from the test case), we have a query which will fail:
UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
This is because there is a NULL value for col_int1 and col_int_not_null is NOT NULL.
CREATE TABLE t1
(pk INT NOT NULL AUTO_INCREMENT,
col_int1 INT,
col_int2 INT,
col_int_not_null INT NOT NULL,
PRIMARY KEY (pk) );
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (1,1,1);
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (NULL,1,1);
INSERT INTO t1 (col_int1, col_int2, col_int_not_null) VALUES (2,1,3);
# transaction
BEGIN;
UPDATE t1 SET col_int1 = (col_int1 + 1) WHERE col_int2 = 1;
--ERROR ER_BAD_NULL_ERROR
UPDATE t1 SET col_int_not_null = col_int1 WHERE col_int2 = 1;
COMMIT;
After running this query, we get the 1048 (ER_BAD_NULL_ERROR) as expected, however, the log contains this - the first row that would have been affected by the failed update.
statement {
type: UPDATE
START_TIMESTAMP
END_TIMESTAMP
update_header {
table_metadata {
schema_name: "test"
table_name: "t1"
}
key_
type: INTEGER
name: "pk"
}
set_
type: INTEGER
name: "col_int_not_null"
}
}
update_data {
segment_id: 1
end_segment: true
record {
key_value: "1"
after_value: "2"
is_null: false
}
}
}
Related branches
- Drizzle Merge Team: Pending requested
-
Diff: 716 lines (+512/-48)9 files modifieddrizzled/session.cc (+14/-14)
drizzled/session.h (+45/-24)
drizzled/sql_insert.cc (+9/-0)
drizzled/sql_update.cc (+22/-8)
drizzled/transaction_services.cc (+121/-2)
drizzled/transaction_services.h (+22/-0)
plugin/transaction_log/tests/r/bug660779.result (+220/-0)
plugin/transaction_log/tests/t/bug660779-master.opt (+1/-0)
plugin/transaction_log/tests/t/bug660779.test (+58/-0)
Changed in drizzle: | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
assignee: | nobody → David Shrewsbury (dshrews) |
Changed in drizzle: | |
status: | Confirmed → In Progress |
Changed in drizzle: | |
status: | In Progress → Fix Committed |
milestone: | none → 2010-11-08 |
importance: | Undecided → High |
Attached branch contains a test case transaction_ log bug660779
./test-run --suite=
The test will pass, but examining the log output in the .result file shows the issue.