workload/schemachanger: check for duplicate trigger functions#153181
workload/schemachanger: check for duplicate trigger functions#153181craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
spilchen
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @golgeek and @srosenberg)
pkg/workload/schemachange/operation_generator.go line 5453 at r1 (raw file):
// Check if the routine already exists. routineAlreadyExists, err := og.fnExistsByName(ctx, tx, schemaName, triggerFunctionName)
Doesn't triggerFunctionName have the schema now (a few lines up)? So, will it ever find a matching function name.
c69c322 to
23e1925
Compare
spilchen
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @golgeek and @srosenberg)
pkg/workload/schemachange/operation_generator.go line 5486 at r2 (raw file):
// Build the SQL statement sqlStatement := fmt.Sprintf("%s;CREATE TRIGGER %s %s %s ON %s FOR EACH ROW EXECUTE FUNCTION %s()",
do we need to specify the schema for the ROW EXECUTE FUNCTION %s() portion?
Previously, it was possible for trigger function names to collide if the workload was run mutliple times against a CRDB server. Certain tests like the mixed version tests will intentionally do this. So, before creating triggers or trigger functions we need to validate that function names do not collide. Fixes: cockroachdb#152716 Release note: None
23e1925 to
2e0221c
Compare
fqazi
left a comment
There was a problem hiding this comment.
@fqazi reviewed 1 of 1 files at r3, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @golgeek, @spilchen, and @srosenberg)
pkg/workload/schemachange/operation_generator.go line 5486 at r2 (raw file):
Previously, spilchen wrote…
do we need to specify the schema for the
ROW EXECUTE FUNCTION %s()portion?
Done.
spilchen
left a comment
There was a problem hiding this comment.
@spilchen reviewed 1 of 2 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @golgeek and @srosenberg)
|
@spilchen TFTR bors r+ |
Previously, it was possible for trigger function names to collide if the workload was run mutliple times against a CRDB server. Certain tests like the mixed version tests will intentionally do this. So, before creating triggers or trigger functions we need to validate that function names do not collide.
Fixes: #152716
Release note: None