-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ever apply a trigger to the entity that's triggering the update (…
…#94)
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,13 +79,18 @@ spindle_trigger_apply(SPINDLEENTRY *entry) | |
{ | ||
return 0; | ||
} | ||
rs = sql_queryf(entry->generate->db, "SELECT \"id\", \"flags\" FROM \"triggers\" WHERE \"triggerid\" = %Q", entry->id); | ||
rs = sql_queryf(entry->generate->db, "SELECT \"id\", \"flags\", \"triggerid\" FROM \"triggers\" WHERE \"triggerid\" = %Q", entry->id); | ||
if(!rs) | ||
{ | ||
return -1; | ||
} | ||
for(; !sql_stmt_eof(rs); sql_stmt_next(rs)) | ||
{ | ||
/* Never apply a trigger to the entry itself */ | ||
if(!strcmp(sql_stmt_str(rs, 0), sql_stmt_str(rs, 2))) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nevali
Author
Member
|
||
{ | ||
continue; | ||
} | ||
flags = (int) sql_stmt_long(rs, 1); | ||
if(!flags) | ||
{ | ||
|
Rather than skipping the matching IDs here, might it be more profitable to add a
AND id <> %Q
to the query on line 82 and just not fetch them in the first place?