To create a lot of records for testing is possible using PROCEDURE like this:
DELIMITER //
drop procedure if exists gen //
CREATE TABLE mytable ( code int, a int, b int ) //
CREATE PROCEDURE gen() BEGIN DECLARE i int DEFAULT 0; WHILE i <= 1000000 DO INSERT INTO mytable (code, a, b) VALUES (i, 1, 1); SET i = i + 1; END WHILE; END //
CALL gen() //
DELIMITER ;