Bug #48885 gendata.pl requires a dsn input, despite the help output saying it is optional
Submitted: 18 Nov 2009 22:32 Modified: 20 Nov 2009 16:46
Reporter: Patrick Crews Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: Random Query Generator Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Bernt Marius Johnsen CPU Architecture:Any
Tags: DSN, gendata, RQG

[18 Nov 2009 22:32] Patrick Crews
Description:
The RQG script gendata.pl will not run without a dsn input, despite the help output saying that such an input is optional:
perl ./gendata.pl --help
./gendata.pl - Random Data Generator. Options:

        --debug         : Turn on debugging for additional output
        --dsn           : DBI resource to connect to (default: no DSN, print CREATE/INSERT statements to STDOUT)
        --engine        : Table engine to use when creating tables with gendata (default: no ENGINE for CREATE TABLE)
        --config        : Configuration ZZ file describing the data (see RandomDataGenerator in MySQL Wiki)
        --rows          : Number of rows to generate for each table, unless specified in the ZZ file
        --seed          : Seed to PRNG. if --seed=time the current time will be used. (default 1)
        --views         : Generate views
        --varchar-length: maximum length of strings (deault 1)
        --help          : This help message

When I try to run the script, I receive this output:
perl ./gendata.pl --config=conf/xx.zz --seed=time
# 17:29:04 Unsupported dsn: 

How to repeat:
Try running the gendata script with any .zz file and no dsn value.

Suggested fix:
I would prefer that we have the option of running this script without a dsn value so that we can have 'dry-runs' of gendata files.
[19 Nov 2009 8:14] Philip Stoev
Bernt, can you please take a look at this? It may be a side-effect from abstracting gendata into a separate object. It did work without a DSN previously. If needed, you can implement a Executor::STDOUT or something along those lines.
[19 Nov 2009 9:07] Bernt Marius Johnsen
We have en Executor::Dummy for test purposes (dsn=dummy), it may easily be enhanced with a flag to make it print the queries.
[20 Nov 2009 16:46] Bernt Marius Johnsen
Fixed. use --dsn=dummy:print for getting a dry-run