8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.85 2000/06/05 07:28:40 tgl Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.86 2000/06/17 23:41:27 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -161,10 +161,9 @@ typedef struct _IndexList
161
161
char * il_ind ;
162
162
int il_natts ;
163
163
AttrNumber * il_attnos ;
164
- uint16 il_nparams ;
165
- Datum * il_params ;
166
164
FuncIndexInfo * il_finfo ;
167
165
PredInfo * il_predInfo ;
166
+ bool il_unique ;
168
167
struct _IndexList * il_next ;
169
168
} IndexList ;
170
169
@@ -1071,12 +1070,10 @@ index_register(char *heap,
1071
1070
char * ind ,
1072
1071
int natts ,
1073
1072
AttrNumber * attnos ,
1074
- uint16 nparams ,
1075
- Datum * params ,
1076
1073
FuncIndexInfo * finfo ,
1077
- PredInfo * predInfo )
1074
+ PredInfo * predInfo ,
1075
+ bool unique )
1078
1076
{
1079
- Datum * v ;
1080
1077
IndexList * newind ;
1081
1078
int len ;
1082
1079
MemoryContext oldcxt ;
@@ -1103,25 +1100,12 @@ index_register(char *heap,
1103
1100
len = natts * sizeof (AttrNumber );
1104
1101
1105
1102
newind -> il_attnos = (AttrNumber * ) palloc (len );
1106
- memmove (newind -> il_attnos , attnos , len );
1103
+ memcpy (newind -> il_attnos , attnos , len );
1107
1104
1108
- if ((newind -> il_nparams = nparams ) > 0 )
1109
- {
1110
- v = newind -> il_params = (Datum * ) palloc (2 * nparams * sizeof (Datum ));
1111
- nparams *= 2 ;
1112
- while (nparams -- > 0 )
1113
- {
1114
- * v = (Datum ) palloc (strlen ((char * ) (* params )) + 1 );
1115
- strcpy ((char * ) * v ++ , (char * ) * params ++ );
1116
- }
1117
- }
1118
- else
1119
- newind -> il_params = (Datum * ) NULL ;
1120
-
1121
- if (finfo != (FuncIndexInfo * ) NULL )
1105
+ if (PointerIsValid (finfo ))
1122
1106
{
1123
1107
newind -> il_finfo = (FuncIndexInfo * ) palloc (sizeof (FuncIndexInfo ));
1124
- memmove (newind -> il_finfo , finfo , sizeof (FuncIndexInfo ));
1108
+ memcpy (newind -> il_finfo , finfo , sizeof (FuncIndexInfo ));
1125
1109
}
1126
1110
else
1127
1111
newind -> il_finfo = (FuncIndexInfo * ) NULL ;
@@ -1135,6 +1119,8 @@ index_register(char *heap,
1135
1119
else
1136
1120
newind -> il_predInfo = NULL ;
1137
1121
1122
+ newind -> il_unique = unique ;
1123
+
1138
1124
newind -> il_next = ILHead ;
1139
1125
1140
1126
ILHead = newind ;
@@ -1155,8 +1141,8 @@ build_indices()
1155
1141
ind = index_openr (ILHead -> il_ind );
1156
1142
Assert (ind );
1157
1143
index_build (heap , ind , ILHead -> il_natts , ILHead -> il_attnos ,
1158
- ILHead -> il_nparams , ILHead -> il_params , ILHead -> il_finfo ,
1159
- ILHead -> il_predInfo );
1144
+ ILHead -> il_finfo , ILHead -> il_predInfo ,
1145
+ ILHead -> il_unique );
1160
1146
1161
1147
/*
1162
1148
* In normal processing mode, index_build would close the heap and
0 commit comments