401 Star 1.4K Fork 1.5K

GVPopenGauss / openGauss-server

 / 详情

【测试类型:SQL功能】【测试版本:3.0.0】 type is table of在GBK环境下打印GBK字符乱码

Done
Bug
Opened this issue  
2022-04-20 11:02

【标题描述】:
【测试类型:SQL功能】【测试版本:3.0.0】 type is table of在GBK环境下打印GBK字符乱码

【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):
输入图片说明
【测试环境】(单机/1主x备x级联备):
单机
【被测功能】:
type is table of在GBK环境下打印
【测试类型】:
功能
【数据库版本】(查询命令: gaussdb –V):
输入图片说明
【预置条件】:
---创建GBK数据库
create database db_gbk_2 encoding='gbk' template=template0 lc_collate='zh_CN.gbk' lc_ctype='zh_CN.gbk';
【操作步骤】(请填写详细的操作步骤):
\c db_gbk_2
CREATE OR REPLACE FUNCTION fun() RETURNS VOID AS $$
DECLARE
Type array_gbk_type IS TABLE OF int2 INDEX BY varchar(10);
array_gbk array_gbk_type;
BEGIN
array_gbk('乁') := 6;
array_gbk('丂') := 12;
array_gbk('亇') := 2;
array_gbk('亅') := 4;
raise info 'FIRST=%',array_gbk.FIRST;
raise info 'LAST=%',array_gbk.LAST;
END;
$$
LANGUAGE plpgsql;
select fun();

【预期输出】:
打印内容:
INFO:FIRST=亇
INFO:LAST=乁
【实际输出】:
输出有误
输入图片说明
【原因分析】:

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

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

【测试代码】:

Comments (3)

tayly13 created缺陷

Hey @tayly13, 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.

yansong_lee set assignee to pengjiong
tayly13 changed description

由于描述中字体显示有点问题
输入图片说明
重新附上操作步骤sql:

\c db_gbk_2
CREATE OR REPLACE FUNCTION fun() RETURNS VOID AS $$
DECLARE
Type array_gbk_type IS TABLE OF int2 INDEX BY varchar(10);
array_gbk array_gbk_type;
BEGIN
array_gbk('乁') := 6;
array_gbk('丂') := 12;
array_gbk('亇') := 2; 
array_gbk('亅') := 4; 
raise info 'FIRST=%',array_gbk.FIRST;
raise info 'LAST=%',array_gbk.LAST; 
END;
$$
LANGUAGE plpgsql;

select fun();
pengjiong throughopengauss/openGauss-server Pull Request !2059 changed issue state from 待办的 to 已完成

08.31 已验收 回归通过
输入图片说明

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
参与者(3)
5622128 opengauss bot 1581905080
C++
1
https://gitee.com/opengauss/openGauss-server.git
git@gitee.com:opengauss/openGauss-server.git
opengauss
openGauss-server
openGauss-server

Search