38 Star 102 Fork 108

openGauss / openGauss-connector-jdbc

 / 详情

【测试类型:接口功能】【测试版本:6.0.0】【自动化】查询blob类型字段返回值为空

待办的
缺陷
创建于  
2024-04-16 17:09

【标题描述】:查询表中blob类型字段返回值为空
【测试类型:接口功能】【测试版本:6.0.0】查询blob类型字段返回值为空
【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):
CentOS Linux release 7.6.1810 (Core)
Linux ctumhispra01218 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
【测试环境】(单机/1主x备x级联备):一主两备
【被测功能】:数据类型与函数
【测试类型】:功能测试
【数据库版本】(查询命令: gaussdb -V):
gaussdb (openGauss 6.0.0-RC1 build e806c612) compiled at 2024-04-10 11:04:35 commit 0 last mr
【预置条件】:无
【操作步骤】(请填写详细的操作步骤):
--step1:创建表,插入数据;expect:成功
drop table if exists t_ustore_empty_blob_0002;
create table t_ustore_empty_blob_0002(f1 int, f2 blob, f3 clob) with (storage_type = ustore);
begin
for i in 1..10 loop
insert into t_ustore_empty_blob_0002 values(i, '1010101010101010101010101001011', rpad('abc', '105', 'exc汉字gdjjkgjvk'));
end loop;
end;
/

--step2:在update语句中验证empty_blob();expect:成功,1-5为null
update t_ustore_empty_blob_0002 set f2 = empty_blob() where f1 < 6;
select f1, f2 from t_ustore_empty_blob_0002;

--step3:清理环境;expect:成功
drop table t_ustore_empty_blob_0002;

【预期输出】:
输入图片说明
【实际输出】:
输入图片说明
【原因分析】:

  1. 这个问题的根因
  2. 问题推断过程
  3. 还有哪些原因可能造成类似现象
  4. 该问题是否有临时规避措施
  5. 问题解决方案
  6. 预计修复问题时间

【日志信息】(请附上日志文件、截图、coredump信息):无
【测试代码】:无

评论 (6)

songjing 创建了缺陷

Hey @songjing, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss_bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

opengauss_bot 添加了
 
sig/connectors
标签

Hi @songjing,
if you want to get quick review about your issue, please contact the owner in first: @周斌 ,
and then any of the maintainers: @Pike
and then any of the committers: @汪伟 , @travelliu , @aaronwell , @Loong , @Kamus , @vimiix
if you have any question, please contact the SIG: Connectors.

songjing 负责人设置为zhangtingtingting
songjing 关联项目设置为openGauss 6.0.0 community
songjing 关联分支设置为master
songjing 优先级设置为次要
songjing 添加协作者申正
songjing 修改了标题
songjing 修改了描述
zhangtingtingting 计划截止日期设置为2024-05-10

原因:内核返回的blob类型值为原始数据的ASCII码,longblob类型值为十六进制的ASCII码,jdbc是按照十六进制的ASCII码解析blob相关类型,用该方法解析的blob类型为乱码,乱码输出为空
解决:jdbc当前是按照longblob的格式处理blob类型的,所以需要内核将blob类型的返回格式跟longblob一致。

申正 负责人zhangtingtingting 修改为wangfeihuo
申正 取消协作者申正
申正 添加协作者pengjiong

该问题主要是因为内核对ab库返回的格式不一样,jdbc对格式的解析都是采用b库的方式处理的,所以对a库二进制格式的解析结果会乱码,后期jdbc会将ab库的处理区分开

此问题原因等同于:https://e.gitee.com/opengaussorg/dashboard?issue=I9DU8L

A库以txt形式返回:
输入图片说明

B库以二进制的形式返回:
输入图片说明

与JDBC对齐,在JDBC侧修改,方案是只有B库,且dolphin.b_compatibility_mode = on的时候,blob的数据才按照16进制处理,其他的情形均按照文本处理。

wangfeihuo 添加协作者wangfeihuo
wangfeihuo 负责人wangfeihuo 修改为zhangtingtingting
pengjiong 取消协作者pengjiong
pengjiong 添加协作者申正
zhangtingtingting 计划截止日期2024-05-10 修改为2024-05-31

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(5)
13084139 opengauss bot 1686829535
Java
1
https://gitee.com/opengauss/openGauss-connector-jdbc.git
git@gitee.com:opengauss/openGauss-connector-jdbc.git
opengauss
openGauss-connector-jdbc
openGauss-connector-jdbc

搜索帮助