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

   ### 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
   
   apache-doris-2.1.3-bin-x64
   
   ### What's Wrong?
   
   这是原表,包含了char(255)类型的字段
   ```
   CREATE TABLE test_doris_huan_hang
   (
        `id` INT NOT NULL,
        `name` CHAR(255),
        `address` VARCHAR(8000),
        `updt_time` DATETIME,
        `money` DECIMAL(16,4),
        `double_test` DECIMAL(16,2) NOT NULL,
        `float_test` DECIMAL(16,2),
        `log_text` STRING
   )
   UNIQUE KEY(`id`)
   DISTRIBUTED BY HASH(`id`) BUCKETS AUTO
   PROPERTIES (
        "replication_num" = "3",
        "light_schema_change" = "true"
   );
   ```
   
   使用create table like创建新表
   ```
   CREATE TABLE `temp_d8fd87d7cc814c1c` LIKE test_doris_huan_hang;
   ```
   
   使用show create table发现,新创建的表的char长度变为了1,导致插入数据时报错
   ```
   CREATE TABLE `temp_d8fd87d7cc814c1c` (
     `id` INT NOT NULL,
     `name` CHAR(1) NULL,
     `address` VARCHAR(8000) NULL,
     `updt_time` DATETIME NULL,
     `money` DECIMAL(16, 4) NULL,
     `double_test` DECIMAL(16, 2) NOT NULL,
     `float_test` DECIMAL(16, 2) NULL,
     `log_text` TEXT NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`id`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`id`) BUCKETS AUTO
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 3",
   "min_load_replica_num" = "-1",
   "is_being_synced" = "false",
   "storage_medium" = "hdd",
   "storage_format" = "V2",
   "inverted_index_storage_format" = "V1",
   "enable_unique_key_merge_on_write" = "true",
   "light_schema_change" = "true",
   "disable_auto_compaction" = "false",
   "enable_single_replica_compaction" = "false",
   "group_commit_interval_ms" = "10000",
   "group_commit_data_bytes" = "134217728"
   );
   ```
   
   并且我测试char(254)就没有问题,只要长度小于255都不会出错,请问这是数据库的问题吗?麻烦查看下,谢谢!
   
   ### What You Expected?
   
   执行create table like需要能正确创建表结构
   
   ### How to Reproduce?
   
   按照上面的描述可复现
   
   ### 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