25 Star 25 Fork 195

openGauss / Plugin

 / 详情

兼容B库模式下,bigint unsigned类型转bigint类型部分结果与mysql不一致

已验收
缺陷
创建于  
2023-08-23 15:15

【标题描述】:
【测试类型:SQL功能】【测试版本:5.1.0】 问题描述
兼容B库模式下,bigint unsigned类型转bigint类型部分结果与mysql不一致
【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):
【测试环境】(单机/1主x备x级联备):
单机
【被测功能】:
SQL功能
【测试类型】:
功能测试
【数据库版本】(查询命令: gaussdb -V):
(openGauss 5.1.0 build 0e27db1c) compiled at 2023-08-16 16:53:16 commit 0 last mr debug
【预置条件】:
1.B库dolphin插件
2.set dolphin.b_compatibility_mode = on;
3.set dolphin.sql_mode = '';
【操作步骤】(请填写详细的操作步骤):

  1. 准备测试数据
    drop table if exists test_ubigint;
    create table test_ubigint(a bigint unsigned);
    insert into test_ubigint values ('9223372036854775807');
    insert into test_ubigint values ('9223372036854775808');
    insert into test_ubigint values ('18446744073709551614');
    insert into test_ubigint values ('18446744073709551615');
    insert into test_ubigint values ('0');
  2. 测试传入函数参数时转换(隐式级别)
    create or replace function imp_convert(a bigint)
    return bigint is
    begin
    return a;
    end;
    /
    select imp_convert(a) from test_ubigint;
    3.测试插入表时转换(赋值级别)
    drop table if exists test_int8;
    create table test_int8(a bigint);
    insert into test_int8 select * from test_ubigint;
    select * from test_int8;
    4.测试调用cast函数时转换(显式级别)
    drop table if exists test_longtext;
    create table test_longtext(a longtext);
    insert into test_longtext select cast(a as signed) from test_ubigint;
    select * from test_longtext;
    【预期输出】:
    参考mysql处输出结果,三种转换级别的结果:
    1.函数参数
    输入图片说明
    2.插入表
    输入图片说明
    3.cast
    输入图片说明

【实际输出】:
函数参数和插入表这两种情况与mysql不一致
1.函数参数
输入图片说明
2.插入表
输入图片说明
3.cast
输入图片说明
【原因分析】:

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

【日志信息】(请附上日志文件、截图、coredump信息):

【测试代码】:

评论 (4)

lukeman 创建了缺陷

Hey @lukeman, 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 @lukeman,
if you want to get quick review about your issue, please contact the owner in first: @黄凯耀 ,
and then any of the maintainers: @黄凯耀 , @CodeRejector
and then any of the committers: @husan1024 , @siven_dev , @chenxiaobin , @pengjiong , @吴岳川 , @zhaosiqi , @jeremytim , @熊小军 , @wumingyuan , @xiuqiangwang , @zhaojun
if you have any question, please contact the SIG: Plugin.

opengauss_bot 添加了
 
sig/plugin
标签
lukeman 负责人设置为lukeman
pengjiong 任务状态待办的 修改为已完成
pengjiong 关联项目设置为openGauss 5.1.0 community
pengjiong 优先级设置为不重要
lukeman 任务状态已完成 修改为待回归
jiexiao1413 任务状态待回归 修改为测试中

(openGauss 5.1.0 build e923404c) compiled at 2023-09-01 10:49:18 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 10.3.0, 64-bit
输入图片说明

lukeman 添加协作者zhanghuan96
zhanghuan96 任务状态测试中 修改为已验收

登录 后才可以发表评论

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

搜索帮助