Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast check only check single literal but not const expr #7886

Closed
decster opened this issue Jun 27, 2022 · 4 comments
Closed

Cast check only check single literal but not const expr #7886

decster opened this issue Jun 27, 2022 · 4 comments
Labels

Comments

@decster
Copy link
Contributor

decster commented Jun 27, 2022

Steps to reproduce the behavior (Required)

insert into table with different values that may overflow

Expected behavior (Required)

Errors should be the same

Real behavior (Required)

Some have error, some not

CREATE TABLE `ttt` (
  `pk` bigint(20) NOT NULL COMMENT "",
  `v0` varchar(65533) NOT NULL COMMENT "",
  `v1` int(11) NOT NULL COMMENT "",
  `c_dec128p38s0` decimal128(38, 0) NULL COMMENT ""
) ENGINE=OLAP 
PRIMARY KEY(`pk`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`pk`) BUCKETS 1 
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT",
"enable_persistent_index" = "false"
);

mysql> insert into ttt values (1,"1", 1, 1e38 * 10);
Query OK, 1 row affected (0.10 sec)
{'label':'insert_e55206af-f5d5-11ec-9a76-0242d786aa56', 'status':'VISIBLE', 'txnId':'36032'}

mysql> insert into ttt values (1,"1", 1, 1e39 + 10);
Query OK, 1 row affected (0.05 sec)
{'label':'insert_edfc0b30-f5d5-11ec-9a76-0242d786aa56', 'status':'VISIBLE', 'txnId':'36033'}

mysql> insert into ttt values (1,"1", 1, 1e39);
ERROR 1064 (HY000): Non-typed decimal literal is overflow, value='1000000000000000000000000000000000000000' (precision=40, scale=0)

StarRocks version (Required)

  • You can get the StarRocks version by executing SQL select current_version()
@decster decster added the type/bug Something isn't working label Jun 27, 2022
@decster
Copy link
Contributor Author

decster commented Jun 27, 2022

relates to #6317

@jaogoy
Copy link
Contributor

jaogoy commented Jun 27, 2022

Had the jobs successfully submitted been finished yet?
If they had, it's just a miss optimization.

@decster
Copy link
Contributor Author

decster commented Jun 28, 2022

It was submitted and finished, why is this a miss optimization, same overflow input, some succeed, some fail, it's inconsistency

@github-actions
Copy link

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants