Commit 07b5d554 authored by Michael Widenius's avatar Michael Widenius

- maria/ma_test_all.sh can now be run with --tmpdir=/dev/shm for faster testing

- Fixed mysql-test-run failures on window
- Fixed compiler warnings from my last push (sorry about that)
- Fixed that maria_chk --repair --extended works again
- Fixed compiler warnings about using not unitialized data

mysql-test/mysql-test-run.pl:
  Better output
mysql-test/suite/parts/inc/partition_check_drop.inc:
  Use remove_files_wildcard instead of rm
mysys/safemalloc.c:
  Fixed argument to printf
storage/maria/ma_cache.c:
  Don't give errors when running maria_chk
storage/maria/ma_dynrec.c:
  Don't give errors when running maria_chk
storage/maria/ma_rt_test.c:
  Added option --datadir for where to put logs and test data
storage/maria/ma_test1.c:
  Added option --datadir for where to put logs and test data
storage/maria/ma_test2.c:
  Added option --datadir for where to put logs and test data
storage/maria/maria_chk.c:
  If --datadir is used but --logdir is not, set --logdir from --datadir
  (this reflects how --help said how things should work)
storage/maria/maria_read_log.c:
  Changed short option for 'maria-log-dir-path' from -l to -h to be same as mysqld, maria_chk, ma_test1 etc..
storage/maria/unittest/ma_test_all-t:
  Allow one to specify --tmpdir for where to store logs and data
storage/xtradb/buf/buf0buf.c:
  Fixed compiler warnings about using not unitialized data
storage/xtradb/row/row0upd.c:
  Fixed compiler warnings about using not unitialized data
storage/xtradb/srv/srv0srv.c:
  Fixed compiler warnings about using not unitialized data
parent e6c45f5e
......@@ -5310,7 +5310,7 @@ sub start_servers($) {
for (all_servers()) {
next unless $_->{WAIT} and started($_);
if ($_->{WAIT}->($_)) {
$tinfo->{comment}= "Failed to start ".$_->name();
$tinfo->{comment}= "Failed to start ".$_->name() . "\n";
return 1;
}
}
......
......@@ -66,10 +66,10 @@ if ($found_garbage)
}
# Do a manual cleanup, because the following tests should not suffer from
# remaining files
--exec rm -f $MYSQLD_DATADIR/test/t1* || true
--remove_files_wildcard $MYSQLD_DATADIR/test t1*
if ($with_directories)
{
--exec rm -f $MYSQLTEST_VARDIR/tmp/t1* || true
--remove_files_wildcard $MYSQLD_DATADIR/test/tmp t1*
}
}
--enable_query_log
......@@ -125,7 +125,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
uchar *data;
DBUG_ENTER("_mymalloc");
DBUG_PRINT("enter",("Size: %lu Total alloc: %lu", (ulong) size,
sf_malloc_cur_memory));
(ulong) sf_malloc_cur_memory));
if (!sf_malloc_quick)
(void) _sanity (filename, lineno);
......@@ -317,7 +317,7 @@ void _myfree(void *ptr, const char *filename, uint lineno, myf myflags)
sf_malloc_cur_memory-= irem->datasize;
sf_malloc_count--;
pthread_mutex_unlock(&THR_LOCK_malloc);
DBUG_PRINT("info", ("bytes freed: %ld", irem->datasize));
DBUG_PRINT("info", ("bytes freed: %ld", (ulong) irem->datasize));
#ifndef HAVE_valgrind
/* Mark this data as free'ed */
......
......@@ -98,7 +98,12 @@ my_bool _ma_read_cache(MARIA_HA *handler, IO_CACHE *info, uchar *buff,
("Error %d reading next-multi-part block (Got %d bytes)",
my_errno, (int) read_length));
if (!my_errno || my_errno == HA_ERR_FILE_TOO_SHORT)
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
{
if (!handler->in_check_table)
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
else
my_errno= HA_ERR_WRONG_IN_RECORD;
}
DBUG_RETURN(1);
}
bzero(buff+read_length,MARIA_BLOCK_INFO_HEADER_LENGTH - in_buff_length -
......
......@@ -2053,6 +2053,10 @@ uint _ma_get_block_info(MARIA_HA *handler, MARIA_BLOCK_INFO *info, File file,
}
err:
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
if (!handler->in_check_table)
{
/* We may be scanning the table for new rows; Don't give an error */
_ma_set_fatal_error(handler->s, HA_ERR_WRONG_IN_RECORD);
}
return BLOCK_ERROR;
}
......@@ -93,9 +93,10 @@ static enum data_file_type record_type= DYNAMIC_RECORD;
int main(int argc, char *argv[])
{
char buff[FN_REFLEN];
MY_INIT(argv[0]);
get_options(argc, argv);
maria_data_root= (char *)".";
get_options(argc, argv);
/* Maria requires that we always have a page cache */
if (maria_init() ||
(init_pagecache(maria_pagecache, maria_block_size * 16, 0, 0,
......@@ -113,7 +114,7 @@ int main(int argc, char *argv[])
exit(1);
}
exit(run_test("rt_test"));
exit(run_test(fn_format(buff, "test1", maria_data_root, "", MYF(0))));
}
......@@ -614,6 +615,8 @@ static struct my_option my_long_options[] =
#endif
{"help", '?', "Display help and exit",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"datadir", 'h', "Path to the database root.", &maria_data_root,
&maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"row-fixed-size", 'S', "Fixed size records",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"rows-in-block", 'M', "Store rows in block format",
......
......@@ -70,12 +70,13 @@ extern int _ma_flush_table_files(MARIA_HA *info, uint flush_data_or_index,
int main(int argc,char *argv[])
{
char buff[FN_REFLEN];
#if defined(SAFE_MUTEX) && defined(THREAD)
safe_mutex_deadlock_detector= 1;
#endif
MY_INIT(argv[0]);
get_options(argc,argv);
maria_data_root= (char *)".";
get_options(argc,argv);
/* Maria requires that we always have a page cache */
if (maria_init() ||
(init_pagecache(maria_pagecache, maria_block_size * 16, 0, 0,
......@@ -95,7 +96,7 @@ int main(int argc,char *argv[])
if (opt_versioning)
init_thr_lock();
exit(run_test("test1"));
exit(run_test(fn_format(buff, "test1", maria_data_root, "", MYF(0))));
}
......@@ -724,6 +725,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "Undocumented",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"datadir", 'h', "Path to the database root.", &maria_data_root,
&maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delete-rows", 'd', "Abort after this many rows has been deleted",
(uchar**) &remove_count, (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG,
1000, 0, 0, 0, 0, 0},
......
......@@ -69,24 +69,25 @@ int main(int argc, char *argv[])
MARIA_KEYDEF keyinfo[10];
MARIA_COLUMNDEF recinfo[10];
MARIA_INFO info;
const char *filename;
char *blob_buffer;
MARIA_CREATE_INFO create_info;
char filename[FN_REFLEN];
#if defined(SAFE_MUTEX) && defined(THREAD)
safe_mutex_deadlock_detector= 1;
#endif
MY_INIT(argv[0]);
filename= "test2";
maria_data_root= (char *)".";
get_options(argc,argv);
fn_format(filename, "test2", maria_data_root, "", MYF(0));
if (! async_io)
my_disable_async_io=1;
/* If we sync or not have no affect on this test */
my_disable_sync= 1;
maria_data_root= (char *)".";
/* Maria requires that we always have a page cache */
if (maria_init() ||
(init_pagecache(maria_pagecache, pagecache_size, 0, 0,
......@@ -1101,6 +1102,9 @@ static void get_options(int argc, char **argv)
case 'H':
checkpoint= atoi(++pos);
break;
case 'h':
maria_data_root= ++pos;
break;
case 'k':
if ((keys=(uint) atoi(++pos)) < 1 ||
keys > (uint) (MARIA_KEYS-first_key))
......
......@@ -38,6 +38,7 @@ static uint decode_bits;
static char **default_argv;
static const char *load_default_groups[]= { "maria_chk", 0 };
static const char *set_collation_name, *opt_tmpdir, *opt_log_dir;
static const char *default_log_dir;
static CHARSET_INFO *set_collation;
static int stopwords_inited= 0;
static MY_TMPDIR maria_chk_tmpdir;
......@@ -106,7 +107,7 @@ int main(int argc, char **argv)
int error;
MY_INIT(argv[0]);
opt_log_dir= maria_data_root= (char *)".";
default_log_dir= opt_log_dir= maria_data_root= (char *)".";
maria_chk_init(&check_param);
check_param.opt_lock_memory= 1; /* Lock memory if possible */
check_param.using_global_keycache = 0;
......@@ -207,7 +208,7 @@ enum options_mc {
OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE, OPT_STATS_METHOD, OPT_TRANSACTION_LOG,
OPT_SKIP_SAFEMALLOC, OPT_ZEROFILL_KEEP_LSN,
OPT_REQUIRE_CONTROL_FILE, OPT_IGNORE_CONTROL_FILE,
OPT_LOG_DIR, OPT_DATADIR, OPT_WARNING_FOR_WRONG_TRANSID
OPT_LOG_DIR, OPT_WARNING_FOR_WRONG_TRANSID
};
static struct my_option my_long_options[] =
......@@ -277,7 +278,7 @@ static struct my_option my_long_options[] =
&check_param.keys_in_use,
&check_param.keys_in_use,
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"datadir", OPT_DATADIR,
{"datadir", 'h',
"Path for control file (and logs if --logdir not used).",
&maria_data_root, 0, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
......@@ -928,6 +929,11 @@ static void get_options(register int *argc,register char ***argv)
MYF(MY_WME))))
exit(1);
if (maria_data_root != default_log_dir && opt_log_dir == default_log_dir)
{
/* --datadir was used and --log-dir was not. Set log-dir to datadir */
opt_log_dir= maria_data_root;
}
return;
} /* get options */
......
......@@ -44,9 +44,9 @@ int main(int argc, char **argv)
uint warnings_count;
MY_INIT(argv[0]);
maria_data_root= (char *)".";
load_defaults("my", load_default_groups, &argc, &argv);
default_argv= argv;
maria_data_root= (char *)".";
get_options(&argc, &argv);
maria_in_recovery= TRUE;
......@@ -195,7 +195,7 @@ static struct my_option my_long_options[] =
{ "end-lsn", 'e', "Stop applying at this lsn. If end-lsn is used, UNDO:s "
"will not be applied", &opt_end_lsn, &opt_end_lsn,
0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
{"maria-log-dir-path", 'l',
{"maria-log-dir-path", 'h',
"Path to the directory where to store transactional log",
(uchar **) &maria_data_root, (uchar **) &maria_data_root, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
......
This diff is collapsed.
......@@ -1076,7 +1076,7 @@ init_again:
"InnoDB: Logical offset (blocks) : %ld (%#lx)\n",
(byte*)chunk->mem + shm_info->frame_offset,
chunk->blocks[0].frame, frame,
phys_offset, phys_offset,
(long) phys_offset, (long) phys_offset,
(long) logi_offset, (long) logi_offset,
(long) blocks_offset, (long) blocks_offset);
} else {
......
......@@ -1224,7 +1224,7 @@ row_upd_changes_ord_field_binary(
const upd_field_t* upd_field;
const dfield_t* dfield;
dfield_t dfield_ext;
ulint dfield_len;
ulint dfield_len= 0;
const byte* buf;
ind_field = dict_index_get_nth_field(index, i);
......
......@@ -2723,6 +2723,7 @@ srv_master_thread(
srv_main_thread_id = os_thread_pf(os_thread_get_curr_id());
memset(&prev_flush_info, 0, sizeof(prev_flush_info));
mutex_enter(&kernel_mutex);
srv_table_reserve_slot(SRV_MASTER);
......
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