mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
up
git-svn-id: file:///svn/tokudb@39 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
24
loadsome/makedata-random.c
Normal file
24
loadsome/makedata-random.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
||||
long long parsell (char *s) {
|
||||
char *end;
|
||||
errno=0;
|
||||
long long r = strtoll(s, &end, 10);
|
||||
assert(*end==0 && end!=s && errno==0);
|
||||
return r;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
long long i;
|
||||
assert(argc==3);
|
||||
long long count=parsell(argv[1]);
|
||||
long long range=100*parsell(argv[2]);
|
||||
for (i=0; i<count; i++) {
|
||||
printf("%lld\t%d\n", (random()%range), random());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -15,9 +15,9 @@ int main (int argc, char *argv[]) {
|
||||
long long i;
|
||||
assert(argc==3);
|
||||
long long lo=parsell(argv[1]);
|
||||
long long hi=parsell(argv[2]);
|
||||
for (i=lo; i<hi; i++) {
|
||||
printf("%lld\t%d\n", i, random());
|
||||
long long count=parsell(argv[2]);
|
||||
for (i=lo*count; count>0; i++, count--) {
|
||||
printf("%lld\t%d\n", i*100, random());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user