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

Commit6ea5df1

Browse files
committed
Fix detect tablespace oid.
1 parentaf0e674 commit6ea5df1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎backup.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,6 @@ void make_pagemap_from_ptrack(parray *files)
13711371
size_tstart_addr;
13721372
Oiddb_oid,rel_oid,tablespace_oid=0;
13731373
intsep_iter,sep_count=0;
1374-
tablespace=palloc0(64);
13751374

13761375
/* Find target path*/
13771376
for(sep_iter= (int)path_length;sep_iter >=0;sep_iter--)
@@ -1380,16 +1379,17 @@ void make_pagemap_from_ptrack(parray *files)
13801379
{
13811380
sep_count++;
13821381
}
1383-
if (sep_count==3)
1382+
if (sep_count==2)
13841383
{
13851384
tmp_path+=sep_iter+1;
13861385
break;
13871386
}
13881387
}
13891388
/* For unix only now */
1390-
sscanf(tmp_path,"%[^/]/%u/%u_ptrack",tablespace,&db_oid,&rel_oid);
1391-
if (strcmp(tablespace,"base")!=0&&strcmp(tablespace,"global")!=0)
1392-
sscanf(tablespace,"%i",&tablespace_oid);
1389+
sscanf(tmp_path,"%u/%u_ptrack",&db_oid,&rel_oid);
1390+
tablespace=strstr(p->ptrack_path,"pg_tblspc");
1391+
if (tablespace!=NULL)
1392+
sscanf(tablespace+10,"%i/",&tablespace_oid);
13931393

13941394
flat_memory=pg_ptrack_get_and_clear(tablespace_oid,
13951395
db_oid,
@@ -1401,7 +1401,6 @@ void make_pagemap_from_ptrack(parray *files)
14011401
p->pagemap.bitmap=pg_malloc(p->pagemap.bitmapsize);
14021402
memcpy(p->pagemap.bitmap,flat_memory+start_addr,p->pagemap.bitmapsize);
14031403
pg_free(flat_memory);
1404-
pg_free(tablespace);
14051404
}
14061405
}
14071406
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp