Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
34826473
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,发现更多精彩内容 >>
提交
34826473
编写于
2月 18, 2016
作者:
A
Abhijit Subramanya
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Fix the length of filename column returned by gp_read_error_log function."
This reverts commit
dd2f326f
.
上级
038f02bb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
29 deletion
+12
-29
src/backend/access/external/url.c
src/backend/access/external/url.c
+4
-16
src/backend/cdb/cdbsreh.c
src/backend/cdb/cdbsreh.c
+4
-6
src/backend/utils/misc/fstream/fstream.c
src/backend/utils/misc/fstream/fstream.c
+2
-5
src/include/cdb/cdbsreh.h
src/include/cdb/cdbsreh.h
+1
-1
src/include/fstream/fstream.h
src/include/fstream/fstream.h
+1
-1
未找到文件。
src/backend/access/external/url.c
浏览文件 @
34826473
...
...
@@ -2068,11 +2068,7 @@ static size_t gp_proto1_read(char *buf, int bufsz, URL_FILE *file, CopyState pst
memcpy
(
fname
,
curl
->
in
.
ptr
+
curl
->
in
.
bot
,
len
);
fname
[
len
]
=
0
;
resetStringInfo
(
pstate
->
cdbsreh
->
filename
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
pstate
->
filename
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
" ["
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
fname
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
"]"
);
snprintf
(
pstate
->
cdbsreh
->
filename
,
sizeof
pstate
->
cdbsreh
->
filename
,
"%s [%s]"
,
pstate
->
filename
,
fname
);
}
curl
->
in
.
bot
+=
len
;
...
...
@@ -2364,7 +2360,6 @@ url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file, CopyState pstate
case
CFTYPE_FILE
:
{
struct
fstream_filename_and_offset
fo
;
fo
.
fname
=
NULL
;
const
int
whole_rows
=
0
;
/* get as much data as possible */
assert
(
size
==
1
);
...
...
@@ -2377,18 +2372,11 @@ url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file, CopyState pstate
pstate
->
cur_lineno
=
fo
.
line_number
-
1
;
if
(
pstate
->
cdbsreh
)
{
resetStringInfo
(
pstate
->
cdbsreh
->
filename
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
pstate
->
filename
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
" ["
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
fo
.
fname
);
appendStringInfo
(
pstate
->
cdbsreh
->
filename
,
"]"
);
}
snprintf
(
pstate
->
cdbsreh
->
filename
,
sizeof
pstate
->
cdbsreh
->
filename
,
"%s [%s]"
,
pstate
->
filename
,
fo
.
fname
);
}
if
(
fo
.
fname
)
gfile_free
(
fo
.
fname
);
break
;
}
case
CFTYPE_EXEC
:
...
...
src/backend/cdb/cdbsreh.c
浏览文件 @
34826473
...
...
@@ -99,11 +99,9 @@ makeCdbSreh(int rejectlimit, bool is_limit_in_rows,
h
->
lastsegid
=
0
;
h
->
consec_csv_err
=
0
;
h
->
log_to_file
=
log_to_file
;
h
->
filename
=
makeStringInfo
();
/* If filename is null we allocate enough memory for the string <stdin> */
initStringInfo
(
h
->
filename
);
appendStringInfoString
(
h
->
filename
,
filename
?
filename
:
"<stdin>"
);
snprintf
(
h
->
filename
,
sizeof
(
h
->
filename
),
"%s"
,
filename
?
filename
:
"<stdin>"
);
/*
* Create a temporary memory context that we can reset once per row to
...
...
@@ -144,7 +142,7 @@ destroyCdbSreh(CdbSreh *cdbsreh)
*/
void
HandleSingleRowError
(
CdbSreh
*
cdbsreh
)
{
/* increment total number of errors for this segment */
cdbsreh
->
rejectcount
++
;
...
...
@@ -267,7 +265,7 @@ FormErrorTuple(CdbSreh *cdbsreh)
}
/* file name */
values
[
errtable_filename
-
1
]
=
DirectFunctionCall1
(
textin
,
CStringGetDatum
(
cdbsreh
->
filename
->
data
));
values
[
errtable_filename
-
1
]
=
DirectFunctionCall1
(
textin
,
CStringGetDatum
(
cdbsreh
->
filename
));
nulls
[
errtable_filename
-
1
]
=
false
;
/* relation name */
...
...
src/backend/utils/misc/fstream/fstream.c
浏览文件 @
34826473
...
...
@@ -571,11 +571,8 @@ static void updateCurFileState(fstream_t* fs,
{
fo
->
foff
=
fs
->
foff
;
fo
->
line_number
=
fs
->
line_number
;
if
(
fo
->
fname
)
gfile_free
(
fo
->
fname
);
fo
->
fname
=
gfile_malloc
(
strlen
(
fs
->
glob
.
gl_pathv
[
fs
->
fidx
])
+
1
);
strncpy
(
fo
->
fname
,
fs
->
glob
.
gl_pathv
[
fs
->
fidx
],
strlen
(
fs
->
glob
.
gl_pathv
[
fs
->
fidx
]));
fo
->
fname
[
strlen
(
fs
->
glob
.
gl_pathv
[
fs
->
fidx
])]
=
0
;
strncpy
(
fo
->
fname
,
fs
->
glob
.
gl_pathv
[
fs
->
fidx
],
sizeof
fo
->
fname
);
fo
->
fname
[
sizeof
fo
->
fname
-
1
]
=
0
;
}
}
...
...
src/include/cdb/cdbsreh.h
浏览文件 @
34826473
...
...
@@ -75,7 +75,7 @@ typedef struct CdbSreh
int
lastsegid
;
/* last QE COPY segid that QD COPY sent bad row to */
MemoryContext
badrowcontext
;
/* per-badrow evaluation context */
StringInfo
filename
;
/* "uri [filename]" */
char
filename
[
256
];
/* "uri [filename]" */
bool
log_to_file
;
/* or log into file? */
Oid
relid
;
/* parent relation id */
...
...
src/include/fstream/fstream.h
浏览文件 @
34826473
...
...
@@ -26,7 +26,7 @@ struct fstream_options{
};
struct
fstream_filename_and_offset
{
char
*
fname
;
char
fname
[
256
]
;
int64_t
line_number
;
/* Line number of first line in buffer. Zero means fstream doesn't know the line number. */
int64_t
foff
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录