-- ---------------------------------------------
-- Temporary table
-- ---------------------------------------------
CREATE TABLE `new_table` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `text` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1;



-- ---------------------------------------------
-- Test procedure
-- ---------------------------------------------
CREATE PROCEDURE `test_fill`(IN num INTEGER)
BEGIN	
      DECLARE a INT Default 0 ;

      simple_loop: LOOP
        	SET a=a+1;
		
		START TRANSACTION;
		INSERT INTO new_table(text) VALUES('dfsd5345345fsdfs43545dddf');
		COMMIT;
        
		IF a = num THEN
		    LEAVE simple_loop;
		END IF;
   END LOOP simple_loop;

END


-- ---------------------------------------------
-- Run test!!
-- ---------------------------------------------
call test_fill(100);
