Skip to content

RandomQueryGeneratorQuickStart

RoelVdP edited this page Jul 24, 2012 · 16 revisions

Table of Contents

About

The Random Query Generator is a tool for testing the MySQL server by means of randomly generated data and queries. Both the data and the queries are highly configurable and various different scenarios can be tested. More information is available here.

Platforms

Linux, Solaris, Windows (ActiveState Perl and Cygwin) and OS X are known to work.

Downloading

 $ bzr branch lp:randgen

Prerequisites

1. DBD::mysql perl module

Fedora/RedHat:

 $ sudo yum install perl-DBD-mysql

Ubuntu:

 http://packages.ubuntu.com/jaunty/libdbd-mysql-perl

Linux generic / OS X:

 $ perl -MCPAN -e 'install DBD::mysql'

OS X with MacPorts:

 $ sudo port install DBD::mysql
 NOTE:  This will likely result in 2 versions of perl on your system - one in /opt/local which can cause problem.  <br>The CPAN install method works well and should be recommended if you don't want to use MacPorts (or similar software)

ActiveState Perl 5.6

 c:\>ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/DBD-mysql.ppd

ActiveState Perl 5.8

 c:\>ppm install http://theoryx5.uwinnipeg.ca/ppms/DBD-mysql.ppd

ActiveState Perl 5.10

 c:\>ppm install http://cpan.uwinnipeg.ca/PPMPackages/10xx/DBD-mysql.ppd

2. GNU tools for Windows

3. CPAN (required if you want to install any CPAN modules below)

Fedora/RedHat:

 $ sudo yum install cpan

4. Test::More Perl module (required if you want to install DBIx::MyParsePP below)

Fedora/RedHat:

 $ perl -MCPAN -e 'install Test::More'

5. (Optional) XML::Writer Perl module

Only required if you want the RQG to generate XML reports from your test runs (option --xml-output=<file>).

The module has no extra non-core dependencies and can be installed via CPAN or ppm.

6. (Optional) DBIx::MyParsePP Perl module

Only required for automatic bug simplification, such as the util/simplify* scripts and the ResultsetComparatorSimplify Validator

 perl -MCPAN -e 'install DBIx::MyParsePP'

7. (Optional) Statistics::Descriptive Perl module

Only required if you want to use the ExecutionTimeComparator validator with extended statistical qualification of results.

If the module is not installed, the validator will still work, but possibly with reduced functionality (depending on settings). Default settings do not require this module.

  perl -MCPAN -e 'install Statistics::Descriptive'

8. (Optional) JSON Perl module

Only required if you want to use the OptimizerTraceParser validator, which grabs JSON-formatted text from MySQL, validates the syntax and makes a Perl datastructure out of it.

  perl -MCPAN -e 'install JSON'

9. (Optional) Test::Unit Perl module

Only required to run RQG unit tests (testing the RQG itself). See the file unit/README for details.

  perl -MCPAN -e 'install Test::Unit'

Running your first test

  • Against an already running server:
 $ perl gentest.pl \
   --dsn=dbi:mysql:host=127.0.0.1:port=3306:user=root:database=test \
   --gendata=conf/example.zz \
   --grammar=conf/example.yy
  • Against a source or binary distribution:
 $ perl runall.pl \
   --basedir=/path/to/mysql/distribution
   --gendata=conf/example.zz \
   --grammar=conf/example.yy

More information is available here

Category:RandomQueryGenerator