#!/bin/bash
#
# Copyright (c) 2006 rPath, Inc.
# This file is distributed under the terms of the MIT License.
# A copy is available at http://www.rpath.com/permanent/mit-license.html
#

TESTDIR=/tmp/mybug

# prepare the test directory
rm -rf $TESTDIR
mkdir -p $TESTDIR/data $TESTDIR/tmp
cat >>$TESTDIR/my.cnf <<EOF
[mysqld]
datadir=$TESTDIR/data
tmpdir=$TESTDIR/tmp
socket=$TESTDIR/socket
log_error=$TESTDIR/log
log_slow_queries
pid_file=$TESTDIR/mysql.pid
character_set_server=latin1
collation_server=latin1_bin
port=60000
long_query_time=1
sql_mode=TRADITIONAL,NO_AUTO_VALUE_ON_ZERO
lower_case_table_names=1
default-table-type=InnoDB
innodb_fast_shutdown
language=/usr/share/mysql/english
log=$TESTDIR/query.log
EOF

# initialize the mysql database
mysql_install_db --defaults-file=$TESTDIR/my.cnf

# start up mysqld
mysqld --defaults-file=$TESTDIR/my.cnf --console
