I am trying to use multiple inserts (in one statement) and I have this table structure
CREATE TABLE Scores
(
studentID varchar(50) not null,
score int
)
ENGINE = InnoDB
My Query:
INSERT INTO Scores Values
('Barry', 45),
(NULL, 41),
('Jones', 53)
This statement (I expected) should fail since [StudentID] column does not accept NULL.
The problem was MySQL inserted empty string (”) into row 2… and allow the rest to continue.
Issue:
or put
under
[mysqld]intomy.cnf(then restartMySQL).