-- 这样测试OK.Delimiter $$Create Procedure P_test()
Begin
DECLARE I int;
DECLARE J int;
set I=100000;
set J=1;
while (I<=120000) do
begin
while (J<=10) do
begin
insert into t_favorites values (I,J) ;
if(J=10) then
set J=1;
else
set J=J+1;
end if;
end;
end while;
set I=I + 1;
end;
end while;
end$$
Call p_test();
Begin
DECLARE I int;
DECLARE J int;
set I=100000;
set J=1;
while (I<=120000) do
begin
while (J<=10) do
begin
insert into t_favorites values (I,J) ;
if(J=10) then
set J=1;
else
set J=J+1;
end if;
end;
end while;
set I=I + 1;
end;
end while;
end$$
Call p_test();
上边是你原来的插入语句,换回来就好了.