alanredsheep opened a new issue, #28284:
URL: https://github.com/apache/doris/issues/28284

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) 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`. 
   
   <img width="563" alt="image" 
src="https://github.com/apache/doris/assets/35416678/5962c11a-843f-4b07-922f-d969ed251081";>
   
   When use three double-quota, the behavior is different.
   
   <img width="554" alt="image" 
src="https://github.com/apache/doris/assets/35416678/c337127b-add5-4e76-868f-b34400c6477c";>
   
   
   ### 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:
   ```sql
   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:
   ```sql
   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
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to