aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepqual.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-03-25 18:44:47 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-03-25 18:44:47 -0400
commitc8e993503d0f1a0cb8f187a136fb64cead9ba591 (patch)
tree4a3492603e52262a7b59730bd7e271e2e2f28443 /src/backend/optimizer/prep/prepqual.c
parent9b19c12e1d930a237817dd432100388990ec082a (diff)
downloadpostgresql-c8e993503d0f1a0cb8f187a136fb64cead9ba591.tar.gz
postgresql-c8e993503d0f1a0cb8f187a136fb64cead9ba591.zip
Fix failure to propagate collation in negate_clause().
Turns out it was this, and not so much plpgsql, that was at fault in Stefan Huehner's collation-error-in-a-trigger bug report of a couple weeks ago.
Diffstat (limited to 'src/backend/optimizer/prep/prepqual.c')
-rw-r--r--src/backend/optimizer/prep/prepqual.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/optimizer/prep/prepqual.c b/src/backend/optimizer/prep/prepqual.c
index fbd68097244..10e00d90dda 100644
--- a/src/backend/optimizer/prep/prepqual.c
+++ b/src/backend/optimizer/prep/prepqual.c
@@ -104,6 +104,8 @@ negate_clause(Node *node)
newopexpr->opfuncid = InvalidOid;
newopexpr->opresulttype = opexpr->opresulttype;
newopexpr->opretset = opexpr->opretset;
+ newopexpr->opcollid = opexpr->opcollid;
+ newopexpr->inputcollid = opexpr->inputcollid;
newopexpr->args = opexpr->args;
newopexpr->location = opexpr->location;
return (Node *) newopexpr;
@@ -126,6 +128,7 @@ negate_clause(Node *node)
newopexpr->opno = negator;
newopexpr->opfuncid = InvalidOid;
newopexpr->useOr = !saopexpr->useOr;
+ newopexpr->inputcollid = saopexpr->inputcollid;
newopexpr->args = saopexpr->args;
newopexpr->location = saopexpr->location;
return (Node *) newopexpr;