Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天地威能
oceanbase
提交
7952fa9f
O
oceanbase
项目概览
天地威能
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7952fa9f
编写于
11月 24, 2022
作者:
W
wjhh2008
提交者:
wangzelin.wzl
11月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix load and select into outfile oss params bug
上级
972d94f0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
9 deletion
+19
-9
src/sql/engine/basic/ob_select_into_op.cpp
src/sql/engine/basic/ob_select_into_op.cpp
+8
-3
src/sql/resolver/cmd/ob_load_data_resolver.cpp
src/sql/resolver/cmd/ob_load_data_resolver.cpp
+11
-6
未找到文件。
src/sql/engine/basic/ob_select_into_op.cpp
浏览文件 @
7952fa9f
...
@@ -72,9 +72,14 @@ int ObSelectIntoOp::inner_open()
...
@@ -72,9 +72,14 @@ int ObSelectIntoOp::inner_open()
ObString
path
=
file_name_
.
get_varchar
().
trim
();
ObString
path
=
file_name_
.
get_varchar
().
trim
();
if
(
path
.
prefix_match_ci
(
OB_OSS_PREFIX
))
{
if
(
path
.
prefix_match_ci
(
OB_OSS_PREFIX
))
{
file_location_
=
IntoFileLocation
::
REMOTE_OSS
;
file_location_
=
IntoFileLocation
::
REMOTE_OSS
;
url_
=
path
.
split_on
(
'?'
);
ObString
temp_url
=
path
.
split_on
(
'?'
);
url_
.
trim
();
temp_url
.
trim
();
if
(
OB_FAIL
(
access_info_
.
set
(
url_
.
ptr
(),
path
.
ptr
())))
{
ObString
storage_info
;
if
(
OB_FAIL
(
ob_write_string
(
ctx_
.
get_allocator
(),
temp_url
,
url_
,
true
)))
{
LOG_WARN
(
"fail to append string"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ob_write_string
(
ctx_
.
get_allocator
(),
path
,
storage_info
,
true
)))
{
LOG_WARN
(
"fail to append string"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
access_info_
.
set
(
url_
.
ptr
(),
storage_info
.
ptr
())))
{
LOG_WARN
(
"fail to set access info"
,
K
(
ret
),
K
(
path
));
LOG_WARN
(
"fail to set access info"
,
K
(
ret
),
K
(
path
));
}
}
...
...
src/sql/resolver/cmd/ob_load_data_resolver.cpp
浏览文件 @
7952fa9f
...
@@ -116,10 +116,11 @@ int ObLoadDataResolver::resolve(const ParseNode &parse_tree)
...
@@ -116,10 +116,11 @@ int ObLoadDataResolver::resolve(const ParseNode &parse_tree)
}
else
{
}
else
{
ObString
file_name
(
file_name_node
->
str_len_
,
file_name_node
->
str_value_
);
ObString
file_name
(
file_name_node
->
str_len_
,
file_name_node
->
str_value_
);
if
(
ObLoadFileLocation
::
OSS
!=
load_args
.
load_file_storage_
)
{
if
(
ObLoadFileLocation
::
OSS
!=
load_args
.
load_file_storage_
)
{
load_args
.
file_name_
=
file_name
;
char
*
full_path_buf
=
nullptr
;
char
*
full_path_buf
=
nullptr
;
char
*
actual_path
=
nullptr
;
char
*
actual_path
=
nullptr
;
if
(
OB_ISNULL
(
full_path_buf
=
static_cast
<
char
*>
(
allocator_
->
alloc
(
DEFAULT_BUF_LENGTH
))))
{
if
(
OB_FAIL
(
ob_write_string
(
*
allocator_
,
file_name
,
load_args
.
file_name_
,
true
)))
{
LOG_WARN
(
"fail to write string"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
full_path_buf
=
static_cast
<
char
*>
(
allocator_
->
alloc
(
DEFAULT_BUF_LENGTH
))))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_WARN
(
"fail to allocate memory"
,
K
(
ret
));
LOG_WARN
(
"fail to allocate memory"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
actual_path
=
realpath
(
file_name_node
->
str_value_
,
full_path_buf
)))
{
}
else
if
(
OB_ISNULL
(
actual_path
=
realpath
(
file_name_node
->
str_value_
,
full_path_buf
)))
{
...
@@ -138,12 +139,16 @@ int ObLoadDataResolver::resolve(const ParseNode &parse_tree)
...
@@ -138,12 +139,16 @@ int ObLoadDataResolver::resolve(const ParseNode &parse_tree)
}
}
}
}
}
else
{
}
else
{
load_args
.
file_name_
=
file_name
.
split_on
(
'?'
);
ObString
temp_file_name
=
file_name
.
split_on
(
'?'
);
if
(
load_args
.
file_name_
.
length
()
<=
0
ObString
storage_info
;
||
file_name
<=
0
)
{
if
(
OB_FAIL
(
ob_write_string
(
*
allocator_
,
temp_file_name
,
load_args
.
file_name_
,
true
)))
{
LOG_WARN
(
"fail to copy string"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ob_write_string
(
*
allocator_
,
file_name
,
storage_info
,
true
)))
{
LOG_WARN
(
"fail to copy string"
,
K
(
ret
));
}
else
if
(
temp_file_name
.
length
()
<=
0
||
storage_info
.
length
()
<=
0
)
{
ret
=
OB_INVALID_ARGUMENT
;
ret
=
OB_INVALID_ARGUMENT
;
LOG_USER_ERROR
(
OB_INVALID_ARGUMENT
,
"file name or access key"
);
LOG_USER_ERROR
(
OB_INVALID_ARGUMENT
,
"file name or access key"
);
}
else
if
(
OB_FAIL
(
load_args
.
access_info_
.
set
(
load_args
.
file_name_
.
ptr
(),
file_name
.
ptr
())))
{
}
else
if
(
OB_FAIL
(
load_args
.
access_info_
.
set
(
load_args
.
file_name_
.
ptr
(),
storage_info
.
ptr
())))
{
LOG_WARN
(
"failed to set access info"
,
K
(
ret
));
LOG_WARN
(
"failed to set access info"
,
K
(
ret
));
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录