Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Gitee 2025 OpenSource,We need your vote!
Fetch the repository succeeded.
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
31
Star
32
Fork
225
openGauss
/
Plugin
Code
Issues
50
Pull Requests
1
Wiki
Insights
Pipelines
Service
JavaDoc
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
【测试类型:接口功能】【测试版本:5.1.1】 使用JDBC连接兼容B库,执行触发器语法报错,语句被截断
Accepted
#I8GEZY
Bug
ningyali
Opened this issue
2023-11-14 17:04
<!-- #请认真填写以下信息,否则可能由于无法定位,导致issue无法解决而被取消 --> 【标题描述】: 【测试类型:接口功能】【测试版本:5.1.1】 使用JDBC连接兼容B库,执行触发器语法报错,语句被截断 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): CentOS Linux release 7.6.1810 (Core) Linux kwemhisprc10432 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级联备):单机 【被测功能】:使用JDBC连接兼容B库,执行存储过程+触发器+插入表数据,与msql结果对比 【测试类型】:功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 5.1.1 build 23313c0e) compiled at 2023-11-10 00:10:06 commit 0 last mr 【预置条件】:数据库正常运行,B库已创建,dolphin插件已加载 【操作步骤】(请填写详细的操作步骤): 1. 创建一个存储过程,触发器中调用 create procedure proc_tinyint0006 (in data tinyint(255)) begin if data not regexp '^[0-9]+$' then signal sqlstate '45000' set message_text = 'invalid data format'; end if; end; 2. 建表 create table t_tinyint0006 ( id int primary key auto_increment, my_data tinyint ); 3. 创建触发器,在插入数据时使用触发器来验证数据 create trigger trigger_tinyint0006 before insert on t_tinyint0006 for each row begin call proc_tinyint0006(new.my_data); end; 4. 创建视图 drop view if exists v_tinyint0006; create view v_tinyint0006 as select * from t_tinyint0006; 5. 插入数据 insert into t_tinyint0006(my_data) values ('1'); insert into t_tinyint0006(my_data) values ('2' + 100); insert into t_tinyint0006(my_data) values (cast(3 as unsigned)); insert into t_tinyint0006(my_data) values (cast(4 as signed)); insert into t_tinyint0006(my_data) values (cast(5 as char)); insert into t_tinyint0006(my_data) values (cast(6 as binary)); 6. 查询 select * from t_tinyint0006 order by 1; select * from v_tinyint0006 order by 1; 7. 清理环境 drop view if exists v_tinyint0006; drop table if exists t_tinyint0006 cascade; drop trigger if exists trigger_tinyint0006; drop procedure if exists proc_tinyint0006; 【预期输出】: 1-7执行成功,结果与mysql一致 【实际输出】: 1-2执行成功,3报错  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
<!-- #请认真填写以下信息,否则可能由于无法定位,导致issue无法解决而被取消 --> 【标题描述】: 【测试类型:接口功能】【测试版本:5.1.1】 使用JDBC连接兼容B库,执行触发器语法报错,语句被截断 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): CentOS Linux release 7.6.1810 (Core) Linux kwemhisprc10432 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级联备):单机 【被测功能】:使用JDBC连接兼容B库,执行存储过程+触发器+插入表数据,与msql结果对比 【测试类型】:功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 5.1.1 build 23313c0e) compiled at 2023-11-10 00:10:06 commit 0 last mr 【预置条件】:数据库正常运行,B库已创建,dolphin插件已加载 【操作步骤】(请填写详细的操作步骤): 1. 创建一个存储过程,触发器中调用 create procedure proc_tinyint0006 (in data tinyint(255)) begin if data not regexp '^[0-9]+$' then signal sqlstate '45000' set message_text = 'invalid data format'; end if; end; 2. 建表 create table t_tinyint0006 ( id int primary key auto_increment, my_data tinyint ); 3. 创建触发器,在插入数据时使用触发器来验证数据 create trigger trigger_tinyint0006 before insert on t_tinyint0006 for each row begin call proc_tinyint0006(new.my_data); end; 4. 创建视图 drop view if exists v_tinyint0006; create view v_tinyint0006 as select * from t_tinyint0006; 5. 插入数据 insert into t_tinyint0006(my_data) values ('1'); insert into t_tinyint0006(my_data) values ('2' + 100); insert into t_tinyint0006(my_data) values (cast(3 as unsigned)); insert into t_tinyint0006(my_data) values (cast(4 as signed)); insert into t_tinyint0006(my_data) values (cast(5 as char)); insert into t_tinyint0006(my_data) values (cast(6 as binary)); 6. 查询 select * from t_tinyint0006 order by 1; select * from v_tinyint0006 order by 1; 7. 清理环境 drop view if exists v_tinyint0006; drop table if exists t_tinyint0006 cascade; drop trigger if exists trigger_tinyint0006; drop procedure if exists proc_tinyint0006; 【预期输出】: 1-7执行成功,结果与mysql一致 【实际输出】: 1-2执行成功,3报错  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
Attachments
opengauss-jdbc-5.1.1.jar
(1.07 MB)
Download
吴北斗
2023-11-27 16:42
Comments (
3
)
Sign in
to comment
Status
Accepted
Backlog
Confirmed
已答复
Canceled
挂起
Fixing
Done
待回归
测试中
Accepted
Assignees
Not set
吴北斗
wu-beidou
Assignee
Collaborator
+Assign
+Mention
周斌
justbk
Assignee
Collaborator
+Assign
+Mention
Labels
sig/plugin
Not set
Projects
Unprojected
Unprojected
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (8)
Tags (12)
master
6.0.0
7.0.0-RC2
5.0.0
7.0.0-RC1
3.0.0
5.1.0
3.1.0
v7.0.0-RC2
v6.0.2
v6.0.1
v6.0.0
v5.0.3
v5.0.2
v6.0.0-RC1
v5.0.1
v5.1.0
v5.0.0
v3.1.0
v2.1.0
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
Duration
(hours)
参与者(2)
1
https://gitee.com/opengauss/Plugin.git
git@gitee.com:opengauss/Plugin.git
opengauss
Plugin
Plugin
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register