-
Committer:
Jay Pipes
-
Date:
2009-11-03 18:49:13 UTC
-
mto:
(1234.1.1 push)
(1237.2.10 push)
-
mto:
This revision was merged to the branch mainline in
revision
1206.
-
Revision ID:
jpipes@serialcoder-20091103184913-12d2cehwq33jgcdn
This patch fixes a bug in the replication service and transaction
proto file that was occurring when an UPDATE statement was SETting
a field to a value by referencing the field itself.
For instance, imagine the following scenario:
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, count INT NOT NULL);
INSERT INTO t1 (id, counter) VALUES (1,1),(2,2),(3,3);
UPDATE t1 SET counter = counter + 1 WHERE id IN (1,2);
Previously, the UpdateHeader message contained a single set_value
byte array containing the new value to set the field to. However,
in scenarios such as the above, for each record being updated, the
value that the field would be set to is different. Therefore, this
patch moves the set_value byte array from the UpdateHeader message
into the UpdateRecord message and names it after_value to match the
existing before_value byte array.
This patch adds a test case to the existing update.test case in the
transaction log suite and modifies the statement_transform library to
properly handle the above scenario.