Commit 5fe4c5af authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Removed SCCS flag from all test cases

Changed atoll -> strtoll
Extended mysql-test-run
parent e962b04b
...@@ -18,6 +18,7 @@ then ...@@ -18,6 +18,7 @@ then
then then
scripts/make_binary_distribution scripts/make_binary_distribution
fi fi
make test
fi fi
exit exit
......
...@@ -18382,6 +18382,11 @@ CHECK TABLE test_table FAST QUICK; ...@@ -18382,6 +18382,11 @@ CHECK TABLE test_table FAST QUICK;
Which only would do a quick check on the table if it wasn't closed properly. Which only would do a quick check on the table if it wasn't closed properly.
@strong{NOTE:} that in some case @code{CHECK TABLE} will change the
table! This happens if the table is marked as 'corrupted' or 'not
closed properly' but @code{CHECK TABLE} didn't find any problems in the
table. In this case @code{CHECK TABLE} will mark the table as ok.
If a table is corrupted, then it's most likely that the problem is in If a table is corrupted, then it's most likely that the problem is in
the indexes and not in the data part. All of the above check types the indexes and not in the data part. All of the above check types
checks the indexes throughly and should thus find most errors. checks the indexes throughly and should thus find most errors.
...@@ -152,10 +152,16 @@ MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --u ...@@ -152,10 +152,16 @@ MYSQL_TEST="$MYSQL_TEST --no-defaults --socket=$MASTER_MYSOCK --database=$DB --u
GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
USE_RUNNING_SERVER=1
DO_GCOV=""
DO_GDB=""
DO_DDD=""
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
--force ) FORCE=1 ;; --force ) FORCE=1 ;;
--record ) RECORD=1 ;; --record ) RECORD=1 ;;
--local) USE_RUNNING_SERVER="" ;;
--gcov ) --gcov )
if [ x$BINARY_DIST = x1 ] ; then if [ x$BINARY_DIST = x1 ] ; then
$ECHO "Cannot do coverage test without the source - please use source dist" $ECHO "Cannot do coverage test without the source - please use source dist"
...@@ -186,6 +192,20 @@ while test $# -gt 0; do ...@@ -186,6 +192,20 @@ while test $# -gt 0; do
shift shift
done done
# If we should run all tests cases, we will use a local server for that
if [ -z "$1" ]
then
USE_RUNNING_SERVER=""
fi
if [ -w / ]
then
# We are running as root; We need to add the --root argument
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --user=root"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
fi
#++ #++
# Function Definitions # Function Definitions
#-- #--
...@@ -368,7 +388,8 @@ stop_slave () ...@@ -368,7 +388,8 @@ stop_slave ()
if [ x$SLAVE_RUNNING = x1 ] if [ x$SLAVE_RUNNING = x1 ]
then then
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root shutdown $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder! if [ $? != 0 ] && [ -f $SLAVE_MYPID ]
then # try harder!
$ECHO "slave not cooperating with mysqladmin, will try manual kill" $ECHO "slave not cooperating with mysqladmin, will try manual kill"
kill `$CAT $SLAVE_MYPID` kill `$CAT $SLAVE_MYPID`
sleep 2 sleep 2
...@@ -390,7 +411,8 @@ stop_master () ...@@ -390,7 +411,8 @@ stop_master ()
if [ x$MASTER_RUNNING = x1 ] if [ x$MASTER_RUNNING = x1 ]
then then
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root shutdown $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder! if [ $? != 0 ] && [ -f $MASTER_MYPID ]
then # try harder!
$ECHO "master not cooperating with mysqladmin, will try manual kill" $ECHO "master not cooperating with mysqladmin, will try manual kill"
kill `$CAT $MASTER_MYPID` kill `$CAT $MASTER_MYPID`
sleep 2 sleep 2
...@@ -565,7 +587,7 @@ mysql_install_db ...@@ -565,7 +587,7 @@ mysql_install_db
#do not automagically start deamons if we are in gdb or running only one test #do not automagically start deamons if we are in gdb or running only one test
#case #case
if [ -z "$DO_GDB" ] && [ -z "$1" ] && [ -z "$DO_DDD" ] if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ]
then then
mysql_start mysql_start
fi fi
...@@ -590,7 +612,7 @@ then ...@@ -590,7 +612,7 @@ then
done done
fi fi
else else
tname=`$BASENAME $1 .test` tname=`$BASENAME $1 .test`
tf=$TESTDIR/$tname.$TESTSUFFIX tf=$TESTDIR/$tname.$TESTSUFFIX
if [ -f $tf ] ; then if [ -f $tf ] ; then
run_testcase $tf run_testcase $tf
...@@ -604,7 +626,7 @@ $ECHO ...@@ -604,7 +626,7 @@ $ECHO
$RM -f $TIMEFILE $RM -f $TIMEFILE
if [ -z "$DO_GDB" ] && [ -z "$DO_DDD" ] if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ]
then then
mysql_stop mysql_stop
fi fi
......
...@@ -62,12 +62,12 @@ static struct option long_options[] = ...@@ -62,12 +62,12 @@ static struct option long_options[] =
void sql_print_error(const char *format,...); void sql_print_error(const char *format,...);
static bool short_form = 0; static bool short_form = 0;
static longlong offset = 0; static ulonglong offset = 0;
static const char* host = "localhost"; static const char* host = "localhost";
static int port = MYSQL_PORT; static int port = MYSQL_PORT;
static const char* user = "test"; static const char* user = "test";
static const char* pass = ""; static const char* pass = "";
static longlong position = 0; static ulonglong position = 0;
static bool use_remote = 0; static bool use_remote = 0;
static short binlog_flags = 0; static short binlog_flags = 0;
static MYSQL* mysql = NULL; static MYSQL* mysql = NULL;
...@@ -166,11 +166,11 @@ static int parse_args(int *argc, char*** argv) ...@@ -166,11 +166,11 @@ static int parse_args(int *argc, char*** argv)
break; break;
case 'o': case 'o':
offset = atoll(optarg); offset = strtoull(optarg,(char**) 0, 10);
break; break;
case 'j': case 'j':
position = atoll(optarg); position = strtoull(optarg,(char**) 0, 10);
break; break;
case 'h': case 'h':
...@@ -312,7 +312,7 @@ static void dump_local_log_entries(const char* logname) ...@@ -312,7 +312,7 @@ static void dump_local_log_entries(const char* logname)
{ {
File fd = -1; File fd = -1;
IO_CACHE cache,*file= &cache; IO_CACHE cache,*file= &cache;
int rec_count = 0; ulonglong rec_count = 0;
if (logname && logname[0] != '-') if (logname && logname[0] != '-')
{ {
...@@ -332,7 +332,7 @@ static void dump_local_log_entries(const char* logname) ...@@ -332,7 +332,7 @@ static void dump_local_log_entries(const char* logname)
/* skip 'position' characters from stdout */ /* skip 'position' characters from stdout */
byte buff[IO_SIZE]; byte buff[IO_SIZE];
my_off_t length,tmp; my_off_t length,tmp;
for (length=position ; length > 0 ; length-=tmp) for (length= (my_off_t) position ; length > 0 ; length-=tmp)
{ {
tmp=min(length,sizeof(buff)); tmp=min(length,sizeof(buff));
if (my_b_read(file,buff, (uint) tmp)) if (my_b_read(file,buff, (uint) tmp))
...@@ -354,13 +354,14 @@ static void dump_local_log_entries(const char* logname) ...@@ -354,13 +354,14 @@ static void dump_local_log_entries(const char* logname)
while(1) while(1)
{ {
char llbuff[21];
Log_event* ev = Log_event::read_log_event(file, 0); Log_event* ev = Log_event::read_log_event(file, 0);
if (!ev) if (!ev)
{ {
if (file->error) if (file->error)
die("Could not read entry at offset %ld : Error in log format or \ die("\
read error", Could not read entry at offset %s : Error in log format or read error",
my_b_tell(file)); llstr(my_b_tell(file),llbuff));
// file->error == 0 means EOF, that's OK, we break in this case // file->error == 0 means EOF, that's OK, we break in this case
break; break;
} }
......
...@@ -526,7 +526,7 @@ int init_master_info(MASTER_INFO* mi) ...@@ -526,7 +526,7 @@ int init_master_info(MASTER_INFO* mi)
return 1; return 1;
} }
mi->pos = atoll(buf); mi->pos = strtoull(buf,(char**) 0, 10);
mi->fd = fd; mi->fd = fd;
if(init_strvar_from_file(mi->host, sizeof(mi->host), &mi->file, if(init_strvar_from_file(mi->host, sizeof(mi->host), &mi->file,
master_host) || master_host) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment