Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit89bbbfc

Browse files
antamelfunny-falcon
authored andcommitted
Use updated parse_filename_for_nontemp_relation() interface.
And place changes under \#if PG_VERSION_NUM >= 170000. Caused by: - 5c47c6546c413d5eb51c1626070a807026e6139d (PostgreSQL) Refactor parse_filename_for_nontemp_relation to parse more. -f1352d7 (ptrack extension) Ptrack 2.0 initial releaseTags: ptrack
1 parentd427f73 commit89bbbfc

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

‎engine.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,13 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
506506
BlockNumberblkno,
507507
nblocks=0;
508508
structstatstat_buf;
509+
#ifPG_VERSION_NUM >=170000
510+
RelFileNumberrelNumber;
511+
unsignedsegno;
512+
#else
509513
intoidchars;
510514
charoidbuf[OIDCHARS+1];
515+
#endif
511516

512517
/* Do not track temporary relations */
513518
if (looks_like_temp_rel_name(filename))
@@ -519,12 +524,19 @@ ptrack_mark_file(Oid dbOid, Oid tablespaceOid,
519524
nodeDb(nodeOf(rnode))=dbOid;
520525
nodeSpc(nodeOf(rnode))=tablespaceOid;
521526

527+
#ifPG_VERSION_NUM >=170000
528+
if (!parse_filename_for_nontemp_relation(filename,&relNumber,&forknum,&segno))
529+
return;
530+
531+
nodeRel(nodeOf(rnode))=relNumber;
532+
#else
522533
if (!parse_filename_for_nontemp_relation(filename,&oidchars,&forknum))
523534
return;
524535

525536
memcpy(oidbuf,filename,oidchars);
526537
oidbuf[oidchars]='\0';
527538
nodeRel(nodeOf(rnode))=atooid(oidbuf);
539+
#endif
528540

529541
/* Compute number of blocks based on file size */
530542
if (stat(filepath,&stat_buf)==0)

‎ptrack.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,25 +330,38 @@ ptrack_gather_filelist(List **filelist, char *path, Oid spcOid, Oid dbOid)
330330
/* Regular file inside database directory, otherwise skip it */
331331
if (dbOid!=InvalidOid||spcOid==GLOBALTABLESPACE_OID)
332332
{
333+
#ifPG_VERSION_NUM >=170000
334+
RelFileNumberrelNumber;
335+
unsignedsegno;
336+
#else
333337
intoidchars;
334338
charoidbuf[OIDCHARS+1];
339+
#endif
335340
char*segpath;
336341
PtrackFileList_i*pfl=palloc0(sizeof(PtrackFileList_i));
337342

338343
/*
339344
* Check that filename seems to be a regular relation file.
340345
*/
346+
#ifPG_VERSION_NUM >=170000
347+
if (!parse_filename_for_nontemp_relation(de->d_name,&relNumber,&pfl->forknum,&segno))
348+
continue;
349+
#else
341350
if (!parse_filename_for_nontemp_relation(de->d_name,&oidchars,&pfl->forknum))
342351
continue;
343-
352+
#endif
344353
/* Parse segno */
345354
segpath=strstr(de->d_name,".");
346355
pfl->segno=segpath!=NULL ?atoi(segpath+1) :0;
347356

348357
/* Fill the pfl in */
358+
#ifPG_VERSION_NUM >=170000
359+
nodeRel(pfl->relnode)=relNumber;
360+
#else
349361
memcpy(oidbuf,de->d_name,oidchars);
350362
oidbuf[oidchars]='\0';
351363
nodeRel(pfl->relnode)=atooid(oidbuf);
364+
#endif
352365
nodeDb(pfl->relnode)=dbOid;
353366
nodeSpc(pfl->relnode)=spcOid==InvalidOid ?DEFAULTTABLESPACE_OID :spcOid;
354367
pfl->path=GetRelationPath(dbOid,nodeSpc(pfl->relnode),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp