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

importinto/lightinng negative value cast to upper bound instead of 0 on non-strict sql mode #58613

Open
D3Hunter opened this issue Dec 30, 2024 · 0 comments · May be fixed by #58641
Open

importinto/lightinng negative value cast to upper bound instead of 0 on non-strict sql mode #58613

D3Hunter opened this issue Dec 30, 2024 · 0 comments · May be fixed by #58641
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@D3Hunter
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t(id int unsigned);
Query OK, 0 rows affected (0.07 sec)

mysql> create table s(id int);
Query OK, 0 rows affected (0.05 sec)

mysql> insert into s values(-1);
Query OK, 1 row affected (0.01 sec)

mysql> insert into t select * from s;
ERROR 1690 (22003): constant -1 overflows int
mysql> import into t from select * from s;
ERROR 1690 (22003): constant -1 overflows int


mysql> set sql_mode='';
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t select * from s;
Query OK, 1 row affected, 1 warning (0.03 sec)
Records: 1  Duplicates: 0  Warnings: 1

mysql> show warnings;
+---------+------+---------------------------+
| Level   | Code | Message                   |
+---------+------+---------------------------+
| Warning | 1690 | constant -1 overflows int |
+---------+------+---------------------------+
1 row in set (0.01 sec)

mysql> select * from t;
+------+
| id   |
+------+
|    0 |
+------+
1 row in set (0.00 sec)

mysql> truncate table t;
Query OK, 0 rows affected (0.26 sec)

mysql> import into t from select * from s;
select * from t;
Query OK, 1 row affected (2.62 sec)
Records: 1, ID: 26a2f775-b3b4-4148-880c-523929a77573

mysql> select * from t;
+------------+
| id         |
+------------+
| 4294967295 |
+------------+
1 row in set (0.00 sec)

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

8.5

@D3Hunter D3Hunter added type/bug The issue is confirmed as a bug. severity/major labels Dec 30, 2024
@D3Hunter D3Hunter added affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 labels Dec 30, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants