History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BRUCE-16
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Robert Klahn
Reporter: Derek Chan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Bruce

Constructed DELETE statement, when run on the parent table of inherited tables may delete more than it should

Created: 25/Sep/07 02:35 PM   Updated: 25/Sep/07 02:35 PM
Component/s: Daemon
Affects Version/s: 1.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File bruce-16.patch (0.5 kb)


Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
Fix before or with BRUCE-14.

A DELETE FROM ONLY on a parent table (aka do not touch children) is not replicated as such on the master.

After fixing BRUCE-14, this may cause data loss.

Steps to reproduce:

CREATE TABLE test (x INT, y INT);
CREATE TABLE test_1 (CHECK (x=1)) INHERITS (test);

on master:

CREATE TRIGGER test_sn AFTER INSERT OR DELETE OR UPDATE ON test FOR EACH STATEMENT EXECUTE PROCEDURE bruce.logsnapshottrigger();
CREATE TRIGGER test_tx AFTER INSERT OR DELETE OR UPDATE ON test FOR EACH ROW EXECUTE PROCEDURE bruce.logtransactiontrigger();

CREATE TRIGGER test_1_sn AFTER INSERT OR DELETE OR UPDATE ON test_1 FOR EACH STATEMENT EXECUTE PROCEDURE bruce.logsnapshottrigger();
CREATE TRIGGER test_1_tx AFTER INSERT OR DELETE OR UPDATE ON test_1 FOR EACH ROW EXECUTE PROCEDURE bruce.logtransactiontrigger();

on slave:

CREATE TRIGGER test_deny BEFORE INSERT OR DELETE OR UPDATE ON test FOR EACH ROW EXECUTE PROCEDURE bruce.denyaccesstrigger();
CREATE TRIGGER test_1_deny BEFORE INSERT OR DELETE OR UPDATE ON test_1 FOR EACH ROW EXECUTE PROCEDURE bruce.denyaccesstrigger();

on master:

INSERT INTO test VALUES (1, 1);

BEGIN;
INSERT INTO test_1 SELECT * FROM test WHERE x=1;
DELETE FROM ONLY test WHERE x=1;
COMMIT;



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.