1

I have been told many times that I should switch my MySql tables engine from MyIsam to InnoDB. Finally I did that, only to have to urgently switch it back to MyIsam this morning. Some PHP scripts break on a weird error that is quite beyond my understanding:

17:01:42 mySQL error occured: Deadlock found when trying to get lock; try restarting transaction
 UPDATE s
 SET combined = '2037-01-01 00:00:00'
 WHERE combined <= 0
 ORDER BY combined ASC
 LIMIT 10000

BTW, I've got an AFTER UPDATE trigger for table s:

CREATE TRIGGER a
AFTER UPDATE ON s
FOR EACH ROW
BEGIN
    SET @lower_tolerance_euro := 4;
    SET @upper_tolerance_euro := 300;

    IF (ABS(OLD.price - NEW.price) >= @lower_tolerance_euro AND
        ABS(OLD.price - NEW.price) <= @upper_tolerance_euro AND
        NEW.passengers = 1 AND 
        NEW.validon > OLD.validon) 
    THEN
        INSERT IGNORE INTO history 
            VALUES (NEW.fkey, NEW.validon, ROUND(NEW.price));
    END IF;
END $$

There are two more triggers on the same table: AFTER INSERT and AFTER DELETE. Everything worked fine before. Table history has no any triggers! Any clues how to debug this? There is no any deadlock really af far as I understand...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.