Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.
Linux, Solaris, Windows (ActiveState Perl and Cygwin) and OS X are known to work.
- * Download page
- From Launchpad using Bazaar:
$ bzr branch lp:randgen
Important: Version 4.004 or newer is required for some RQG features (mysql_multi_statement support).
$ sudo yum install perl-DBD-mysql
Linux generic / OS X:
Important: for this command you will need to install CPAN first, see CPAN instructions in point 3 below
$ perl -MCPAN -e 'install DBD::mysql'
OS X with MacPorts:
$ sudo port install DBD::mysql
Important: This will likely result in 2 versions of perl on your system - one in /opt/local which can cause problem.
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
Important: This is a prerequisite to installing any CPAN modules below, or to installing DBD::mysql above using the CPAN method.
$ sudo yum install cpan /OR/ $ sudo yum install perl-CPAN
Sidenote: you can also use
$ sudo perl -MCPAN -e "shell"
To invoke a shell, and then use install <module></module> (ref module names below) at the shell's (cpan) prompt to install the various modules listed below. This is usually a much easier and quicker way to install all modules. Example of how this works, including a check to see if things went correctly:
$ sudo perl -MCPAN -e "shell" cpan> install Test::More Digest::MD5 Log::Log4perl XML::Writer DBIx::MyParsePP Statistics::Descriptive JSON Test::Unit [...] cpan> install Test::More Digest::MD5 Log::Log4perl XML::Writer DBIx::MyParsePP Statistics::Descriptive JSON Test::Unit Test::More is up to date (0.98). Digest::MD5 is up to date (2.53). Log::Log4perl is up to date (1.42). XML::Writer is up to date (0.623). DBIx::MyParsePP is up to date (0.50). Statistics::Descriptive is up to date (3.0605). JSON is up to date (2.59). Test::Unit is up to date (0.25).
$ sudo perl -MCPAN -e 'install Test::More'
$ sudo perl -MCPAN -e 'install Digest::MD5'
$ sudo perl -MCPAN -e 'install Log::Log4perl'
Only required if you want the RQG to generate XML reports from your test runs (option --xml-output=your_filename).
The module has no extra non-core dependencies and can be installed via CPAN or ppm.
$ sudo perl -MCPAN -e 'install XML::Writer'
Only required for automatic bug simplification, such as the util/simplify* scripts and the ResultsetComparatorSimplify Validator
$ sudo perl -MCPAN -e 'install DBIx::MyParsePP'
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.
$ sudo perl -MCPAN -e 'install Statistics::Descriptive'
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.
$ sudo perl -MCPAN -e 'install JSON'
Only required to run RQG unit tests (testing the RQG itself). See the file unit/README for details.
$ sudo perl -MCPAN -e 'install Test::Unit'
- Against an already running server:
$ perl gentest.pl \ --dsn=dbi:mysql:host=127.0.0.1:port=3306:user=root:database=test \ --gendata=conf/examples/example.zz \ --grammar=conf/examples/example.yy
- Against a source or binary distribution:
$ perl runall.pl \ --basedir=/path/to/mysql/distribution --gendata=conf/examples/example.zz \ --grammar=conf/examples/example.yy
More information is available here