You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
workload/schemachanger: fix invalid function syntax errors
Previously, the random schema changer workload used $$ as a delimiter
for function definitions. Unfortunately, randomly generated strings used
by functions could easily contain $$ causing the definition to
terminator to show up. To address this patch modifies the delimiter to
be $FUNC_BODY$.
Fixes: #148555
Release note: None
triggerFunction:=fmt.Sprintf(`CREATE FUNCTION %s() RETURNS TRIGGER AS $$ BEGIN %s;RETURN NULL;END; $$ LANGUAGE PLpgSQL`, triggerFunctionName, selectStmt.sql)
5345
+
triggerFunction:=fmt.Sprintf(`CREATE FUNCTION %s() RETURNS TRIGGER AS $FUNC_BODY$ BEGIN %s;RETURN NULL;END; $FUNC_BODY$ LANGUAGE PLpgSQL`, triggerFunctionName, selectStmt.sql)
5346
5346
5347
5347
og.LogMessage(fmt.Sprintf("Created trigger function %s", triggerFunction))
0 commit comments