DELIMITER $$ DROPPROCEDUREIFEXISTS`insert_content` $$ CREATEPROCEDURE`insert_content`(STARTINT(10), MAXINT(10)) BEGIN DECLARE i INTDEFAULT0; DECLARE catid INT; DECLARE modelid INT; DECLARE published INT; DECLARE publishedby INT; DECLARESTATUSINT; DECLARE times INT; DECLARE DATETIME INT; SET autocommit = 0; REPEAT SET i = i+1; SETSTATUS = 6; SET catid = FLOOR(1+RAND()*10000); SET modelid = 1; SET published = FLOOR(1000000000+RAND()*451577599); SET publishedby = FLOOR(1+RAND()*300); SET times = FLOOR(1000000000+RAND()*451577599); SET DATETIME = FLOOR(1000000000+RAND()*451577599); IF (i % 50 = 0) THEN SETSTATUS= FLOOR(1+RAND()*5); SET published = NULL; SET publishedby = NULL; SET times = NULL; SET DATETIME = NULL; ENDIF; IF (i % 4 = 0) THEN SET modelid = FLOOR(2+RAND()*9); ENDIF; INSERTINTOcontentVALUES((START+i), MD5(START+i), rand_string(FLOOR(20+RAND()*180)), catid, modelid, published, publishedby, FROM_UNIXTIME(times), FROM_UNIXTIME(DATETIME), STATUS); UNTIL i = MAX ENDREPEAT; COMMIT; END $$ DELIMITER ;