Skip to content

[Bug]: CTAS with concat_ws infers result column definition differently from MySQL #24434

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

20346ca

Other Environment Information

- MO version: 8.0.30-MatrixOne-v
- MySQL version: 8.0.45
- Verify date: 2026-05-18

Actual Behavior

CREATE TABLE ... AS SELECT concat_ws(...) infers the result column type/length differently from MySQL.

MO:

CREATE TABLE `string02` (
  `newcol` varchar(65535) DEFAULT NULL
)

MySQL:

CREATE TABLE `string02` (
  `newCol` varchar(46) DEFAULT NULL
)

Expected Behavior

The CTAS result schema should be consistent with MySQL, including alias casing and inferred varchar length.

Steps to Reproduce

drop table if exists string02;
drop table if exists string01;

create table string01 (col1 varchar(40), col2 char, col3 text default null);
insert into string01 values ('  database system', 'a', 'x');
insert into string01 values (' string function ', '1', 'y');
insert into string01 values ('test create table as select', '0', null);

create table string02 as
select concat_ws(',', col1, 'abcde') as newCol
from string01;

show create table string02;
desc string02;
select * from string02;

Additional information

Split from #14792 after re-verification.

Activity

  1. Ariznawlll commented on May 18, 2026

    @Ariznawlll
    CollaboratorAuthor

    Closing in favor of summary tracker #24436. This issue was split from #14792 during re-verification and is now tracked centrally in #24436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions