已关闭
[Bug]: D库设置default_collation后,执行CREATE TABLE AS 使用 sql_variant 列时报错 type sql_variant not support set charset #8224
liuzhen001创建于  6月25日关闭于  8月7日
liuzhen001
liuzhen001成员
6月25日 创建

测试类型

SQL功能

测试版本

7.0.0LTS

问题描述

操作系统和硬件信息

image.png

测试环境

企业版主备

被测功能

预置条件

操作步骤

-- @owner: cjl
-- @date: 2025/12/26
-- @testpoint:【sql_variant类型】create table as/like 创建表,合理报错
@connect PrimaryDbDmode;
drop table if exists tab_1130344;
drop table if exists tt_1130344;
drop table if exists like_1130344;
drop table if exists as_1130344;
--建表;
create table tt_1130344(a1 sql_variant PRIMARY KEY);
insert into tt_1130344 values(2::int),('ff'::char(8)),('!'::varchar(3)),('li'::char(6)),('good'::varchar2(8)),('yes'::char);
--建表;
create table tab_1130344
(
a1 sql_variant not null,
a2 sql_variant unique,
a3 sql_variant PRIMARY KEY,
a4 sql_variant default 'good',
a5 sql_variant check(a5 is not null),
a6 sql_variant REFERENCES tt_1130344(a1));
--插入数据;
insert into tab_1130344 values(100::int,10::int,'cc'::varchar(3),'dd'::varchar2(8),'ee'::char,'ff'::char(8));
insert into tab_1130344(a1,a2,a3,a5,a6) values(200::int,40::int,'is'::char(4),'very'::char(4),'good'::varchar(4));
--create table as;
create table as_1130344 as select * from tab_1130344;
--create table like;
create table like_1130344 (like tab_1130344 including all);
--查询;
select count() from tab_1130344;
select count(
) from as_1130344;
select count(*) from like_1130344;
drop table if exists tab_1130344;
drop table if exists tt_1130344;
drop table if exists like_1130344;
drop table if exists as_1130344;
``

预期输出

实际输出

image.png

日志信息

image.png

提单组织

测试团队

测试代码

likedislike
liuzhen001liuzhen001成员
6月25日 添加了label:bug
opengauss_bot
opengauss_bot成员
6月25日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
6月25日 将 TestManager 设为负责人
opengauss_botopengauss_bot成员
6月25日 添加了label:sig/StorageEngine,sig/AI,sig/CM,sig/CloudNative,sig/SecurityTechnology,sig/SQLEngine
opengauss_bot
opengauss_bot成员
6月25日 评论:

Welcome To openGauss Community

Hey @liuzhen001 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zjh_hw .

likedislike
liuzhen001liuzhen001成员
6月25日 将 shijuzheng1997 设为负责人,移除负责人 TestManager
liuzhen001liuzhen001成员
6月25日 issue优先级由 无优先级 改变为 次要
liuzhen001liuzhen001成员
6月25日 关联了看板:临时看板
chendong76chendong76成员
7月3日 关联了看板:openGauss 7.0.0-LTS
chendong76chendong76成员
7月3日 移除了看板:临时看板
shijuzheng1997shijuzheng1997成员
7月29日 关联了pull request:修复D库设置default_collation后,执行CREATE TABLE AS 使用 sql_variant 列时报错 type sql_variant not support set charset的问题
ywzq1161327784ywzq1161327784成员
7月29日 issue状态由 待办的 改变为 已完成
shijuzheng1997
shijuzheng1997成员
8月5日 评论:

20260805开发自验
图片.png

likedislike
shijuzheng1997shijuzheng1997成员
8月5日 issue状态由 已完成 改变为 待回归
liuzhen001
liuzhen001成员
8月7日 评论:

回归版本:7.0.0 LTS B017
回归结论:回归通过
回归过程:
image.png

likedislike
liuzhen001liuzhen001成员
8月7日 issue状态由 待回归 改变为 已验收
liuzhen001liuzhen001成员
8月7日 关闭了 issue