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

Commit556110f

Browse files
committed
copy_relation_data was mistakenly assuming that the source relation
would always be already open at the smgr level. Per bug report fromFabien Coelho.
1 parentb4456e6 commit556110f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.129 2004/08/29 05:06:41 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.130 2004/08/31 15:56:39 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -5434,7 +5434,7 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace)
54345434
staticvoid
54355435
copy_relation_data(Relationrel,SMgrRelationdst)
54365436
{
5437-
SMgrRelationsrc=rel->rd_smgr;
5437+
SMgrRelationsrc;
54385438
booluse_wal;
54395439
BlockNumbernblocks;
54405440
BlockNumberblkno;
@@ -5457,6 +5457,9 @@ copy_relation_data(Relation rel, SMgrRelation dst)
54575457
use_wal=XLogArchivingActive()&& !rel->rd_istemp;
54585458

54595459
nblocks=RelationGetNumberOfBlocks(rel);
5460+
/* RelationGetNumberOfBlocks will certainly have opened rd_smgr */
5461+
src=rel->rd_smgr;
5462+
54605463
for (blkno=0;blkno<nblocks;blkno++)
54615464
{
54625465
smgrread(src,blkno,buf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp