@@ -195,11 +195,11 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
195
195
while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
196
196
{
197
197
ForkNumber forkNum ;
198
- int oidchars ;
198
+ int relnumchars ;
199
199
unlogged_relation_entry ent ;
200
200
201
201
/* Skip anything that doesn't look like a relation data file. */
202
- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
202
+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
203
203
& forkNum ))
204
204
continue ;
205
205
@@ -235,11 +235,11 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
235
235
while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
236
236
{
237
237
ForkNumber forkNum ;
238
- int oidchars ;
238
+ int relnumchars ;
239
239
unlogged_relation_entry ent ;
240
240
241
241
/* Skip anything that doesn't look like a relation data file. */
242
- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
242
+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
243
243
& forkNum ))
244
244
continue ;
245
245
@@ -285,13 +285,13 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
285
285
while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
286
286
{
287
287
ForkNumber forkNum ;
288
- int oidchars ;
289
- char oidbuf [OIDCHARS + 1 ];
288
+ int relnumchars ;
289
+ char relnumbuf [OIDCHARS + 1 ];
290
290
char srcpath [MAXPGPATH * 2 ];
291
291
char dstpath [MAXPGPATH ];
292
292
293
293
/* Skip anything that doesn't look like a relation data file. */
294
- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
294
+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
295
295
& forkNum ))
296
296
continue ;
297
297
@@ -304,10 +304,10 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
304
304
dbspacedirname , de -> d_name );
305
305
306
306
/* Construct destination pathname. */
307
- memcpy (oidbuf , de -> d_name , oidchars );
308
- oidbuf [ oidchars ] = '\0' ;
307
+ memcpy (relnumbuf , de -> d_name , relnumchars );
308
+ relnumbuf [ relnumchars ] = '\0' ;
309
309
snprintf (dstpath , sizeof (dstpath ), "%s/%s%s" ,
310
- dbspacedirname , oidbuf , de -> d_name + oidchars + 1 +
310
+ dbspacedirname , relnumbuf , de -> d_name + relnumchars + 1 +
311
311
strlen (forkNames [INIT_FORKNUM ]));
312
312
313
313
/* OK, we're ready to perform the actual copy. */
@@ -328,12 +328,12 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
328
328
while ((de = ReadDir (dbspace_dir , dbspacedirname )) != NULL )
329
329
{
330
330
ForkNumber forkNum ;
331
- int oidchars ;
332
- char oidbuf [OIDCHARS + 1 ];
331
+ int relnumchars ;
332
+ char relnumbuf [OIDCHARS + 1 ];
333
333
char mainpath [MAXPGPATH ];
334
334
335
335
/* Skip anything that doesn't look like a relation data file. */
336
- if (!parse_filename_for_nontemp_relation (de -> d_name , & oidchars ,
336
+ if (!parse_filename_for_nontemp_relation (de -> d_name , & relnumchars ,
337
337
& forkNum ))
338
338
continue ;
339
339
@@ -342,10 +342,10 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
342
342
continue ;
343
343
344
344
/* Construct main fork pathname. */
345
- memcpy (oidbuf , de -> d_name , oidchars );
346
- oidbuf [ oidchars ] = '\0' ;
345
+ memcpy (relnumbuf , de -> d_name , relnumchars );
346
+ relnumbuf [ relnumchars ] = '\0' ;
347
347
snprintf (mainpath , sizeof (mainpath ), "%s/%s%s" ,
348
- dbspacedirname , oidbuf , de -> d_name + oidchars + 1 +
348
+ dbspacedirname , relnumbuf , de -> d_name + relnumchars + 1 +
349
349
strlen (forkNames [INIT_FORKNUM ]));
350
350
351
351
fsync_fname (mainpath , false);
@@ -372,13 +372,13 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
372
372
* for a non-temporary relation and false otherwise.
373
373
*
374
374
* NB: If this function returns true, the caller is entitled to assume that
375
- * *oidchars has been set to the a value no more than OIDCHARS, and thus
376
- * that a buffer of OIDCHARS+1 characters is sufficient to hold the OID
377
- * portion of the filename. This is critical to protect against a possible
378
- * buffer overrun.
375
+ * *relnumchars has been set to a value no more than OIDCHARS, and thus
376
+ * that a buffer of OIDCHARS+1 characters is sufficient to hold the
377
+ * RelFileNumber portion of the filename. This is critical to protect against
378
+ * a possible buffer overrun.
379
379
*/
380
380
bool
381
- parse_filename_for_nontemp_relation (const char * name , int * oidchars ,
381
+ parse_filename_for_nontemp_relation (const char * name , int * relnumchars ,
382
382
ForkNumber * fork )
383
383
{
384
384
int pos ;
@@ -388,7 +388,7 @@ parse_filename_for_nontemp_relation(const char *name, int *oidchars,
388
388
;
389
389
if (pos == 0 || pos > OIDCHARS )
390
390
return false;
391
- * oidchars = pos ;
391
+ * relnumchars = pos ;
392
392
393
393
/* Check for a fork name. */
394
394
if (name [pos ] != '_' )
0 commit comments