Menu

#4848 (ok 4.4.2) trigger sql with delimiters maxes out cpu resources

Latest_Git
fixed
None
Low
2015-04-13
2015-04-09
monojp
No

after creating tables with

CREATE TABLE test1(a1 INT);
CREATE TABLE test2(a2 INT);
CREATE TABLE test3(a3 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE test4(
  a4 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  b4 INT DEFAULT 0
);

and running the following sql query directly

delimiter |

CREATE TRIGGER testref BEFORE INSERT ON test1
  FOR EACH ROW
  BEGIN
    INSERT INTO test2 SET a2 = NEW.a1;
    DELETE FROM test3 WHERE a3 = NEW.a1;
    UPDATE test4 SET b4 = b4 + 1 WHERE a4 = NEW.a1;
  END;
|

delimiter ;

our apache webserver maxes out on cpu usage until it is exited which results in an internal server error. the same tests on the demo interface (latest stable + latest git) e.g. http://demo.phpmyadmin.net/STABLE/ results in import.php returning

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.2.1</center>
</body>
</html>

after a few seconds

tested locally with versions 4.4.1.1 going downwards until 4.3.8. bevhaviour was always the same (100% cpu, internal server error from apache)

Discussion

  • Madhura Jayaratne

    • assigned_to: Madhura Jayaratne
     
  • Madhura Jayaratne

    • summary: trigger sql with delimiters maxes out cpu resources --> (ok 4.4.2) trigger sql with delimiters maxes out cpu resources
    • status: open --> resolved
    • Priority: High --> Low
     
  • Marc Delisle

    Marc Delisle - 2015-04-13
    • Status: resolved --> fixed