Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
9c50a004
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,发现更多精彩内容 >>
提交
9c50a004
编写于
6月 20, 2001
作者:
H
Hiroshi Inoue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change the driver so that large error messages are returned
by multiple SQLError calls.
上级
f5d0c6ca
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
48 addition
and
4 deletion
+48
-4
src/interfaces/odbc/environ.c
src/interfaces/odbc/environ.c
+37
-3
src/interfaces/odbc/statement.c
src/interfaces/odbc/statement.c
+9
-1
src/interfaces/odbc/statement.h
src/interfaces/odbc/statement.h
+2
-0
未找到文件。
src/interfaces/odbc/environ.c
浏览文件 @
9c50a004
...
...
@@ -91,12 +91,16 @@ SQLError(
char
*
msg
;
int
status
;
mylog
(
"**** SQLError: henv=%u, hdbc=%u, hstmt=%u
\n
"
,
henv
,
hdbc
,
hstmt
);
mylog
(
"**** SQLError: henv=%u, hdbc=%u, hstmt=%u
<%d>
\n
"
,
henv
,
hdbc
,
hstmt
,
cbErrorMsgMax
);
if
(
cbErrorMsgMax
<
0
)
return
SQL_ERROR
;
if
(
SQL_NULL_HSTMT
!=
hstmt
)
{
/* CC: return an error of a hstmt */
StatementClass
*
stmt
=
(
StatementClass
*
)
hstmt
;
SWORD
msglen
;
BOOL
once_again
=
FALSE
;
if
(
SC_get_error
(
stmt
,
&
status
,
&
msg
))
{
...
...
@@ -112,8 +116,18 @@ SQLError(
return
SQL_NO_DATA_FOUND
;
}
msglen
=
(
SWORD
)
strlen
(
msg
);
if
(
NULL
!=
pcbErrorMsg
)
*
pcbErrorMsg
=
(
SWORD
)
strlen
(
msg
);
{
*
pcbErrorMsg
=
msglen
;
if
(
cbErrorMsgMax
==
0
)
once_again
=
TRUE
;
else
if
(
msglen
>=
cbErrorMsgMax
)
{
once_again
=
TRUE
;
*
pcbErrorMsg
=
cbErrorMsgMax
-
1
;
}
}
if
((
NULL
!=
szErrorMsg
)
&&
(
cbErrorMsgMax
>
0
))
strncpy_null
(
szErrorMsg
,
msg
,
cbErrorMsgMax
);
...
...
@@ -238,6 +252,26 @@ SQLError(
return
SQL_NO_DATA_FOUND
;
}
if
(
once_again
)
{
int
outlen
;
stmt
->
errornumber
=
status
;
if
(
cbErrorMsgMax
>
0
)
outlen
=
*
pcbErrorMsg
;
else
outlen
=
0
;
if
(
!
stmt
->
errormsg_malloced
||
!
stmt
->
errormsg
)
{
stmt
->
errormsg
=
malloc
(
msglen
-
outlen
+
1
);
stmt
->
errormsg_malloced
=
TRUE
;
}
memmove
(
stmt
->
errormsg
,
msg
+
outlen
,
msglen
-
outlen
+
1
);
}
else
if
(
stmt
->
errormsg_malloced
)
SC_clear_error
(
stmt
);
if
(
cbErrorMsgMax
==
0
)
return
SQL_SUCCESS_WITH_INFO
;
else
return
SQL_SUCCESS
;
}
else
if
(
SQL_NULL_HDBC
!=
hdbc
)
...
...
src/interfaces/odbc/statement.c
浏览文件 @
9c50a004
...
...
@@ -248,6 +248,7 @@ SC_Constructor(void)
rv
->
errormsg
=
NULL
;
rv
->
errornumber
=
0
;
rv
->
errormsg_created
=
FALSE
;
rv
->
errormsg_malloced
=
FALSE
;
rv
->
statement
=
NULL
;
rv
->
stmt_with_params
=
NULL
;
...
...
@@ -530,9 +531,12 @@ SC_recycle_statement(StatementClass *self)
self
->
bind_row
=
0
;
self
->
last_fetch_count
=
0
;
if
(
self
->
errormsg_malloced
&&
self
->
errormsg
)
free
(
self
->
errormsg
);
self
->
errormsg
=
NULL
;
self
->
errornumber
=
0
;
self
->
errormsg_created
=
FALSE
;
self
->
errormsg_malloced
=
FALSE
;
self
->
lobj_fd
=
-
1
;
...
...
@@ -610,9 +614,12 @@ SC_unbind_cols(StatementClass *self)
void
SC_clear_error
(
StatementClass
*
self
)
{
if
(
self
->
errormsg_malloced
&&
self
->
errormsg
)
free
(
self
->
errormsg
);
self
->
errornumber
=
0
;
self
->
errormsg
=
NULL
;
self
->
errormsg_created
=
FALSE
;
self
->
errormsg_malloced
=
FALSE
;
}
...
...
@@ -675,6 +682,7 @@ SC_get_error(StatementClass *self, int *number, char **message)
{
*
number
=
self
->
errornumber
;
*
message
=
self
->
errormsg
;
if
(
!
self
->
errormsg_malloced
)
self
->
errormsg
=
NULL
;
}
...
...
src/interfaces/odbc/statement.h
浏览文件 @
9c50a004
...
...
@@ -218,6 +218,8 @@ struct StatementClass_
char
pre_executing
;
/* This statement is prematurely executing */
char
inaccurate_result
;
/* Current status is PREMATURE but
* result is inaccurate */
char
errormsg_malloced
;
/* Current status is PREMATURE but
* result is inaccurate */
};
#define SC_get_conn(a) (a->hdbc)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录