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

not the same behavior with mysql when inserting a big scientific notation number #47787

Closed
lcwangchao opened this issue Oct 19, 2023 · 0 comments · Fixed by #47803
Closed

not the same behavior with mysql when inserting a big scientific notation number #47787

lcwangchao opened this issue Oct 19, 2023 · 0 comments · Fixed by #47803
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 affects-7.5 severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@lcwangchao
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

> drop table if exists t1;
> create table t1(a int);
> set @@sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
> insert into t1 values("1e30");

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

In MySQL 8.0, it returns an error:

mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.33    |
+-----------+
1 row in set (0.00 sec)

mysql> insert into t1 values("1e30");
ERROR 1264 (22003): Out of range value for column 'a' at row 1

3. What did you see instead (Required)

In tidb, the insert succeed with an warning:

mysql> insert into t1 values("1e30");
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'a' at row 1 |
+---------+------+--------------------------------------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

master, but I think it affects all versions of tidb

@lcwangchao lcwangchao added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Oct 19, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. 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 labels Oct 19, 2023
@lcwangchao lcwangchao added severity/moderate affects-6.1 affects-6.5 affects-7.1 affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. and removed severity/major may-affects-5.3 This bug maybe affects 5.3.x versions. 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 labels Oct 19, 2023
@zanmato1984 zanmato1984 added sig/sql-infra SIG: SQL Infra and removed sig/execution SIG execution labels Oct 19, 2023
ti-chi-bot bot pushed a commit that referenced this issue Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. affects-6.1 affects-6.5 affects-7.1 affects-7.5 severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
2 participants