Table:
CREATE TABLE logaction
(
actype varchar(8) not null,
actime DATETIME not null,
devid int not null
);
SQL:
insert into logaction values ('TEST', '2013-08-22', 1);
insert into logaction values ('TEST', '2013-08-22 09:45:30', 1);
insert into logaction values ('TEST', 'xyz', 2); // shouldn't this fail?
The last record does make it into the table regardless of the non-datetime value for the actime column. Why and how can I enforce that only good data go in?
Here is a SQL Fiddle.