You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "alanredsheep (via GitHub)" <gi...@apache.org> on 2023/12/12 09:12:50 UTC

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

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-unsubscribe@doris.apache.org.apache.org

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


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


Re: [I] [Bug] show create table result doesn't match ddl when use three single-quota (''') [doris]

Posted by "LemonLiTree (via GitHub)" <gi...@apache.org>.
LemonLiTree commented on issue #28284:
URL: https://github.com/apache/doris/issues/28284#issuecomment-1853559855

   Mysql does not add escape characters, but keeps the same comment, and doris should be the same
   <img width="1381" alt="image" src="https://github.com/apache/doris/assets/109049295/01587707-9175-4ec7-9e22-503a01c37dce">
   like this
   <img width="651" alt="image" src="https://github.com/apache/doris/assets/109049295/f85af0f0-05de-4024-b286-d23adbd4aa1d">
   


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [I] [Bug] show create table result doesn't match ddl when use three single-quota (''') [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman closed issue #28284: [Bug] show create table result doesn't match ddl when use three single-quota (''')
URL: https://github.com/apache/doris/issues/28284


-- 
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-unsubscribe@doris.apache.org

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


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