COMMENTS
--------

There are two versions of DBT2(TPC-C) test:

   - pure C based version of the test(nonSP) 
   - server side SP based version of the test(default)

It is possible to run C based(nonSP) test with any version of MySQL 
server.

To run SP based test you have to build test with includes and libraries 
from MySQL 5.0 or higher.

Don't forget to run 'mysql_install_db'!

PREPARATION FOR TEST
--------------------

0. Build test binaries

aclocal
autoheader
autoconf
automake

NOTE:

   If you want to compile with MySQL support, you must either make sure 
   that path to 'mysql_config' is listed in your PATH environment variable 
   or specify file locations explicitly using options --with-mysql-includes 
   and --with-mysql-libs options.

./configure --help 

...
  --enable-nonsp          Force to build nonSP version of dbt2 test 
                          (default is no)
  --enable-debug-query    Dump all queries to client log file
...

  --with-mysql[=DIR]      Build C based version of dbt2 test. Set to the path
                          of the MySQL's installation, or leave unset if the
                          path is already in the search path
  --with-mysql-includes   path to MySQL header files
  --with-mysql-libs       path to MySQL libraries


./configure --with-mysql [--enable-nonsp] [--with-mysql-libs=<path>] \
            [--with-mysql-includes=<path>] 

make

1. How to generate data files for test?

   One has to specify:

     -w - number of warehouses (example: -w 3)
     -d - output path for data files (example: -d /tmp/dbt2-w3)
     - mode (example: --mysql)

   datagen -w 3 -d /tmp/dbt2-w3 --mysql

   Please note that output directory for data file should exist.

2. How to load test database?

   You should run shell script which will create database scheme
   and will load all data files. 

   cd scripts/mysql
   ./mysql_load_db.sh

   usage: mysql_load_db.sh [options]
   options:
       -d <database name>
       -f <path to dataset files>
       -m <database scheme [OPTIMIZED|ORIG] (default scheme OPTIMIZED)>
       -c <path to mysql client binary. (default /usr/bin/mysql)>
       -s <database socket>
       -h <database host>
       -u <database user>
       -p <database password>
       -e <storage engine: [MYISAM|INNODB|BDB]. (default INNODB)>
       -l <to use LOCAL keyword while loading dataset>
       -v <verbose output>

   Example: sh mysql_load_db.sh -d dbt2 -f /tmp/dbt2-w3 -s /tmp/mysql.sock

3. How to load SP procedures? (optional, only if you ran configure with 
   --enable-mysql-sp)

   cd scripts/mysql
   ./mysql_load_sp.sh

   usage: mysql_load_sp.sh [options]
   options:
       -d <database name>
       -c <path to mysql client binary. (default: /usr/bin/mysql)>
       -f <path to SPs>
       -h <database host (default: localhost)>
       -s <database socket>
       -u <database user>
       -p <database password>
       -t <database port>

   Example: sh mysql_load_sp.sh -d dbt2 -f ../../storedproc/mysql/

RUN TEST
--------

   cd scripts
   sh ./run_mysql.sh

   usage: run_mysql.sh -c <number of database connections> -t <duration of test> -w <number of warehouses>
   other options:
       -n <database name. (default dbt2)>
       -h <database host name. (default localhost)>
       -l <database port number. (default 3306)>
       -o <database socket>
       -u <database user>
       -p <database password>
       -s <delay of starting of new thread in milliseconds(default 300ms)>
       -k <stack size. (default 256k)>
       -m <terminals per warehouse. [1..10] (default 10)>
       -z <comments for the test>
       -e <use zero delays for test (default no)>
       -v <verbose output>

   Example: sh run_mysql.sh -c 20 -t 300 -w 3

   Test will be run for 300 seconds with 20 database connections and 
   scale factor(num of warehouses) 3

    -c number of database connections 
    -t duration of test in seconds
    -w number of warehouses (scale factor)

WARNING: If you break test (by Control-C for instance) or some kind of error
happened during running of test and you want to start test again please be sure 
that 'client' and 'driver' programms are not running anymore otherwise test 
will fail.

WARNING: Please ensure that number of warehouses (option -w) is less of equal
(not greater) to the real number of warehouses that exist in your test
database.

POSTRUNNING ANALYSES
--------------------

Results can be found in scripts/output/<number>

some of the usefull log files:

  scripts/output/<number>/client/error.log - errors from backend C|SP based
  scripts/output/<number>/driver/error.log - errors from terminals(driver)
  scripts/output/<number>/driver/mix.log - info about performed transactions
  scripts/output/<number>/driver/results.out - results of the test


