While trying to import the .sql file into my database, I get the following error for one of the insert statements -
ERROR 1292 (22007) at line 31504: Incorrect datetime value: '1936-01-31 00:00:00' for column 'BatchDate' at row 1. Operation failed with exitcode 1
I encountered this error only for dates older than 1980. And this only happens when I try to import a dump through an import statement or through a WorkBench. If I execute only the expression, it works fine. Here is the table structure and insert statement
DROP TABLE IF EXISTS `BatchEntry`; CREATE TABLE `BatchEntry` ( `BatchNo` INTEGER NOT NULL AUTO_INCREMENT, `BatchDate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `BTax_ID` DOUBLE NULL DEFAULT 0, `BPayor_No` DOUBLE NULL DEFAULT 0, `BBroker_No` DOUBLE NULL DEFAULT 0, `BHam_Cont` VARCHAR(4), `BInv_Org_Date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `BInv_Due_Date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `BDate_Adv` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `BRec_Amt` DECIMAL(19,4) DEFAULT 0, `BPaymnt_Com` LONGTEXT, `BTrans_Count` INTEGER DEFAULT 0, `BPrefix` VARCHAR(10), `BStartNumber` INTEGER DEFAULT 0, `BSuffix` VARCHAR(10), `BCreated` TINYINT(1) DEFAULT 0, `BAdvMethod` INTEGER DEFAULT 0, INDEX (`BPayor_No`), INDEX (`BTax_ID`), PRIMARY KEY (`BatchNo`) ) ENGINE=myisam DEFAULT CHARSET=utf8; INSERT INTO `BatchEntry` (`BatchNo`, `BatchDate`, `BTax_ID`, `BPayor_No`, `BBroker_No`, `BHam_Cont`, `BInv_Org_Date`, `BInv_Due_Date`, `BDate_Adv`, `BRec_Amt`, `BPaymnt_Com`, `BTrans_Count`, `BPrefix`, `BStartNumber`, `BSuffix`, `BCreated`, `BAdvMethod`) VALUES (1396, '1936-01-31 00:00:00', 561986585, 4528, 749, 'BSR', '2005-12-30 00:00:00', '2006-01-30 00:00:00', '2006-01-31 00:00:00', 0, NULL, 14, 'MC', 24850, NULL, 1, 1);