--source include/have_innodb.inc CREATE TABLE tablica_s_govnom ( pri1 int(11) UNSIGNED NOT NULL, DT datetime DEFAULT NULL, dop1 text DEFAULT NULL , PRIMARY KEY (pri1), INDEX UK_tablica_s_govnom (DT) ) ENGINE = INNODB AVG_ROW_LENGTH = 16384 CHARACTER SET utf8 COLLATE utf8_general_ci ROW_FORMAT = DYNAMIC; INSERT INTO tablica_s_govnom(pri1,DT,dop1) VALUES(1,NOW(),'2222'); DELIMITER |; CREATE PROCEDURE Sucks_test() BEGIN DECLARE pri1,pri3 int; DECLARE pri2,comment VARCHAR(255); DECLARE dop1_1,dop2,dop3 VARCHAR(255) DEFAULT '222'; set pri1=1,pri2='1',pri3=1,comment='123'; INSERT INTO tablica_s_govnom(pri1, DT, dop1) VALUES(pri1, NOW() ,dop1_1) ON DUPLICATE KEY UPDATE DT=NOW(), dop1=VALUES(dop1); END | create procedure call_in_loop(iterations int) begin while iterations > 0 do call Sucks_test(); end while; end | delimiter ;| call call_in_loop(100);