Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
obproxy
提交
47eb493f
O
obproxy
项目概览
oceanbase
/
obproxy
1 年多 前同步成功
通知
11
Star
100
Fork
70
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obproxy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
47eb493f
编写于
5月 08, 2021
作者:
W
wgs13579
提交者:
guangshu.wgs
6月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compatible with connector/j bugs
上级
fadcddc8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
7 deletion
+43
-7
src/rpc/obmysql/packet/ompk_handshake_response.cpp
src/rpc/obmysql/packet/ompk_handshake_response.cpp
+43
-7
未找到文件。
src/rpc/obmysql/packet/ompk_handshake_response.cpp
浏览文件 @
47eb493f
...
...
@@ -38,6 +38,7 @@ int OMPKHandshakeResponse::decode()
const
char
*
pos
=
cdata_
;
const
int64_t
len
=
hdr_
.
len_
;
const
char
*
end
=
buf
+
len
;
bool
maybe_connector_j
=
false
;
//OB_ASSERT(NULL != cdata_);
if
(
NULL
!=
cdata_
)
{
...
...
@@ -97,6 +98,10 @@ int OMPKHandshakeResponse::decode()
if
(
capability_
.
cap_flags_
.
OB_CLIENT_CONNECT_WITH_DB
)
{
database_
=
ObString
::
make_string
(
pos
);
pos
+=
strlen
(
pos
)
+
1
;
}
else
{
if
(
'\0'
==
*
pos
)
{
maybe_connector_j
=
true
;
}
}
}
...
...
@@ -131,8 +136,13 @@ int OMPKHandshakeResponse::decode()
pos
+=
key_len
;
if
(
pos
>
end
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpected error pos > end"
,
K
(
ret
),
K
(
pos
),
K
(
end
));
if
(
!
maybe_connector_j
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpected error pos > end"
,
K
(
ret
),
K
(
pos
),
K
(
end
));
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_DEBUG
(
"unexpected error pos > end, may by connector/j"
,
K
(
ret
),
K
(
pos
),
K
(
end
));
}
}
else
{
// get value
uint64_t
value_inc_len
=
0
;
...
...
@@ -151,25 +161,51 @@ int OMPKHandshakeResponse::decode()
}
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_len
));
if
(
!
maybe_connector_j
)
{
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_len
));
}
else
{
LOG_DEBUG
(
"invalid packet, may by connector/j"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_len
));
}
}
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_inc_len
));
if
(
!
maybe_connector_j
)
{
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_inc_len
));
}
else
{
LOG_DEBUG
(
"invalid packet, may by connector/j"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
value_inc_len
));
}
}
}
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_len
));
if
(
!
maybe_connector_j
)
{
LOG_ERROR
(
"invalid packet"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_len
));
}
else
{
LOG_DEBUG
(
"invalid packet, may by connector/j"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_len
));
}
}
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_ERROR
(
"error"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_inc_len
));
if
(
!
maybe_connector_j
)
{
LOG_ERROR
(
"error"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_inc_len
));
}
else
{
LOG_DEBUG
(
"error, may by connector/j"
,
K
(
ret
),
K
(
all_attrs_len
),
K
(
key_inc_len
));
}
}
}
}
else
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_ERROR
(
"get len fail"
,
K
(
ret
),
K
(
pos
),
K
(
all_attrs_len
));
if
(
!
maybe_connector_j
)
{
LOG_ERROR
(
"get len fail"
,
K
(
ret
),
K
(
pos
),
K
(
all_attrs_len
));
}
else
{
LOG_DEBUG
(
"get len fail, may by connector/j"
,
K
(
ret
),
K
(
pos
),
K
(
all_attrs_len
));
}
}
/* 如果长度不对, 又怀疑是 connector/j, 放过, 参考 bug: https://bugs.mysql.com/bug.php?id=79612 */
if
(
OB_INVALID_ARGUMENT
==
ret
&&
maybe_connector_j
)
{
ret
=
OB_SUCCESS
;
connect_attrs_
.
reset
();
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录