dujl opened a new pull request, #12148:
URL: https://github.com/apache/doris/pull/12148

    support create the table containing string/text type with a default value 
that length greater than 1
   
   # Proposed changes
   
   Issue Number: close #12145
   
   ## Problem summary
   Create the table containing string/text type with a default value that 
length greater than 1 failed.
   ```
   CREATE TABLE `tb6` (
     `id` int(11) NULL DEFAULT "10",
     `name` varchar(32) NULL DEFAULT "a varchar 32",
     `c_text` text NULL DEFAULT "a text",
     `c_str` string  NULL DEFAULT "a string"
   ) ENGINE=OLAP
   UNIQUE KEY(`id`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`id`) BUCKETS 4
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 3",
   "in_memory" = "false",
   "storage_format" = "V2",
   "disable_auto_compaction" = "false"
   ); 
   ```
   
   Describe your changes.
   do not set string/text column type‘s length as 1.
   
   ```
   mysql> insert into tb6 (id, c_str) select 2,  'string value';
   Query OK, 1 row affected (0.04 sec)
   {'label':'insert_6c0d9cb7483488e_9f029797c91dab0b', 'status':'VISIBLE', 
'txnId':'2004'}
   mysql> insert into tb6 (id, c_str) select 1,  'string value';
   Query OK, 1 row affected (0.03 sec)
   {'label':'insert_92da962f4f954d82_916b66273df28cea', 'status':'VISIBLE', 
'txnId':'2005'}
   mysql> 
   mysql> select * from tb6;
   +------+--------------+--------+--------------+
   | id   | name         | c_text | c_str        |
   +------+--------------+--------+--------------+
   |    1 | a varchar 32 | a text | string value |
   |    2 | a varchar 32 | a text | string value |
   +------+--------------+--------+--------------+
   2 rows in set (0.11 sec)
   ```
   
   
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [N ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ N] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ N] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ N] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


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

Reply via email to