【标题描述】:查询表中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;
【预期输出】:
【实际输出】:
【原因分析】:
【日志信息】(请附上日志文件、截图、coredump信息):无
【测试代码】:无
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
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.
原因:内核返回的blob类型值为原始数据的ASCII码,longblob类型值为十六进制的ASCII码,jdbc是按照十六进制的ASCII码解析blob相关类型,用该方法解析的blob类型为乱码,乱码输出为空
解决:jdbc当前是按照longblob的格式处理blob类型的,所以需要内核将blob类型的返回格式跟longblob一致。
该问题主要是因为内核对ab库返回的格式不一样,jdbc对格式的解析都是采用b库的方式处理的,所以对a库二进制格式的解析结果会乱码,后期jdbc会将ab库的处理区分开
与JDBC对齐,在JDBC侧修改,方案是只有B库,且dolphin.b_compatibility_mode = on的时候,blob的数据才按照16进制处理,其他的情形均按照文本处理。
登录 后才可以发表评论