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

sql_mode STRICT_ALL_TABLES does not work properly #13150

Closed
cyliu0 opened this issue Nov 5, 2019 · 2 comments · Fixed by #19605
Closed

sql_mode STRICT_ALL_TABLES does not work properly #13150

cyliu0 opened this issue Nov 5, 2019 · 2 comments · Fixed by #19605
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/P1 The issue has P1 priority. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@cyliu0
Copy link
Contributor

cyliu0 commented Nov 5, 2019

Bug Report

There is a related fix, but it's not working now #8544

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
mysql> create table t (a bigint unsigned);
Query OK, 0 rows affected (0.00 sec)

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

mysql> insert into t value(1);
Query OK, 1 row affected (0.01 sec)
  1. What did you expect to see?
    On MySQL:
mysql> update t set a = -1;
ERROR 1264 (22003): Out of range value for column 'a' at row 1
mysql> select * from t;
+------+
| a    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)
  1. What did you see instead?
    On TiDB:
mysql> update t set a = -1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from t;
+----------------------+
| a                    |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-721-g579304039
Git Commit Hash: 579304039685562d390c0de5b783425efbd2bd8d
Git Branch: master
UTC Build Time: 2019-11-05 07:49:08
GoVersion: go version go1.13.1 darwin/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
@cyliu0 cyliu0 added the type/bug The issue is confirmed as a bug. label Nov 5, 2019
@ghost
Copy link

ghost commented Jul 15, 2020

Confirming this issue still exists in master:

drop table if exists t;
create table t (a bigint unsigned);
set @@sql_mode = 'strict_all_tables';
insert into t value(1);
update t set a = -1;
select * from t;

..


mysql> update t set a = -1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

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

mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-771-gca41972fb
Edition: Community
Git Commit Hash: ca41972fbac068c8a5de107d9075f09ac68842ac
Git Branch: master
UTC Build Time: 2020-07-14 02:41:21
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

@qw4990 qw4990 added severity/critical sig/execution SIG execution help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/P1 The issue has P1 priority. labels Aug 26, 2020
@time-and-fate
Copy link
Member

/assign time-and-fate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/P1 The issue has P1 priority. severity/critical sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants