Fix for bug291.
authorJan Wieck <JanWieck@Yahoo.com>
Fri, 7 Jun 2013 20:04:13 +0000 (16:04 -0400)
committerJan Wieck <JanWieck@Yahoo.com>
Fri, 7 Jun 2013 20:04:13 +0000 (16:04 -0400)
The apply trigger messed up the query if a row
was updated to all the same values in case a
table has a multi-column primary key.

src/backend/slony1_funcs.c

index 64c17855eb19d5ea782cd02ab8a6735968a1aa4c..9f640133ecd0db082e764457cd1c0f9da8e90643 100644 (file)
@@ -1496,7 +1496,7 @@ versionFunc(logApply)(PG_FUNCTION_ARGS)
                                         * Special case if there were no columns updated. We tell
                                         * it to set the first PK column to itself.
                                         */
-                                       if (cmdupdncols == 0)
+                                       if (cmdupdncols == 0 && i == 0)
                                        {
                                                sprintf(applyQueryPos, "%s = %s",
                                                                slon_quote_identifier(colname),