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

ErrOverflow should be allowed in DELETE and UPDATE statement if the sql_mode is not strict #49143

Closed
YangKeao opened this issue Dec 4, 2023 · 0 comments · Fixed by #49122
Closed
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@YangKeao
Copy link
Member

YangKeao commented Dec 4, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set sql_mode='';
create table t (id char(255));
insert into t values ('12312323112312312331212331212312331221');
delete from t where cast(id as unsigned) = 1;
update t set id = '1' where cast(id as unsigned) = 1;

2. What did you expect to see? (Required)

A warning.

3. What did you see instead (Required)

mysql> delete from t where cast(id as unsigned) = 1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '12312323112312312331212331212312331221'
mysql> update t set id = '1' where cast(id as unsigned) = 1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '12312323112312312331212331212312331221'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants