Bug 124 - EXECUTE SCRIPT, ONLY ON != EVENT NODE is wrong
Summary: EXECUTE SCRIPT, ONLY ON != EVENT NODE is wrong
Status: RESOLVED FIXED
Alias: None
Product: Slony-I
Classification: Unclassified
Component: slonik (show other bugs)
Version: 2.0
Hardware: All All
: medium normal
Assignee: Jan Wieck
URL:
Depends on:
Blocks:
 
Reported: 2010-05-18 07:41 UTC by Steve Singer
Modified: 2010-09-09 10:10 UTC (History)
1 user (show)

See Also:


Attachments
Have DDL validate that not both EVENT NODE and ONLY ON NODE are set (600 bytes, patch)
2010-08-18 13:03 UTC, Christopher Browne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Singer 2010-05-18 07:41:24 UTC
A slonik command like

EXECUTE SCRIPT( SET ID=1, FILENAME='/tmp/executeScript5718113975686807087.sql' , EVENT NODE=1, EXECUTE ONLY ON=5);

Where the EVENT NODE != the EXECUTE ONLY ON node tries to execute the DDL against node 1 (the event node).  This essentially ignores the node id specified in the ONLY ON syntax.

We could either:

1) Submit the ddl script into the replication queue on the event node but only execute it on the ONLY ON node.

2) Change EXECUTE ONLY ON to be a boolean so when it is true we only execute on the EVENT NODE

3) Generate an error if event node != ONLY ON and let the user fix their script.
Comment 1 Jan Wieck 2010-08-13 09:55:14 UTC
Or change the event node value after parsing with the execute only node (if given), emitting a warning.
Comment 2 Christopher Browne 2010-08-18 13:02:05 UTC
(In reply to comment #0)
> 3) Generate an error if event node != ONLY ON and let the user fix their
> script.

I favour this option, generally.

There's also the nuance that when you do "EXECUTE ONLY ON," there isn't an event generated, so I'd think it a fine idea to require that EVENT NODE be left blank, in this case.
Comment 3 Christopher Browne 2010-08-18 13:03:33 UTC
Created attachment 60 [details]
Have DDL validate that not both EVENT NODE and ONLY ON NODE are set

Here's a patch that validates that EVENT NODE and ONLY ON NODE are not both present.
Comment 4 Steve Singer 2010-08-25 11:31:34 UTC
Jan to review code.