use mysql;drop database test;create database test character set = 'gbk';use test;create table if not exists t1 ( c1 int auto_increment not null primary key, c2 float not null default 0.0, c3 char(50) not null default '', c4 varchar(50) not null default '', c5 datetime not null default '1900-01-01 00:00:00', c6 timestamp not null default current_timestamp ); drop procedure if exists create_sample;delimiter // create procedure create_sample (in v_count bigint) begin declare v_i bigint; set v_i=1;
while (v_i<=v_count) do insert into test.t1 select null,rand()*10000,uuid(),uuid(),adddate(now(),interval rand()*50000 second),sysdate(); set v_i=v_i+1; end while; end //delimiter ;call create_sample(100);
use mysql;drop database test;create database test character set = 'gbk';use test;create table if not exists t1 (
c1 int auto_increment not null primary key,
c2 float not null default 0.0,
c3 char(50) not null default '',
c4 varchar(50) not null default '',
c5 datetime not null default '1900-01-01 00:00:00',
c6 timestamp not null default current_timestamp
);
drop procedure if exists create_sample;delimiter //
create procedure create_sample (in v_count bigint)
begin
declare v_i bigint;
set v_i=1;
while (v_i<=v_count)
do
insert into test.t1 select null,rand()*10000,uuid(),uuid(),adddate(now(),interval rand()*50000 second),sysdate();
set v_i=v_i+1;
end while;
end //delimiter ;call create_sample(100);