|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.1.1.1 1996/07/09 06:21:27 scrappy Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.2 1996/07/19 06:27:59 scrappy Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -124,7 +124,7 @@ ExecUnique(Unique *node)
|
124 | 124 |
|
125 | 125 | if (uniqueAttr) {
|
126 | 126 | tupDesc = ExecGetResultType(uniquestate);
|
127 |
| - typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum]->atttypid); |
| 127 | + typoutput = typtoout((Oid)tupDesc->attrs[uniqueAttrNum-1]->atttypid); |
128 | 128 | }
|
129 | 129 |
|
130 | 130 | /* ----------------
|
@@ -174,8 +174,8 @@ ExecUnique(Unique *node)
|
174 | 174 | if (isNull1 == isNull2) {
|
175 | 175 | if (isNull1) /* both are null, they are equal */
|
176 | 176 | continue;
|
177 |
| - val1 = fmgr(typoutput, attr1, gettypelem(tupDesc->attrs[uniqueAttrNum]->atttypid)); |
178 |
| - val2 = fmgr(typoutput, attr2, gettypelem(tupDesc->attrs[uniqueAttrNum]->atttypid)); |
| 177 | + val1 = fmgr(typoutput, attr1, gettypelem(tupDesc->attrs[uniqueAttrNum-1]->atttypid)); |
| 178 | + val2 = fmgr(typoutput, attr2, gettypelem(tupDesc->attrs[uniqueAttrNum-1]->atttypid)); |
179 | 179 | /* now, val1 and val2 are ascii representations so we can
|
180 | 180 | use strcmp for comparison */
|
181 | 181 | if (strcmp(val1,val2) == 0) /* they are equal */
|
|
0 commit comments