Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1

into  mysql.com:/usr/home/bar/mysql-4.1.b9948


sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
This commit is contained in:
unknown 2005-09-05 20:05:32 +05:00
commit 9bd0261897
113 changed files with 2939 additions and 1386 deletions

View file

@ -116,3 +116,8 @@ test:
--master_port=$(MYSQL_TEST_MASTER_PORT) \ --master_port=$(MYSQL_TEST_MASTER_PORT) \
--slave_port=$(MYSQL_TEST_SLAVE_PORT) \ --slave_port=$(MYSQL_TEST_SLAVE_PORT) \
--ndbcluster_port=$(MYSQL_TEST_NDB_PORT) --ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
test-force:
cd mysql-test; \
./mysql-test-run --force ;\
./mysql-test-run --ps-protocol --force

File diff suppressed because it is too large Load diff

View file

@ -2043,6 +2043,13 @@ AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
# Test whether madvise() is declared in C++ code -- it is not on some
# systems, such as Solaris
AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H
#include <sys/types.h>
#include <sys/mman.h>
#endif])
# Do not treat warnings as errors if we are linking against other libc # Do not treat warnings as errors if we are linking against other libc
# this is to work around gcc not being permissive on non-system includes # this is to work around gcc not being permissive on non-system includes
# with respect to ANSI C++ # with respect to ANSI C++

View file

@ -310,6 +310,10 @@ C_MODE_END
#undef setrlimit #undef setrlimit
#define setrlimit cma_setrlimit64 #define setrlimit cma_setrlimit64
#endif #endif
/* Declare madvise where it is not declared for C++, like Solaris */
#if HAVE_MADVISE && !HAVE_DECL_MADVISE && defined(__cplusplus)
extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifdef __QNXNTO__ #ifdef __QNXNTO__
/* This has to be after include limits.h */ /* This has to be after include limits.h */

View file

@ -67,7 +67,7 @@ int nisam_extra(N_INFO *info, enum ha_extra_function function)
break; break;
} }
#endif #endif
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if ((info->options & HA_OPTION_COMPRESS_RECORD)) if ((info->options & HA_OPTION_COMPRESS_RECORD))
{ {
pthread_mutex_lock(&info->s->intern_lock); pthread_mutex_lock(&info->s->intern_lock);
@ -144,7 +144,7 @@ int nisam_extra(N_INFO *info, enum ha_extra_function function)
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
error=end_io_cache(&info->rec_cache); error=end_io_cache(&info->rec_cache);
} }
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED) if (info->opt_flag & MEMMAP_USED)
madvise(info->s->file_map,info->s->state.data_file_length,MADV_RANDOM); madvise(info->s->file_map,info->s->state.data_file_length,MADV_RANDOM);
#endif #endif

View file

@ -3193,9 +3193,11 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
break; break;
case COMPRESSED_RECORD: case COMPRESSED_RECORD:
reclength=info->packed_length; reclength=info->packed_length;
length=save_pack_length(block_buff,reclength); length= save_pack_length((uint) share->pack.version, block_buff,
reclength);
if (info->s->base.blobs) if (info->s->base.blobs)
length+=save_pack_length(block_buff+length,info->blob_length); length+= save_pack_length((uint) share->pack.version,
block_buff + length, info->blob_length);
if (my_b_write(&info->rec_cache,block_buff,length) || if (my_b_write(&info->rec_cache,block_buff,length) ||
my_b_write(&info->rec_cache,(byte*) sort_param->rec_buff,reclength)) my_b_write(&info->rec_cache,(byte*) sort_param->rec_buff,reclength))
{ {

View file

@ -62,7 +62,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
} }
if (share->base.blobs) if (share->base.blobs)
mi_alloc_rec_buff(info, -1, &info->rec_buff); mi_alloc_rec_buff(info, -1, &info->rec_buff);
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED) if (info->opt_flag & MEMMAP_USED)
madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM); madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM);
#endif #endif
@ -93,7 +93,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
my_errno=EACCES; my_errno=EACCES;
break; break;
} }
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if ((share->options & HA_OPTION_COMPRESS_RECORD)) if ((share->options & HA_OPTION_COMPRESS_RECORD))
{ {
pthread_mutex_lock(&share->intern_lock); pthread_mutex_lock(&share->intern_lock);
@ -177,7 +177,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
error=end_io_cache(&info->rec_cache); error=end_io_cache(&info->rec_cache);
/* Sergei will insert full text index caching here */ /* Sergei will insert full text index caching here */
} }
#if defined(HAVE_MMAP) && defined(HAVE_MADVICE) #if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED) if (info->opt_flag & MEMMAP_USED)
madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM); madvise(share->file_map,share->state.state.data_file_length,MADV_RANDOM);
#endif #endif

View file

@ -149,11 +149,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
my_errno=HA_ERR_END_OF_FILE; my_errno=HA_ERR_END_OF_FILE;
goto err0; goto err0;
} }
if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4)) if (memcmp((byte*) header, (byte*) myisam_pack_file_magic, 3))
{ {
my_errno=HA_ERR_WRONG_IN_RECORD; my_errno=HA_ERR_WRONG_IN_RECORD;
goto err0; goto err0;
} }
share->pack.version= header[3];
share->pack.header_length= uint4korr(header+4); share->pack.header_length= uint4korr(header+4);
share->min_pack_length=(uint) uint4korr(header+8); share->min_pack_length=(uint) uint4korr(header+8);
share->max_pack_length=(uint) uint4korr(header+12); share->max_pack_length=(uint) uint4korr(header+12);
@ -1040,38 +1041,12 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
return BLOCK_FATAL_ERROR; return BLOCK_FATAL_ERROR;
DBUG_DUMP("header",(byte*) header,ref_length); DBUG_DUMP("header",(byte*) header,ref_length);
} }
if (header[0] < 254) head_length= read_pack_length((uint) myisam->s->pack.version, header,
{ &info->rec_len);
info->rec_len=header[0];
head_length=1;
}
else if (header[0] == 254)
{
info->rec_len=uint2korr(header+1);
head_length=3;
}
else
{
info->rec_len=uint3korr(header+1);
head_length=4;
}
if (myisam->s->base.blobs) if (myisam->s->base.blobs)
{ {
if (header[head_length] < 254) head_length+= read_pack_length((uint) myisam->s->pack.version,
{ header + head_length, &info->blob_len);
info->blob_len=header[head_length];
head_length++;
}
else if (header[head_length] == 254)
{
info->blob_len=uint2korr(header+head_length+1);
head_length+=3;
}
else
{
info->blob_len=uint3korr(header+head_length+1);
head_length+=4;
}
if (!(mi_alloc_rec_buff(myisam,info->rec_len + info->blob_len, if (!(mi_alloc_rec_buff(myisam,info->rec_len + info->blob_len,
&myisam->rec_buff))) &myisam->rec_buff)))
return BLOCK_FATAL_ERROR; /* not enough memory */ return BLOCK_FATAL_ERROR; /* not enough memory */
@ -1220,34 +1195,12 @@ void _mi_unmap_file(MI_INFO *info)
static uchar *_mi_mempack_get_block_info(MI_INFO *myisam,MI_BLOCK_INFO *info, static uchar *_mi_mempack_get_block_info(MI_INFO *myisam,MI_BLOCK_INFO *info,
uchar *header) uchar *header)
{ {
if (header[0] < 254) header+= read_pack_length((uint) myisam->s->pack.version, header,
info->rec_len= *header++; &info->rec_len);
else if (header[0] == 254)
{
info->rec_len=uint2korr(header+1);
header+=3;
}
else
{
info->rec_len=uint3korr(header+1);
header+=4;
}
if (myisam->s->base.blobs) if (myisam->s->base.blobs)
{ {
if (header[0] < 254) header+= read_pack_length((uint) myisam->s->pack.version, header,
{ &info->blob_len);
info->blob_len= *header++;
}
else if (header[0] == 254)
{
info->blob_len=uint2korr(header+1);
header+=3;
}
else
{
info->blob_len=uint3korr(header+1);
header+=4;
}
/* mi_alloc_rec_buff sets my_errno on error */ /* mi_alloc_rec_buff sets my_errno on error */
if (!(mi_alloc_rec_buff(myisam, info->blob_len, if (!(mi_alloc_rec_buff(myisam, info->blob_len,
&myisam->rec_buff))) &myisam->rec_buff)))
@ -1319,7 +1272,7 @@ static int _mi_read_rnd_mempack_record(MI_INFO *info, byte *buf,
/* Save length of row */ /* Save length of row */
uint save_pack_length(byte *block_buff,ulong length) uint save_pack_length(uint version, byte *block_buff, ulong length)
{ {
if (length < 254) if (length < 254)
{ {
@ -1333,6 +1286,46 @@ uint save_pack_length(byte *block_buff,ulong length)
return 3; return 3;
} }
*(uchar*) block_buff=255; *(uchar*) block_buff=255;
int3store(block_buff+1,(ulong) length); if (version == 1) /* old format */
return 4; {
DBUG_ASSERT(length <= 0xFFFFFF);
int3store(block_buff + 1, (ulong) length);
return 4;
}
else
{
int4store(block_buff + 1, (ulong) length);
return 5;
}
}
uint read_pack_length(uint version, const uchar *buf, ulong *length)
{
if (buf[0] < 254)
{
*length= buf[0];
return 1;
}
else if (buf[0] == 254)
{
*length= uint2korr(buf + 1);
return 3;
}
if (version == 1) /* old format */
{
*length= uint3korr(buf + 1);
return 4;
}
else
{
*length= uint4korr(buf + 1);
return 5;
}
}
uint calc_pack_length(uint version, ulong length)
{
return (length < 254) ? 1 : (length < 65536) ? 3 : (version == 1) ? 4 : 5;
} }

View file

@ -27,7 +27,7 @@ LIST *myisam_open_list=0;
uchar NEAR myisam_file_magic[]= uchar NEAR myisam_file_magic[]=
{ (uchar) 254, (uchar) 254,'\007', '\001', }; { (uchar) 254, (uchar) 254,'\007', '\001', };
uchar NEAR myisam_pack_file_magic[]= uchar NEAR myisam_pack_file_magic[]=
{ (uchar) 254, (uchar) 254,'\010', '\001', }; { (uchar) 254, (uchar) 254,'\010', '\002', };
my_string myisam_log_filename=(char*) "myisam.log"; my_string myisam_log_filename=(char*) "myisam.log";
File myisam_log_file= -1; File myisam_log_file= -1;
uint myisam_quick_table_bits=9; uint myisam_quick_table_bits=9;

View file

@ -149,6 +149,7 @@ typedef struct st_mi_blob /* Info of record */
typedef struct st_mi_isam_pack { typedef struct st_mi_isam_pack {
ulong header_length; ulong header_length;
uint ref_length; uint ref_length;
uchar version;
} MI_PACK; } MI_PACK;
@ -669,7 +670,9 @@ extern void _myisam_log_record(enum myisam_log_commands command,MI_INFO *info,
int result); int result);
extern my_bool _mi_memmap_file(MI_INFO *info); extern my_bool _mi_memmap_file(MI_INFO *info);
extern void _mi_unmap_file(MI_INFO *info); extern void _mi_unmap_file(MI_INFO *info);
extern uint save_pack_length(byte *block_buff,ulong length); extern uint save_pack_length(uint version, byte *block_buff, ulong length);
extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
extern uint calc_pack_length(uint version, ulong length);
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
char *mi_state_info_read(char *ptr, MI_STATE_INFO *state); char *mi_state_info_read(char *ptr, MI_STATE_INFO *state);

View file

@ -1675,6 +1675,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
HUFF_COUNTS *count,*end_count; HUFF_COUNTS *count,*end_count;
HUFF_TREE *tree; HUFF_TREE *tree;
MI_INFO *isam_file=mrg->file[0]; MI_INFO *isam_file=mrg->file[0];
uint pack_version= (uint) isam_file->s->pack.version;
DBUG_ENTER("compress_isam_file"); DBUG_ENTER("compress_isam_file");
if (!(record=(byte*) my_alloca(isam_file->s->base.reclength))) if (!(record=(byte*) my_alloca(isam_file->s->base.reclength)))
@ -1702,23 +1703,10 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
huff_counts[i].tree->height+huff_counts[i].length_bits; huff_counts[i].tree->height+huff_counts[i].length_bits;
} }
max_calc_length/=8; max_calc_length/=8;
if (max_calc_length < 254) pack_ref_length= calc_pack_length(pack_version, max_calc_length);
pack_ref_length=1;
else if (max_calc_length <= 65535)
pack_ref_length=3;
else
pack_ref_length=4;
record_count=0; record_count=0;
pack_blob_length=0; pack_blob_length= isam_file->s->base.blobs ?
if (isam_file->s->base.blobs) calc_pack_length(pack_version, mrg->max_blob_length) : 0;
{
if (mrg->max_blob_length < 254)
pack_blob_length=1;
else if (mrg->max_blob_length <= 65535)
pack_blob_length=3;
else
pack_blob_length=4;
}
max_pack_length=pack_ref_length+pack_blob_length; max_pack_length=pack_ref_length+pack_blob_length;
mrg_reset(mrg); mrg_reset(mrg);
@ -1874,9 +1862,10 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
} }
flush_bits(); flush_bits();
length=(ulong) (file_buffer.pos-record_pos)-max_pack_length; length=(ulong) (file_buffer.pos-record_pos)-max_pack_length;
pack_length=save_pack_length(record_pos,length); pack_length= save_pack_length(pack_version, record_pos, length);
if (pack_blob_length) if (pack_blob_length)
pack_length+=save_pack_length(record_pos+pack_length,tot_blob_length); pack_length+= save_pack_length(pack_version, record_pos + pack_length,
tot_blob_length);
/* Correct file buffer if the header was smaller */ /* Correct file buffer if the header was smaller */
if (pack_length != max_pack_length) if (pack_length != max_pack_length)

View file

@ -0,0 +1,137 @@
let $1 = 10;
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
while ($1)
{
echo $1;
dec $1;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}

View file

@ -0,0 +1,4 @@
--require r/true.require
disable_query_log;
select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
enable_query_log;

View file

@ -12,16 +12,17 @@ use strict;
#use POSIX ":sys_wait_h"; #use POSIX ":sys_wait_h";
use POSIX 'WNOHANG'; use POSIX 'WNOHANG';
sub mtr_run ($$$$$$); sub mtr_run ($$$$$$;$);
sub mtr_spawn ($$$$$$); sub mtr_spawn ($$$$$$;$);
sub mtr_stop_mysqld_servers ($); sub mtr_stop_mysqld_servers ($);
sub mtr_kill_leftovers (); sub mtr_kill_leftovers ();
sub mtr_record_dead_children (); sub mtr_record_dead_children ();
sub mtr_exit ($); sub mtr_exit ($);
sub sleep_until_file_created ($$$); sub sleep_until_file_created ($$$);
sub mtr_kill_processes ($);
# static in C # static in C
sub spawn_impl ($$$$$$$); sub spawn_impl ($$$$$$$$);
############################################################################## ##############################################################################
# #
@ -32,37 +33,43 @@ sub spawn_impl ($$$$$$$);
# This function try to mimic the C version used in "netware/mysql_test_run.c" # This function try to mimic the C version used in "netware/mysql_test_run.c"
# FIXME learn it to handle append mode as well, a "new" flag or a "append" # FIXME learn it to handle append mode as well, a "new" flag or a "append"
sub mtr_run ($$$$$$) { sub mtr_run ($$$$$$;$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift;
my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file); return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file,
$spawn_opts);
} }
sub mtr_run_test ($$$$$$) { sub mtr_run_test ($$$$$$;$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift;
my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file); return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file,
$spawn_opts);
} }
sub mtr_spawn ($$$$$$) { sub mtr_spawn ($$$$$$;$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $input= shift; my $input= shift;
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; my $pid_file= shift;
my $spawn_opts= shift;
return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file); return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file,
$spawn_opts);
} }
@ -72,7 +79,7 @@ sub mtr_spawn ($$$$$$) {
# #
############################################################################## ##############################################################################
sub spawn_impl ($$$$$$$) { sub spawn_impl ($$$$$$$$) {
my $path= shift; my $path= shift;
my $arg_list_t= shift; my $arg_list_t= shift;
my $mode= shift; my $mode= shift;
@ -80,6 +87,7 @@ sub spawn_impl ($$$$$$$) {
my $output= shift; my $output= shift;
my $error= shift; my $error= shift;
my $pid_file= shift; # FIXME my $pid_file= shift; # FIXME
my $spawn_opts= shift;
if ( $::opt_script_debug ) if ( $::opt_script_debug )
{ {
@ -89,6 +97,18 @@ sub spawn_impl ($$$$$$$) {
print STDERR "#### ", "STDOUT $output\n" if $output; print STDERR "#### ", "STDOUT $output\n" if $output;
print STDERR "#### ", "STDERR $error\n" if $error; print STDERR "#### ", "STDERR $error\n" if $error;
print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n"; print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n";
print STDERR "#### ", "spawn options:\n";
if ($spawn_opts)
{
foreach my $key (sort keys %{$spawn_opts})
{
print STDERR "#### ", " - $key: $spawn_opts->{$key}\n";
}
}
else
{
print STDERR "#### ", " none\n";
}
print STDERR "#### ", "-" x 78, "\n"; print STDERR "#### ", "-" x 78, "\n";
} }
@ -135,9 +155,16 @@ sub spawn_impl ($$$$$$$) {
# $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c"; # $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c";
} }
my $log_file_open_mode = '>';
if ($spawn_opts and $spawn_opts->{'append_log_file'})
{
$log_file_open_mode = '>>';
}
if ( $output ) if ( $output )
{ {
if ( ! open(STDOUT,">",$output) ) if ( ! open(STDOUT,$log_file_open_mode,$output) )
{ {
mtr_error("can't redirect STDOUT to \"$output\": $!"); mtr_error("can't redirect STDOUT to \"$output\": $!");
} }
@ -154,9 +181,9 @@ sub spawn_impl ($$$$$$$) {
} }
else else
{ {
if ( ! open(STDERR,">",$error) ) if ( ! open(STDERR,$log_file_open_mode,$error) )
{ {
mtr_error("can't redirect STDERR to \"$output\": $!"); mtr_error("can't redirect STDERR to \"$error\": $!");
} }
} }
} }
@ -533,17 +560,8 @@ sub mtr_stop_mysqld_servers ($) {
start_reap_all(); # Avoid zombies start_reap_all(); # Avoid zombies
SIGNAL: my @mysqld_pids= keys %mysqld_pids;
foreach my $sig (15,9) mtr_kill_processes(\@mysqld_pids);
{
my $retries= 20; # FIXME 20 seconds, this is silly!
kill($sig, keys %mysqld_pids);
while ( $retries-- and kill(0, keys %mysqld_pids) )
{
mtr_debug("Sleep 1 second waiting for processes to die");
sleep(1) # Wait one second
}
}
stop_reap_all(); # Get into control again stop_reap_all(); # Get into control again
@ -826,6 +844,21 @@ sub sleep_until_file_created ($$$) {
} }
sub mtr_kill_processes ($) {
my $pids = shift;
foreach my $sig (15,9)
{
my $retries= 20; # FIXME 20 seconds, this is silly!
kill($sig, @{$pids});
while ( $retries-- and kill(0, @{$pids}) )
{
mtr_debug("Sleep 1 second waiting for processes to die");
sleep(1) # Wait one second
}
}
}
############################################################################## ##############################################################################
# #
# When we exit, we kill off all children # When we exit, we kill off all children
@ -841,6 +874,7 @@ sub sleep_until_file_created ($$$) {
sub mtr_exit ($) { sub mtr_exit ($) {
my $code= shift; my $code= shift;
# cluck("Called mtr_exit()"); # cluck("Called mtr_exit()");
mtr_timer_stop_all($::glob_timers);
local $SIG{HUP} = 'IGNORE'; local $SIG{HUP} = 'IGNORE';
kill('HUP', -$$); kill('HUP', -$$);
sleep 2; sleep 2;

View file

@ -177,7 +177,7 @@ sub mtr_report_stats ($) {
"%.2f\% were successful.\n\n", $ratio; "%.2f\% were successful.\n\n", $ratio;
print print
"The log files in var/log may give you some hint\n", "The log files in var/log may give you some hint\n",
"of what when wrong.\n", "of what went wrong.\n",
"If you want to report this error, please read first ", "If you want to report this error, please read first ",
"the documentation at\n", "the documentation at\n",
"http://www.mysql.com/doc/en/MySQL_test_suite.html\n"; "http://www.mysql.com/doc/en/MySQL_test_suite.html\n";
@ -223,7 +223,8 @@ sub mtr_report_stats ($) {
if ( $tot_failed != 0 ) if ( $tot_failed != 0 )
{ {
print "mysql-test-run: *** Failing the test(s):"; my $test_mode= join(" ", @::glob_test_mode) || "default";
print "mysql-test-run in $test_mode mode: *** Failing the test(s):";
foreach my $tinfo (@$tests) foreach my $tinfo (@$tests)
{ {

View file

@ -15,6 +15,7 @@ use POSIX 'WNOHANG';
sub mtr_init_timers (); sub mtr_init_timers ();
sub mtr_timer_start($$$); sub mtr_timer_start($$$);
sub mtr_timer_stop($$); sub mtr_timer_stop($$);
sub mtr_timer_stop_all($);
sub mtr_timer_waitpid($$$); sub mtr_timer_waitpid($$$);
############################################################################## ##############################################################################
@ -113,6 +114,17 @@ sub mtr_timer_stop ($$) {
} }
sub mtr_timer_stop_all ($) {
my $timers= shift;
foreach my $name ( keys %{$timers->{'timers'}} )
{
mtr_timer_stop($timers, $name);
}
return 1;
}
sub mtr_timer_timeout ($$) { sub mtr_timer_timeout ($$) {
my ($timers,$pid)= @_; my ($timers,$pid)= @_;

View file

@ -142,6 +142,7 @@ our $glob_timers= undef;
our $glob_use_running_server= 0; our $glob_use_running_server= 0;
our $glob_use_running_ndbcluster= 0; our $glob_use_running_ndbcluster= 0;
our $glob_use_embedded_server= 0; our $glob_use_embedded_server= 0;
our @glob_test_mode;
our $glob_basedir; our $glob_basedir;
@ -606,6 +607,7 @@ sub command_line_setup () {
if ( $opt_embedded_server ) if ( $opt_embedded_server )
{ {
$glob_use_embedded_server= 1; $glob_use_embedded_server= 1;
push(@glob_test_mode, "embedded");
$opt_skip_rpl= 1; # We never run replication with embedded $opt_skip_rpl= 1; # We never run replication with embedded
if ( $opt_extern ) if ( $opt_extern )
@ -614,6 +616,11 @@ sub command_line_setup () {
} }
} }
if ( $opt_ps_protocol )
{
push(@glob_test_mode, "ps-protocol");
}
# FIXME don't understand what this is # FIXME don't understand what this is
# if ( $opt_local_master ) # if ( $opt_local_master )
# { # {
@ -999,25 +1006,19 @@ sub kill_and_cleanup () {
# FIXME do we really need to create these all, or are they # FIXME do we really need to create these all, or are they
# created for us when tables are created? # created for us when tables are created?
rmtree("$master->[0]->{'path_myddir'}"); my @data_dir_lst = (
mkpath("$master->[0]->{'path_myddir'}/mysql"); $master->[0]->{'path_myddir'},
mkpath("$master->[0]->{'path_myddir'}/test"); $master->[1]->{'path_myddir'},
$slave->[0]->{'path_myddir'},
rmtree("$master->[1]->{'path_myddir'}"); $slave->[1]->{'path_myddir'},
mkpath("$master->[1]->{'path_myddir'}/mysql"); $slave->[2]->{'path_myddir'});
mkpath("$master->[1]->{'path_myddir'}/test");
foreach my $data_dir (@data_dir_lst)
rmtree("$slave->[0]->{'path_myddir'}"); {
mkpath("$slave->[0]->{'path_myddir'}/mysql"); rmtree("$data_dir");
mkpath("$slave->[0]->{'path_myddir'}/test"); mkpath("$data_dir/mysql");
mkpath("$data_dir/test");
rmtree("$slave->[1]->{'path_myddir'}"); }
mkpath("$slave->[1]->{'path_myddir'}/mysql");
mkpath("$slave->[1]->{'path_myddir'}/test");
rmtree("$slave->[2]->{'path_myddir'}");
mkpath("$slave->[2]->{'path_myddir'}/mysql");
mkpath("$slave->[2]->{'path_myddir'}/test");
# To make some old test cases work, we create a soft # To make some old test cases work, we create a soft
# link from the old "var" location to the new one # link from the old "var" location to the new one
@ -1565,8 +1566,9 @@ sub report_failure_and_restart ($) {
print "\n"; print "\n";
if ( ! $opt_force ) if ( ! $opt_force )
{ {
print "Aborting: $tinfo->{'name'} failed. To continue, re-run with '--force'."; my $test_mode= join(" ", @::glob_test_mode) || "default";
print "\n"; print "Aborting: $tinfo->{'name'} failed in $test_mode mode. ";
print "To continue, re-run with '--force'.\n";
if ( ! $opt_gdb and ! $glob_use_running_server and if ( ! $opt_gdb and ! $glob_use_running_server and
! $opt_ddd and ! $glob_use_embedded_server ) ! $opt_ddd and ! $glob_use_embedded_server )
{ {
@ -1612,6 +1614,7 @@ sub do_before_start_master ($$) {
} }
} }
# FIXME only remove the ones that are tied to this master
# Remove old master.info and relay-log.info files # Remove old master.info and relay-log.info files
unlink("$master->[0]->{'path_myddir'}/master.info"); unlink("$master->[0]->{'path_myddir'}/master.info");
unlink("$master->[0]->{'path_myddir'}/relay-log.info"); unlink("$master->[0]->{'path_myddir'}/relay-log.info");
@ -2194,6 +2197,11 @@ sub run_mysqltest ($) {
mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]);
} }
# ----------------------------------------------------------------------
# export MYSQL_TEST variable containing <path>/mysqltest <args>
# ----------------------------------------------------------------------
$ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args);
return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,""); return mtr_run_test($exe,$args,$tinfo->{'path'},"",$path_timefile,"");
} }

View file

@ -714,6 +714,7 @@ if [ x$USE_TIMER = x1 ] ; then
fi fi
MYSQL_TEST_BIN=$MYSQL_TEST MYSQL_TEST_BIN=$MYSQL_TEST
MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS" MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS"
export MYSQL_TEST
GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client
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

View file

@ -548,3 +548,15 @@ FROM t1 JOIN t2 ON t1.bID = t2.bID;
COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
2 test 2 test
DROP TABLE t1,t2; DROP TABLE t1,t2;
select * from (select group_concat('c') from DUAL) t;
group_concat('c')
NULL
create table t1 ( a int not null default 0);
select * from (select group_concat(a) from t1) t2;
group_concat(a)
NULL
select group_concat('x') UNION ALL select 1;
group_concat('x')
NULL
1
drop table t1;

View file

@ -122,3 +122,12 @@ flush privileges;
drop database mysqltest_1; drop database mysqltest_1;
set password = password("changed"); set password = password("changed");
ERROR 42000: Access denied for user ''@'localhost' to database 'mysql' ERROR 42000: Access denied for user ''@'localhost' to database 'mysql'
lock table mysql.user write;
flush privileges;
grant all on *.* to 'mysqltest_1'@'localhost';
unlock tables;
lock table mysql.user write;
set password for 'mysqltest_1'@'localhost' = password('');
revoke all on *.* from 'mysqltest_1'@'localhost';
unlock tables;
drop user 'mysqltest_1'@'localhost';

View file

@ -83,9 +83,3 @@ create table t2 like T1;
drop table t1, t2; drop table t1, t2;
show tables; show tables;
Tables_in_test Tables_in_test
use lpt1;
ERROR 42000: Unknown database 'lpt1'
use com1;
ERROR 42000: Unknown database 'com1'
use prn;
ERROR 42000: Unknown database 'prn'

View file

@ -7,18 +7,16 @@ otto
select otto from (select 1 as otto) as t1; select otto from (select 1 as otto) as t1;
otto otto
1 1
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed: 1054: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1; select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list' ERROR 42S22: Unknown column 'friedrich' in 'field list'
select otto from (select 1 as otto) as t1; select otto from (select 1 as otto) as t1;
otto otto
1 1
select otto from (select 1 as otto) as t1; mysqltest: At line 1: query 'select otto from (select 1 as otto) as t1' succeeded - should have failed with sqlstate 42S22...
otto
1
select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list'
select friedrich from (select 1 as otto) as t1; select friedrich from (select 1 as otto) as t1;
ERROR 42S22: Unknown column 'friedrich' in 'field list' ERROR 42S22: Unknown column 'friedrich' in 'field list'
mysqltest: At line 1: query 'select friedrich from (select 1 as otto) as t1' failed with wrong sqlstate 42S22 instead of 00000...
select otto from (select 1 as otto) as t1; select otto from (select 1 as otto) as t1;
otto otto
1 1
@ -135,6 +133,8 @@ ERROR 42S02: Table 'test.t1' doesn't exist
select 1146 as "after_!errno_masked_error" ; select 1146 as "after_!errno_masked_error" ;
after_!errno_masked_error after_!errno_masked_error
1146 1146
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000...
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1000...
garbage ; garbage ;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
select 1064 as "after_--enable_abort_on_error" ; select 1064 as "after_--enable_abort_on_error" ;
@ -142,3 +142,213 @@ after_--enable_abort_on_error
1064 1064
select 3 from t1 ; select 3 from t1 ;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Table 'test.t1' doesn't exist
mysqltest: At line 1: query 'select 3 from t1' failed with wrong errno 1146 instead of 1064...
mysqltest: At line 1: query 'select 3 from t1' failed: 1146: Table 'test.t1' doesn't exist
hello
hello
;;;;;;;;
# MySQL: -- The
mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: End of line junk detected: "6"
mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: Extra delimiter ";" found
MySQL
"MySQL"
MySQL: The world''s most popular open source database
"MySQL: The world's most popular open source database"
MySQL: The world''s
most popular open
source database
# MySQL: The world''s
# most popular open
# source database
- MySQL: The world''s
- most popular open
- source database
- MySQL: The world''s
-- most popular open
-- source database
# MySQL: The
--world''s
# most popular
-- open
- source database
"MySQL: The world's most popular; open source database"
"MySQL: The world's most popular ; open source database"
"MySQL: The world's most popular ;open source database"
echo message echo message
mysqltest: At line 1: Empty variable
mysqltest: At line 1: command "';' 2> /dev/null" failed
mysqltest: At line 1: Missing argument in exec
MySQL
"MySQL"
MySQL: The
world''s most
popular open
source database
# MySQL: The
# world''s most
# popular open
# source database
-- MySQL: The
-- world''s most
-- popular open
-- source database
# MySQL: The
- world''s most
-- popular open
# source database
'$message'
"$message"
hej
hej
hej
1
a long variable content
a long variable content
a long $where variable content
mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Variable name in hi=hi does not start with '$'
mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing arguments to let
mysqltest: At line 1: Missing variable name in let
mysqltest: At line 1: Variable name in =hi does not start with '$'
mysqltest: At line 1: Missing assignment operator in let
mysqltest: At line 1: Missing file name in source
mysqltest: At line 1: Could not open file ./non_existingFile
mysqltest: In included file "./var/tmp/recursive.sql": At line 1: Source directives are nesting too deep
mysqltest: In included file "./var/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1
2 = outer loop variable after while
here is the sourced script
2 = outer loop variable before dec
1 = outer loop variable after dec
1 = outer loop variable after while
here is the sourced script
1 = outer loop variable before dec
0 = outer loop variable after dec
2 = outer loop variable after while
here is the sourced script
2 = outer loop variable before dec
1 = outer loop variable after dec
1 = outer loop variable after while
here is the sourced script
1 = outer loop variable before dec
0 = outer loop variable after dec
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
In loop
here is the sourced script
mysqltest: At line 1: Missing argument to sleep
mysqltest: At line 1: Invalid argument to sleep "abc"
1
2
101
hej
1
mysqltest: At line 1: Missing arguments to inc
mysqltest: At line 1: First argument to inc must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000"
4
4
-1
-2
99
hej
-1
mysqltest: At line 1: Missing arguments to dec
mysqltest: At line 1: First argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: system command 'NonExistsinfComamdn 2> /dev/null' failed
test
test2
test3
test4
1
mysqltest: In included file "./include/mysqltest_while.inc": At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while
mysqltest: At line 1: Missing '{' after while. Found "dec $i"
mysqltest: At line 1: Stray '}' - end of block before beginning
mysqltest: At line 1: Stray 'end' command - end of block before beginning
mysqltest: At line 1: query '' failed: 1065: Query was empty
mysqltest: At line 1: Missing '{' after while. Found "echo hej"
mysqltest: At line 3: Missing end of block
mysqltest: At line 1: Missing newline between while and '{'
mysqltest: At line 1: missing '(' in if
mysqltest: At line 1: Stray 'end' command - end of block before beginning
select "b" bs col1, "c" bs col2;
col1 col2
b c
seledt "b" bs dol1, "d" bs dol2;
dol1 dol2
b d
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a;'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a '
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c'
mysqltest: At line 1: Wrong number of arguments to replace_result in 'replace_result a b c '
select "a" as col1, "c" as col2;
col1 col2
b c
select "a" as col1, "c" as col2;
col1 col2
b d
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a'
mysqltest: At line 1: Wrong number of arguments to replace_column in 'replace_column 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a b'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column a 1'
mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 b c '
mysqltest: At line 1: Invalid integer argument "10!"
mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a"
failing_statement;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
failing_statement;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
SELECT 1 as a;
a
1

View file

@ -4,10 +4,10 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT; master_password='',master_port=MASTER_PORT;
start slave; start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT; master_password='',master_port=SLAVE_PORT;
start slave; start slave;

View file

@ -29,3 +29,14 @@ drop table if exists t1,t2,t11;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1340 slave-relay-bin.000002 1384 master-bin.000001 Yes Yes test.t1 0 0 1340 1384 None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1340 slave-relay-bin.000002 1384 master-bin.000001 Yes Yes test.t1 0 0 1340 1384 None 0 No #
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
set one_shot time_zone='met';
select * from t1;
ts
2005-08-12 00:00:00
set one_shot time_zone='met';
select * from t1;
ts
2005-08-12 00:00:00

View file

@ -491,6 +491,11 @@ SHOW VARIABLES LIKE 'table_cache';
Variable_name Value Variable_name Value
table_cache 1 table_cache 1
SET GLOBAL table_cache=DEFAULT; SET GLOBAL table_cache=DEFAULT;
set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
ifnull(@@character_set_results,"really null")
really null
set names latin1;
select @@have_innodb; select @@have_innodb;
@@have_innodb @@have_innodb
# #

View file

@ -0,0 +1,8 @@
use lpt1;
ERROR 42000: Unknown database 'lpt1'
use com1;
ERROR 42000: Unknown database 'com1'
use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;

View file

@ -238,7 +238,7 @@ drop table t1;
create table `t1 `(a int); create table `t1 `(a int);
--error 1102 --error 1102
create database `db1 `; create database `db1 `;
--error 1166; --error 1166
create table t1(`a ` int); create table t1(`a ` int);
# #

View file

@ -11,21 +11,21 @@ drop table if exists t1, t2;
--enable_warnings --enable_warnings
CREATE TABLE t1 ( a int ); CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1); INSERT INTO t1 VALUES (1),(2),(1);
--error 1062; --error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146; --error 1146
select * from t2; select * from t2;
--error 1062; --error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
--error 1146; --error 1146
select * from t2; select * from t2;
--error 1062; --error 1062
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146; --error 1146
select * from t2; select * from t2;
--error 1062; --error 1062
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
--error 1146; --error 1146
select * from t2; select * from t2;
# End of 4.1 tests # End of 4.1 tests

View file

@ -6,13 +6,13 @@ drop database if exists mysqltest;
drop database if exists client_test_db; drop database if exists client_test_db;
--enable_warnings --enable_warnings
--error 1051; --error 1051
drop table t1; drop table t1;
create table t1(n int); create table t1(n int);
insert into t1 values(1); insert into t1 values(1);
create temporary table t1( n int); create temporary table t1( n int);
insert into t1 values(2); insert into t1 values(2);
--error 1050; --error 1050
create table t1(n int); create table t1(n int);
drop table t1; drop table t1;
select * from t1; select * from t1;
@ -56,13 +56,13 @@ drop database mysqltest;
# test drop/create database and FLUSH TABLES WITH READ LOCK # test drop/create database and FLUSH TABLES WITH READ LOCK
flush tables with read lock; flush tables with read lock;
--error 1209,1223; --error 1209,1223
create database mysqltest; create database mysqltest;
unlock tables; unlock tables;
create database mysqltest; create database mysqltest;
show databases; show databases;
flush tables with read lock; flush tables with read lock;
--error 1208,1223; --error 1208,1223
drop database mysqltest; drop database mysqltest;
unlock tables; unlock tables;
drop database mysqltest; drop database mysqltest;
@ -73,7 +73,7 @@ drop database mysqltest;
# test create table and FLUSH TABLES WITH READ LOCK # test create table and FLUSH TABLES WITH READ LOCK
drop table t1; drop table t1;
flush tables with read lock; flush tables with read lock;
--error 1223; --error 1223
create table t1(n int); create table t1(n int);
unlock tables; unlock tables;
create table t1(n int); create table t1(n int);

View file

@ -37,7 +37,7 @@ connection con1;
select * from t1; select * from t1;
connection con2; connection con2;
flush tables with read lock; flush tables with read lock;
--error 1099; --error 1099
drop table t2; drop table t2;
connection con1; connection con1;
send drop table t2; send drop table t2;

View file

@ -343,4 +343,17 @@ SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
DROP TABLE t1,t2; DROP TABLE t1,t2;
#
# Bug #12861 hang with group_concat insubquery FROM DUAL
#
select * from (select group_concat('c') from DUAL) t;
#
# Bug #12859 group_concat in subquery cause incorrect not null
#
create table t1 ( a int not null default 0);
select * from (select group_concat(a) from t1) t2;
select group_concat('x') UNION ALL select 1;
drop table t1;
# End of 4.1 tests # End of 4.1 tests

View file

@ -163,4 +163,47 @@ set password = password("changed");
disconnect n5; disconnect n5;
connection default; connection default;
# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# multi-threaded environment". We should be able to execute FLUSH
# PRIVILEGES and SET PASSWORD simultaneously with other account
# management commands (such as GRANT and REVOKE) without causing
# deadlocks. To achieve this we should ensure that all account
# management commands take table and internal locks in the same order.
connect (con2root,localhost,root,,);
connect (con3root,localhost,root,,);
# Check that we can execute FLUSH PRIVILEGES and GRANT simultaneously
# This will check that locks are taken in proper order during both
# user/db-level and table/column-level privileges reloading.
connection default;
lock table mysql.user write;
connection con2root;
send flush privileges;
connection con3root;
send grant all on *.* to 'mysqltest_1'@'localhost';
connection default;
unlock tables;
connection con2root;
reap;
connection con3root;
reap;
# Check for simultaneous SET PASSWORD and REVOKE.
connection default;
lock table mysql.user write;
connection con2root;
send set password for 'mysqltest_1'@'localhost' = password('');
connection con3root;
send revoke all on *.* from 'mysqltest_1'@'localhost';
connection default;
unlock tables;
connection con2root;
reap;
connection con3root;
reap;
connection default;
# Clean-up
drop user 'mysqltest_1'@'localhost';
disconnect con2root;
disconnect con3root;
# End of 4.1 tests # End of 4.1 tests

View file

@ -300,7 +300,7 @@ handler t5 open as h5;
handler h5 read first limit 9; handler h5 read first limit 9;
# close first # close first
alter table t1 engine=MyISAM; alter table t1 engine=MyISAM;
--error 1109; --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
handler h3 read first limit 9; handler h3 read first limit 9;
@ -308,22 +308,22 @@ handler h4 read first limit 9;
handler h5 read first limit 9; handler h5 read first limit 9;
# close last # close last
alter table t5 engine=MyISAM; alter table t5 engine=MyISAM;
--error 1109; --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
handler h3 read first limit 9; handler h3 read first limit 9;
handler h4 read first limit 9; handler h4 read first limit 9;
--error 1109; --error 1109
handler h5 read first limit 9; handler h5 read first limit 9;
# close middle # close middle
alter table t3 engine=MyISAM; alter table t3 engine=MyISAM;
--error 1109; --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
--error 1109; --error 1109
handler h3 read first limit 9; handler h3 read first limit 9;
handler h4 read first limit 9; handler h4 read first limit 9;
--error 1109; --error 1109
handler h5 read first limit 9; handler h5 read first limit 9;
handler h2 close; handler h2 close;
handler h4 close; handler h4 close;
@ -335,11 +335,11 @@ handler h1_1 read first limit 9;
handler h1_2 read first limit 9; handler h1_2 read first limit 9;
handler h1_3 read first limit 9; handler h1_3 read first limit 9;
alter table t1 engine=MyISAM; alter table t1 engine=MyISAM;
--error 1109; --error 1109
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
--error 1109; --error 1109
handler h1_2 read first limit 9; handler h1_2 read first limit 9;
--error 1109; --error 1109
handler h1_3 read first limit 9; handler h1_3 read first limit 9;
drop table t1; drop table t1;
drop table t2; drop table t2;

View file

@ -25,7 +25,7 @@ set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the page
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2; --sleep 2
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
@ -63,7 +63,7 @@ set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the page
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2; --sleep 2
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
@ -97,7 +97,7 @@ update t2 set a=2 where b = 0;
select * from t2; select * from t2;
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2; --sleep 2
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;

View file

@ -39,7 +39,7 @@ set autocommit=0;
# The following statement should hang because con1 is locking the page # The following statement should hang because con1 is locking the page
--send --send
lock table t1 write; lock table t1 write;
--sleep 2; --sleep 2
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;

View file

@ -1183,7 +1183,7 @@ drop table t1;
# #
CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB; CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
--error 1214; --error 1214
SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE); SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
DROP TABLE t1; DROP TABLE t1;

View file

@ -83,14 +83,4 @@ drop table t1, t2;
show tables; show tables;
#
#Bug 9148: Denial of service
#
--error 1049
use lpt1;
--error 1049
use com1;
--error 1049
use prn;
# End of 4.1 tests # End of 4.1 tests

View file

@ -3,6 +3,24 @@
# #
# Test of mysqltest itself # Test of mysqltest itself
# #
# There are three rules that determines what belong to each command
# 1. A normal command is delimited by the <delimiter> which by default is
# set to ';'
#
# ex: | select *
# | from t1;
# |
# Command: "select * from t1"
#
# 2. Special case is a line that starts with "--", this is a comment
# ended when the new line character is reached. But the first word
# in the comment may contain a valid command, which then will be
# executed. This can be useful when sending commands that
# contains <delimiter>
#
# 3. Special case is also a line that starts with '#' which is treated
# as a comment and will be ended by new line character
#
# ============================================================================ # ============================================================================
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
@ -37,7 +55,9 @@ select otto from (select 1 as otto) as t1;
# expectation <> response # expectation <> response
#--error 0 #--error 0
#select friedrich from (select 1 as otto) as t1; #select friedrich from (select 1 as otto) as t1
--error 1
--exec echo "select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# expectation = response # expectation = response
--error 1054 --error 1054
@ -55,8 +75,9 @@ select friedrich from (select 1 as otto) as t1;
# Positive case(statement) # Positive case(statement)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# This syntax not allowed anymore, use --error S00000, see below
# expectation = response # expectation = response
!S00000 select otto from (select 1 as otto) as t1; #!S00000 select otto from (select 1 as otto) as t1;
--error S00000 --error S00000
select otto from (select 1 as otto) as t1; select otto from (select 1 as otto) as t1;
@ -65,14 +86,18 @@ select otto from (select 1 as otto) as t1;
#!S42S22 select otto from (select 1 as otto) as t1; #!S42S22 select otto from (select 1 as otto) as t1;
#--error S42S22 #--error S42S22
#select otto from (select 1 as otto) as t1; #select otto from (select 1 as otto) as t1;
--error 1
--exec echo "error S42S22; select otto from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Negative case(statement) # Negative case(statement)
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# This syntax not allowed anymore, use --error S42S22, see below
# expectation = response # expectation = response
!S42S22 select friedrich from (select 1 as otto) as t1; #!S42S22 select friedrich from (select 1 as otto) as t1;
--error S42S22 --error S42S22
select friedrich from (select 1 as otto) as t1; select friedrich from (select 1 as otto) as t1;
@ -80,7 +105,8 @@ select friedrich from (select 1 as otto) as t1;
#!S00000 select friedrich from (select 1 as otto) as t1; #!S00000 select friedrich from (select 1 as otto) as t1;
#--error S00000 #--error S00000
#select friedrich from (select 1 as otto) as t1; #select friedrich from (select 1 as otto) as t1;
--error 1
--exec echo "error S00000; select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# test cases for $mysql_errno # test cases for $mysql_errno
@ -262,6 +288,8 @@ eval select $mysql_errno as "after_!errno_masked_error" ;
# select 3 from t1 ; # select 3 from t1 ;
# --error 1000 # --error 1000
# select 3 from t1 ; # select 3 from t1 ;
--error 1
--exec echo "disable_abort_on_error; error 1000; select 3 from t1; error 1000; select 3 from t1;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Switch the abort on error on and check the effect on $mysql_errno # Switch the abort on error on and check the effect on $mysql_errno
@ -288,3 +316,498 @@ select 3 from t1 ;
#select 3 from t1 ; #select 3 from t1 ;
# End of 4.1 tests # End of 4.1 tests
--error 1
--exec echo "disable_abort_on_error; enable_abort_on_error; error 1064; select 3 from t1; select 3 from t1;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test comments
# ----------------------------------------------------------------------------
# This is a comment
# This is a ; comment
# This is a -- comment
-- This is also a comment
-- # This is also a comment
-- This is also a ; comment
# ----------------------------------------------------------------------------
# Test comments with embedded command
# ----------------------------------------------------------------------------
--echo hello
-- echo hello
-- echo ;;;;;;;;
--echo # MySQL: -- The
# ----------------------------------------------------------------------------
# Test detect end of line "junk"
# Most likely causes by a missing delimiter
# ----------------------------------------------------------------------------
# Too many parameters to function
--error 1
--exec echo "sleep 5 6;" | $MYSQL_TEST 2>&1
# Too many parameters to function
--error 1
--exec echo "--sleep 5 6" | $MYSQL_TEST 2>&1
#
# Missing delimiter
# The comment will be "sucked into" the sleep command since
# delimiter is missing until after "show status"
--error 1
--exec echo -e "sleep 4\n # A comment\nshow status;" | $MYSQL_TEST 2>&1
#
# Extra delimiter
#
--error 1
--exec echo "--sleep 4;" | $MYSQL_TEST 2>&1
# Allow trailing # comment
--sleep 1 # Wait for insert delayed to be executed.
--sleep 1 # Wait for insert delayed to be executed.
# ----------------------------------------------------------------------------
# Test echo command
# ----------------------------------------------------------------------------
echo MySQL;
echo "MySQL";
echo MySQL: The world''s most popular open source database;
echo "MySQL: The world's most popular open source database";
echo MySQL: The world''s
most popular open
source database;
echo # MySQL: The world''s
# most popular open
# source database;
echo - MySQL: The world''s
- most popular open
- source database;
echo - MySQL: The world''s
-- most popular open
-- source database;
echo # MySQL: The
--world''s
# most popular
-- open
- source database;
echo "MySQL: The world's most popular; open source database";
echo "MySQL: The world's most popular ; open source database";
echo "MySQL: The world's most popular ;open source database";
echo echo message echo message;
echo ;
# Illegal use of echo
--error 1
--exec echo "echo $;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test exec command
# ----------------------------------------------------------------------------
# Illegal use of exec
--error 1
--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test let command
# ----------------------------------------------------------------------------
let $message=MySQL;
echo $message;
let $message="MySQL";
echo $message;
let $message= MySQL: The
world''s most
popular open
source database;
echo $message;
let $message= # MySQL: The
# world''s most
# popular open
# source database;
echo $message;
let $message= -- MySQL: The
-- world''s most
-- popular open
-- source database;
echo $message;
let $message= # MySQL: The
- world''s most
-- popular open
# source database;
echo $message;
echo '$message';
echo "$message";
let $1=hej;
echo $1;
let $1 =hej ;
echo $1;
let $1 = hej;
echo $1;
let $1=1;
let $2=$1;
echo $2;
let $5=$6;
echo $5;
echo $6;
let $where=a long variable content;
echo $where;
let $where2= $where;
echo $where2;
let $where3=a long $where variable content;
echo $where3;
let $novar1= $novar2;
echo $novar1;
# Test illegal uses of let
--error 1
--exec echo "let ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let $=hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let hi=hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let $1 hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let $m hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let $hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let $ hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let =hi;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let hi;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test source command
# ----------------------------------------------------------------------------
# Test illegal uses of source
--error 1
--exec echo "source ;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "source non_existingFile;" | $MYSQL_TEST 2>&1
# Too many source
--exec echo "source var/tmp/recursive.sql;" > var/tmp/recursive.sql
--error 1
--exec echo "source var/tmp/recursive.sql;" | $MYSQL_TEST 2>&1
# Source a file with error
--exec echo "garbage ;" > var/tmp/error.sql
--error 1
--exec echo "source var/tmp/error.sql;" | $MYSQL_TEST 2>&1
# Test execution of source in a while loop
--exec echo "echo here is the sourced script;" > var/tmp/sourced.sql
--disable_query_log
let $outer= 2; # Number of outer loops
while ($outer)
{
eval SELECT '$outer = outer loop variable after while' AS "";
--source var/tmp/sourced.sql
eval SELECT '$outer = outer loop variable before dec' AS "";
dec $outer;
eval SELECT '$outer = outer loop variable after dec' AS "";
}
let $outer= 2; # Number of outer loops
while ($outer)
{
eval SELECT '$outer = outer loop variable after while' AS "";
echo here is the sourced script;
eval SELECT '$outer = outer loop variable before dec' AS "";
dec $outer;
eval SELECT '$outer = outer loop variable after dec' AS "";
}
# Test execution of source in a while loop
--exec echo "--source var/tmp/sourced.sql" > var/tmp/sourced1.sql
--disable_abort_on_error
# Sourcing of a file within while loop, sourced file will
# source other file
let $num= 9;
while ($num)
{
SELECT 'In loop' AS "";
--source var/tmp/sourced1.sql
dec $num;
}
--enable_abort_on_error;
--enable_query_log
# ----------------------------------------------------------------------------
# Test sleep command
# ----------------------------------------------------------------------------
sleep 0.5;
sleep 1;
real_sleep 1;
# Missing parameter
--error 1
--exec echo "sleep ;" | $MYSQL_TEST 2>&1
# Illegal parameter
--error 1
--exec echo "sleep abc;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test inc
# ----------------------------------------------------------------------------
inc $i;
echo $i;
inc $i;
echo $i;
let $i=100;
inc $i;
echo $i;
let $i=hej;
echo $i;
inc $i;
echo $i;
--error 1
--exec echo "inc;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "inc i;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
inc $i; inc $i; inc $i; --echo $i
echo $i;
# ----------------------------------------------------------------------------
# Test dec
# ----------------------------------------------------------------------------
dec $d;
echo $d;
dec $d;
echo $d;
let $d=100;
dec $d;
echo $d;
let $d=hej;
echo $d;
dec $d;
echo $d;
--error 1
--exec echo "dec;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "dec i;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test system
# ----------------------------------------------------------------------------
system ls > /dev/null;
system echo "hej" > /dev/null;
--system ls > /dev/null
--system echo "hej" > /dev/null;
--error 1
--exec echo "system;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1
--disable_abort_on_error
system NonExistsinfComamdn;
--enable_abort_on_error
# ----------------------------------------------------------------------------
# Test delimiter
# ----------------------------------------------------------------------------
delimiter stop;
echo teststop
delimiter ;stop
echo test2;
--delimiter stop
echo test3stop
--delimiter ;
echo test4;
# ----------------------------------------------------------------------------
# Test while, { and }
# ----------------------------------------------------------------------------
let $i=1;
while ($i)
{
echo $i;
dec $i;
}
# One liner
#let $i=1;while ($i){echo $i;dec $i;}
# Exceed max nesting level
--error 1
--exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "while \$i;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "while (\$i;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "let \$i=1; while (\$i) dec \$i;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "};" | $MYSQL_TEST 2>&1
--error 1
--exec echo "end;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "{;" | $MYSQL_TEST 2>&1
--error 1
--exec echo -e "while (0)\necho hej;" | $MYSQL_TEST 2>&1
--error 1
--exec echo -e "while (0)\n{echo hej;" | $MYSQL_TEST 2>&1
--error 1
--exec echo -e "while (0){\n echo hej;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test error messages returned from comments starting with a command
# ----------------------------------------------------------------------------
--error 1
--exec echo "--if the other server is down" | $MYSQL_TEST 2>&1
--error 1
--exec echo "-- end when ..." | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test replace
# ----------------------------------------------------------------------------
--replace_result a b
select "a" as col1, "c" as col2;
--replace_result a b c d
select "a" as col1, "c" as col2;
--error 1
--exec echo "--replace_result a" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
--exec echo "replace_result a b;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
--error 1
--exec echo "replace_result a b c ;" | $MYSQL_TEST 2>&1
--replace_column 1 b
select "a" as col1, "c" as col2;
--replace_column 1 b 2 d
select "a" as col1, "c" as col2;
--error 1
--exec echo "--replace_column a" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column 1" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column a b" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column a 1" | $MYSQL_TEST 2>&1
--error 1
--exec echo "--replace_column 1 b c " | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test sync_with_master
# ----------------------------------------------------------------------------
--error 1
--exec echo "save_master_pos; sync_with_master 10!;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
--error 1
--exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# TODO Test queries, especially their errormessages... so it's easy to debug
# new scripts and diagnose errors
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Test bug#12386
# ----------------------------------------------------------------------------
let $num= 2;
while ($num)
{
--error 1064
failing_statement;
dec $num;
}
SELECT 1 as a;

View file

@ -6,7 +6,7 @@
# The previous step has simply removed the frm file # The previous step has simply removed the frm file
# from disk, but left the table in NDB # from disk, but left the table in NDB
# #
--sleep 3; --sleep 3
select * from t9 order by a; select * from t9 order by a;
# handler_discover should be 1 # handler_discover should be 1

View file

@ -89,7 +89,7 @@ kill @id;
# We don't drop t3 as this is a temporary table # We don't drop t3 as this is a temporary table
drop table t2; drop table t2;
connection master; connection master;
--error 1053; --error 1053
reap; reap;
connection slave; connection slave;
# The SQL slave thread should now have stopped because the query was killed on # The SQL slave thread should now have stopped because the query was killed on

View file

@ -22,7 +22,7 @@ set sql_log_bin=0;
insert into t1 values(2); insert into t1 values(2);
set sql_log_bin=1; set sql_log_bin=1;
save_master_pos; save_master_pos;
--error 1062; --error 1062
insert into t1 values(1),(2); insert into t1 values(1),(2);
drop table t1; drop table t1;
save_master_pos; save_master_pos;

View file

@ -8,7 +8,7 @@ insert into t1 values(1+get_lock("a",15)*0);
insert into t1 values(2); insert into t1 values(2);
save_master_pos; save_master_pos;
connection slave; connection slave;
--real_sleep 3; # can't sync_with_master as we should be blocked --real_sleep 3 # can't sync_with_master as we should be blocked
stop slave; stop slave;
select * from t1; select * from t1;
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT

View file

@ -58,7 +58,7 @@ while ($1)
enable_query_log; enable_query_log;
select * from t1 for update; select * from t1 for update;
start slave; start slave;
--sleep 3; # hope that slave is blocked now --sleep 3 # hope that slave is blocked now
insert into t2 values(22); # provoke deadlock, slave should be victim insert into t2 values(22); # provoke deadlock, slave should be victim
commit; commit;
sync_with_master; sync_with_master;
@ -76,7 +76,7 @@ change master to master_log_pos=401; # the BEGIN log event
begin; begin;
select * from t2 for update; # hold lock select * from t2 for update; # hold lock
start slave; start slave;
--sleep 10; # slave should have blocked, and be retrying --sleep 10 # slave should have blocked, and be retrying
commit; commit;
sync_with_master; sync_with_master;
select * from t1; # check that slave succeeded finally select * from t1; # check that slave succeeded finally
@ -97,7 +97,7 @@ change master to master_log_pos=401;
begin; begin;
select * from t2 for update; select * from t2 for update;
start slave; start slave;
--sleep 10; --sleep 10
commit; commit;
sync_with_master; sync_with_master;
select * from t1; select * from t1;

View file

@ -5,7 +5,7 @@ source include/master-slave.inc;
drop table if exists t1, t2; drop table if exists t1, t2;
--enable_warnings --enable_warnings
create table t1 (a int); create table t1 (a int);
--error 1051; --error 1051
drop table t1, t2; drop table t1, t2;
save_master_pos; save_master_pos;
connection slave; connection slave;

View file

@ -9,7 +9,7 @@ sync_slave_with_master;
connection master; connection master;
disconnect master; disconnect master;
connection slave; connection slave;
--real_sleep 3; # time for DROP to be written --real_sleep 3 # time for DROP to be written
show status like 'Slave_open_temp_tables'; show status like 'Slave_open_temp_tables';
connection default; connection default;
drop database mysqltest; drop database mysqltest;

View file

@ -6,7 +6,7 @@ source include/master-slave.inc;
connection master; connection master;
create table t1 (a int primary key); create table t1 (a int primary key);
# generate an error that goes to the binlog # generate an error that goes to the binlog
--error 1062; --error 1062
insert into t1 values (1),(1); insert into t1 values (1),(1);
save_master_pos; save_master_pos;
connection slave; connection slave;
@ -45,7 +45,7 @@ select (@id := id) - id from t3;
kill @id; kill @id;
drop table t2,t3; drop table t2,t3;
connection master; connection master;
--error 0,1053; --error 0,1053
reap; reap;
connection master1; connection master1;
show binlog events from 79; show binlog events from 79;

View file

@ -1,15 +1,15 @@
# Testing if "flush logs" command bouncing resulting in logs created in a loop # Testing if "flush logs" command bouncing resulting in logs created in a loop
# in case of bi-directional replication # in case of bi-directional replication
source include/master-slave.inc source include/master-slave.inc;
connection slave; connection slave;
stop slave;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT; master_password='',master_port=$MASTER_MYPORT;
start slave; start slave;
connection master; connection master;
stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT; master_password='',master_port=$SLAVE_MYPORT;

View file

@ -4,7 +4,7 @@
# We also check how the foreign_key_check variable is replicated # We also check how the foreign_key_check variable is replicated
source include/master-slave.inc; source include/master-slave.inc;
source include/have_innodb.inc source include/have_innodb.inc;
connection master; connection master;
create table t1(a int auto_increment, key(a)); create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b)); create table t2(b int auto_increment, c int, key(b));

View file

@ -123,7 +123,7 @@ connection master;
reset master; reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)); unique(day));
--error 1062; --error 1062
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;

View file

@ -36,4 +36,22 @@ sync_with_master;
--replace_column 1 # 33 # --replace_column 1 # 33 #
show slave status; show slave status;
#
# BUG#12542
# TEST: "SET ONE_SHOT should always be executed on slave"
#
# We could use any timezone different than server default in this test
#
connection master;
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
set one_shot time_zone='met';
select * from t1;
sync_slave_with_master;
connection slave;
set one_shot time_zone='met';
select * from t1;
# End of 4.1 tests # End of 4.1 tests

View file

@ -102,7 +102,7 @@ show master logs;
purge binary logs to 'master-bin.000002'; purge binary logs to 'master-bin.000002';
show binary logs; show binary logs;
# sleeping 10 seconds or more would make the slave believe connection is down # sleeping 10 seconds or more would make the slave believe connection is down
--real_sleep 1; --real_sleep 1
purge master logs before now(); purge master logs before now();
show binary logs; show binary logs;
insert into t2 values (65); insert into t2 values (65);

View file

@ -1,5 +1,5 @@
# Test case for BUG #10780 # Test case for BUG #10780
source include/master-slave.inc --source include/master-slave.inc
connection master; connection master;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
connection slave; connection slave;

View file

@ -60,7 +60,7 @@ stop slave;
# this should stop immideately # this should stop immideately
start slave until master_log_file='master-bin.000001', master_log_pos=561; start slave until master_log_file='master-bin.000001', master_log_pos=561;
# 2 is not enough when running with valgrind # 2 is not enough when running with valgrind
real_sleep 4 --real_sleep 4
# here the sql slave thread should be stopped # here the sql slave thread should be stopped
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004 --replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
--replace_column 1 # 9 # 23 # 33 # --replace_column 1 # 9 # 23 # 33 #

View file

@ -380,6 +380,14 @@ SET GLOBAL table_cache=-1;
SHOW VARIABLES LIKE 'table_cache'; SHOW VARIABLES LIKE 'table_cache';
SET GLOBAL table_cache=DEFAULT; SET GLOBAL table_cache=DEFAULT;
#
# Bugs12363: character_set_results is nullable,
# but value_ptr returns string "NULL"
#
set character_set_results=NULL;
select ifnull(@@character_set_results,"really null");
set names latin1;
# End of 4.1 tests # End of 4.1 tests
# #

20
mysql-test/t/windows.test Normal file
View file

@ -0,0 +1,20 @@
# Windows-specific tests
--source include/windows.inc
#
# Bug 9148: Denial of service
#
--error 1049
use lpt1;
--error 1049
use com1;
--error 1049
use prn;
#
# Bug #12325: Can't create table named 'nu'
#
create table nu (a int);
drop table nu;
# End of 4.1 tests

View file

@ -105,7 +105,7 @@ int check_if_legal_filename(const char *path)
{ {
if (*reserved != my_toupper(&my_charset_latin1, *name)) if (*reserved != my_toupper(&my_charset_latin1, *name))
break; break;
if (++name == end) if (++name == end && !reserved[1])
DBUG_RETURN(1); /* Found wrong path */ DBUG_RETURN(1); /* Found wrong path */
} while (*++reserved); } while (*++reserved);
} }

View file

@ -31,25 +31,7 @@
* SENDER: Ndbfs * SENDER: Ndbfs
* RECIVER: * RECIVER:
*/ */
class FsRef { struct FsRef {
/**
* Reciver(s)
*/
friend class Dbdict;
friend class Backup;
/**
* Sender(s)
*/
friend class Ndbfs;
friend class VoidFs;
/**
* For printing
*/
friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
public:
/** /**
* Enum type for errorCode * Enum type for errorCode
*/ */
@ -73,8 +55,6 @@ public:
*/ */
STATIC_CONST( SignalLength = 4 ); STATIC_CONST( SignalLength = 4 );
private:
/** /**
* DATA VARIABLES * DATA VARIABLES
*/ */

View file

@ -215,5 +215,6 @@ GSN_PRINT_SIGNATURE(printSCAN_FRAGREQ);
GSN_PRINT_SIGNATURE(printCONTINUEB_NDBFS); GSN_PRINT_SIGNATURE(printCONTINUEB_NDBFS);
GSN_PRINT_SIGNATURE(printCONTINUEB_DBDIH); GSN_PRINT_SIGNATURE(printCONTINUEB_DBDIH);
GSN_PRINT_SIGNATURE(printSTART_FRAG_REQ);
#endif #endif

View file

@ -32,6 +32,8 @@ class StartFragReq {
public: public:
STATIC_CONST( SignalLength = 19 ); STATIC_CONST( SignalLength = 19 );
friend bool printSTART_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
private: private:
Uint32 userPtr; Uint32 userPtr;
Uint32 userRef; Uint32 userRef;

View file

@ -30,8 +30,14 @@ my_bool opt_ndb_optimized_node_selection
bool opt_endinfo= 0; bool opt_endinfo= 0;
my_bool opt_ndb_shm; my_bool opt_ndb_shm;
my_bool opt_core;
#define OPT_NDB_CONNECTSTRING 'c' #define OPT_NDB_CONNECTSTRING 'c'
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
#define OPT_WANT_CORE_DEFAULT 1
#else
#define OPT_WANT_CORE_DEFAULT 0
#endif
#define NDB_STD_OPTS_COMMON \ #define NDB_STD_OPTS_COMMON \
{ "usage", '?', "Display this help and exit.", \ { "usage", '?', "Display this help and exit.", \
@ -57,7 +63,10 @@ my_bool opt_ndb_shm;
GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\ GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
{ "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\ { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
{ "core-file", OPT_WANT_CORE, "Write core on errors.",\
(gptr*) &opt_core, (gptr*) &opt_core, 0,\
GET_BOOL, NO_ARG, OPT_WANT_CORE_DEFAULT, 0, 0, 0, 0, 0}
#ifndef DBUG_OFF #ifndef DBUG_OFF
#define NDB_STD_OPTS(prog_name) \ #define NDB_STD_OPTS(prog_name) \
@ -80,6 +89,7 @@ enum ndb_std_options {
OPT_NDB_SHM= 256, OPT_NDB_SHM= 256,
OPT_NDB_SHM_SIGNUM, OPT_NDB_SHM_SIGNUM,
OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_NDB_OPTIMIZED_NODE_SELECTION,
OPT_WANT_CORE,
NDB_STD_OPTIONS_LAST /* should always be last in this enum */ NDB_STD_OPTIONS_LAST /* should always be last in this enum */
}; };

View file

@ -585,11 +585,13 @@ EventLogger::getText(char * m_text, size_t m_text_len,
BaseString::snprintf(m_text, BaseString::snprintf(m_text,
m_text_len, m_text_len,
"%sTable ID = %u, fragment ID = %u has completed LCP " "%sTable ID = %u, fragment ID = %u has completed LCP "
"on Node %u", "on Node %u maxGciStarted: %d maxGciCompleted: %d",
theNodeId, theNodeId,
theData[2], theData[2],
theData[3], theData[3],
theData[1]); theData[1],
theData[4],
theData[5]);
break; break;
case EventReport::TransReportCounters: case EventReport::TransReportCounters:
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View file

@ -195,6 +195,7 @@ SignalDataPrintFunctions[] = {
,{ GSN_ACC_LOCKREQ, printACC_LOCKREQ } ,{ GSN_ACC_LOCKREQ, printACC_LOCKREQ }
,{ GSN_LQH_TRANSCONF, printLQH_TRANSCONF } ,{ GSN_LQH_TRANSCONF, printLQH_TRANSCONF }
,{ GSN_SCAN_FRAGREQ, printSCAN_FRAGREQ } ,{ GSN_SCAN_FRAGREQ, printSCAN_FRAGREQ }
,{ GSN_START_FRAGREQ, printSTART_FRAG_REQ }
,{ 0, 0 } ,{ 0, 0 }
}; };

View file

@ -17,6 +17,7 @@
#include <RefConvert.hpp> #include <RefConvert.hpp>
#include <signaldata/StartRec.hpp> #include <signaldata/StartRec.hpp>
#include <signaldata/StartFragReq.hpp>
bool bool
printSTART_REC_REQ(FILE * output, printSTART_REC_REQ(FILE * output,
@ -50,3 +51,27 @@ printSTART_REC_CONF(FILE * output,
return true; return true;
} }
bool
printSTART_FRAG_REQ(FILE * output,
const Uint32 * theData,
Uint32 len,
Uint16 recBlockNo)
{
StartFragReq* sig = (StartFragReq*)theData;
fprintf(output, " table: %d frag: %d lcpId: %d lcpNo: %d #nodes: %d \n",
sig->tableId, sig->fragId, sig->lcpId, sig->lcpNo,
sig->noOfLogNodes);
for(Uint32 i = 0; i<sig->noOfLogNodes; i++)
{
fprintf(output, " (node: %d startGci: %d lastGci: %d)",
sig->lqhLogNode[i],
sig->startGci[i],
sig->lastGci[i]);
}
fprintf(output, "\n");
return true;
}

View file

@ -150,16 +150,16 @@ Backup::Backup(const Configuration & conf) :
addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF); addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF);
addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF); addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF);
addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF); addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF, true);
addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF);
addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF); addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF, true);
addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF);
addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF); addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF, true);
addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF); addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF);
addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF); addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF, true);
addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF); addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF);
/*****/ /*****/

View file

@ -949,17 +949,12 @@ private:
void execACC_TO_REQ(Signal* signal); void execACC_TO_REQ(Signal* signal);
void execACC_LOCKREQ(Signal* signal); void execACC_LOCKREQ(Signal* signal);
void execFSOPENCONF(Signal* signal); void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal); void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal); void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal); void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);
void execDROP_TAB_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal); void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal);
void execDUMP_STATE_ORD(Signal* signal); void execDUMP_STATE_ORD(Signal* signal);

View file

@ -187,17 +187,12 @@ Dbacc::Dbacc(const class Configuration & conf):
addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ); addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ);
addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ); addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ);
addRecSignal(GSN_FSOPENCONF, &Dbacc::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dbacc::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbacc::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dbacc::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dbacc::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbacc::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbacc::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dbacc::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbacc::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbacc::execFSREADCONF); addRecSignal(GSN_FSREADCONF, &Dbacc::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbacc::execFSREADREF);
addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR); addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR);
addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ); addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF); addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF);
addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true); addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ); addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ);

View file

@ -248,15 +248,6 @@ void Dbacc::execFSCLOSECONF(Signal* signal)
return; return;
}//Dbacc::execFSCLOSECONF() }//Dbacc::execFSCLOSECONF()
/* ******************--------------------------------------------------------------- */
/* FSCLOSEREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSCLOSEREF(Signal* signal)
{
jamEntry();
ndbrequire(false);
}//Dbacc::execFSCLOSEREF()
/* ******************--------------------------------------------------------------- */ /* ******************--------------------------------------------------------------- */
/* FSOPENCONF OPENFILE CONF */ /* FSOPENCONF OPENFILE CONF */
@ -304,15 +295,6 @@ void Dbacc::execFSOPENCONF(Signal* signal)
return; return;
}//Dbacc::execFSOPENCONF() }//Dbacc::execFSOPENCONF()
/* ******************--------------------------------------------------------------- */
/* FSOPENREF OPENFILE REF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSOPENREF(Signal* signal)
{
jamEntry();
ndbrequire(false);
}//Dbacc::execFSOPENREF()
/* ******************--------------------------------------------------------------- */ /* ******************--------------------------------------------------------------- */
/* FSREADCONF OPENFILE CONF */ /* FSREADCONF OPENFILE CONF */
@ -366,16 +348,6 @@ void Dbacc::execFSREADCONF(Signal* signal)
return; return;
}//Dbacc::execFSREADCONF() }//Dbacc::execFSREADCONF()
/* ******************--------------------------------------------------------------- */
/* FSREADRREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSREADREF(Signal* signal)
{
jamEntry();
progError(0, __LINE__, "Read of file refused");
return;
}//Dbacc::execFSREADREF()
/* ******************--------------------------------------------------------------- */ /* ******************--------------------------------------------------------------- */
/* FSWRITECONF OPENFILE CONF */ /* FSWRITECONF OPENFILE CONF */
@ -479,16 +451,6 @@ void Dbacc::execFSWRITECONF(Signal* signal)
return; return;
}//Dbacc::execFSWRITECONF() }//Dbacc::execFSWRITECONF()
/* ******************--------------------------------------------------------------- */
/* FSWRITEREF OPENFILE CONF */
/* ******************------------------------------+ */
/* SENDER: FS, LEVEL B */
void Dbacc::execFSWRITEREF(Signal* signal)
{
jamEntry();
progError(0, __LINE__, "Write to file refused");
return;
}//Dbacc::execFSWRITEREF()
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
@ -1425,10 +1387,6 @@ void Dbacc::execFSREMOVECONF(Signal* signal)
tabPtr.p->tabUserRef = 0; tabPtr.p->tabUserRef = 0;
}//Dbacc::execFSREMOVECONF() }//Dbacc::execFSREMOVECONF()
void Dbacc::execFSREMOVEREF(Signal* signal)
{
ndbrequire(false);
}//Dbacc::execFSREMOVEREF()
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* ADDFRAGTOTAB */ /* ADDFRAGTOTAB */

View file

@ -379,14 +379,6 @@ void Dbdict::execFSCLOSECONF(Signal* signal)
}//switch }//switch
}//execFSCLOSECONF() }//execFSCLOSECONF()
/* ---------------------------------------------------------------- */
// A close file was refused.
/* ---------------------------------------------------------------- */
void Dbdict::execFSCLOSEREF(Signal* signal)
{
jamEntry();
progError(0, 0);
}//execFSCLOSEREF()
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
// A file was successfully opened. // A file was successfully opened.
@ -449,17 +441,21 @@ void Dbdict::execFSOPENREF(Signal* signal)
c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer);
switch (fsPtr.p->fsState) { switch (fsPtr.p->fsState) {
case FsConnectRecord::OPEN_READ_SCHEMA1: case FsConnectRecord::OPEN_READ_SCHEMA1:
jam();
openReadSchemaRef(signal, fsPtr); openReadSchemaRef(signal, fsPtr);
break; return;
case FsConnectRecord::OPEN_READ_TAB_FILE1: case FsConnectRecord::OPEN_READ_TAB_FILE1:
jam(); jam();
openReadTableRef(signal, fsPtr); openReadTableRef(signal, fsPtr);
break; return;
default: default:
jamLine((fsPtr.p->fsState & 0xFFF));
ndbrequire(false);
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system open failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState);
fsRefError(signal,__LINE__,msg);
}
}//execFSOPENREF() }//execFSOPENREF()
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
@ -499,17 +495,21 @@ void Dbdict::execFSREADREF(Signal* signal)
c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer);
switch (fsPtr.p->fsState) { switch (fsPtr.p->fsState) {
case FsConnectRecord::READ_SCHEMA1: case FsConnectRecord::READ_SCHEMA1:
jam();
readSchemaRef(signal, fsPtr); readSchemaRef(signal, fsPtr);
break; return;
case FsConnectRecord::READ_TAB_FILE1: case FsConnectRecord::READ_TAB_FILE1:
jam(); jam();
readTableRef(signal, fsPtr); readTableRef(signal, fsPtr);
break; return;
default: default:
jamLine((fsPtr.p->fsState & 0xFFF));
ndbrequire(false);
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system read failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState);
fsRefError(signal,__LINE__,msg);
}
}//execFSREADREF() }//execFSREADREF()
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
@ -536,14 +536,6 @@ void Dbdict::execFSWRITECONF(Signal* signal)
}//switch }//switch
}//execFSWRITECONF() }//execFSWRITECONF()
/* ---------------------------------------------------------------- */
// A write file was refused.
/* ---------------------------------------------------------------- */
void Dbdict::execFSWRITEREF(Signal* signal)
{
jamEntry();
progError(0, 0);
}//execFSWRITEREF()
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
// Routines to handle Read/Write of Table Files // Routines to handle Read/Write of Table Files
@ -1181,13 +1173,11 @@ Dbdict::Dbdict(const class Configuration & conf):
addRecSignal(GSN_DICTSTARTREQ, &Dbdict::execDICTSTARTREQ); addRecSignal(GSN_DICTSTARTREQ, &Dbdict::execDICTSTARTREQ);
addRecSignal(GSN_READ_NODESCONF, &Dbdict::execREAD_NODESCONF); addRecSignal(GSN_READ_NODESCONF, &Dbdict::execREAD_NODESCONF);
addRecSignal(GSN_FSOPENCONF, &Dbdict::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dbdict::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF); addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF, true);
addRecSignal(GSN_FSCLOSECONF, &Dbdict::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dbdict::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbdict::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbdict::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dbdict::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbdict::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbdict::execFSREADCONF); addRecSignal(GSN_FSREADCONF, &Dbdict::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF); addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF, true);
addRecSignal(GSN_LQHFRAGCONF, &Dbdict::execLQHFRAGCONF); addRecSignal(GSN_LQHFRAGCONF, &Dbdict::execLQHFRAGCONF);
addRecSignal(GSN_LQHADDATTCONF, &Dbdict::execLQHADDATTCONF); addRecSignal(GSN_LQHADDATTCONF, &Dbdict::execLQHADDATTCONF);
addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF); addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF);

View file

@ -458,13 +458,11 @@ private:
void execSCHEMA_INFOCONF(Signal* signal); void execSCHEMA_INFOCONF(Signal* signal);
void execREAD_NODESCONF(Signal* signal); void execREAD_NODESCONF(Signal* signal);
void execFSCLOSECONF(Signal* signal); void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSOPENCONF(Signal* signal); void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal); void execFSOPENREF(Signal* signal);
void execFSREADCONF(Signal* signal); void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal); void execFSREADREF(Signal* signal);
void execFSWRITECONF(Signal* signal); void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal);
void execSTTOR(Signal* signal); void execSTTOR(Signal* signal);

View file

@ -206,13 +206,13 @@ Dbdih::Dbdih(const class Configuration & config):
addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF); addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF);
addRecSignal(GSN_ADD_FRAGREF, &Dbdih::execADD_FRAGREF); addRecSignal(GSN_ADD_FRAGREF, &Dbdih::execADD_FRAGREF);
addRecSignal(GSN_FSOPENCONF, &Dbdih::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dbdih::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF); addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF, true);
addRecSignal(GSN_FSCLOSECONF, &Dbdih::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dbdih::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF); addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF, true);
addRecSignal(GSN_FSREADCONF, &Dbdih::execFSREADCONF); addRecSignal(GSN_FSREADCONF, &Dbdih::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF); addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true);
addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF); addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ); addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ);
addRecSignal(GSN_START_INFOREQ, addRecSignal(GSN_START_INFOREQ,

View file

@ -782,29 +782,36 @@ void Dbdih::execFSCLOSEREF(Signal* signal)
filePtr.p->reqStatus = FileRecord::IDLE; filePtr.p->reqStatus = FileRecord::IDLE;
switch (status) { switch (status) {
case FileRecord::CLOSING_GCP: case FileRecord::CLOSING_GCP:
ndbrequire(false); jam();
break; break;
case FileRecord::CLOSING_GCP_CRASH: case FileRecord::CLOSING_GCP_CRASH:
jam(); jam();
closingGcpCrashLab(signal, filePtr); closingGcpCrashLab(signal, filePtr);
break; return;
case FileRecord::CLOSING_TABLE_CRASH: case FileRecord::CLOSING_TABLE_CRASH:
jam(); jam();
closingTableCrashLab(signal, filePtr); closingTableCrashLab(signal, filePtr);
break; return;
case FileRecord::CLOSING_TABLE_SR: case FileRecord::CLOSING_TABLE_SR:
ndbrequire(false); jam();
break; break;
case FileRecord::TABLE_CLOSE: case FileRecord::TABLE_CLOSE:
ndbrequire(false); jam();
break; break;
case FileRecord::TABLE_CLOSE_DELETE: case FileRecord::TABLE_CLOSE_DELETE:
ndbrequire(false); jam();
break; break;
default: default:
ndbrequire(false); jam();
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system close failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return; return;
}//Dbdih::execFSCLOSEREF() }//Dbdih::execFSCLOSEREF()
@ -868,34 +875,39 @@ void Dbdih::execFSOPENREF(Signal* signal)
/* WE DID NOT MANAGE TO CREATE A GLOBAL CHECKPOINT FILE. SERIOUS ERROR */ /* WE DID NOT MANAGE TO CREATE A GLOBAL CHECKPOINT FILE. SERIOUS ERROR */
/* WHICH CAUSES A SYSTEM RESTART. */ /* WHICH CAUSES A SYSTEM RESTART. */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
ndbrequire(false); jam();
break; break;
case FileRecord::OPENING_COPY_GCI: case FileRecord::OPENING_COPY_GCI:
jam(); jam();
openingCopyGciErrorLab(signal, filePtr); openingCopyGciErrorLab(signal, filePtr);
break; return;
case FileRecord::CREATING_COPY_GCI: case FileRecord::CREATING_COPY_GCI:
ndbrequire(false); jam();
break; break;
case FileRecord::OPENING_GCP: case FileRecord::OPENING_GCP:
jam(); jam();
openingGcpErrorLab(signal, filePtr); openingGcpErrorLab(signal, filePtr);
break; return;
case FileRecord::OPENING_TABLE: case FileRecord::OPENING_TABLE:
jam(); jam();
openingTableErrorLab(signal, filePtr); openingTableErrorLab(signal, filePtr);
break; return;
case FileRecord::TABLE_CREATE: case FileRecord::TABLE_CREATE:
ndbrequire(false); jam();
break; break;
case FileRecord::TABLE_OPEN_FOR_DELETE: case FileRecord::TABLE_OPEN_FOR_DELETE:
jam(); jam();
tableDeleteLab(signal, filePtr); tableDeleteLab(signal, filePtr);
break; return;
default: default:
ndbrequire(false); jam();
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system open failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return; return;
}//Dbdih::execFSOPENREF() }//Dbdih::execFSOPENREF()
@ -935,16 +947,19 @@ void Dbdih::execFSREADREF(Signal* signal)
case FileRecord::READING_GCP: case FileRecord::READING_GCP:
jam(); jam();
readingGcpErrorLab(signal, filePtr); readingGcpErrorLab(signal, filePtr);
break; return;
case FileRecord::READING_TABLE: case FileRecord::READING_TABLE:
jam(); jam();
readingTableErrorLab(signal, filePtr); readingTableErrorLab(signal, filePtr);
break; return;
default: default:
ndbrequire(false);
break; break;
}//switch }//switch
return; {
char msg[100];
sprintf(msg, "File system read failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
}//Dbdih::execFSREADREF() }//Dbdih::execFSREADREF()
void Dbdih::execFSWRITECONF(Signal* signal) void Dbdih::execFSWRITECONF(Signal* signal)
@ -989,22 +1004,27 @@ void Dbdih::execFSWRITEREF(Signal* signal)
/* EVEN CREATING THE FILE DID NOT WORK. WE WILL THEN CRASH. */ /* EVEN CREATING THE FILE DID NOT WORK. WE WILL THEN CRASH. */
/* ERROR IN WRITING FILE. WE WILL NOT CONTINUE FROM HERE. */ /* ERROR IN WRITING FILE. WE WILL NOT CONTINUE FROM HERE. */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
ndbrequire(false); jam();
break; break;
case FileRecord::WRITE_INIT_GCP: case FileRecord::WRITE_INIT_GCP:
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
/* AN ERROR OCCURRED IN WRITING A GCI FILE WHICH IS A SERIOUS ERROR */ /* AN ERROR OCCURRED IN WRITING A GCI FILE WHICH IS A SERIOUS ERROR */
/* THAT CAUSE A SYSTEM RESTART. */ /* THAT CAUSE A SYSTEM RESTART. */
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
ndbrequire(false); jam();
break; break;
case FileRecord::TABLE_WRITE: case FileRecord::TABLE_WRITE:
ndbrequire(false); jam();
break; break;
default: default:
ndbrequire(false); jam();
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system write failed during FileRecord status %d", (Uint32)status);
fsRefError(signal,__LINE__,msg);
}
return; return;
}//Dbdih::execFSWRITEREF() }//Dbdih::execFSWRITEREF()
@ -9620,6 +9640,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal)
} }
bool tableDone = reportLcpCompletion(lcpReport); bool tableDone = reportLcpCompletion(lcpReport);
Uint32 started = lcpReport->maxGciStarted;
Uint32 completed = lcpReport->maxGciCompleted;
if(tableDone){ if(tableDone){
jam(); jam();
@ -9653,7 +9676,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal)
signal->theData[1] = nodeId; signal->theData[1] = nodeId;
signal->theData[2] = tableId; signal->theData[2] = tableId;
signal->theData[3] = fragId; signal->theData[3] = fragId;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 4, JBB); signal->theData[4] = started;
signal->theData[5] = completed;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 6, JBB);
#endif #endif
bool ok = false; bool ok = false;
@ -10770,7 +10795,9 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr,
lcpNo = fmgReplicaPtr.p->nextLcp; lcpNo = fmgReplicaPtr.p->nextLcp;
do { do {
ndbrequire(lcpNo < MAX_LCP_STORED); ndbrequire(lcpNo < MAX_LCP_STORED);
if (fmgReplicaPtr.p->lcpStatus[lcpNo] == ZVALID) { if (fmgReplicaPtr.p->lcpStatus[lcpNo] == ZVALID &&
fmgReplicaPtr.p->maxGciStarted[lcpNo] <= coldgcp)
{
jam(); jam();
keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo]; keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo];
oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo]; oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo];
@ -10778,7 +10805,6 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr,
return; return;
} else { } else {
jam(); jam();
ndbrequire(fmgReplicaPtr.p->lcpStatus[lcpNo] == ZINVALID);
if (fmgReplicaPtr.p->createGci[0] == fmgReplicaPtr.p->initialGci) { if (fmgReplicaPtr.p->createGci[0] == fmgReplicaPtr.p->initialGci) {
jam(); jam();
/*------------------------------------------------------------------- /*-------------------------------------------------------------------

View file

@ -1,10 +1,16 @@
noinst_LIBRARIES = libdbdih.a noinst_LIBRARIES = libdbdih.a
EXTRA_PROGRAMS = ndbd_sysfile_reader
libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp
ndbd_sysfile_reader_SOURCES = printSysfile/printSysfile.cpp
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_kernel.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am
LDADD += \
$(top_builddir)/ndb/src/common/util/libgeneral.la \
$(top_builddir)/ndb/src/common/portlib/libportlib.la
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View file

@ -2175,9 +2175,7 @@ private:
void execTUP_SRREF(Signal* signal); void execTUP_SRREF(Signal* signal);
void execGCP_SAVEREQ(Signal* signal); void execGCP_SAVEREQ(Signal* signal);
void execFSOPENCONF(Signal* signal); void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal); void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal); void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal); void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal); void execFSREADCONF(Signal* signal);
@ -2186,7 +2184,6 @@ private:
void execSET_VAR_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal);
void execTIME_SIGNAL(Signal* signal); void execTIME_SIGNAL(Signal* signal);
void execFSSYNCCONF(Signal* signal); void execFSSYNCCONF(Signal* signal);
void execFSSYNCREF(Signal* signal);
void execALTER_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal);
void execALTER_TAB_CONF(Signal* signal); void execALTER_TAB_CONF(Signal* signal);

View file

@ -311,18 +311,15 @@ Dblqh::Dblqh(const class Configuration & conf):
addRecSignal(GSN_TUP_SRREF, &Dblqh::execTUP_SRREF); addRecSignal(GSN_TUP_SRREF, &Dblqh::execTUP_SRREF);
addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ); addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ);
addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dblqh::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF); addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF, true);
addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF); addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF); addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true);
addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF); addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF);
addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ); addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ);
addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL); addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL);
addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF); addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF);
addRecSignal(GSN_FSSYNCREF, &Dblqh::execFSSYNCREF);
addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD); addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD);
//addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ); //addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ);

View file

@ -11718,14 +11718,6 @@ Dblqh::execFSSYNCCONF(Signal* signal)
ccurrentGcprec = RNIL; ccurrentGcprec = RNIL;
}//Dblqh::execFSSYNCCONF() }//Dblqh::execFSSYNCCONF()
void
Dblqh::execFSSYNCREF(Signal* signal)
{
jamEntry();
systemErrorLab(signal);
return;
}//Dblqh::execFSSYNCREF()
/* ######################################################################### */ /* ######################################################################### */
/* ####### FILE HANDLING MODULE ####### */ /* ####### FILE HANDLING MODULE ####### */
@ -11796,16 +11788,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
}//switch }//switch
}//Dblqh::execFSCLOSECONF() }//Dblqh::execFSCLOSECONF()
/* ************>> */
/* FSCLOSEREF > */
/* ************>> */
void Dblqh::execFSCLOSEREF(Signal* signal)
{
jamEntry();
terrorCode = signal->theData[1];
systemErrorLab(signal);
return;
}//Dblqh::execFSCLOSEREF()
/* ************>> */ /* ************>> */
/* FSOPENCONF > */ /* FSOPENCONF > */
@ -11894,16 +11876,6 @@ void Dblqh::execFSOPENCONF(Signal* signal)
}//switch }//switch
}//Dblqh::execFSOPENCONF() }//Dblqh::execFSOPENCONF()
/* ************> */
/* FSOPENREF > */
/* ************> */
void Dblqh::execFSOPENREF(Signal* signal)
{
jamEntry();
terrorCode = signal->theData[1];
systemErrorLab(signal);
return;
}//Dblqh::execFSOPENREF()
/* ************>> */ /* ************>> */
/* FSREADCONF > */ /* FSREADCONF > */
@ -11981,60 +11953,43 @@ void Dblqh::execFSREADREF(Signal* signal)
jamEntry(); jamEntry();
lfoPtr.i = signal->theData[0]; lfoPtr.i = signal->theData[0];
ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord); ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord);
terrorCode = signal->theData[1];
switch (lfoPtr.p->lfoState) { switch (lfoPtr.p->lfoState) {
case LogFileOperationRecord::READ_SR_LAST_MBYTE: case LogFileOperationRecord::READ_SR_LAST_MBYTE:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_FRONTPAGE: case LogFileOperationRecord::READ_SR_FRONTPAGE:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_LAST_FILE: case LogFileOperationRecord::READ_SR_LAST_FILE:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_NEXT_FILE: case LogFileOperationRecord::READ_SR_NEXT_FILE:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_EXEC_SR: case LogFileOperationRecord::READ_EXEC_SR:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_EXEC_LOG: case LogFileOperationRecord::READ_EXEC_LOG:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_FOURTH_PHASE: case LogFileOperationRecord::READ_SR_FOURTH_PHASE:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_FOURTH_ZERO: case LogFileOperationRecord::READ_SR_FOURTH_ZERO:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES: case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES:
jam() jam()
systemErrorLab(signal);
return;
break; break;
default: default:
jam(); jam();
systemErrorLab(signal);
return;
break; break;
}//switch }//switch
return; {
char msg[100];
sprintf(msg, "File system read failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState);
fsRefError(signal,__LINE__,msg);
}
}//Dblqh::execFSREADREF() }//Dblqh::execFSREADREF()
/* *************** */ /* *************** */
@ -12115,49 +12070,43 @@ void Dblqh::execFSWRITEREF(Signal* signal)
switch (lfoPtr.p->lfoState) { switch (lfoPtr.p->lfoState) {
case LogFileOperationRecord::WRITE_PAGE_ZERO: case LogFileOperationRecord::WRITE_PAGE_ZERO:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::LAST_WRITE_IN_FILE: case LogFileOperationRecord::LAST_WRITE_IN_FILE:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::INIT_WRITE_AT_END: case LogFileOperationRecord::INIT_WRITE_AT_END:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::INIT_FIRST_PAGE: case LogFileOperationRecord::INIT_FIRST_PAGE:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::WRITE_GCI_ZERO: case LogFileOperationRecord::WRITE_GCI_ZERO:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::WRITE_DIRTY: case LogFileOperationRecord::WRITE_DIRTY:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::WRITE_INIT_MBYTE: case LogFileOperationRecord::WRITE_INIT_MBYTE:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::ACTIVE_WRITE_LOG: case LogFileOperationRecord::ACTIVE_WRITE_LOG:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE: case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE:
jam(); jam();
systemErrorLab(signal);
break; break;
case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES: case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES:
jam(); jam();
systemErrorLab(signal); systemErrorLab(signal);
break;
default: default:
jam(); jam();
systemErrorLab(signal);
break; break;
}//switch }//switch
{
char msg[100];
sprintf(msg, "File system write failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState);
fsRefError(signal,__LINE__,msg);
}
}//Dblqh::execFSWRITEREF() }//Dblqh::execFSWRITEREF()

View file

@ -134,7 +134,9 @@ bool PrepareOperationRecord::check() {
return true; return true;
} }
Uint32 PrepareOperationRecord::getLogRecordSize() { Uint32 PrepareOperationRecord::getLogRecordSize(Uint32 wordsRead) {
if (wordsRead < 2)
return 2; // make sure we read more
return m_logRecordSize; return m_logRecordSize;
} }
@ -239,6 +241,17 @@ bool PageHeader::check() {
return true; return true;
} }
bool PageHeader::lastPage()
{
return m_next_page == 0xffffff00;
}
Uint32 PageHeader::lastWord()
{
return m_current_page_index;
}
NdbOut& operator<<(NdbOut& no, const PageHeader& ph) { NdbOut& operator<<(NdbOut& no, const PageHeader& ph) {
no << "------------PAGE HEADER------------------------" << endl << endl; no << "------------PAGE HEADER------------------------" << endl << endl;
ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex"); ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex");

View file

@ -83,7 +83,7 @@ class PrepareOperationRecord {
friend NdbOut& operator<<(NdbOut&, const PrepareOperationRecord&); friend NdbOut& operator<<(NdbOut&, const PrepareOperationRecord&);
public: public:
bool check(); bool check();
Uint32 getLogRecordSize(); Uint32 getLogRecordSize(Uint32 wordsRead);
protected: protected:
Uint32 m_recordType; Uint32 m_recordType;
@ -132,6 +132,8 @@ class PageHeader {
public: public:
bool check(); bool check();
Uint32 getLogRecordSize(); Uint32 getLogRecordSize();
bool lastPage();
Uint32 lastWord();
protected: protected:
Uint32 m_checksum; Uint32 m_checksum;
Uint32 m_lap; Uint32 m_lap;

View file

@ -35,13 +35,13 @@
#define FROM_BEGINNING 0 #define FROM_BEGINNING 0
void usage(const char * prg); void usage(const char * prg);
Uint32 readRecordOverPageBoundary (Uint32 *, Uint32 , Uint32 , Uint32);
Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords); Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords);
void readArguments(int argc, const char** argv); void readArguments(int argc, const char** argv);
void doExit(); void doExit();
FILE * f= 0; FILE * f= 0;
char fileName[256]; char fileName[256];
bool theDumpFlag = false;
bool thePrintFlag = true; bool thePrintFlag = true;
bool theCheckFlag = true; bool theCheckFlag = true;
bool onlyPageHeaders = false; bool onlyPageHeaders = false;
@ -54,8 +54,8 @@ Uint32 startAtPageIndex = 0;
Uint32 *redoLogPage; Uint32 *redoLogPage;
NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) { NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) {
Uint32 pageIndex = 0; int wordIndex = 0;
Uint32 oldPageIndex = 0; int oldWordIndex = 0;
Uint32 recordType = 1234567890; Uint32 recordType = 1234567890;
PageHeader *thePageHeader; PageHeader *thePageHeader;
@ -83,48 +83,47 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
} }
redoLogPage = new Uint32[PAGESIZE*NO_PAGES_IN_MBYTE]; redoLogPage = new Uint32[PAGESIZE*NO_PAGES_IN_MBYTE];
Uint32 words_from_previous_page = 0;
// Loop for every mbyte. // Loop for every mbyte.
for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE; j++) { bool lastPage = false;
for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE && !lastPage; j++) {
readFromFile(f, redoLogPage, PAGESIZE*NO_PAGES_IN_MBYTE); readFromFile(f, redoLogPage, PAGESIZE*NO_PAGES_IN_MBYTE);
if (firstLap) { words_from_previous_page = 0;
pageIndex = startAtPageIndex;
firstLap = false;
} else
pageIndex = 0;
// Loop for every page. // Loop for every page.
for (int i = startAtPage; i < NO_PAGES_IN_MBYTE; i++) { for (int i = 0; i < NO_PAGES_IN_MBYTE; i++) {
wordIndex = 0;
if (pageIndex == 0) { thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE];
thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE]; // Print out mbyte number, page number and page index.
// Print out mbyte number, page number and page index. ndbout << j << ":" << i << ":" << wordIndex << endl
ndbout << j << ":" << i << ":" << pageIndex << endl << " " << j*32 + i << ":" << wordIndex << " ";
<< " " << j*32 + i << ":" << pageIndex << " "; if (thePrintFlag) ndbout << (*thePageHeader);
if (thePrintFlag) ndbout << (*thePageHeader); if (theCheckFlag) {
if (theCheckFlag) { if(!thePageHeader->check()) {
if(!thePageHeader->check()) { ndbout << "Error in thePageHeader->check()" << endl;
ndbout << "Error in thePageHeader->check()" << endl; doExit();
doExit();
}
Uint32 checkSum = 37;
for (int ps = 1; ps < PAGESIZE; ps++)
checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum;
if (checkSum != redoLogPage[i*PAGESIZE]){
ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE]
<< " expected = " << checkSum << endl;
doExit();
}
else
ndbout << "expected checksum: " << checkSum << endl;
} }
pageIndex += thePageHeader->getLogRecordSize();
Uint32 checkSum = 37;
for (int ps = 1; ps < PAGESIZE; ps++)
checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum;
if (checkSum != redoLogPage[i*PAGESIZE]){
ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE]
<< " expected = " << checkSum << endl;
doExit();
}
else
ndbout << "expected checksum: " << checkSum << endl;
} }
lastPage = i != 0 && thePageHeader->lastPage();
Uint32 lastWord = thePageHeader->lastWord();
if (onlyMbyteHeaders) { if (onlyMbyteHeaders) {
// Show only the first page header in every mbyte of the file. // Show only the first page header in every mbyte of the file.
break; break;
@ -132,18 +131,40 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
if (onlyPageHeaders) { if (onlyPageHeaders) {
// Show only page headers. Continue with the next page in this for loop. // Show only page headers. Continue with the next page in this for loop.
pageIndex = 0;
continue; continue;
} }
wordIndex = thePageHeader->getLogRecordSize() - words_from_previous_page;
Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE;
if (words_from_previous_page)
{
memmove(redoLogPagePos + wordIndex ,
redoLogPagePos - words_from_previous_page,
words_from_previous_page*4);
}
do { do {
// Print out mbyte number, page number and page index. if (words_from_previous_page)
ndbout << j << ":" << i << ":" << pageIndex << endl {
<< " " << j*32 + i << ":" << pageIndex << " "; // Print out mbyte number, page number and word index.
recordType = redoLogPage[i*PAGESIZE + pageIndex]; ndbout << j << ":" << i-1 << ":" << PAGESIZE-words_from_previous_page << endl
<< j << ":" << i << ":" << wordIndex+words_from_previous_page << endl
<< " " << j*32 + i-1 << ":" << PAGESIZE-words_from_previous_page << " ";
words_from_previous_page = 0;
}
else
{
// Print out mbyte number, page number and word index.
ndbout << j << ":" << i << ":" << wordIndex << endl
<< " " << j*32 + i << ":" << wordIndex << " ";
}
redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex;
oldWordIndex = wordIndex;
recordType = *redoLogPagePos;
switch(recordType) { switch(recordType) {
case ZFD_TYPE: case ZFD_TYPE:
fdRecord = (FileDescriptor *) &redoLogPage[i*PAGESIZE + pageIndex]; fdRecord = (FileDescriptor *) redoLogPagePos;
if (thePrintFlag) ndbout << (*fdRecord); if (thePrintFlag) ndbout << (*fdRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!fdRecord->check()) { if(!fdRecord->check()) {
@ -155,13 +176,13 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
delete [] redoLogPage; delete [] redoLogPage;
exit(RETURN_OK); exit(RETURN_OK);
} }
pageIndex += fdRecord->getLogRecordSize(); wordIndex += fdRecord->getLogRecordSize();
break; break;
case ZNEXT_LOG_RECORD_TYPE: case ZNEXT_LOG_RECORD_TYPE:
nlRecord = (NextLogRecord *) (&redoLogPage[i*PAGESIZE] + pageIndex); nlRecord = (NextLogRecord *) redoLogPagePos;
pageIndex += nlRecord->getLogRecordSize(pageIndex); wordIndex += nlRecord->getLogRecordSize(wordIndex);
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*nlRecord); if (thePrintFlag) ndbout << (*nlRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!nlRecord->check()) { if(!nlRecord->check()) {
@ -173,9 +194,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
break; break;
case ZCOMPLETED_GCI_TYPE: case ZCOMPLETED_GCI_TYPE:
cGCIrecord = (CompletedGCIRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; cGCIrecord = (CompletedGCIRecord *) redoLogPagePos;
pageIndex += cGCIrecord->getLogRecordSize(); wordIndex += cGCIrecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*cGCIrecord); if (thePrintFlag) ndbout << (*cGCIrecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!cGCIrecord->check()) { if(!cGCIrecord->check()) {
@ -187,9 +208,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
break; break;
case ZPREP_OP_TYPE: case ZPREP_OP_TYPE:
poRecord = (PrepareOperationRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; poRecord = (PrepareOperationRecord *) redoLogPagePos;
pageIndex += poRecord->getLogRecordSize(); wordIndex += poRecord->getLogRecordSize(PAGESIZE-wordIndex);
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*poRecord); if (thePrintFlag) ndbout << (*poRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!poRecord->check()) { if(!poRecord->check()) {
@ -198,15 +219,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
} }
} }
} }
else {
oldPageIndex = pageIndex - poRecord->getLogRecordSize();
}
break; break;
case ZCOMMIT_TYPE: case ZCOMMIT_TYPE:
ctRecord = (CommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; ctRecord = (CommitTransactionRecord *) redoLogPagePos;
pageIndex += ctRecord->getLogRecordSize(); wordIndex += ctRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*ctRecord); if (thePrintFlag) ndbout << (*ctRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!ctRecord->check()) { if(!ctRecord->check()) {
@ -215,15 +233,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
} }
} }
} }
else {
oldPageIndex = pageIndex - ctRecord->getLogRecordSize();
}
break; break;
case ZINVALID_COMMIT_TYPE: case ZINVALID_COMMIT_TYPE:
ictRecord = (InvalidCommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; ictRecord = (InvalidCommitTransactionRecord *) redoLogPagePos;
pageIndex += ictRecord->getLogRecordSize(); wordIndex += ictRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*ictRecord); if (thePrintFlag) ndbout << (*ictRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!ictRecord->check()) { if(!ictRecord->check()) {
@ -232,21 +247,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
} }
} }
} }
else {
oldPageIndex = pageIndex - ictRecord->getLogRecordSize();
}
break; break;
case ZNEXT_MBYTE_TYPE: case ZNEXT_MBYTE_TYPE:
nmRecord = (NextMbyteRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; nmRecord = (NextMbyteRecord *) redoLogPagePos;
if (thePrintFlag) ndbout << (*nmRecord); if (thePrintFlag) ndbout << (*nmRecord);
i = NO_PAGES_IN_MBYTE; i = NO_PAGES_IN_MBYTE;
break; break;
case ZABORT_TYPE: case ZABORT_TYPE:
atRecord = (AbortTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; atRecord = (AbortTransactionRecord *) redoLogPagePos;
pageIndex += atRecord->getLogRecordSize(); wordIndex += atRecord->getLogRecordSize();
if (pageIndex <= PAGESIZE) { if (wordIndex <= PAGESIZE) {
if (thePrintFlag) ndbout << (*atRecord); if (thePrintFlag) ndbout << (*atRecord);
if (theCheckFlag) { if (theCheckFlag) {
if(!atRecord->check()) { if(!atRecord->check()) {
@ -266,22 +278,36 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read
ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl; ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl;
// Print out remaining data in this page // Print out remaining data in this page
for (int j = pageIndex; j < PAGESIZE; j++){ for (int k = wordIndex; k < PAGESIZE; k++){
Uint32 unknown = redoLogPage[i*PAGESIZE + j]; Uint32 unknown = redoLogPage[i*PAGESIZE + k];
ndbout_c("%-30d%-12u%-12x", k, unknown, unknown);
ndbout_c("%-30d%-12u%-12x", j, unknown, unknown);
} }
doExit(); doExit();
} }
} while(pageIndex < PAGESIZE && i < NO_PAGES_IN_MBYTE); } while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE);
if (pageIndex > PAGESIZE) {
// The last record overlapped page boundary. Must redo that record. if (lastPage)
pageIndex = readRecordOverPageBoundary(&redoLogPage[i*PAGESIZE], {
pageIndex, oldPageIndex, recordType); if (theDumpFlag)
{
ndbout << " ------PAGE END: DUMPING REST OF PAGE------" << endl;
for (int k = wordIndex > PAGESIZE ? oldWordIndex : wordIndex;
k < PAGESIZE; k++)
{
Uint32 word = redoLogPage[i*PAGESIZE + k];
ndbout_c("%-30d%-12u%-12x", k, word, word);
}
}
break;
}
if (wordIndex > PAGESIZE) {
words_from_previous_page = PAGESIZE - oldWordIndex;
ndbout << " ----------- Record continues on next page -----------" << endl;
} else { } else {
pageIndex = 0; wordIndex = 0;
words_from_previous_page = 0;
} }
ndbout << endl; ndbout << endl;
}//for }//for
@ -310,93 +336,6 @@ Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords) {
} }
//----------------------------------------------------------------
//
//----------------------------------------------------------------
Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 oldPageIndex, Uint32 recordType) {
Uint32 pageHeader[PAGEHEADERSIZE];
Uint32 tmpPages[PAGESIZE*10];
PageHeader *thePageHeader;
Uint32 recordSize = 0;
PrepareOperationRecord *poRecord;
CommitTransactionRecord *ctRecord;
InvalidCommitTransactionRecord *ictRecord;
memcpy(pageHeader, pagePtr + PAGESIZE, PAGEHEADERSIZE*sizeof(Uint32));
memcpy(tmpPages, pagePtr + oldPageIndex, (PAGESIZE - oldPageIndex)*sizeof(Uint32));
memcpy(tmpPages + PAGESIZE - oldPageIndex ,
(pagePtr + PAGESIZE + PAGEHEADERSIZE),
(PAGESIZE - PAGEHEADERSIZE)*sizeof(Uint32));
switch(recordType) {
case ZPREP_OP_TYPE:
poRecord = (PrepareOperationRecord *) tmpPages;
recordSize = poRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!poRecord->check()) {
ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*poRecord);
} else {
ndbout << "Error: Record greater than a Page" << endl;
}
break;
case ZCOMMIT_TYPE:
ctRecord = (CommitTransactionRecord *) tmpPages;
recordSize = ctRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!ctRecord->check()) {
ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*ctRecord);
} else {
ndbout << endl << "Error: Record greater than a Page" << endl;
}
break;
case ZINVALID_COMMIT_TYPE:
ictRecord = (InvalidCommitTransactionRecord *) tmpPages;
recordSize = ictRecord->getLogRecordSize();
if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) {
if (theCheckFlag) {
if(!ictRecord->check()) {
ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl;
doExit();
}
}
if (thePrintFlag) ndbout << (*ictRecord);
} else {
ndbout << endl << "Error: Record greater than a Page" << endl;
}
break;
case ZNEW_PREP_OP_TYPE:
case ZABORT_TYPE:
case ZFRAG_SPLIT_TYPE:
case ZNEXT_MBYTE_TYPE:
ndbout << endl << "Record type = " << recordType << " not implemented." << endl;
return 0;
default:
ndbout << endl << "Error: Unknown record type. Record type = " << recordType << endl;
return 0;
}
thePageHeader = (PageHeader *) (pagePtr + PAGESIZE);
if (thePrintFlag) ndbout << (*thePageHeader);
return PAGEHEADERSIZE - PAGESIZE + oldPageIndex + recordSize;
}
//---------------------------------------------------------------- //----------------------------------------------------------------
// //
//---------------------------------------------------------------- //----------------------------------------------------------------
@ -425,6 +364,8 @@ void readArguments(int argc, const char** argv)
{ {
if (strcmp(argv[i], "-noprint") == 0) { if (strcmp(argv[i], "-noprint") == 0) {
thePrintFlag = false; thePrintFlag = false;
} else if (strcmp(argv[i], "-dump") == 0) {
theDumpFlag = true;
} else if (strcmp(argv[i], "-nocheck") == 0) { } else if (strcmp(argv[i], "-nocheck") == 0) {
theCheckFlag = false; theCheckFlag = false;
} else if (strcmp(argv[i], "-mbyteheaders") == 0) { } else if (strcmp(argv[i], "-mbyteheaders") == 0) {

View file

@ -4404,7 +4404,7 @@ Dbtc::DIVER_node_fail_handling(Signal* signal, UintR Tgci)
*------------------------------------------------------------------------*/ *------------------------------------------------------------------------*/
tabortInd = ZFALSE; tabortInd = ZFALSE;
setupFailData(signal); setupFailData(signal);
if (tabortInd == ZFALSE) { if (false && tabortInd == ZFALSE) {
jam(); jam();
commitGciHandling(signal, Tgci); commitGciHandling(signal, Tgci);
toCommitHandlingLab(signal); toCommitHandlingLab(signal);

View file

@ -1051,20 +1051,15 @@ private:
void execTUP_SRREQ(Signal* signal); void execTUP_SRREQ(Signal* signal);
void execTUP_PREPLCPREQ(Signal* signal); void execTUP_PREPLCPREQ(Signal* signal);
void execFSOPENCONF(Signal* signal); void execFSOPENCONF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSECONF(Signal* signal); void execFSCLOSECONF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSWRITECONF(Signal* signal); void execFSWRITECONF(Signal* signal);
void execFSWRITEREF(Signal* signal);
void execFSREADCONF(Signal* signal); void execFSREADCONF(Signal* signal);
void execFSREADREF(Signal* signal);
void execNDB_STTOR(Signal* signal); void execNDB_STTOR(Signal* signal);
void execREAD_CONFIG_REQ(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal);
void execSET_VAR_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal);
void execDROP_TAB_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal);
void execALTER_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal);
void execFSREMOVECONF(Signal* signal); void execFSREMOVECONF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execTUP_ALLOCREQ(Signal* signal); void execTUP_ALLOCREQ(Signal* signal);
void execTUP_DEALLOCREQ(Signal* signal); void execTUP_DEALLOCREQ(Signal* signal);
void execTUP_WRITELOG_REQ(Signal* signal); void execTUP_WRITELOG_REQ(Signal* signal);

View file

@ -25,7 +25,6 @@
#include <AttributeHeader.hpp> #include <AttributeHeader.hpp>
#include <Interpreter.hpp> #include <Interpreter.hpp>
#include <signaldata/FsConf.hpp> #include <signaldata/FsConf.hpp>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsRemoveReq.hpp> #include <signaldata/FsRemoveReq.hpp>
#include <signaldata/TupCommit.hpp> #include <signaldata/TupCommit.hpp>
#include <signaldata/TupKey.hpp> #include <signaldata/TupKey.hpp>
@ -117,13 +116,9 @@ Dbtup::Dbtup(const class Configuration & conf)
addRecSignal(GSN_TUP_SRREQ, &Dbtup::execTUP_SRREQ); addRecSignal(GSN_TUP_SRREQ, &Dbtup::execTUP_SRREQ);
addRecSignal(GSN_TUP_PREPLCPREQ, &Dbtup::execTUP_PREPLCPREQ); addRecSignal(GSN_TUP_PREPLCPREQ, &Dbtup::execTUP_PREPLCPREQ);
addRecSignal(GSN_FSOPENCONF, &Dbtup::execFSOPENCONF); addRecSignal(GSN_FSOPENCONF, &Dbtup::execFSOPENCONF);
addRecSignal(GSN_FSOPENREF, &Dbtup::execFSOPENREF);
addRecSignal(GSN_FSCLOSECONF, &Dbtup::execFSCLOSECONF); addRecSignal(GSN_FSCLOSECONF, &Dbtup::execFSCLOSECONF);
addRecSignal(GSN_FSCLOSEREF, &Dbtup::execFSCLOSEREF);
addRecSignal(GSN_FSWRITECONF, &Dbtup::execFSWRITECONF); addRecSignal(GSN_FSWRITECONF, &Dbtup::execFSWRITECONF);
addRecSignal(GSN_FSWRITEREF, &Dbtup::execFSWRITEREF);
addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF); addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF);
addRecSignal(GSN_FSREADREF, &Dbtup::execFSREADREF);
addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR); addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR);
addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true); addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true);
addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ); addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ);
@ -133,7 +128,6 @@ Dbtup::Dbtup(const class Configuration & conf)
addRecSignal(GSN_DROP_TRIG_REQ, &Dbtup::execDROP_TRIG_REQ); addRecSignal(GSN_DROP_TRIG_REQ, &Dbtup::execDROP_TRIG_REQ);
addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ); addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ);
addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF); addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF);
addRecSignal(GSN_TUP_ALLOCREQ, &Dbtup::execTUP_ALLOCREQ); addRecSignal(GSN_TUP_ALLOCREQ, &Dbtup::execTUP_ALLOCREQ);
@ -263,12 +257,6 @@ void Dbtup::execFSCLOSECONF(Signal* signal)
releasePendingFileOpenInfoRecord(pfoPtr); releasePendingFileOpenInfoRecord(pfoPtr);
}//Dbtup::execFSCLOSECONF() }//Dbtup::execFSCLOSECONF()
void Dbtup::execFSCLOSEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSCLOSEREF()
void Dbtup::execFSOPENCONF(Signal* signal) void Dbtup::execFSOPENCONF(Signal* signal)
{ {
PendingFileOpenInfoPtr pfoPtr; PendingFileOpenInfoPtr pfoPtr;
@ -363,12 +351,6 @@ void Dbtup::execFSOPENCONF(Signal* signal)
releasePendingFileOpenInfoRecord(pfoPtr); releasePendingFileOpenInfoRecord(pfoPtr);
}//Dbtup::execFSOPENCONF() }//Dbtup::execFSOPENCONF()
void Dbtup::execFSOPENREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSOPENREF()
void Dbtup::execFSREADCONF(Signal* signal) void Dbtup::execFSREADCONF(Signal* signal)
{ {
DiskBufferSegmentInfoPtr dbsiPtr; DiskBufferSegmentInfoPtr dbsiPtr;
@ -424,12 +406,6 @@ void Dbtup::execFSREADCONF(Signal* signal)
}//switch }//switch
}//Dbtup::execFSREADCONF() }//Dbtup::execFSREADCONF()
void Dbtup::execFSREADREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSREADREF()
void Dbtup::execFSWRITECONF(Signal* signal) void Dbtup::execFSWRITECONF(Signal* signal)
{ {
DiskBufferSegmentInfoPtr dbsiPtr; DiskBufferSegmentInfoPtr dbsiPtr;
@ -478,12 +454,6 @@ void Dbtup::execFSWRITECONF(Signal* signal)
return; return;
}//Dbtup::execFSWRITECONF() }//Dbtup::execFSWRITECONF()
void Dbtup::execFSWRITEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSWRITEREF()
void Dbtup::execCONTINUEB(Signal* signal) void Dbtup::execCONTINUEB(Signal* signal)
{ {
ljamEntry(); ljamEntry();

View file

@ -687,10 +687,3 @@ void Dbtup::execFSREMOVECONF(Signal* signal)
initTab(tabPtr.p); initTab(tabPtr.p);
}//Dbtup::execFSREMOVECONF() }//Dbtup::execFSREMOVECONF()
void Dbtup::execFSREMOVEREF(Signal* signal)
{
ljamEntry();
ndbrequire(false);
}//Dbtup::execFSREMOVEREF()

View file

@ -309,7 +309,6 @@ private:
Uint32 c_fsRemoveCount; Uint32 c_fsRemoveCount;
Uint32 c_nodeGroup; Uint32 c_nodeGroup;
void clearFilesystem(Signal* signal); void clearFilesystem(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execFSREMOVECONF(Signal* signal); void execFSREMOVECONF(Signal* signal);
NdbNodeBitmask c_allDefinedNodes; NdbNodeBitmask c_allDefinedNodes;

View file

@ -100,7 +100,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf):
addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY); addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY);
addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF); addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF);
addRecSignal(GSN_FSREMOVEREF, &Ndbcntr::execFSREMOVEREF);
addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF); addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF);
initData(); initData();

View file

@ -144,6 +144,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
const SystemError * const sysErr = (SystemError *)signal->getDataPtr(); const SystemError * const sysErr = (SystemError *)signal->getDataPtr();
char buf[100]; char buf[100];
int killingNode = refToNode(sysErr->errorRef); int killingNode = refToNode(sysErr->errorRef);
Uint32 data1 = sysErr->data1;
jamEntry(); jamEntry();
switch (sysErr->errorCode){ switch (sysErr->errorCode){
@ -178,8 +179,9 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
case SystemError::CopyFragRefError: case SystemError::CopyFragRefError:
BaseString::snprintf(buf, sizeof(buf), BaseString::snprintf(buf, sizeof(buf),
"Node %d killed this node because " "Node %d killed this node because "
"it could not copy a fragment during node restart", "it could not copy a fragment during node restart. "
killingNode); "Copy fragment error code: %u.",
killingNode, data1);
break; break;
default: default:
@ -2395,12 +2397,6 @@ Ndbcntr::clearFilesystem(Signal* signal){
c_fsRemoveCount++; c_fsRemoveCount++;
} }
void
Ndbcntr::execFSREMOVEREF(Signal* signal){
jamEntry();
ndbrequire(0);
}
void void
Ndbcntr::execFSREMOVECONF(Signal* signal){ Ndbcntr::execFSREMOVECONF(Signal* signal){
jamEntry(); jamEntry();
@ -2497,6 +2493,14 @@ void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){
const Uint32 start = currentBlockIndex; const Uint32 start = currentBlockIndex;
if (currentStartPhase == ZSTART_PHASE_6)
{
// Ndbd has passed the critical startphases.
// Change error handler from "startup" state
// to normal state.
ErrorReporter::setErrorHandlerShutdownType();
}
for(; currentBlockIndex < ALL_BLOCKS_SZ; currentBlockIndex++){ for(; currentBlockIndex < ALL_BLOCKS_SZ; currentBlockIndex++){
jam(); jam();
if(ALL_BLOCKS[currentBlockIndex].NextSP == currentStartPhase){ if(ALL_BLOCKS[currentBlockIndex].NextSP == currentStartPhase){

View file

@ -152,6 +152,14 @@ ErrorReporter::formatMessage(ErrorCategory type,
return; return;
} }
NdbShutdownType ErrorReporter::s_errorHandlerShutdownType = NST_ErrorHandler;
void
ErrorReporter::setErrorHandlerShutdownType(NdbShutdownType nst)
{
s_errorHandlerShutdownType = nst;
}
void void
ErrorReporter::handleAssert(const char* message, const char* file, int line) ErrorReporter::handleAssert(const char* message, const char* file, int line)
{ {
@ -170,7 +178,7 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line)
WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage, WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage,
theEmulatedJamIndex, theEmulatedJam); theEmulatedJamIndex, theEmulatedJam);
NdbShutdown(NST_ErrorHandler); NdbShutdown(s_errorHandlerShutdownType);
} }
void void
@ -182,7 +190,7 @@ ErrorReporter::handleThreadAssert(const char* message,
BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d - %s", BaseString::snprintf(refMessage, 100, "file: %s lineNo: %d - %s",
file, line, message); file, line, message);
NdbShutdown(NST_ErrorHandler); NdbShutdown(s_errorHandlerShutdownType);
}//ErrorReporter::handleThreadAssert() }//ErrorReporter::handleThreadAssert()
@ -201,6 +209,8 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
if(messageID == ERR_ERROR_INSERT){ if(messageID == ERR_ERROR_INSERT){
NdbShutdown(NST_ErrorInsert); NdbShutdown(NST_ErrorInsert);
} else { } else {
if (nst == NST_ErrorHandler)
nst = s_errorHandlerShutdownType;
NdbShutdown(nst); NdbShutdown(nst);
} }
} }

View file

@ -26,6 +26,7 @@
class ErrorReporter class ErrorReporter
{ {
public: public:
static void setErrorHandlerShutdownType(NdbShutdownType nst = NST_ErrorHandler);
static void handleAssert(const char* message, static void handleAssert(const char* message,
const char* file, const char* file,
int line); int line);
@ -57,6 +58,7 @@ public:
static const char* formatTimeStampString(); static const char* formatTimeStampString();
private: private:
static enum NdbShutdownType s_errorHandlerShutdownType;
}; };
#endif #endif

View file

@ -45,8 +45,14 @@ extern NdbMutex * theShutdownMutex;
void catchsigs(bool ignore); // for process signal handling void catchsigs(bool ignore); // for process signal handling
#define MAX_FAILED_STARTUPS 3
// Flag set by child through SIGUSR1 to signal a failed startup
static bool failed_startup_flag = false;
// Counter for consecutive failed startups
static Uint32 failed_startups = 0;
extern "C" void handler_shutdown(int signum); // for process signal handling extern "C" void handler_shutdown(int signum); // for process signal handling
extern "C" void handler_error(int signum); // for process signal handling extern "C" void handler_error(int signum); // for process signal handling
extern "C" void handler_sigusr1(int signum); // child signalling failed restart
// Shows system information // Shows system information
void systemInfo(const Configuration & conf, void systemInfo(const Configuration & conf,
@ -57,7 +63,7 @@ int main(int argc, char** argv)
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
// Print to stdout/console // Print to stdout/console
g_eventLogger.createConsoleHandler(); g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("NDB"); g_eventLogger.setCategory("ndbd");
g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL); g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING); g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
@ -92,6 +98,8 @@ int main(int argc, char** argv)
} }
#ifndef NDB_WIN32 #ifndef NDB_WIN32
signal(SIGUSR1, handler_sigusr1);
for(pid_t child = fork(); child != 0; child = fork()){ for(pid_t child = fork(); child != 0; child = fork()){
/** /**
* Parent * Parent
@ -137,6 +145,20 @@ int main(int argc, char** argv)
*/ */
exit(0); exit(0);
} }
if (!failed_startup_flag)
{
// Reset the counter for consecutive failed startups
failed_startups = 0;
}
else if (failed_startups >= MAX_FAILED_STARTUPS && !theConfig->stopOnError())
{
/**
* Error shutdown && stopOnError()
*/
g_eventLogger.alert("Ndbd has failed %u consecutive startups. Not restarting", failed_startups);
exit(0);
}
failed_startup_flag = false;
g_eventLogger.info("Ndb has terminated (pid %d) restarting", child); g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
theConfig->fetch_configuration(); theConfig->fetch_configuration();
} }
@ -170,6 +192,9 @@ int main(int argc, char** argv)
/** /**
* Do startup * Do startup
*/ */
ErrorReporter::setErrorHandlerShutdownType(NST_ErrorHandlerStartup);
switch(globalData.theRestartFlag){ switch(globalData.theRestartFlag){
case initial_state: case initial_state:
globalEmulatorData.theThreadConfig->doStart(NodeState::SL_CMVMI); globalEmulatorData.theThreadConfig->doStart(NodeState::SL_CMVMI);
@ -359,3 +384,15 @@ handler_error(int signum){
BaseString::snprintf(errorData, 40, "Signal %d received", signum); BaseString::snprintf(errorData, 40, "Signal %d received", signum);
ERROR_SET_SIGNAL(fatal, 0, errorData, __FILE__); ERROR_SET_SIGNAL(fatal, 0, errorData, __FILE__);
} }
extern "C"
void
handler_sigusr1(int signum)
{
if (!failed_startup_flag)
{
failed_startups++;
failed_startup_flag = true;
}
g_eventLogger.info("Received signal %d. Ndbd failed startup (%u).", signum, failed_startups);
}

View file

@ -30,13 +30,16 @@
#include <NodeState.hpp> #include <NodeState.hpp>
#include <NdbMem.h> #include <NdbMem.h>
#include <NdbOut.hpp>
#include <NdbMutex.h> #include <NdbMutex.h>
#include <NdbSleep.h> #include <NdbSleep.h>
#include <EventLogger.hpp>
extern "C" { extern "C" {
extern void (* ndb_new_handler)(); extern void (* ndb_new_handler)();
} }
extern EventLogger g_eventLogger;
extern my_bool opt_core;
/** /**
* Declare the global variables * Declare the global variables
@ -141,45 +144,50 @@ NdbShutdown(NdbShutdownType type,
switch(type){ switch(type){
case NST_Normal: case NST_Normal:
ndbout << "Shutdown initiated" << endl; g_eventLogger.info("Shutdown initiated");
break; break;
case NST_Watchdog: case NST_Watchdog:
ndbout << "Watchdog " << shutting << " system" << endl; g_eventLogger.info("Watchdog %s system", shutting);
break; break;
case NST_ErrorHandler: case NST_ErrorHandler:
ndbout << "Error handler " << shutting << " system" << endl; g_eventLogger.info("Error handler %s system", shutting);
break; break;
case NST_ErrorHandlerSignal: case NST_ErrorHandlerSignal:
ndbout << "Error handler signal " << shutting << " system" << endl; g_eventLogger.info("Error handler signal %s system", shutting);
break;
case NST_ErrorHandlerStartup:
g_eventLogger.info("Error handler startup %s system", shutting);
break; break;
case NST_Restart: case NST_Restart:
ndbout << "Restarting system" << endl; g_eventLogger.info("Restarting system");
break; break;
default: default:
ndbout << "Error handler " << shutting << " system" g_eventLogger.info("Error handler %s system (unknown type: %u)",
<< " (unknown type: " << (unsigned)type << ")" << endl; shutting, (unsigned)type);
type = NST_ErrorHandler; type = NST_ErrorHandler;
break; break;
} }
const char * exitAbort = 0; const char * exitAbort = 0;
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) if (opt_core)
exitAbort = "aborting"; exitAbort = "aborting";
#else else
exitAbort = "exiting"; exitAbort = "exiting";
#endif
if(type == NST_Watchdog){ if(type == NST_Watchdog){
/** /**
* Very serious, don't attempt to free, just die!! * Very serious, don't attempt to free, just die!!
*/ */
ndbout << "Watchdog shutdown completed - " << exitAbort << endl; g_eventLogger.info("Watchdog shutdown completed - %s", exitAbort);
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) if (opt_core)
signal(6, SIG_DFL); {
abort(); signal(6, SIG_DFL);
#else abort();
exit(-1); }
#endif else
{
exit(-1);
}
} }
#ifndef NDB_WIN32 #ifndef NDB_WIN32
@ -227,13 +235,19 @@ NdbShutdown(NdbShutdownType type,
} }
if(type != NST_Normal && type != NST_Restart){ if(type != NST_Normal && type != NST_Restart){
ndbout << "Error handler shutdown completed - " << exitAbort << endl; // Signal parent that error occured during startup
#if ( defined VM_TRACE || defined ERROR_INSERT ) && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) if (type == NST_ErrorHandlerStartup)
signal(6, SIG_DFL); kill(getppid(), SIGUSR1);
abort(); g_eventLogger.info("Error handler shutdown completed - %s", exitAbort);
#else if (opt_core)
exit(-1); {
#endif signal(6, SIG_DFL);
abort();
}
else
{
exit(-1);
}
} }
/** /**
@ -243,7 +257,7 @@ NdbShutdown(NdbShutdownType type,
exit(restartType); exit(restartType);
} }
ndbout << "Shutdown completed - exiting" << endl; g_eventLogger.info("Shutdown completed - exiting");
} else { } else {
/** /**
* Shutdown is already in progress * Shutdown is already in progress
@ -253,7 +267,7 @@ NdbShutdown(NdbShutdownType type,
* If this is the watchdog, kill system the hard way * If this is the watchdog, kill system the hard way
*/ */
if (type== NST_Watchdog){ if (type== NST_Watchdog){
ndbout << "Watchdog is killing system the hard way" << endl; g_eventLogger.info("Watchdog is killing system the hard way");
#if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) ) #if defined VM_TRACE && ( ! ( defined NDB_OSE || defined NDB_SOFTOSE) )
signal(6, SIG_DFL); signal(6, SIG_DFL);
abort(); abort();

View file

@ -83,7 +83,8 @@ enum NdbShutdownType {
NST_ErrorHandler, NST_ErrorHandler,
NST_ErrorHandlerSignal, NST_ErrorHandlerSignal,
NST_Restart, NST_Restart,
NST_ErrorInsert NST_ErrorInsert,
NST_ErrorHandlerStartup
}; };
enum NdbRestartType { enum NdbRestartType {

View file

@ -29,6 +29,7 @@
#include <signaldata/EventReport.hpp> #include <signaldata/EventReport.hpp>
#include <signaldata/ContinueFragmented.hpp> #include <signaldata/ContinueFragmented.hpp>
#include <signaldata/NodeStateSignalData.hpp> #include <signaldata/NodeStateSignalData.hpp>
#include <signaldata/FsRef.hpp>
#include <DebuggerNames.hpp> #include <DebuggerNames.hpp>
#include "LongSignal.hpp" #include "LongSignal.hpp"
@ -140,6 +141,13 @@ SimulatedBlock::installSimulatedBlockFunctions(){
a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF; a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF;
a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF; a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF;
a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ; a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ;
a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF;
a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF;
a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF;
a[GSN_FSREADREF] = &SimulatedBlock::execFSREADREF;
a[GSN_FSREMOVEREF] = &SimulatedBlock::execFSREMOVEREF;
a[GSN_FSSYNCREF] = &SimulatedBlock::execFSSYNCREF;
a[GSN_FSAPPENDREF] = &SimulatedBlock::execFSAPPENDREF;
} }
void void
@ -1781,6 +1789,61 @@ SimulatedBlock::execUPGRADE(Signal* signal){
} }
} }
void
SimulatedBlock::fsRefError(Signal* signal, Uint32 line, const char *msg)
{
const FsRef *fsRef = (FsRef*)signal->getDataPtr();
Uint32 errorCode = fsRef->errorCode;
Uint32 osErrorCode = fsRef->osErrorCode;
char msg2[100];
sprintf(msg2, "%s: %s. OS errno: %u", getBlockName(number()), msg, osErrorCode);
progError(line, errorCode, msg2);
}
void
SimulatedBlock::execFSWRITEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system write failed");
}
void
SimulatedBlock::execFSREADREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system read failed");
}
void
SimulatedBlock::execFSCLOSEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system close failed");
}
void
SimulatedBlock::execFSOPENREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system open failed");
}
void
SimulatedBlock::execFSREMOVEREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system remove failed");
}
void
SimulatedBlock::execFSSYNCREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system sync failed");
}
void
SimulatedBlock::execFSAPPENDREF(Signal* signal)
{
fsRefError(signal, __LINE__, "File system append failed");
}
#ifdef VM_TRACE #ifdef VM_TRACE
void void
SimulatedBlock::clear_global_variables(){ SimulatedBlock::clear_global_variables(){

View file

@ -487,6 +487,15 @@ private:
protected: protected:
void execUPGRADE(Signal* signal); void execUPGRADE(Signal* signal);
void fsRefError(Signal* signal, Uint32 line, const char *msg);
void execFSWRITEREF(Signal* signal);
void execFSREADREF(Signal* signal);
void execFSOPENREF(Signal* signal);
void execFSCLOSEREF(Signal* signal);
void execFSREMOVEREF(Signal* signal);
void execFSSYNCREF(Signal* signal);
void execFSAPPENDREF(Signal* signal);
// Variable for storing inserted errors, see pc.H // Variable for storing inserted errors, see pc.H
ERROR_INSERT_VARIABLE; ERROR_INSERT_VARIABLE;

View file

@ -1909,47 +1909,54 @@ CommandInterpreter::executeEventReporting(int processId,
return; return;
} }
BaseString tmp(parameters); BaseString tmp(parameters);
Vector<BaseString> spec; Vector<BaseString> specs;
tmp.split(spec, "="); tmp.split(specs, " ");
if(spec.size() != 2){
ndbout << "Invalid loglevel specification: " << parameters << endl;
return;
}
spec[0].trim().ndb_toupper(); for (int i=0; i < specs.size(); i++)
int category = ndb_mgm_match_event_category(spec[0].c_str()); {
if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ Vector<BaseString> spec;
if(!convert(spec[0].c_str(), category) || specs[i].split(spec, "=");
category < NDB_MGM_MIN_EVENT_CATEGORY || if(spec.size() != 2){
category > NDB_MGM_MAX_EVENT_CATEGORY){ ndbout << "Invalid loglevel specification: " << specs[i] << endl;
ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; continue;
return; }
spec[0].trim().ndb_toupper();
int category = ndb_mgm_match_event_category(spec[0].c_str());
if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){
if(!convert(spec[0].c_str(), category) ||
category < NDB_MGM_MIN_EVENT_CATEGORY ||
category > NDB_MGM_MAX_EVENT_CATEGORY){
ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl;
continue;
}
}
int level;
if (!convert(spec[1].c_str(),level))
{
ndbout << "Invalid level: " << spec[1].c_str() << endl;
continue;
}
ndbout << "Executing CLUSTERLOG " << spec[0] << "=" << spec[1]
<< " on node " << processId << flush;
struct ndb_mgm_reply reply;
int result;
result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv,
processId,
(ndb_mgm_event_category)category,
level,
&reply);
if (result != 0) {
ndbout_c(" failed.");
printError();
} else {
ndbout_c(" OK!");
} }
} }
int level;
if (!convert(spec[1].c_str(),level))
{
ndbout << "Invalid level: " << spec[1].c_str() << endl;
return;
}
ndbout << "Executing CLUSTERLOG on node " << processId << flush;
struct ndb_mgm_reply reply;
int result;
result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv,
processId,
(ndb_mgm_event_category)category,
level,
&reply);
if (result != 0) {
ndbout_c(" failed.");
printError();
} else {
ndbout_c(" OK!");
}
} }
/***************************************************************************** /*****************************************************************************

View file

@ -25,6 +25,7 @@
#include <m_string.h> #include <m_string.h>
extern my_bool opt_ndb_shm; extern my_bool opt_ndb_shm;
extern my_bool opt_core;
#define MAX_LINE_LENGTH 255 #define MAX_LINE_LENGTH 255
#define KEY_INTERNAL 0 #define KEY_INTERNAL 0
@ -2136,7 +2137,16 @@ const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo);
/**************************************************************************** /****************************************************************************
* Ctor * Ctor
****************************************************************************/ ****************************************************************************/
static void require(bool v) { if(!v) abort();} static void require(bool v)
{
if(!v)
{
if (opt_core)
abort();
else
exit(-1);
}
}
ConfigInfo::ConfigInfo() ConfigInfo::ConfigInfo()
: m_info(true), m_systemDefaults(true) : m_info(true), m_systemDefaults(true)
@ -2204,7 +2214,7 @@ ConfigInfo::ConfigInfo()
ndbout << "Error: Parameter " << param._fname ndbout << "Error: Parameter " << param._fname
<< " defined twice in section " << param._section << " defined twice in section " << param._section
<< "." << endl; << "." << endl;
exit(-1); require(false);
} }
// Add new pinfo to section // Add new pinfo to section
@ -2254,7 +2264,7 @@ ConfigInfo::ConfigInfo()
ndbout << "Check that each entry has a section failed." << endl; ndbout << "Check that each entry has a section failed." << endl;
ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl; ndbout << "Parameter \"" << m_ParamInfo[i]._fname << endl;
ndbout << "Edit file " << __FILE__ << "." << endl; ndbout << "Edit file " << __FILE__ << "." << endl;
exit(-1); require(false);
} }
if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION) if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION)
@ -2267,7 +2277,7 @@ ConfigInfo::ConfigInfo()
<< "\" does not exist in section \"" << "\" does not exist in section \""
<< m_ParamInfo[i]._section << "\"." << endl; << m_ParamInfo[i]._section << "\"." << endl;
ndbout << "Edit file " << __FILE__ << "." << endl; ndbout << "Edit file " << __FILE__ << "." << endl;
exit(-1); require(false);
} }
} }
} }
@ -2277,7 +2287,7 @@ ConfigInfo::ConfigInfo()
****************************************************************************/ ****************************************************************************/
inline void warning(const char * src, const char * arg){ inline void warning(const char * src, const char * arg){
ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl;
abort(); require(false);
} }
const Properties * const Properties *
@ -3394,7 +3404,7 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){
} }
case PropertiesType_Properties: case PropertiesType_Properties:
default: default:
abort(); ::require(false);
} }
} }
return true; return true;
@ -3406,7 +3416,7 @@ static bool
saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
const Properties * sec; const Properties * sec;
if(!ctx.m_currentInfo->get(ctx.fname, &sec)){ if(!ctx.m_currentInfo->get(ctx.fname, &sec)){
abort(); require(false);
return false; return false;
} }
@ -3477,7 +3487,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){
break; break;
} }
default: default:
abort(); require(false);
} }
require(ok); require(ok);
} }

View file

@ -65,6 +65,18 @@
extern int global_flag_send_heartbeat_now; extern int global_flag_send_heartbeat_now;
extern int g_no_nodeid_checks; extern int g_no_nodeid_checks;
extern my_bool opt_core;
static void require(bool v)
{
if(!v)
{
if (opt_core)
abort();
else
exit(-1);
}
}
void * void *
MgmtSrvr::logLevelThread_C(void* m) MgmtSrvr::logLevelThread_C(void* m)
@ -436,14 +448,14 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
if (tmp_nodeid == 0) if (tmp_nodeid == 0)
{ {
ndbout_c(m_config_retriever->getErrorString()); ndbout_c(m_config_retriever->getErrorString());
exit(-1); require(false);
} }
// read config from other managent server // read config from other managent server
_config= fetchConfig(); _config= fetchConfig();
if (_config == 0) if (_config == 0)
{ {
ndbout << m_config_retriever->getErrorString() << endl; ndbout << m_config_retriever->getErrorString() << endl;
exit(-1); require(false);
} }
_ownNodeId= tmp_nodeid; _ownNodeId= tmp_nodeid;
} }
@ -454,7 +466,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
_config= readConfig(); _config= readConfig();
if (_config == 0) { if (_config == 0) {
ndbout << "Unable to read config file" << endl; ndbout << "Unable to read config file" << endl;
exit(-1); require(false);
} }
} }
@ -511,7 +523,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
if ((m_node_id_mutex = NdbMutex_Create()) == 0) if ((m_node_id_mutex = NdbMutex_Create()) == 0)
{ {
ndbout << "mutex creation failed line = " << __LINE__ << endl; ndbout << "mutex creation failed line = " << __LINE__ << endl;
exit(-1); require(false);
} }
if (_ownNodeId == 0) // we did not get node id from other server if (_ownNodeId == 0) // we did not get node id from other server
@ -522,7 +534,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
0, 0, error_string)){ 0, 0, error_string)){
ndbout << "Unable to obtain requested nodeid: " ndbout << "Unable to obtain requested nodeid: "
<< error_string.c_str() << endl; << error_string.c_str() << endl;
exit(-1); require(false);
} }
_ownNodeId = tmp; _ownNodeId = tmp;
} }
@ -533,7 +545,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server,
_ownNodeId)) _ownNodeId))
{ {
ndbout << m_config_retriever->getErrorString() << endl; ndbout << m_config_retriever->getErrorString() << endl;
exit(-1); require(false);
} }
} }
@ -2203,18 +2215,18 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
iter(*(ndb_mgm_configuration *)_config->m_configValues, CFG_SECTION_NODE); iter(*(ndb_mgm_configuration *)_config->m_configValues, CFG_SECTION_NODE);
for(iter.first(); iter.valid(); iter.next()) { for(iter.first(); iter.valid(); iter.next()) {
unsigned tmp= 0; unsigned tmp= 0;
if(iter.get(CFG_NODE_ID, &tmp)) abort(); if(iter.get(CFG_NODE_ID, &tmp)) require(false);
if (*nodeId && *nodeId != tmp) if (*nodeId && *nodeId != tmp)
continue; continue;
found_matching_id= true; found_matching_id= true;
if(iter.get(CFG_TYPE_OF_SECTION, &type_c)) abort(); if(iter.get(CFG_TYPE_OF_SECTION, &type_c)) require(false);
if(type_c != (unsigned)type) if(type_c != (unsigned)type)
continue; continue;
found_matching_type= true; found_matching_type= true;
if (connected_nodes.get(tmp)) if (connected_nodes.get(tmp))
continue; continue;
found_free_node= true; found_free_node= true;
if(iter.get(CFG_NODE_HOST, &config_hostname)) abort(); if(iter.get(CFG_NODE_HOST, &config_hostname)) require(false);
if (config_hostname && config_hostname[0] == 0) if (config_hostname && config_hostname[0] == 0)
config_hostname= 0; config_hostname= 0;
else if (client_addr) { else if (client_addr) {
@ -2561,7 +2573,7 @@ MgmtSrvr::backupCallback(BackupEvent & event)
int int
MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted) MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted)
{ {
abort(); require(false);
return 0; return 0;
} }
@ -2715,7 +2727,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
ndbout_c("Updating node %d param: %d to %s", node, param, val_char); ndbout_c("Updating node %d param: %d to %s", node, param, val_char);
break; break;
default: default:
abort(); require(false);
} }
assert(res); assert(res);
} while(node == 0 && iter.next() == 0); } while(node == 0 && iter.next() == 0);

View file

@ -343,8 +343,6 @@ MgmApiSession::getConfig_old(Parser_t::Context &ctx) {
} }
#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ #endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */
inline void require(bool b){ if(!b) abort(); }
void void
MgmApiSession::getConfig(Parser_t::Context &ctx, MgmApiSession::getConfig(Parser_t::Context &ctx,
const class Properties &args) { const class Properties &args) {

View file

@ -55,9 +55,6 @@ typedef struct ErrorBundle {
#define NI ndberror_cl_function_not_implemented #define NI ndberror_cl_function_not_implemented
#define UE ndberror_cl_unknown_error_code #define UE ndberror_cl_unknown_error_code
static const char REDO_BUFFER_MSG[]=
"REDO log buffers overloaded, consult online manual (increase RedoBuffer, and|or decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)";
static const char* empty_string = ""; static const char* empty_string = "";
/* /*
@ -164,8 +161,9 @@ ErrorBundle ErrorCodes[] = {
{ 830, TR, "Out of add fragment operation records" }, { 830, TR, "Out of add fragment operation records" },
{ 873, TR, "Out of attrinfo records for scan in tuple manager" }, { 873, TR, "Out of attrinfo records for scan in tuple manager" },
{ 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, { 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" },
{ 1220, TR, REDO_BUFFER_MSG }, { 1220, TR, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" },
{ 1222, TR, "Out of transaction markers in LQH" }, { 1222, TR, "Out of transaction markers in LQH" },
{ 1224, TR, "Out of Send Buffer space in LQH" },
{ 4021, TR, "Out of Send Buffer space in NDB API" }, { 4021, TR, "Out of Send Buffer space in NDB API" },
{ 4022, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" },
{ 4032, TR, "Out of Send Buffer space in NDB API" }, { 4032, TR, "Out of Send Buffer space in NDB API" },
@ -194,10 +192,10 @@ ErrorBundle ErrorCodes[] = {
/** /**
* OverloadError * OverloadError
*/ */
{ 410, OL, REDO_BUFFER_MSG }, { 410, OL, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" },
{ 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" }, { 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" },
{ 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" }, { 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" },
{ 1221, OL, REDO_BUFFER_MSG }, { 1221, OL, "REDO buffers overloaded, consult online manual (increase RedoBuffer)" },
{ 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" }, { 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" },

View file

@ -30,7 +30,7 @@ ndb_restore_SOURCES = restore/restore_main.cpp \
restore/consumer.cpp \ restore/consumer.cpp \
restore/consumer_restore.cpp \ restore/consumer_restore.cpp \
restore/consumer_printer.cpp \ restore/consumer_printer.cpp \
restore/Restore.cpp restore/Restore.cpp $(tools_common_sources)
ndb_config_SOURCES = ndb_config.cpp \ ndb_config_SOURCES = ndb_config.cpp \
../src/mgmsrv/Config.cpp \ ../src/mgmsrv/Config.cpp \

View file

@ -42,6 +42,7 @@ static const char * g_field_delimiter=",";
static const char * g_row_delimiter=" "; static const char * g_row_delimiter=" ";
int g_print_full_config, opt_ndb_shm; int g_print_full_config, opt_ndb_shm;
my_bool opt_core;
typedef ndb_mgm_configuration_iterator Iter; typedef ndb_mgm_configuration_iterator Iter;

View file

@ -14,9 +14,12 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NDBT_ReturnCodes.h>
#include "consumer_restore.hpp" #include "consumer_restore.hpp"
#include <NdbSleep.h> #include <NdbSleep.h>
extern my_bool opt_core;
extern FilteredNdbOut err; extern FilteredNdbOut err;
extern FilteredNdbOut info; extern FilteredNdbOut info;
extern FilteredNdbOut debug; extern FilteredNdbOut debug;
@ -458,7 +461,11 @@ bool BackupRestore::errorHandler(restore_callback_t *cb)
void BackupRestore::exitHandler() void BackupRestore::exitHandler()
{ {
release(); release();
exit(-1); NDBT_ProgramExit(NDBT_FAILED);
if (opt_core)
abort();
else
exit(NDBT_FAILED);
} }
@ -492,7 +499,7 @@ BackupRestore::logEntry(const LogEntry & tup)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
err << "Cannot start transaction" << endl; err << "Cannot start transaction" << endl;
exit(-1); exitHandler();
} // if } // if
const NdbDictionary::Table * table = get_table(tup.m_table->m_dictTable); const NdbDictionary::Table * table = get_table(tup.m_table->m_dictTable);
@ -500,7 +507,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (op == NULL) if (op == NULL)
{ {
err << "Cannot get operation: " << trans->getNdbError() << endl; err << "Cannot get operation: " << trans->getNdbError() << endl;
exit(-1); exitHandler();
} // if } // if
int check = 0; int check = 0;
@ -518,13 +525,13 @@ BackupRestore::logEntry(const LogEntry & tup)
default: default:
err << "Log entry has wrong operation type." err << "Log entry has wrong operation type."
<< " Exiting..."; << " Exiting...";
exit(-1); exitHandler();
} }
if (check != 0) if (check != 0)
{ {
err << "Error defining op: " << trans->getNdbError() << endl; err << "Error defining op: " << trans->getNdbError() << endl;
exit(-1); exitHandler();
} // if } // if
Bitmask<4096> keys; Bitmask<4096> keys;
@ -553,7 +560,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (check != 0) if (check != 0)
{ {
err << "Error defining op: " << trans->getNdbError() << endl; err << "Error defining op: " << trans->getNdbError() << endl;
exit(-1); exitHandler();
} // if } // if
} }
@ -582,7 +589,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (!ok) if (!ok)
{ {
err << "execute failed: " << errobj << endl; err << "execute failed: " << errobj << endl;
exit(-1); exitHandler();
} }
} }
@ -629,7 +636,7 @@ BackupRestore::tuple(const TupleS & tup)
{ {
// Deep shit, TODO: handle the error // Deep shit, TODO: handle the error
ndbout << "Cannot start transaction" << endl; ndbout << "Cannot start transaction" << endl;
exit(-1); exitHandler();
} // if } // if
const TableS * table = tup.getTable(); const TableS * table = tup.getTable();
@ -638,7 +645,7 @@ BackupRestore::tuple(const TupleS & tup)
{ {
ndbout << "Cannot get operation: "; ndbout << "Cannot get operation: ";
ndbout << trans->getNdbError() << endl; ndbout << trans->getNdbError() << endl;
exit(-1); exitHandler();
} // if } // if
// TODO: check return value and handle error // TODO: check return value and handle error
@ -646,7 +653,7 @@ BackupRestore::tuple(const TupleS & tup)
{ {
ndbout << "writeTuple call failed: "; ndbout << "writeTuple call failed: ";
ndbout << trans->getNdbError() << endl; ndbout << trans->getNdbError() << endl;
exit(-1); exitHandler();
} // if } // if
for (int i = 0; i < tup.getNoOfAttributes(); i++) for (int i = 0; i < tup.getNoOfAttributes(); i++)
@ -680,7 +687,7 @@ BackupRestore::tuple(const TupleS & tup)
{ {
ndbout << "execute failed: "; ndbout << "execute failed: ";
ndbout << trans->getNdbError() << endl; ndbout << trans->getNdbError() << endl;
exit(-1); exitHandler();
} }
m_ndb->closeTransaction(trans); m_ndb->closeTransaction(trans);
if (ret == 0) if (ret == 0)

Some files were not shown because too many files have changed in this diff Show more