パーティション表の一括作成
delimiter // ;
create procedure create_partition_tables()
begin
set @i := 0;
while @i<100 do
set @sql := concat('create table test_partition_', @i, '(id int primary key auto_increment, owner int, name varchar(100))');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
set @i = @i+1;
end while;
end //