Re: [PR] [fix](sql) Fix error for show create table column comment [doris]

2024-12-08 Thread via GitHub


w41ter merged PR #44958:
URL: https://github.com/apache/doris/pull/44958


-- 
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

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



Re: [PR] [fix](sql) Fix error for show create table column comment [doris]

2024-12-05 Thread via GitHub


w41ter commented on code in PR #44958:
URL: https://github.com/apache/doris/pull/44958#discussion_r1872523256


##
fe/fe-core/src/test/java/org/apache/doris/analysis/ShowCreateTableStmtTest.java:
##
@@ -32,7 +32,7 @@ protected void runBeforeAll() throws Exception {
 createDatabase("test");
 useDatabase("test");
 createTable("create table table1\n"
-+ "(k1 int comment 'test column k1', k2 int comment 'test 
column k2')  comment 'test table1' "
++ "(k1 int comment 'test column k1', k2 int comment 'test 
column k2', `timestamp` DATE NOT NULL COMMENT '[''-01-01'', 
''-12-31'']')  comment 'test table1' "

Review Comment:
   `''-01-01`, what is the purpose of the `''` here?



-- 
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

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



Re: [PR] [fix](sql) Fix error for show create table column comment [doris]

2024-12-05 Thread via GitHub


w41ter commented on PR #44958:
URL: https://github.com/apache/doris/pull/44958#issuecomment-2522045213

   > the right way to fix it is escaping comment string. the current way could 
not process double quote in comment correctly.
   
   `getComment(true)` already escapes the quote `"`, so this fix is right.
   
   ```
   public String getComment(boolean escapeQuota) {
   if (!escapeQuota) {
   return comment;
   }
   return SqlUtils.escapeQuota(comment);
   }
   
   public static String escapeQuota(String str) {
   if (Strings.isNullOrEmpty(str)) {
   return str;
   }
   return str.replaceAll("\"", "\"");
   }
   ```
   
   
   


-- 
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

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



Re: [PR] [fix](sql) Fix error for show create table column comment [doris]

2024-12-04 Thread via GitHub


wyxxxcat commented on PR #44958:
URL: https://github.com/apache/doris/pull/44958#issuecomment-2519080580

   > the right way to fix it is escaping comment string. the current way could 
not process double quote in comment correctly.
   
   why can't I use \\" to escape correctly, can you describe it in more detail?
   ```
   mysql> show create table t\G;
   *** 1. row ***
  Table: t
   Create Table: CREATE TABLE `t` (
 `timestamp` date NOT NULL COMMENT "xxx\"xx\"x"
   ) ENGINE=OLAP
   DUPLICATE KEY(`timestamp`)
   DISTRIBUTED BY RANDOM BUCKETS AUTO
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1",
   );
   1 row in set (0.00 sec)
   ```


-- 
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

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



Re: [PR] [fix](sql) Fix error for show create table column comment [doris]

2024-12-04 Thread via GitHub


github-actions[bot] commented on PR #44958:
URL: https://github.com/apache/doris/pull/44958#issuecomment-2518935152

   PR approved by at least one committer and no changes requested.


-- 
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

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