You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a column with default value and not nullable, when I try to insert null value to this column i'm getting error Column 'isUsa' cannot be null, why mysql2 doesn't fit the default value instead of throw exception?
For example in sql query:
-- Insert without specifying isUsa, will default to 0
INSERT INTO users () VALUES ();
-- Insert with NULL value for isUsa, will be replaced with 0
INSERT INTO users (isUsa) VALUES (NULL);
This is the user table describe:
Field Type Null Key Default Extra
isUsa tinyint(1) NO 0
.....
.....
I have a column with default value and not nullable, when I try to insert
null
value to this column i'm getting errorColumn 'isUsa' cannot be null
, why mysql2 doesn't fit the default value instead of throw exception?For example in sql query:
This is the user table describe:
This is the backend snippet:
The text was updated successfully, but these errors were encountered: