3
# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
4
# Use is subject to license terms.
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; version 2 of the License.
10
# This program is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23
use lib "$ENV{RQG_HOME}/lib";
26
use GenTest::Constants;
27
use GenTest::App::Gendata;
30
my ($spec_file, $config_file, $debug, $engine, $help, $dsn, $rows, $varchar_len,
31
$views, $server_id, $seed);
33
my $opt_result = GetOptions(
35
'config:s' => \$config_file, ## Kept for backward compatability.
36
'spec:s' => \$spec_file,
40
'engine:s' => \$engine,
43
'varchar-length=i' => \$varchar_len,
44
'server-id=i' > \$server_id
47
if (defined $config_file) {
48
carp("--config is deprecated. Use --spec");
49
$spec_file = $config_file if not defined $spec_file;
52
help() if !$opt_result || $help || not defined $spec_file;
54
exit(1) if !$opt_result;
57
my $app = GenTest::App::Gendata->new(spec_file => $spec_file,
64
varchar_length => $varchar_len,
65
server_id => $server_id);
68
my $status = $app->run();
75
$0 - Random Data Generator. Options:
77
--debug : Turn on debugging for additional output
78
--dsn : DBI resource to connect to
79
--engine : Table engine to use when creating tables with gendata (default: no ENGINE for CREATE TABLE)
80
--spec : Specification ZZ file describing the data (see RandomDataGenerator in MySQL Wiki)
81
--rows : Number of rows to generate for each table, unless specified in the ZZ file
82
--seed : Seed to PRNG. if --seed=time the current time will be used. (default 1)
83
--views : Generate views
84
--varchar-length: maximum length of strings (deault 1)
85
--help : This help message