I have a "trigger before insert" in a table in MySQL, which calculates a time accumulated in the last column of the table through a stored procedure that compares the record that is being inserted with the previous record chronologically ordered and the same kind.
The fact is that when I insert individually from a console in this way:
insert into personas (Nombre,Zona,Fecha_Hora)
Values ('Usuario','Zona 1','2018-05-15 07:50:00');
commit;
The trigger runs well and completes the data as it corresponds to changing the Date_Hour.
The problem is that when I perform massive insert the trigger behaves as if the first record was always being inserted and does not calculate the accumulated times.
Any ideas that I may be missing or that I might be doing wrong?