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
Fetch the repository succeeded.
Open Source
>
Database Related
>
Database Service
&&
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
443
Star
1.5K
Fork
1.8K
openGauss
/
openGauss-server
Code
Issues
976
Pull Requests
151
Wiki
Insights
Pipelines
Service
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.
【测试类型:SQL功能】【测试版本:6.0.0】float精度,A库模式下修改精度p和数据类型导致数据精度丢失;float类型可以修改为其他数据类型
Accepted
#IADD8P
Bug
李春龙
Opened this issue
2024-07-16 16:22
【标题描述】:float精度,A库模式下修改精度p和数据类型导致数据精度丢失;float类型可以修改为其他数据类型 【测试类型:SQL功能】【测试版本:6.0.0】float精度,A库模式下修改精度p和数据类型导致数据精度丢失;float类型可以修改为其他数据类型 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): CentOS Linux release 7.6.1810 (Core) Linux ecs-k8s-0002 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 【测试环境】(单机/1主x备x级联备): 1主2备 【被测功能】: sql功能 【测试类型】: 功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 8d33e9eb) compiled at 2024-07-12 10:05:09 commit 0 last mr 【预置条件】: 【操作步骤】(请填写详细的操作步骤): 1.设置参数 set behavior_compat_options = 'float_as_numeric'; 2.创建表插入数据 create table t_com_a_float_test0015(col1 int, col2 float(5), col3 float(44), col4 float(20)); insert into t_com_a_float_test0015 values(1, 12345678901234.567890123456789, 123456789123456789123456789123456789123456789.123456789123456789123456789123456789, 123.123); insert into t_com_a_float_test0015 values(12, 0.12345678901234567890123456789, 0.123456789123456789123456789123456789123456789123456789123456789123456789123456789,123.123); insert into t_com_a_float_test0015 values(21, 123456789.12345,123456789123456789123456789.12345678912, 123.123); 3.查询表及结构 expect:成功 select pg_get_tabledef('t_com_a_float_test0015'); select * from t_com_a_float_test0015 order by col1; 4.修改float列精度及数据类型 alter table t_com_a_float_test0015 modify (col1 float(1)); alter table t_com_a_float_test0015 modify (col2 float(10)); alter table t_com_a_float_test0015 modify (col3 float(63)); alter table t_com_a_float_test0015 modify (col4 char(20)); 5.查询表及结构 expect:成功 select pg_get_tabledef('t_com_a_float_test0015'); select * from t_com_a_float_test0015 order by col1; 【预期输出】: float类型不能变化为字符串类型,精度不能丢失 【实际输出】: opengauss:  O:  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
【标题描述】:float精度,A库模式下修改精度p和数据类型导致数据精度丢失;float类型可以修改为其他数据类型 【测试类型:SQL功能】【测试版本:6.0.0】float精度,A库模式下修改精度p和数据类型导致数据精度丢失;float类型可以修改为其他数据类型 【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a): CentOS Linux release 7.6.1810 (Core) Linux ecs-k8s-0002 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 【测试环境】(单机/1主x备x级联备): 1主2备 【被测功能】: sql功能 【测试类型】: 功能测试 【数据库版本】(查询命令: gaussdb -V): gaussdb (openGauss 6.0.0 build 8d33e9eb) compiled at 2024-07-12 10:05:09 commit 0 last mr 【预置条件】: 【操作步骤】(请填写详细的操作步骤): 1.设置参数 set behavior_compat_options = 'float_as_numeric'; 2.创建表插入数据 create table t_com_a_float_test0015(col1 int, col2 float(5), col3 float(44), col4 float(20)); insert into t_com_a_float_test0015 values(1, 12345678901234.567890123456789, 123456789123456789123456789123456789123456789.123456789123456789123456789123456789, 123.123); insert into t_com_a_float_test0015 values(12, 0.12345678901234567890123456789, 0.123456789123456789123456789123456789123456789123456789123456789123456789123456789,123.123); insert into t_com_a_float_test0015 values(21, 123456789.12345,123456789123456789123456789.12345678912, 123.123); 3.查询表及结构 expect:成功 select pg_get_tabledef('t_com_a_float_test0015'); select * from t_com_a_float_test0015 order by col1; 4.修改float列精度及数据类型 alter table t_com_a_float_test0015 modify (col1 float(1)); alter table t_com_a_float_test0015 modify (col2 float(10)); alter table t_com_a_float_test0015 modify (col3 float(63)); alter table t_com_a_float_test0015 modify (col4 char(20)); 5.查询表及结构 expect:成功 select pg_get_tabledef('t_com_a_float_test0015'); select * from t_com_a_float_test0015 order by col1; 【预期输出】: float类型不能变化为字符串类型,精度不能丢失 【实际输出】: opengauss:  O:  【原因分析】: 1. 这个问题的根因 2. 问题推断过程 3. 还有哪些原因可能造成类似现象 4. 该问题是否有临时规避措施 5. 问题解决方案 6. 预计修复问题时间 【日志信息】(请附上日志文件、截图、coredump信息): 【测试代码】:
Comments (
4
)
Sign in
to comment
Status
Accepted
Backlog
Confirmed
已答复
Canceled
挂起
Fixing
Done
待回归
测试中
Accepted
Assignees
Not set
zhubin79
zhubin79
Assignee
Collaborator
+Assign
+Mention
douxin
ywzq1161327784
Assignee
Collaborator
+Assign
+Mention
Labels
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 (20)
Tags (30)
master
6.0.0
5.0.0
datavec_poc
tp_poc
7.0.0-RC2
7.0.0-RC1
master_bak08271930
bugfix_0725
3.0.0
iud_dev
dev_board
5.1.0
kms
2.0.0
3.1.0
2.1.0
1.1.0
1.0.1
1.0.0
v7.0.0-RC2
v6.0.2
v7.0.0-RC1
v6.0.1
v3.0.6
v6.0.0
v3.0.5B009
v5.0.3
v5.0.2
v6.0.0-RC1
v3.0.5
v5.0.1
v5.1.0
5.1.0
v5.0.0
v3.0.3
v3.1.1
v3.0.2
v3.1.0
v2.0.5
v3.0.1
v2.0.4
v2.0.3
v3.0.0
v2.1.0
v2.0.1
v2.0.0
v1.1.0
v1.0.1
v1.0.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)
C++
1
https://gitee.com/opengauss/openGauss-server.git
git@gitee.com:opengauss/openGauss-server.git
opengauss
openGauss-server
openGauss-server
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