Skip to content

[Bug] show create table result doesn't match ddl when use three single-quota (''') #28284

@alanredsheep

Description

@alanredsheep

Search before asking

  • I had searched in the issues and found no similar issues.

Version

doris-1.2.6
selectdb(with doris-core-2.0.2)

What's Wrong?

Notice that the show create table result has a syntax error in the comment of column name.

image

When use three double-quota, the behavior is different.

image

What You Expected?

We know that mysql can use two single-quota or two double-quota to escape.
So in show create table result, this escape quota should add a slash(/) just like the behavior of three double-quota.

'default:''' should become 'default:\''
just like "default:""" -> 'default:\"',
but no 'default:'', which would lead to a syntax error.

Or doris can just throw an error when users use three single-quota(''').

How to Reproduce?

Create table with ddl below:

CREATE TABLE tmp.test (
  `id` int NOT NULL COMMENT 'id',
  `name` varchar(256) NOT NULL COMMENT 'name, default:'''
) 
UNIQUE KEY(`id`)
DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES (
  "replication_allocation" = "tag.location.default: 3"
);

Then show create table shows result below:

CREATE TABLE `test` (
  `id` int(11) NOT NULL COMMENT 'id',
  `name` varchar(256) NOT NULL COMMENT 'name, default:''
) ENGINE=OLAP
UNIQUE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"in_memory" = "false",
"storage_format" = "V2",
"disable_auto_compaction" = "false"
);

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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