401 Star 1.4K Fork 1.5K

GVPopenGauss / openGauss-server

 / 详情

jsonb类型查询报错

已验收
缺陷
创建于  
2021-11-11 15:09

【使用jsonb的-->>操作符操作标量类型报错失败】:
【测试类型:SQL功能】【测试版本:v2.1.0】 问题描述

【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):

  1. CentOS Linux release 7.9.2009 (Core)
  2. Linux localhost.localdomain 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    【测试环境】(单机/1主x备x级联备):
    单机
    【被测功能】:

【测试类型】:

【数据库版本】(查询命令: gaussdb –V):
输入图片说明
【预置条件】:

【操作步骤】(请填写详细的操作步骤):

  1. create table t_jsonb(id integer, info jsonb);
  2. truncate table t_jsonb;
  3. insert into t_jsonb values (1,'{"num": "1", "name": "张三", "score": "90"}');
  4. select * from t_jsonb ;
  5. insert into t_jsonb values (2,'"abc"');
  6. select * from t_jsonb ;

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

  1. 这个问题的根因

  2. 问题推断过程

  3. 还有哪些原因可能造成类似现象

  4. 该问题是否有临时规避措施

  5. 问题解决方案

  6. 预计修复问题时间

【日志信息】(请附上日志文件、截图、coredump信息):
输入图片说明
【测试代码】:

评论 (5)

Ryan 创建了缺陷

Hey @chuanglichuangwai, 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 https://gitee.com/opengauss/community/blob/master/contributors/command.en.md to find the details.

Ryan 修改了描述
Ryan 修改了标题

this issue is assigned to: @siven_dev.

opengauss-bot 负责人设置为siven_dev
zhangxubo 添加了
 
sig/sqlengine
标签

当前openGauss之中,与pg不完全相同,这是当前预期结果

赵文浩 负责人siven_dev 修改为yansong_lee

可以用以下语法查出,故关闭此问题单

openGauss=# select * from t_jsonb where jsonb_typeof(info)='object' and info->>'num'='1';
-[ RECORD 1 ]-------------------------------------
id   | 1
info | {"num": "1", "name": "张三", "score": "90"}
yansong_lee 任务状态待办的 修改为已验收

登录 后才可以发表评论

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

搜索帮助