Created
February 13, 2023 15:24
-
-
Save felipsmartins/cca15b269acfb981218f09a011fe63e8 to your computer and use it in GitHub Desktop.
mysql max int sql_mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MySQL [xxx]> desc teste; | |
+----------------+------------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+----------------+------------------+------+-----+---------+-------+ | |
| int_positivo | int(10) unsigned | YES | | NULL | | | |
| int_sinalizado | int(11) | YES | | NULL | | | |
+----------------+------------------+------+-----+---------+-------+ | |
2 rows in set (0,003 sec) | |
MySQL [xxx]> set sql_mode = 'STRICT_TRANS_TABLES'; | |
Query OK, 0 rows affected (0,000 sec) | |
MySQL [xxx]> insert into teste (int_sinalizado, int_positivo) values (-30, 4294967296); | |
ERROR 1264 (22003): Out of range value for column 'int_positivo' at row 1 | |
MySQL [xxx]> set sql_mode = ''; | |
Query OK, 0 rows affected (0,000 sec) | |
MySQL [xxx]> insert into teste (int_sinalizado, int_positivo) values (-30, 4294967296); | |
Query OK, 1 row affected, 1 warning (0,005 sec) | |
MySQL [xxx]> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment