Skip to content

Commit 8148952

Browse files
committed
Copy indexkeys in _copyIndexPath.
1 parent e6dfee3 commit 8148952

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.4 1996/11/13 20:48:46 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.5 1997/04/10 07:59:09 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1073,6 +1073,19 @@ _copyIndexPath(IndexPath *from)
10731073
*/
10741074
newnode->indexid = listCopy(from->indexid);
10751075
Node_Copy(from, newnode, indexqual);
1076+
1077+
if (from->indexkeys)
1078+
{
1079+
int i, len;
1080+
1081+
for(len=0; from->indexkeys[len]!=0; len++)
1082+
;
1083+
newnode->indexkeys = (int *)palloc(sizeof(int) * (len+1));
1084+
for(i=0; i < len; i++) {
1085+
newnode->indexkeys[i] = from->indexkeys[i];
1086+
}
1087+
newnode->indexkeys[len] = 0;
1088+
}
10761089

10771090
return newnode;
10781091
}

0 commit comments

Comments
 (0)