Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fc5c577e
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fc5c577e
编写于
10月 25, 2002
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow fseeko in pg_dump only if fseeko() will work for all supported file
sizes.
上级
2908a838
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
13 deletion
+41
-13
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+2
-2
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+27
-1
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+3
-1
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+3
-3
src/bin/pg_dump/pg_backup_files.c
src/bin/pg_dump/pg_backup_files.c
+3
-3
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+3
-3
未找到文件。
src/bin/pg_dump/common.c
浏览文件 @
fc5c577e
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
1 2002/10/09 16:20:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
2 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -290,7 +290,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
* attr with the same name, then only dump it if:
*
* - it is NOT NULL and zero parents are NOT NULL
* OR
* OR
* - it has a default value AND the default value does not match
* all parent default values, or no parents specify a default.
*
...
...
src/bin/pg_dump/pg_backup_archiver.c
浏览文件 @
fc5c577e
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.
59 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.
60 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2338,6 +2338,32 @@ ReadHead(ArchiveHandle *AH)
}
/*
* checkSeek
* check to see if fseek can be performed.
*/
bool
checkSeek
(
FILE
*
fp
)
{
if
(
fseek
(
fp
,
0
,
SEEK_CUR
)
!=
0
)
return
false
;
else
if
(
sizeof
(
off_t
)
>
sizeof
(
long
))
/*
* At this point, off_t is too large for long, so we return
* based on whether an off_t version of fseek is available.
*/
#ifdef HAVE_FSEEKO
return
true
;
#else
return
false
;
#endif
else
return
true
;
}
static
void
_SortToc
(
ArchiveHandle
*
AH
,
TocSortCompareFn
fn
)
{
...
...
src/bin/pg_dump/pg_backup_archiver.h
浏览文件 @
fc5c577e
...
...
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
8 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
9 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -27,6 +27,7 @@
#include "postgres_fe.h"
#include <stdio.h>
#include <time.h>
#include <errno.h>
...
...
@@ -284,6 +285,7 @@ extern void ReadToc(ArchiveHandle *AH);
extern
void
WriteDataChunks
(
ArchiveHandle
*
AH
);
extern
int
TocIDRequired
(
ArchiveHandle
*
AH
,
int
id
,
RestoreOptions
*
ropt
);
extern
bool
checkSeek
(
FILE
*
fp
);
/*
* Mandatory routines for each supported format
...
...
src/bin/pg_dump/pg_backup_custom.c
浏览文件 @
fc5c577e
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
2 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
3 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -179,7 +179,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file %s: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
}
else
{
...
...
@@ -190,7 +190,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file %s: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ReadHead
(
AH
);
ReadToc
(
AH
);
...
...
src/bin/pg_dump/pg_backup_files.c
浏览文件 @
fc5c577e
...
...
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
0 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
1 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -129,7 +129,7 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
if
(
AH
->
FH
==
NULL
)
die_horribly
(
NULL
,
modulename
,
"could not open output file: %s
\n
"
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
if
(
AH
->
compression
<
0
||
AH
->
compression
>
9
)
AH
->
compression
=
Z_DEFAULT_COMPRESSION
;
...
...
@@ -147,7 +147,7 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
if
(
AH
->
FH
==
NULL
)
die_horribly
(
NULL
,
modulename
,
"could not open input file: %s
\n
"
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ReadHead
(
AH
);
ReadToc
(
AH
);
...
...
src/bin/pg_dump/pg_backup_tar.c
浏览文件 @
fc5c577e
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
1 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
2 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -190,7 +190,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
*/
/* setvbuf(ctx->tarFH, NULL, _IONBF, 0); */
ctx
->
hasSeek
=
(
fseeko
(
ctx
->
tarFH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
ctx
->
tarFH
);
if
(
AH
->
compression
<
0
||
AH
->
compression
>
9
)
AH
->
compression
=
Z_DEFAULT_COMPRESSION
;
...
...
@@ -227,7 +227,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
ctx
->
tarFHpos
=
0
;
ctx
->
hasSeek
=
(
fseeko
(
ctx
->
tarFH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
ctx
->
tarFH
);
/*
* Forcibly unmark the header as read since we use the lookahead
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录