Skip to content

Commit

Permalink
fix sql errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sidorares committed Apr 23, 2013
1 parent d123b69 commit 04f07f8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions test/create-500k-random-ints-doubles-table.sql
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
-- from http://sixarm.com/about/mysql-create-random-data-text-strings.html

drop table if exists ints;
drop procedure if exists randomizer;
drop procedure if exists randomize_nums;

CREATE TABLE ints (
id int(11) NOT NULL AUTO_INCREMENT,
val1 int(11),
val2 double
val2 double,
PRIMARY KEY (id)
);

delimiter $$
create procedure randomize_nums()
begin
declare i int Default 0 ;
declare random char(20);
declare random int(20);
declare random1 double;
myloop: loop
set random=floor(rand() * 99999)) ;
set random=floor(rand() * 99999);
set random1=rand() * 99999 ;
insert into `foos` (`id`, `val1`, `val2`) VALUES (i+1,random, random1) ;
insert into ints VALUES (i+1,random, random1) ;
set i=i+1;
if i=500000 then
leave myloop;
Expand Down

0 comments on commit 04f07f8

Please sign in to comment.