Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
c917660a
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,发现更多精彩内容 >>
提交
c917660a
编写于
9月 03, 2002
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Workaround for format strings that are concatenated from macros
(INT64_FORMAT), which gettext cannot handle.
上级
738d1383
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
85 addition
and
27 deletion
+85
-27
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+48
-15
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+37
-12
未找到文件。
src/backend/commands/sequence.c
浏览文件 @
c917660a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.8
5 2002/08/30 19:23:19 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.8
6 2002/09/03 18:50:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -400,8 +400,12 @@ nextval(PG_FUNCTION_ARGS)
if
(
rescnt
>
0
)
break
;
/* stop fetching */
if
(
!
seq
->
is_cycled
)
elog
(
ERROR
,
"%s.nextval: reached MAXVALUE ("
INT64_FORMAT
")"
,
sequence
->
relname
,
maxv
);
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
maxv
);
elog
(
ERROR
,
"%s.nextval: reached MAXVALUE (%s)"
,
sequence
->
relname
,
buf
);
}
next
=
minv
;
}
else
...
...
@@ -416,8 +420,12 @@ nextval(PG_FUNCTION_ARGS)
if
(
rescnt
>
0
)
break
;
/* stop fetching */
if
(
!
seq
->
is_cycled
)
elog
(
ERROR
,
"%s.nextval: reached MINVALUE ("
INT64_FORMAT
")"
,
sequence
->
relname
,
minv
);
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
minv
);
elog
(
ERROR
,
"%s.nextval: reached MINVALUE (%s)"
,
sequence
->
relname
,
buf
);
}
next
=
maxv
;
}
else
...
...
@@ -551,8 +559,14 @@ do_setval(RangeVar *sequence, int64 next, bool iscalled)
seq
=
read_info
(
"setval"
,
elm
,
seqrel
,
&
buf
);
if
((
next
<
seq
->
min_value
)
||
(
next
>
seq
->
max_value
))
elog
(
ERROR
,
"%s.setval: value "
INT64_FORMAT
" is out of bounds ("
INT64_FORMAT
","
INT64_FORMAT
")"
,
sequence
->
relname
,
next
,
seq
->
min_value
,
seq
->
max_value
);
{
char
bufv
[
100
],
bufm
[
100
],
bufx
[
100
];
snprintf
(
bufv
,
100
,
INT64_FORMAT
,
next
);
snprintf
(
bufm
,
100
,
INT64_FORMAT
,
seq
->
min_value
);
snprintf
(
bufx
,
100
,
INT64_FORMAT
,
seq
->
max_value
);
elog
(
ERROR
,
"%s.setval: value %s is out of bounds (%s,%s)"
,
sequence
->
relname
,
bufv
,
bufm
,
bufx
);
}
/* save info in local cache */
elm
->
last
=
next
;
/* last returned number */
...
...
@@ -813,8 +827,13 @@ init_params(CreateSeqStmt *seq, Form_pg_sequence new)
new
->
min_value
=
defGetInt64
(
min_value
);
if
(
new
->
min_value
>=
new
->
max_value
)
elog
(
ERROR
,
"DefineSequence: MINVALUE ("
INT64_FORMAT
") can't be >= MAXVALUE ("
INT64_FORMAT
")"
,
new
->
min_value
,
new
->
max_value
);
{
char
bufm
[
100
],
bufx
[
100
];
snprintf
(
bufm
,
100
,
INT64_FORMAT
,
new
->
min_value
);
snprintf
(
bufx
,
100
,
INT64_FORMAT
,
new
->
max_value
);
elog
(
ERROR
,
"DefineSequence: MINVALUE (%s) must be less than MAXVALUE (%s)"
,
bufm
,
bufx
);
}
if
(
last_value
==
(
DefElem
*
)
NULL
)
/* START WITH */
{
...
...
@@ -827,17 +846,31 @@ init_params(CreateSeqStmt *seq, Form_pg_sequence new)
new
->
last_value
=
defGetInt64
(
last_value
);
if
(
new
->
last_value
<
new
->
min_value
)
elog
(
ERROR
,
"DefineSequence: START value ("
INT64_FORMAT
") can't be < MINVALUE ("
INT64_FORMAT
")"
,
new
->
last_value
,
new
->
min_value
);
{
char
bufs
[
100
],
bufm
[
100
];
snprintf
(
bufs
,
100
,
INT64_FORMAT
,
new
->
last_value
);
snprintf
(
bufm
,
100
,
INT64_FORMAT
,
new
->
min_value
);
elog
(
ERROR
,
"DefineSequence: START value (%s) can't be less than MINVALUE (%s)"
,
bufs
,
bufm
);
}
if
(
new
->
last_value
>
new
->
max_value
)
elog
(
ERROR
,
"DefineSequence: START value ("
INT64_FORMAT
") can't be > MAXVALUE ("
INT64_FORMAT
")"
,
new
->
last_value
,
new
->
max_value
);
{
char
bufs
[
100
],
bufm
[
100
];
snprintf
(
bufs
,
100
,
INT64_FORMAT
,
new
->
last_value
);
snprintf
(
bufm
,
100
,
INT64_FORMAT
,
new
->
max_value
);
elog
(
ERROR
,
"DefineSequence: START value (%s) can't be greater than MAXVALUE (%s)"
,
bufs
,
bufm
);
}
if
(
cache_value
==
(
DefElem
*
)
NULL
)
/* CACHE */
new
->
cache_value
=
1
;
else
if
((
new
->
cache_value
=
defGetInt64
(
cache_value
))
<=
0
)
elog
(
ERROR
,
"DefineSequence: CACHE ("
INT64_FORMAT
") can't be <= 0"
,
new
->
cache_value
);
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
new
->
cache_value
);
elog
(
ERROR
,
"DefineSequence: CACHE (%s) can't be <= 0"
,
buf
);
}
}
...
...
src/bin/pg_dump/pg_backup_tar.c
浏览文件 @
c917660a
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.2
6 2002/08/28 20:46:24 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.2
7 2002/09/03 18:50:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1024,8 +1024,13 @@ _tarAddFile(ArchiveHandle *AH, TAR_MEMBER *th)
die_horribly
(
AH
,
modulename
,
"could not close tar member: %s
\n
"
,
strerror
(
errno
));
if
(
len
!=
th
->
fileLen
)
die_horribly
(
AH
,
modulename
,
"actual file length ("
INT64_FORMAT
") does not match expected ("
INT64_FORMAT
")
\n
"
,
(
int64
)
len
,
(
int64
)
th
->
pos
);
{
char
buf1
[
100
],
buf2
[
100
];
snprintf
(
buf1
,
100
,
INT64_FORMAT
,
(
int64
)
len
);
snprintf
(
buf2
,
100
,
INT64_FORMAT
,
(
int64
)
th
->
pos
);
die_horribly
(
AH
,
modulename
,
"actual file length (%s) does not match expected (%s)
\n
"
,
buf1
,
buf2
);
}
pad
=
((
len
+
511
)
&
~
511
)
-
len
;
for
(
i
=
0
;
i
<
pad
;
i
++
)
...
...
@@ -1055,14 +1060,21 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
/* Go to end of current file, if any */
if
(
ctx
->
tarFHpos
!=
0
)
{
ahlog
(
AH
,
4
,
"moving from position "
INT64_FORMAT
" to next member at file position "
INT64_FORMAT
"
\n
"
,
(
int64
)
ctx
->
tarFHpos
,
(
int64
)
ctx
->
tarNextMember
);
char
buf1
[
100
],
buf2
[
100
];
snprintf
(
buf1
,
100
,
INT64_FORMAT
,
(
int64
)
ctx
->
tarFHpos
);
snprintf
(
buf2
,
100
,
INT64_FORMAT
,
(
int64
)
ctx
->
tarNextMember
);
ahlog
(
AH
,
4
,
"moving from position %s to next member at file position %s
\n
"
,
buf1
,
buf2
);
while
(
ctx
->
tarFHpos
<
ctx
->
tarNextMember
)
_tarReadRaw
(
AH
,
&
c
,
1
,
NULL
,
ctx
->
tarFH
);
}
ahlog
(
AH
,
4
,
"now at file position "
INT64_FORMAT
"
\n
"
,
(
int64
)
ctx
->
tarFHpos
);
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
(
int64
)
ctx
->
tarFHpos
);
ahlog
(
AH
,
4
,
"now at file position %s
\n
"
,
buf
);
}
/* We are at the start of the file. or at the next member */
...
...
@@ -1125,9 +1137,14 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
{
#if 0
if (ftello(ctx->tarFH) != ctx->tarFHpos)
{
char buf1[100], buf2[100];
snprintf(buf1, 100, INT64_FORMAT, (int64) ftello(ctx->tarFH));
snprintf(buf2, 100, INT64_FORMAT, (int64) ftello(ctx->tarFHpos));
die_horribly(AH, modulename,
"mismatch in actual vs. predicted file position (" INT64_FORMAT " vs. " INT64_FORMAT ")\n",
(int64) ftello(ctx->tarFH), (int64) ctx->tarFHpos);
"mismatch in actual vs. predicted file position (%s vs. %s)\n",
buf1, buf2);
}
#endif
/* Save the pos for reporting purposes */
...
...
@@ -1170,14 +1187,22 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
sscanf
(
&
h
[
124
],
"%12o"
,
&
len
);
sscanf
(
&
h
[
148
],
"%8o"
,
&
sum
);
ahlog
(
AH
,
3
,
"TOC Entry %s at "
INT64_FORMAT
" (length %lu, checksum %d)
\n
"
,
&
tag
[
0
],
(
int64
)
hPos
,
(
unsigned
long
)
len
,
sum
);
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
(
int64
)
hPos
);
ahlog
(
AH
,
3
,
"TOC Entry %s at %s (length %lu, checksum %d)
\n
"
,
&
tag
[
0
],
buf
,
(
unsigned
long
)
len
,
sum
);
}
if
(
chk
!=
sum
)
{
char
buf
[
100
];
snprintf
(
buf
,
100
,
INT64_FORMAT
,
(
int64
)
ftello
(
ctx
->
tarFH
));
die_horribly
(
AH
,
modulename
,
"corrupt tar header found in %s "
"(expected %d, computed %d) file position "
INT64_FORMAT
"
\n
"
,
&
tag
[
0
],
sum
,
chk
,
(
int64
)
ftello
(
ctx
->
tarFH
));
"(expected %d, computed %d) file position %s
\n
"
,
&
tag
[
0
],
sum
,
chk
,
buf
);
}
th
->
targetFile
=
strdup
(
tag
);
th
->
fileLen
=
len
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录