CalvinKirs opened a new pull request, #25833:
URL: https://github.com/apache/doris/pull/25833
### What happend
When parsing String syntax, ' and " are both legal in 2.0.2. We will remove
the outer boundary symbols, but you can add ' inside "", such as "I don't", but
2.0.2 does not escape the middle ' and returns it by default. will be wrapped
into ', so it becomes 'I don't'. This syntax analysis is wrong. Now we have to
escape all the symbols inside and it becomes 'I don/'t'.
```
CREATE TABLE IF NOT EXISTS a2 (
`c1` int NOT NULL DEFAULT "1" comment "sd",
`c2` int NOT NULL DEFAULT "4" comment "'nll'"
) ENGINE=OLAP
UNIQUE KEY(`c1`)
COMMENT "'llll'll'"
PARTITION BY LIST (`c1`)
(
PARTITION p1 VALUES IN ("1","2","3"),
PARTITION p2 VALUES IN ("4","5","6")
)
DISTRIBUTED BY HASH(`c1`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
);
```
### test
```
kris> CREATE TABLE test_create_table_like (
a DATEV2 NOT NULL COMMENT "'a' is a date, but it's not a
date/n,/r/n/t/n/'",
b VARCHAR(96) NOT NULL COMMENT ' /"a/" is a date,
/n/,/r/n/t/n',
c VARCHAR(96) NOT NULL COMMENT 'c',
d VARCHAR(96) COMMENT '',
e bigint NOT NULL )
DISTRIBUTED BY HASH(e) BUCKETS 1
PROPERTIES( 'replication_num' = '1')
[2023-10-24 16:50:52] completed in 504 ms
kris> create table tctl_1 like test_create_table_like
[2023-10-24 16:51:20] completed in 430 ms
kris> create table tctl_2 like tctl_1
[2023-10-24 16:51:30] completed in 429 ms
kris> create table tctl_3 like tctl_2
[2023-10-24 16:51:42] completed in 408 ms
kris> CREATE TABLE a1 (
a DATEV2 NOT NULL COMMENT "'a' is a date, but it's not a
date/n,/r/n/t/n/'",
b VARCHAR(96) NOT NULL COMMENT ' /"a/" is a date,
/n/,/r/n/t/n',
c VARCHAR(96) NOT NULL COMMENT 'c',
d VARCHAR(96) COMMENT '',
e bigint NOT NULL )
COMMENT "'a' is a date, but it's not a date/n,/r/n/t/n/'"
DISTRIBUTED BY HASH(e) BUCKETS 1
PROPERTIES( 'replication_num' = '1')
[2023-10-24 16:58:18] completed in 526 ms
kris> create table a2 like a1
[2023-10-24 16:58:32] completed in 389 ms
kris> create table a3 like a2
[2023-10-24 16:58:41] completed in 363 ms
kris> show create table a3
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]