Skip to content

[Bug] insert时数值超出类型表示范围仍导入成功 #40870

Open
@yongjinhou

Description

@yongjinhou

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.1.5

What's Wrong?

使用新优化器,insert时数值超出类型表示范围仍导入成功
这个问题与新优化器有关,之前的优化器在stmt.analyze阶段就抛异常了,新优化器没考虑这个异常

What You Expected?

insert时数值超出类型表示范围导入失败并抛出异常

How to Reproduce?

insert导入的值超出int范围:

CREATE TABLE int_tb ( k1 INT NULL, v1 INT SUM NULL, v2 INT MAX NULL, v3 INT MIN NULL, v4 INT REPLACE NULL ) AGGREGATE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 15 PROPERTIES ("replication_allocation" = "tag.location.default: 1");
insert into int_tb select 0, -2147483649, 0, 0, 0;

insert导入的值超出char范围:

CREATE TABLE stream_insert_datatype_db.varchar_tb ( k1 VARCHAR(1) NULL, v1 VARCHAR(1) REPLACE NULL ) AGGREGATE KEY(k1) DISTRIBUTED BY HASH(k1) BUCKETS 15 PROPERTIES ("replication_allocation" = "tag.location.default: 1");
insert into varchar_tb select "a", 100;

Anything Else?

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions