diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-07-19 06:27:59 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-07-19 06:27:59 +0000 |
commit | 6562fa851e56e0eba456a1b8dde567b3183cea23 (patch) | |
tree | fe884a4d50afe2200b93c5b954e7a11bfcb5d6f9 /src/backend/executor/nodeUnique.c | |
parent | 9bffaade96ffc867afe81160d64ac287a971e330 (diff) | |
download | postgresql-6562fa851e56e0eba456a1b8dde567b3183cea23.tar.gz postgresql-6562fa851e56e0eba456a1b8dde567b3183cea23.zip |
Fixes:
'select distinct on' causes backend to crash
submitted by: Chris Dunlop chris@onthe.net.au
Diffstat (limited to 'src/backend/executor/nodeUnique.c')
-rw-r--r-- | src/backend/executor/nodeUnique.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeUnique.c b/src/backend/executor/nodeUnique.c index 8be0bd8497c..8e81b95d8a8 100644 --- a/src/backend/executor/nodeUnique.c +++ b/src/backend/executor/nodeUnique.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1.1.1 1996/07/09 06:21:27 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.2 1996/07/19 06:27:59 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -124,7 +124,7 @@ ExecUnique(Unique *node) if (uniqueAttr) { tupDesc = ExecGetResultType(uniquestate); - typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum]->atttypid); + typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum-1]->atttypid); } /* ---------------- @@ -174,8 +174,8 @@ ExecUnique(Unique *node) if (isNull1 == isNull2) { if (isNull1) /* both are null, they are equal */ continue; - val1 = fmgr(typoutput, attr1, gettypelem(tupDesc->attrs[uniqueAttrNum]->atttypid)); - val2 = fmgr(typoutput, attr2, gettypelem(tupDesc->attrs[uniqueAttrNum]->atttypid)); + val1 = fmgr(typoutput, attr1, gettypelem(tupDesc->attrs[uniqueAttrNum-1]->atttypid)); + val2 = fmgr(typoutput, attr2, gettypelem(tupDesc->attrs[uniqueAttrNum-1]->atttypid)); /* now, val1 and val2 are ascii representations so we can use strcmp for comparison */ if (strcmp(val1,val2) == 0) /* they are equal */ |