Merge mysql.com:/home/jimw/my/mysql-4.1-12302

into  mysql.com:/home/jimw/my/mysql-4.1-clean
This commit is contained in:
jimw@mysql.com 2005-08-24 08:50:12 -07:00
commit 006e5b770b
26 changed files with 313 additions and 3481 deletions

View file

@ -42,8 +42,8 @@ RSC=rc.exe
# PROP Output_Dir ".\debug"
# PROP Intermediate_Dir ".\debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /FD /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /FD /c /GX
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "_DEBUG"
@ -67,8 +67,8 @@ LINK32=link.exe
# PROP Output_Dir ".\classic"
# PROP Intermediate_Dir ".\classic"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /FD /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /FD /c /GX
# ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG"
@ -92,8 +92,8 @@ LINK32=link.exe
# PROP Output_Dir ".\release"
# PROP Intermediate_Dir ".\release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /FD /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /FD /c /GX
# ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG"

View file

@ -41,8 +41,8 @@ RSC=rc.exe
# PROP Output_Dir ".\Debug"
# PROP Intermediate_Dir ".\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /FD /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /FD /c /GX
# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033
@ -66,8 +66,8 @@ LINK32=link.exe
# PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /FD /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /FD /c /GX
# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32
# ADD BASE RSC /l 1033

View file

@ -49,7 +49,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@ -75,7 +75,7 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "HAVE_EXAMPLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@ -102,7 +102,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MT /W3 /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D "DBUG_OFF" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@ -130,7 +130,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "HAVE_EXAMPLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-nt-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@ -159,7 +159,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "USE_SYMDIR" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "HAVE_BERKELEY_DB" /D "HAVE_BLACKHOLE_DB" /D "HAVE_EXAMPLE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-max /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@ -215,7 +215,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /D MYSQL_SERVER_SUFFIX=-pro /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "MYSQL_SERVER" /D LICENSE=Commercial /D "_MBCS" /D "HAVE_DLOPEN" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D "DBUG_OFF" /D "NDEBUG" /D "_WINDOWS" /D "_CONSOLE" /D MYSQL_SERVER_SUFFIX=-pro /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -272,7 +272,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "DBUG_OFF" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "USE_SYMDIR" /D "HAVE_DLOPEN" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D LICENSE=Commercial /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-pro-nt /FD
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../regex" /I "../zlib" /D "__NT__" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "HAVE_ARCHIVE_DB" /D LICENSE=Commercial /D "NDEBUG" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /D MYSQL_SERVER_SUFFIX=-pro-nt /FD
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@ -451,6 +451,14 @@ SOURCE=.\gstream.cpp
# End Source File
# Begin Source File
SOURCE=.\examples\ha_archive.cpp
# End Source File
# Begin Source File
SOURCE=.\examples\ha_example.cpp
# End Source File
# Begin Source File
SOURCE=.\ha_blackhole.cpp
# End Source File
# Begin Source File

View file

@ -3281,7 +3281,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/src/kernel/blocks/backup/Makefile dnl
ndb/src/kernel/blocks/dbutil/Makefile dnl
ndb/src/kernel/blocks/suma/Makefile dnl
ndb/src/kernel/blocks/grep/Makefile dnl
ndb/src/kernel/blocks/dbtux/Makefile dnl
ndb/src/kernel/vm/Makefile dnl
ndb/src/mgmapi/Makefile dnl

View file

@ -0,0 +1,4 @@
--require r/lowercase0.require
--disable_query_log;
show variables like "lower_case_%";
--enable_query_log;

View file

@ -576,15 +576,19 @@ set @arg00= 9223372036854775807 ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
set @arg00= '9223372036854775807' ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
# Use the minimum BIGINT from the manual
#
@ -592,15 +596,19 @@ set @arg00= -9223372036854775808 ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
set @arg00= '-9223372036854775808' ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
# Numeric overflow of columns(c1, c2, c3, c4, c5, c12) with type not in
@ -610,8 +618,10 @@ set @arg00= 1.11111111111111111111e+50 ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
# Attention: The columns(c1,c2,c3,c4,c5,c6) do not get the overflow,
# because the string is treated as written integer and
@ -620,15 +630,19 @@ set @arg00= '1.11111111111111111111e+50' ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
# Attention: The columns(c1,c2,c3,c4,c5,c6) do not get the overflow,
# because the string is treated as written integer and
@ -637,8 +651,10 @@ set @arg00= '-1.11111111111111111111e+50' ;
execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00,
@arg00, @arg00, @arg00, @arg00, @arg00 ;
--vertical_results
--replace_result e+0 e+
execute my_select ;
--horizontal_results
--replace_result e+0 e+
execute my_delete ;
########################## test of string types ##########################

View file

@ -185,10 +185,6 @@ sub spawn_parent_impl {
if ( $mode eq 'run' or $mode eq 'test' )
{
my $exit_value= -1;
# my $signal_num= 0;
# my $dumped_core= 0;
if ( $mode eq 'run' )
{
# Simple run of command, we wait for it to return
@ -199,12 +195,7 @@ sub spawn_parent_impl {
mtr_error("$path ($pid) got lost somehow");
}
$exit_value= $?;
# $exit_value= $? >> 8;
# $signal_num= $? & 127;
# $dumped_core= $? & 128;
return $exit_value;
return mtr_process_exit_status($?);
}
else
{
@ -218,6 +209,8 @@ sub spawn_parent_impl {
# FIXME is this as it should be? Can't mysqld terminate
# normally from running a test case?
my $exit_value= -1;
my $saved_exit_value;
my $ret_pid; # What waitpid() returns
while ( ($ret_pid= waitpid(-1,0)) != -1 )
@ -227,13 +220,28 @@ sub spawn_parent_impl {
# but not $exit_value, this is flagged from
#
my $timer_name= mtr_timer_timeout($::glob_timers, $ret_pid);
if ( $timer_name )
{
if ( $timer_name eq "suite" )
{
# We give up here
# FIXME we should only give up the suite, not all of the run?
print STDERR "\n";
mtr_error("Test suite timeout");
}
elsif ( $timer_name eq "testcase" )
{
$saved_exit_value= 63; # Mark as timeout
kill(9, $pid); # Kill mysqltest
next; # Go on and catch the termination
}
}
if ( $ret_pid == $pid )
{
# We got termination of mysqltest, we are done
$exit_value= $?;
# $exit_value= $? >> 8;
# $signal_num= $? & 127;
# $dumped_core= $? & 128;
$exit_value= mtr_process_exit_status($?);
last;
}
@ -281,7 +289,7 @@ sub spawn_parent_impl {
}
}
return $exit_value;
return $saved_exit_value || $exit_value;
}
}
else
@ -292,6 +300,23 @@ sub spawn_parent_impl {
}
# ----------------------------------------------------------------------
# We try to emulate how an Unix shell calculates the exit code
# ----------------------------------------------------------------------
sub mtr_process_exit_status {
my $raw_status= shift;
if ( $raw_status & 127 )
{
return ($raw_status & 127) + 128; # Signal num + 128
}
else
{
return $raw_status >> 8; # Exit code
}
}
##############################################################################
#
@ -331,7 +356,7 @@ sub mtr_kill_leftovers () {
});
}
mtr_mysqladmin_shutdown(\@args);
mtr_mysqladmin_shutdown(\@args, 20);
# We now have tried to terminate nice. We have waited for the listen
# port to be free, but can't really tell if the mysqld process died
@ -441,7 +466,8 @@ sub mtr_stop_mysqld_servers ($) {
# First try nice normal shutdown using 'mysqladmin'
# ----------------------------------------------------------------------
mtr_mysqladmin_shutdown($spec);
# Shutdown time must be high as slave may be in reconnect
mtr_mysqladmin_shutdown($spec, 70);
# ----------------------------------------------------------------------
# We loop with waitpid() nonblocking to see how many of the ones we
@ -591,8 +617,9 @@ sub mtr_stop_mysqld_servers ($) {
#
##############################################################################
sub mtr_mysqladmin_shutdown () {
sub mtr_mysqladmin_shutdown {
my $spec= shift;
my $adm_shutdown_tmo= shift;
my %mysql_admin_pids;
my @to_kill_specs;
@ -631,7 +658,7 @@ sub mtr_mysqladmin_shutdown () {
mtr_add_arg($args, "--protocol=tcp"); # Needed if no --socket
}
mtr_add_arg($args, "--connect_timeout=5");
mtr_add_arg($args, "--shutdown_timeout=20");
mtr_add_arg($args, "--shutdown_timeout=$adm_shutdown_tmo");
mtr_add_arg($args, "shutdown");
# We don't wait for termination of mysqladmin
my $pid= mtr_spawn($::exe_mysqladmin, $args,
@ -808,11 +835,15 @@ sub sleep_until_file_created ($$$) {
# FIXME something is wrong, we sometimes terminate with "Hangup" written
# to tty, and no STDERR output telling us why.
# FIXME for some readon, setting HUP to 'IGNORE' will cause exit() to
# write out "Hangup", and maybe loose some output. We insert a sleep...
sub mtr_exit ($) {
my $code= shift;
# cluck("Called mtr_exit()");
local $SIG{HUP} = 'IGNORE';
kill('HUP', -$$);
sleep 2;
exit($code);
}

View file

@ -109,7 +109,14 @@ sub mtr_report_test_failed ($) {
my $tinfo= shift;
$tinfo->{'result'}= 'MTR_RES_FAILED';
if ( $tinfo->{'timeout'} )
{
print "[ fail ] timeout\n";
}
else
{
print "[ fail ]\n";
}
# FIXME Instead of this test, and meaningless error message in 'else'
# we should write out into $::path_timefile when the error occurs.

127
mysql-test/lib/mtr_timer.pl Normal file
View file

@ -0,0 +1,127 @@
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use Carp qw(cluck);
use Socket;
use Errno;
use strict;
#use POSIX ":sys_wait_h";
use POSIX 'WNOHANG';
sub mtr_init_timers ();
sub mtr_timer_start($$$);
sub mtr_timer_stop($$);
sub mtr_timer_waitpid($$$);
##############################################################################
#
# Initiate a structure shared by all timers
#
##############################################################################
sub mtr_init_timers () {
my $timers = { timers => {}, pids => {}};
return $timers;
}
##############################################################################
#
# Start, stop and poll a timer
#
# As alarm() isn't portable to Windows, we use separate processes to
# implement timers. That is why there is a mtr_timer_waitpid(), as this
# is where we catch a timeout.
#
##############################################################################
sub mtr_timer_start($$$) {
my ($timers,$name,$duration)= @_;
if ( exists $timers->{'timers'}->{$name} )
{
# We have an old running timer, kill it
mtr_timer_stop($timers,$name);
}
FORK:
{
my $tpid= fork();
if ( ! defined $tpid )
{
if ( $! == $!{EAGAIN} ) # See "perldoc Errno"
{
mtr_debug("Got EAGAIN from fork(), sleep 1 second and redo");
sleep(1);
redo FORK;
}
else
{
mtr_error("can't fork");
}
}
if ( $tpid )
{
# Parent, record the information
$timers->{'timers'}->{$name}->{'pid'}= $tpid;
$timers->{'timers'}->{$name}->{'duration'}= $duration;
$timers->{'pids'}->{$tpid}= $name;
}
else
{
# Child, redirect output and exec
# FIXME do we need to redirect streams?
$0= "mtr_timer(timers,$name,$duration)";
sleep($duration);
exit(0);
}
}
}
sub mtr_timer_stop ($$) {
my ($timers,$name)= @_;
if ( exists $timers->{'timers'}->{$name} )
{
my $tpid= $timers->{'timers'}->{$name}->{'pid'};
# FIXME as Cygwin reuses pids fast, maybe check that is
# the expected process somehow?!
kill(9, $tpid);
# As the timers are so simple programs, we trust them to terminate,
# and use blocking wait for it. We wait just to avoid a zombie.
waitpid($tpid,0);
delete $timers->{'timers'}->{$name}; # Remove the timer information
delete $timers->{'pids'}->{$tpid}; # and PID reference
return 1;
}
else
{
mtr_debug("Asked to stop timer \"$name\" not started");
return 0;
}
}
sub mtr_timer_timeout ($$) {
my ($timers,$pid)= @_;
return "" unless exists $timers->{'pids'}->{$pid};
# We got a timeout
my $name= $timers->{'pids'}->{$pid};
mtr_timer_stop($timers, $timers->{'timers'}->{$name});
return $name;
}
1;

View file

@ -90,6 +90,7 @@ use strict;
require "lib/mtr_cases.pl";
require "lib/mtr_process.pl";
require "lib/mtr_timer.pl";
require "lib/mtr_io.pl";
require "lib/mtr_gcov.pl";
require "lib/mtr_gprof.pl";
@ -137,6 +138,7 @@ our $glob_mysql_test_dir= undef;
our $glob_mysql_bench_dir= undef;
our $glob_hostname= undef;
our $glob_scriptname= undef;
our $glob_timers= undef;
our $glob_use_running_server= 0;
our $glob_use_running_ndbcluster= 0;
our $glob_use_embedded_server= 0;
@ -234,6 +236,8 @@ our $opt_ps_protocol;
our $opt_sleep_time_after_restart= 1;
our $opt_sleep_time_for_delete= 10;
our $opt_testcase_timeout= 5; # 5 min max
our $opt_suite_timeout= 120; # 2 hours max
our $opt_socket;
@ -435,6 +439,8 @@ sub initial_setup () {
$path_my_basedir=
$opt_source_dist ? $glob_mysql_test_dir : $glob_basedir;
$glob_timers= mtr_init_timers();
}
@ -530,6 +536,8 @@ sub command_line_setup () {
'vardir=s' => \$opt_vardir,
'verbose' => \$opt_verbose,
'wait-timeout=i' => \$opt_wait_timeout,
'testcase-timeout=i' => \$opt_testcase_timeout,
'suite-timeout=i' => \$opt_suite_timeout,
'warnings|log-warnings' => \$opt_warnings,
'with-openssl' => \$opt_with_openssl,
@ -1197,6 +1205,8 @@ sub run_suite () {
mtr_report("Finding Tests in the '$suite' suite");
mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
my $tests= collect_test_cases($suite);
mtr_report("Starting Tests in the '$suite' suite");
@ -1205,7 +1215,9 @@ sub run_suite () {
foreach my $tinfo ( @$tests )
{
mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
run_testcase($tinfo);
mtr_timer_stop($glob_timers,"testcase");
}
mtr_print_line();
@ -1226,6 +1238,8 @@ sub run_suite () {
}
mtr_report_stats($tests);
mtr_timer_stop($glob_timers,"suite");
}
@ -1523,6 +1537,11 @@ sub run_testcase ($) {
# Testcase itself tell us to skip this one
mtr_report_test_skipped($tinfo);
}
elsif ( $res == 63 )
{
$tinfo->{'timeout'}= 1; # Mark as timeout
report_failure_and_restart($tinfo);
}
else
{
# Test case failed, if in control mysqltest returns 1
@ -1657,8 +1676,6 @@ sub mysqld_arguments ($$$$$) {
my $extra_opt= shift;
my $slave_master_info= shift;
# print STDERR Dumper($extra_opt);
my $sidx= ""; # Index as string, 0 is empty string
if ( $idx > 0 )
{
@ -2026,6 +2043,7 @@ sub run_mysqltest ($) {
my $tinfo= shift;
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
"--port=$master->[0]->{'path_myport'} " .
"--socket=$master->[0]->{'path_mysock'} --password=";
if ( $opt_debug )
{
@ -2034,6 +2052,7 @@ sub run_mysqltest ($) {
}
my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " .
"--port=$master->[0]->{'path_myport'} " .
"--socket=$master->[0]->{'path_mysock'} --password=";
if ( $opt_debug )
{
@ -2262,6 +2281,10 @@ Misc options
help Get this help text
unified-diff | udiff When presenting differences, use unified diff
testcase-timeout=MINUTES Max test case run time (default 5)
suite-timeout=MINUTES Max test suite run time (default 120)
Options not yet described, or that I want to look into more
big-test
@ -2281,4 +2304,5 @@ Options not yet described, or that I want to look into more
HERE
mtr_exit(1);
}

View file

@ -120,9 +120,9 @@ DOCID DOCNAME DOCTYPEID FOLDERID AUTHOR CREATED TITLE SUBTITLE DOCABSTRACT PUBLI
c373e9f5ad07993f3859444553544200 Last Discussion c373e9f5ad079174ff17444553544200 c373e9f5ad0796c0eca4444553544200 Goldilocks 2003-06-09 11:21:06 Title: Last Discussion NULL Setting new abstract and keeping doc checked out 2003-06-09 10:51:26 2003-06-09 10:51:26 NULL NULL NULL 03eea05112b845949f3fd03278b5fe43 2003-06-09 11:21:06 admin 0 NULL Discussion NULL NULL
EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found
1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 32 test.t2.DOCID 1
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where

View file

@ -663,3 +663,22 @@ CHARSET_INFO *fs_character_set()
return fs_cset_cache;
}
#endif
/*
Transforms a string into hex form.
*/
char *bare_str_to_hex(char *to, const char *from, uint len)
{
char *p= to;
uint i;
for (i= 0; i < len; i++, p+= 2)
{
/* val[i] is char. Casting to uchar helps greatly if val[i] < 0 */
uint tmp= (uint) (uchar) from[i];
p[0]= _dig_vec_upper[tmp >> 4];
p[1]= _dig_vec_upper[tmp & 15];
}
*p= 0;
return p; /* pointer to end 0 of 'to' */
}

View file

@ -1,12 +1,16 @@
#SUBDIRS = redoLogReader
noinst_LIBRARIES = libdblqh.a
EXTRA_PROGRAMS = ndbd_redo_log_reader
libdblqh_a_SOURCES = DblqhInit.cpp DblqhMain.cpp
ndbd_redo_log_reader_SOURCES = redoLogReader/records.cpp redoLogReader/redoLogFileReader.cpp
include $(top_srcdir)/ndb/config/common.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
%::SCCS/s.%

View file

@ -1,9 +0,0 @@
include .defs.mk
BIN_TARGET := redoLogFileReader
SOURCES := records.cpp redoLogFileReader.cpp
TYPE := util
include $(NDB_TOP)/Epilogue.mk

View file

@ -40,7 +40,7 @@ Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords);
void readArguments(int argc, const char** argv);
void doExit();
FILE * f;
FILE * f= 0;
char fileName[256];
bool thePrintFlag = true;
bool theCheckFlag = true;
@ -458,7 +458,7 @@ void readArguments(int argc, const char** argv)
void doExit() {
ndbout << "Error in redoLogReader(). Exiting!" << endl;
fclose(f);
if (f) fclose(f);
delete [] redoLogPage;
exit(RETURN_ERROR);
}

File diff suppressed because it is too large Load diff

View file

@ -1,535 +0,0 @@
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef GREP_HPP
#define GREP_HPP
#include <ndb_limits.h>
#include <SimulatedBlock.hpp>
#include <NodeBitmask.hpp>
#include <SignalCounter.hpp>
#include <SLList.hpp>
#include <DLList.hpp>
#include <GrepError.hpp>
#include <GrepEvent.hpp>
#include <signaldata/EventReport.hpp>
#include <signaldata/SumaImpl.hpp>
/**
* Module in block (Should be placed elsewhere)
*/
class BlockComponent {
public:
BlockComponent(SimulatedBlock *);
BlockReference reference() { return m_sb->reference(); };
BlockNumber number() { return m_sb->number(); };
void sendSignal(NodeReceiverGroup rg,
GlobalSignalNumber gsn,
Signal* signal,
Uint32 length,
JobBufferLevel jbuf ) const {
m_sb->sendSignal(rg, gsn, signal, length, jbuf);
}
void sendSignal(BlockReference ref,
GlobalSignalNumber gsn,
Signal* signal,
Uint32 length,
JobBufferLevel jbuf ) const {
m_sb->sendSignal(ref, gsn, signal, length, jbuf);
}
void sendSignal(BlockReference ref,
GlobalSignalNumber gsn,
Signal* signal,
Uint32 length,
JobBufferLevel jbuf,
LinearSectionPtr ptr[3],
Uint32 noOfSections) const {
m_sb->sendSignal(ref, gsn, signal, length, jbuf, ptr, noOfSections);
}
void sendSignalWithDelay(BlockReference ref,
GlobalSignalNumber gsn,
Signal* signal,
Uint32 delayInMilliSeconds,
Uint32 length) const {
m_sb->sendSignalWithDelay(ref, gsn, signal, delayInMilliSeconds, length);
}
NodeId getOwnNodeId() const {
return m_sb->getOwnNodeId();
}
bool assembleFragments(Signal * signal) {
return m_sb->assembleFragments(signal);
}
void progError(int line, int err_code, const char* extra) {
m_sb->progError(line, err_code, extra);
}
private:
SimulatedBlock * m_sb;
};
/**
* Participant of GREP Protocols (not necessarily a protocol coordinator)
*
* This object is only used on primary system
*/
#if 0
class GrepParticipant : public SimulatedBlock
{
protected:
GrepParticipant(const Configuration & conf);
virtual ~GrepParticipant();
BLOCK_DEFINES(GrepParticipant);
protected:
/***************************************************************************
* SUMA Signal Interface
***************************************************************************/
void execSUB_CREATE_CONF(Signal*);
void execSUB_STARTCONF(Signal*);
void execSUB_REMOVE_CONF(Signal*);
void execSUB_META_DATA(Signal*);
void execSUB_TABLE_DATA(Signal*);
void execSUB_SYNC_CONF(Signal*);
void execSUB_GCP_COMPLETE_REP(Signal*);
void execSUB_SYNC_CONTINUE_REQ(Signal*);
/***************************************************************************
* GREP Coordinator Signal Interface
***************************************************************************/
void execGREP_CREATE_REQ(Signal*);
void execGREP_START_REQ(Signal*);
void execGREP_SYNC_REQ(Signal*);
void execGREP_REMOVE_REQ(Signal*);
protected:
BlockReference m_repRef; ///< Replication node (only one rep node per grep)
private:
BlockReference m_coordinator;
Uint32 m_latestSeenGCI;
};
#endif
/**
* GREP Coordinator
*/
class Grep : public SimulatedBlock //GrepParticipant
{
BLOCK_DEFINES(Grep);
public:
Grep(const Configuration & conf);
virtual ~Grep();
private:
/***************************************************************************
* General Signal Recivers
***************************************************************************/
void execSTTOR(Signal*);
void sendSTTORRY(Signal*);
void execNDB_STTOR(Signal*);
void execDUMP_STATE_ORD(Signal*);
void execREAD_NODESCONF(Signal*);
void execNODE_FAILREP(Signal*);
void execINCL_NODEREQ(Signal*);
void execGREP_REQ(Signal*);
void execAPI_FAILREQ(Signal*);
/**
* Forwarded to PSCoord
*/
//CONF
void fwdGREP_CREATE_CONF(Signal* s) {
pscoord.execGREP_CREATE_CONF(s); };
void fwdGREP_START_CONF(Signal* s) {
pscoord.execGREP_START_CONF(s); };
void fwdGREP_SYNC_CONF(Signal* s) {
pscoord.execGREP_SYNC_CONF(s); };
void fwdGREP_REMOVE_CONF(Signal* s) {
pscoord.execGREP_REMOVE_CONF(s); };
void fwdCREATE_SUBID_CONF(Signal* s) {
pscoord.execCREATE_SUBID_CONF(s); };
//REF
void fwdGREP_CREATE_REF(Signal* s) {
pscoord.execGREP_CREATE_REF(s); };
void fwdGREP_START_REF(Signal* s) {
pscoord.execGREP_START_REF(s); };
void fwdGREP_SYNC_REF(Signal* s) {
pscoord.execGREP_SYNC_REF(s); };
void fwdGREP_REMOVE_REF(Signal* s) {
pscoord.execGREP_REMOVE_REF(s); };
void fwdCREATE_SUBID_REF(Signal* s) {
pscoord.execCREATE_SUBID_REF(s); };
//REQ
void fwdGREP_SUB_CREATE_REQ(Signal* s) {
pscoord.execGREP_SUB_CREATE_REQ(s); };
void fwdGREP_SUB_START_REQ(Signal* s) {
pscoord.execGREP_SUB_START_REQ(s); };
void fwdGREP_SUB_SYNC_REQ(Signal* s) {
pscoord.execGREP_SUB_SYNC_REQ(s); };
void fwdGREP_SUB_REMOVE_REQ(Signal* s) {
pscoord.execGREP_SUB_REMOVE_REQ(s); };
void fwdGREP_CREATE_SUBID_REQ(Signal* s) {
pscoord.execGREP_CREATE_SUBID_REQ(s); };
/**
* Forwarded to PSPart
*/
void fwdSTART_ME(Signal* s){
pspart.execSTART_ME(s);
};
void fwdGREP_ADD_SUB_REQ(Signal* s){
pspart.execGREP_ADD_SUB_REQ(s);
};
void fwdGREP_ADD_SUB_REF(Signal* s){
pspart.execGREP_ADD_SUB_REF(s);
};
void fwdGREP_ADD_SUB_CONF(Signal* s){
pspart.execGREP_ADD_SUB_CONF(s);
};
//CONF
void fwdSUB_CREATE_CONF(Signal* s) {
pspart.execSUB_CREATE_CONF(s); };
void fwdSUB_START_CONF(Signal* s) {
pspart.execSUB_START_CONF(s); };
void fwdSUB_REMOVE_CONF(Signal* s) {
pspart.execSUB_REMOVE_CONF(s); };
void fwdSUB_SYNC_CONF(Signal* s) {
pspart.execSUB_SYNC_CONF(s); };
//REF
void fwdSUB_CREATE_REF(Signal* s) {
pspart.execSUB_CREATE_REF(s); };
void fwdSUB_START_REF(Signal* s) {
pspart.execSUB_START_REF(s); };
void fwdSUB_REMOVE_REF(Signal* s) {
pspart.execSUB_REMOVE_REF(s); };
void fwdSUB_SYNC_REF(Signal* s) {
pspart.execSUB_SYNC_REF(s); };
//REQ
void fwdSUB_SYNC_CONTINUE_REQ(Signal* s) {
pspart.execSUB_SYNC_CONTINUE_REQ(s); };
void fwdGREP_CREATE_REQ(Signal* s) {
pspart.execGREP_CREATE_REQ(s); };
void fwdGREP_START_REQ(Signal* s) {
pspart.execGREP_START_REQ(s); };
void fwdGREP_SYNC_REQ(Signal* s) {
pspart.execGREP_SYNC_REQ(s); };
void fwdGREP_REMOVE_REQ(Signal* s) {
pspart.execGREP_REMOVE_REQ(s); };
void fwdSUB_META_DATA(Signal* s) {
pspart.execSUB_META_DATA(s); };
void fwdSUB_TABLE_DATA(Signal* s) {
pspart.execSUB_TABLE_DATA(s); };
void fwdSUB_GCP_COMPLETE_REP(Signal* s) {
pspart.execSUB_GCP_COMPLETE_REP(s); };
void sendEventRep(Signal * signal,
EventReport::EventType type,
GrepEvent::Subscription event,
Uint32 subId,
Uint32 subKey,
Uint32 err,
Uint32 gci=0);
void getNodeGroupMembers(Signal* signal);
/***************************************************************************
* Block Data
***************************************************************************/
struct Node {
Uint32 nodeId;
Uint32 alive;
Uint32 nextList;
union { Uint32 prevList; Uint32 nextPool; };
};
typedef Ptr<Node> NodePtr;
NodeId m_masterNodeId;
SLList<Node> m_nodes;
NdbNodeBitmask m_aliveNodes;
ArrayPool<Node> m_nodePool;
/**
* for all Suma's to keep track of other Suma's in Node group
*/
Uint32 c_nodeGroup;
Uint32 c_noNodesInGroup;
Uint32 c_idInNodeGroup;
NodeId c_nodesInGroup[4];
public:
/***************************************************************************
* GREP PS Coordinator
***************************************************************************/
class PSCoord : public BlockComponent {
private:
struct SubCoordinator {
Uint32 m_subscriberRef;
Uint32 m_subscriberData;
Uint32 m_coordinatorRef;
Uint32 m_subscriptionId;
Uint32 m_subscriptionKey;
Uint32 m_subscriptionType;
NdbNodeBitmask m_participants;
Uint32 m_outstandingRequest;
SignalCounter m_outstandingParticipants;
Uint32 nextHash;
union { Uint32 prevHash; Uint32 nextPool; };
Uint32 hashValue() const {
return m_subscriptionId + m_subscriptionKey;
}
bool equal(const SubCoordinator & s) const {
return
m_subscriptionId == s.m_subscriptionId &&
m_subscriptionKey == s.m_subscriptionKey;
}
};
typedef Ptr<SubCoordinator> SubCoordinatorPtr;
ArrayPool<SubCoordinator> c_subCoordinatorPool;
DLHashTable<SubCoordinator>::Iterator c_subPtr;
DLHashTable<SubCoordinator> c_runningSubscriptions;
void prepareOperationRec(SubCoordinatorPtr ptr,
BlockReference subscriber,
Uint32 subId,
Uint32 subKey,
Uint32 request);
public:
PSCoord(class Grep *);
void execGREP_CREATE_CONF(Signal*);
void execGREP_START_CONF(Signal*);
void execGREP_SYNC_CONF(Signal*);
void execGREP_REMOVE_CONF(Signal*);
void execGREP_CREATE_REF(Signal*);
void execGREP_START_REF(Signal*);
void execGREP_SYNC_REF(Signal*);
void execGREP_REMOVE_REF(Signal*);
void execCREATE_SUBID_CONF(Signal*); //comes from SUMA
void execGREP_CREATE_SUBID_REQ(Signal*);
void execGREP_SUB_CREATE_REQ(Signal*);
void execGREP_SUB_START_REQ(Signal*);
void execGREP_SUB_SYNC_REQ(Signal*);
void execGREP_SUB_REMOVE_REQ(Signal*);
void execCREATE_SUBID_REF(Signal*);
void sendCreateSubIdRef_SS(Signal * signal,
Uint32 subId,
Uint32 subKey,
BlockReference to,
GrepError::GE_Code err);
void sendSubRemoveRef_SS(Signal * signal,
SubCoordinator sub,
GrepError::GE_Code err);
void sendRefToSS(Signal * signal,
SubCoordinator sub,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
void setRepRef(BlockReference rr) { m_repRef = rr; };
//void setAliveNodes(NdbNodeBitmask an) { m_aliveNodes = an; };
BlockReference m_repRef; ///< Rep node (only one rep node per grep)
// NdbNodeBitmask m_aliveNodes;
Uint32 m_outstandingRequest;
SignalCounter m_outstandingParticipants;
Grep * m_grep;
} pscoord;
friend class PSCoord;
/***************************************************************************
* GREP PS Participant
***************************************************************************
* Participant of GREP Protocols (not necessarily a protocol coordinator)
*
* This object is only used on primary system
***************************************************************************/
class PSPart: public BlockComponent
{
//protected:
//GrepParticipant(const Configuration & conf);
//virtual ~GrepParticipant();
//BLOCK_DEFINES(GrepParticipant);
struct Subscription {
Uint32 m_subscriberRef;
Uint32 m_subscriberData;
Uint32 m_subscriptionId;
Uint32 m_subscriptionKey;
Uint32 m_subscriptionType;
Uint32 m_coordinatorRef;
Uint32 m_outstandingRequest;
Uint32 m_operationPtrI;
Uint32 nextHash;
union { Uint32 prevHash; Uint32 nextPool; };
Uint32 hashValue() const {
return m_subscriptionId + m_subscriptionKey;
}
bool equal(const Subscription & s) const {
return
m_subscriptionId == s.m_subscriptionId &&
m_subscriptionKey == s.m_subscriptionKey;
}
};
typedef Ptr<Subscription> SubscriptionPtr;
DLHashTable<Subscription> c_subscriptions;
DLHashTable<Subscription>::Iterator c_subPtr;
ArrayPool<Subscription> c_subscriptionPool;
public:
PSPart(class Grep *);
//protected:
/*************************************************************************
* SUMA Signal Interface
*************************************************************************/
void execSUB_CREATE_CONF(Signal*);
void execSUB_START_CONF(Signal*);
void execSUB_SYNC_CONF(Signal*);
void execSUB_REMOVE_CONF(Signal*);
void execSUB_CREATE_REF(Signal*);
void execSUB_START_REF(Signal*);
void execSUB_SYNC_REF(Signal*);
void execSUB_REMOVE_REF(Signal*);
void execSUB_META_DATA(Signal*);
void execSUB_TABLE_DATA(Signal*);
void execSUB_GCP_COMPLETE_REP(Signal*);
void execSUB_SYNC_CONTINUE_REQ(Signal*);
/*************************************************************************
* GREP Coordinator Signal Interface
*************************************************************************/
void execGREP_CREATE_REQ(Signal*);
void execGREP_START_REQ(Signal*);
void execGREP_SYNC_REQ(Signal*);
void execGREP_REMOVE_REQ(Signal*);
/**
* NR/NF signals
*/
void execSTART_ME(Signal *);
void execGREP_ADD_SUB_REQ(Signal *);
void execGREP_ADD_SUB_REF(Signal *);
void execGREP_ADD_SUB_CONF(Signal *);
/*************************************************************************
* GREP Coordinator error handling interface
*************************************************************************/
void sendRefToPSCoord(Signal * signal,
Subscription sub,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
//protected:
BlockReference m_repRef; ///< Replication node
///< (only one rep node per grep)
bool m_recoveryMode;
private:
BlockReference m_coordinator;
Uint32 m_firstScanGCI;
Uint32 m_lastScanGCI;
Uint32 m_latestSeenGCI;
Grep * m_grep;
} pspart;
friend class PSPart;
/***************************************************************************
* AddRecSignal Stuff (should maybe be gerneralized)
***************************************************************************/
typedef void (Grep::* ExecSignalLocal1) (Signal* signal);
typedef void (Grep::PSCoord::* ExecSignalLocal2) (Signal* signal);
typedef void (Grep::PSPart::* ExecSignalLocal4) (Signal* signal);
};
/*************************************************************************
* Requestor
*
* The following methods are callbacks (registered functions)
* for the Requestor. The Requestor calls these when it needs
* something to be done.
*************************************************************************/
void startSubscription(void * cbObj, Signal*, int type);
void scanSubscription(void * cbObj, Signal*, int type);
#endif

View file

@ -1,164 +0,0 @@
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "Grep.hpp"
#include <Properties.hpp>
#include <Configuration.hpp>
/*****************************************************************************
* Grep Participant
*****************************************************************************/
#if 0
GrepParticipant::GrepParticipant(const Configuration & conf) :
SimulatedBlock(GREP, conf)
{
BLOCK_CONSTRUCTOR(Grep);
//m_repRef = 0;
m_latestSeenGCI = 0;
}
GrepParticipant::~GrepParticipant()
{
}
BLOCK_FUNCTIONS(GrepParticipant);
#endif
/*****************************************************************************
* Grep Coordinator
*****************************************************************************/
Grep::Grep(const Configuration & conf) :
// GrepParticipant(conf),
SimulatedBlock(GREP, conf),
m_nodes(m_nodePool),
pscoord(this),
pspart(this)
{
m_nodePool.setSize(MAX_NDB_NODES);
m_masterNodeId = getOwnNodeId();
/***************************************************************************
* General Signals
***************************************************************************/
addRecSignal(GSN_STTOR, &Grep::execSTTOR);
addRecSignal(GSN_NDB_STTOR, &Grep::execNDB_STTOR);
addRecSignal(GSN_DUMP_STATE_ORD, &Grep::execDUMP_STATE_ORD);
addRecSignal(GSN_READ_NODESCONF, &Grep::execREAD_NODESCONF);
addRecSignal(GSN_NODE_FAILREP, &Grep::execNODE_FAILREP);
addRecSignal(GSN_INCL_NODEREQ, &Grep::execINCL_NODEREQ);
addRecSignal(GSN_GREP_REQ, &Grep::execGREP_REQ);
addRecSignal(GSN_API_FAILREQ, &Grep::execAPI_FAILREQ);
/***************************************************************************
* Grep::PSCoord Signal Interface
***************************************************************************/
/**
* From Grep::PSPart
*/
addRecSignal(GSN_GREP_CREATE_CONF, &Grep::fwdGREP_CREATE_CONF);
addRecSignal(GSN_GREP_START_CONF, &Grep::fwdGREP_START_CONF);
addRecSignal(GSN_GREP_SYNC_CONF, &Grep::fwdGREP_SYNC_CONF);
addRecSignal(GSN_GREP_REMOVE_CONF, &Grep::fwdGREP_REMOVE_CONF);
addRecSignal(GSN_GREP_CREATE_REF, &Grep::fwdGREP_CREATE_REF);
addRecSignal(GSN_GREP_START_REF, &Grep::fwdGREP_START_REF);
addRecSignal(GSN_GREP_REMOVE_REF, &Grep::fwdGREP_REMOVE_REF);
/**
* From Grep::SSCoord to Grep::PSCoord
*/
addRecSignal(GSN_GREP_SUB_START_REQ, &Grep::fwdGREP_SUB_START_REQ);
addRecSignal(GSN_GREP_SUB_CREATE_REQ, &Grep::fwdGREP_SUB_CREATE_REQ);
addRecSignal(GSN_GREP_SUB_SYNC_REQ, &Grep::fwdGREP_SUB_SYNC_REQ);
addRecSignal(GSN_GREP_SUB_REMOVE_REQ, &Grep::fwdGREP_SUB_REMOVE_REQ);
addRecSignal(GSN_GREP_CREATE_SUBID_REQ, &Grep::fwdGREP_CREATE_SUBID_REQ);
/****************************************************************************
* PSPart
***************************************************************************/
/**
* From SUMA to GREP PS Participant. If suma is not a coodinator
*/
addRecSignal(GSN_SUB_START_CONF, &Grep::fwdSUB_START_CONF);
addRecSignal(GSN_SUB_CREATE_CONF, &Grep::fwdSUB_CREATE_CONF);
addRecSignal(GSN_SUB_SYNC_CONF, &Grep::fwdSUB_SYNC_CONF);
addRecSignal(GSN_SUB_REMOVE_CONF, &Grep::fwdSUB_REMOVE_CONF);
addRecSignal(GSN_SUB_CREATE_REF, &Grep::fwdSUB_CREATE_REF);
addRecSignal(GSN_SUB_START_REF, &Grep::fwdSUB_START_REF);
addRecSignal(GSN_SUB_SYNC_REF, &Grep::fwdSUB_SYNC_REF);
addRecSignal(GSN_SUB_REMOVE_REF, &Grep::fwdSUB_REMOVE_REF);
addRecSignal(GSN_SUB_SYNC_CONTINUE_REQ,
&Grep::fwdSUB_SYNC_CONTINUE_REQ);
/**
* From Suma to Grep::PSPart. Data signals.
*/
addRecSignal(GSN_SUB_META_DATA, &Grep::fwdSUB_META_DATA);
addRecSignal(GSN_SUB_TABLE_DATA, &Grep::fwdSUB_TABLE_DATA);
addRecSignal(GSN_SUB_GCP_COMPLETE_REP, &Grep::fwdSUB_GCP_COMPLETE_REP);
/**
* From Grep::PSCoord to Grep::PSPart
*/
addRecSignal(GSN_GREP_CREATE_REQ, &Grep::fwdGREP_CREATE_REQ);
addRecSignal(GSN_GREP_START_REQ, &Grep::fwdGREP_START_REQ);
addRecSignal(GSN_GREP_REMOVE_REQ, &Grep::fwdGREP_REMOVE_REQ);
addRecSignal(GSN_GREP_SYNC_REQ, &Grep::fwdGREP_SYNC_REQ);
addRecSignal(GSN_CREATE_SUBID_CONF, &Grep::fwdCREATE_SUBID_CONF);
addRecSignal(GSN_GREP_START_ME, &Grep::fwdSTART_ME);
addRecSignal(GSN_GREP_ADD_SUB_REQ, &Grep::fwdGREP_ADD_SUB_REQ);
addRecSignal(GSN_GREP_ADD_SUB_REF, &Grep::fwdGREP_ADD_SUB_REF);
addRecSignal(GSN_GREP_ADD_SUB_CONF, &Grep::fwdGREP_ADD_SUB_CONF);
}
Grep::~Grep()
{
}
BLOCK_FUNCTIONS(Grep)
Grep::PSPart::PSPart(Grep * sb) :
BlockComponent(sb),
c_subscriptions(c_subscriptionPool)
{
m_grep = sb;
m_firstScanGCI = 1; // Empty interval = [1,0]
m_lastScanGCI = 0;
m_latestSeenGCI = 0;
c_subscriptions.setSize(10);
c_subscriptionPool.setSize(10);
}
Grep::PSCoord::PSCoord(Grep * sb) :
BlockComponent(sb),
c_runningSubscriptions(c_subCoordinatorPool)
{
m_grep = sb;
c_runningSubscriptions.setSize(10);
c_subCoordinatorPool.setSize(2);
}
//BLOCK_FUNCTIONS(Grep::PSCoord);
BlockComponent::BlockComponent(SimulatedBlock * sb) {
m_sb = sb;
}

View file

@ -1,23 +0,0 @@
noinst_LIBRARIES = libgrep.a
libgrep_a_SOURCES = Grep.cpp GrepInit.cpp
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libgrep.dsp
libgrep.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -1,12 +0,0 @@
include .defs.mk
TYPE := kernel
BIN_TARGET := grep_systab_test
BIN_TARGET_ARCHIVES := portlib general
CCFLAGS_LOC += -I..
SOURCES = ../GrepSystemTable.cpp grep_systab_test.cpp
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,138 +0,0 @@
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/**
* Unit Test for GrepSystemTable
*/
#include "../GrepSystemTable.hpp"
#include <SimulatedBlock.hpp>
#define EXEC(X) ( ndbout << endl, ndbout_c(#X), X )
int
main () {
GrepSystemTable st;
Uint32 f, l;
ndbout_c("*************************************");
ndbout_c("* GrepSystemTable Unit Test Program *");
ndbout_c("*************************************");
ndbout_c("--------------------------------------------------------");
ndbout_c("Test 1: Clear");
ndbout_c("--------------------------------------------------------");
EXEC(st.set(GrepSystemTable::PS, 22, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 26);
EXEC(st.clear(GrepSystemTable::PS, 20, 24));
st.print();
st.require(GrepSystemTable::PS, 25, 26);
EXEC(st.clear(GrepSystemTable::PS, 0, 100));
st.print();
st.require(GrepSystemTable::PS, 1, 0);
EXEC(st.set(GrepSystemTable::PS, 22, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 26);
EXEC(st.clear(GrepSystemTable::PS, 24, 28));
st.print();
st.require(GrepSystemTable::PS, 22, 23);
EXEC(st.clear(GrepSystemTable::PS, 0, 100));
st.print();
st.require(GrepSystemTable::PS, 1, 0);
EXEC(st.set(GrepSystemTable::PS, 22, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 26);
EXEC(st.clear(GrepSystemTable::PS, 24, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 23);
EXEC(st.clear(GrepSystemTable::PS, 0, 100));
st.print();
st.require(GrepSystemTable::PS, 1, 0);
EXEC(st.set(GrepSystemTable::PS, 22, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 26);
EXEC(st.clear(GrepSystemTable::PS, 22, 24));
st.print();
st.require(GrepSystemTable::PS, 25, 26);
ndbout_c("--------------------------------------------------------");
ndbout_c("Test 2: PS --> SSreq");
ndbout_c("--------------------------------------------------------");
EXEC(st.set(GrepSystemTable::PS, 22, 26));
st.print();
st.require(GrepSystemTable::PS, 22, 26);
st.require(GrepSystemTable::SSReq, 1, 0);
if (!EXEC(st.copy(GrepSystemTable::PS, GrepSystemTable::SSReq, 3, &f, &l)))
ndbout_c("%s:%d: Illegal copy!", __FILE__, __FILE__);
ndbout_c("f=%d, l=%d", f, l);
st.print();
st.require(GrepSystemTable::PS, 22, 26);
st.require(GrepSystemTable::SSReq, 22, 24);
EXEC(st.clear(GrepSystemTable::PS, 22, 22));
st.print();
st.require(GrepSystemTable::PS, 23, 26);
st.require(GrepSystemTable::SSReq, 22, 24);
if (!EXEC(st.copy(GrepSystemTable::PS, GrepSystemTable::SSReq, 2, &f, &l)))
ndbout_c("%s:%d: Illegal copy!", __FILE__, __LINE__);
ndbout_c("f=%d, l=%d", f, l);
st.print();
st.require(GrepSystemTable::PS, 23, 26);
st.require(GrepSystemTable::SSReq, 22, 26);
st.set(GrepSystemTable::SS, 7, 9);
st.set(GrepSystemTable::InsReq, 7, 9);
if (EXEC(st.movable(GrepSystemTable::SS, GrepSystemTable::InsReq)))
ndbout_c("%s:%d: Illegal move!", __FILE__, __LINE__);
st.print();
st.require(GrepSystemTable::SS, 7, 9);
st.require(GrepSystemTable::InsReq, 7, 9);
EXEC(st.intervalMinus(7, 9, 7, 7, &f, &l));
ndbout_c("f=%d, l=%d", f, l);
st.clear(GrepSystemTable::InsReq, 8, 9);
st.require(GrepSystemTable::SS, 7, 9);
st.require(GrepSystemTable::InsReq, 7, 7);
if (EXEC(st.movable(GrepSystemTable::SS, GrepSystemTable::InsReq)) != 2)
ndbout_c("%s:%d: Illegal move!", __FILE__, __LINE__);
st.print();
EXEC(st.copy(GrepSystemTable::SS, GrepSystemTable::InsReq, &f));
st.print();
st.require(GrepSystemTable::SS, 7, 9);
st.require(GrepSystemTable::InsReq, 7, 8);
ndbout_c("--------------------------------------------------------");
ndbout_c("Test completed");
ndbout_c("--------------------------------------------------------");
}

View file

@ -1,540 +0,0 @@
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NDBT.hpp>
#include <NDBT_Test.hpp>
#include <HugoTransactions.hpp>
#include <UtilTransactions.hpp>
#include <NdbGrep.hpp>
#define CHECK(b) if (!(b)) { \
g_err << "ERR: "<< step->getName() \
<< " failed on line " << __LINE__ << endl; \
result = NDBT_FAILED; \
continue; }
int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
int records = ctx->getNumRecords();
HugoTransactions hugoTrans(*ctx->getTab());
if (hugoTrans.loadTable(GETNDB(step), records) != 0){
return NDBT_FAILED;
}
return NDBT_OK;
}
int runPkUpdate(NDBT_Context* ctx, NDBT_Step* step){
int loops = ctx->getNumLoops();
int records = ctx->getNumRecords();
int batchSize = ctx->getProperty("BatchSize", 1);
int i = 0;
HugoTransactions hugoTrans(*ctx->getTab());
while (i<loops) {
g_info << "|- " << i << ": ";
if (hugoTrans.pkUpdateRecords(GETNDB(step), records, batchSize) != 0){
g_info << endl;
return NDBT_FAILED;
}
i++;
}
g_info << endl;
return NDBT_OK;
}
int runRestartInitial(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
Ndb* pNdb = GETNDB(step);
const NdbDictionary::Table *tab = ctx->getTab();
pNdb->getDictionary()->dropTable(tab->getName());
if (restarter.restartAll(true) != 0)
return NDBT_FAILED;
return NDBT_OK;
}
int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
int loops = ctx->getNumLoops();
NdbRestarter restarter;
int i = 0;
int lastId = 0;
if (restarter.getNumDbNodes() < 2){
ctx->stopTest();
return NDBT_OK;
}
if(restarter.waitClusterStarted(60) != 0){
g_err << "Cluster failed to start" << endl;
return NDBT_FAILED;
}
loops *= restarter.getNumDbNodes();
while(i<loops && result != NDBT_FAILED && !ctx->isTestStopped()){
int id = lastId % restarter.getNumDbNodes();
int nodeId = restarter.getDbNodeId(id);
ndbout << "Restart node " << nodeId << endl;
if(restarter.restartOneDbNode(nodeId) != 0){
g_err << "Failed to restartNextDbNode" << endl;
result = NDBT_FAILED;
break;
}
if(restarter.waitClusterStarted(60) != 0){
g_err << "Cluster failed to start" << endl;
result = NDBT_FAILED;
break;
}
NdbSleep_SecSleep(1);
lastId++;
i++;
}
ctx->stopTest();
return result;
}
int runCheckAllNodesStarted(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
if(restarter.waitClusterStarted(1) != 0){
g_err << "All nodes was not started " << endl;
return NDBT_FAILED;
}
return NDBT_OK;
}
bool testMaster = true;
bool testSlave = false;
int setMaster(NDBT_Context* ctx, NDBT_Step* step){
testMaster = true;
testSlave = false;
return NDBT_OK;
}
int setMasterAsSlave(NDBT_Context* ctx, NDBT_Step* step){
testMaster = true;
testSlave = true;
return NDBT_OK;
}
int setSlave(NDBT_Context* ctx, NDBT_Step* step){
testMaster = false;
testSlave = true;
return NDBT_OK;
}
int runAbort(NDBT_Context* ctx, NDBT_Step* step){
NdbGrep grep(GETNDB(step)->getNodeId()+1);
NdbRestarter restarter;
if (restarter.getNumDbNodes() < 2){
ctx->stopTest();
return NDBT_OK;
}
if(restarter.waitClusterStarted(60) != 0){
g_err << "Cluster failed to start" << endl;
return NDBT_FAILED;
}
if (testMaster) {
if (testSlave) {
if (grep.NFMasterAsSlave(restarter) == -1){
return NDBT_FAILED;
}
} else {
if (grep.NFMaster(restarter) == -1){
return NDBT_FAILED;
}
}
} else {
if (grep.NFSlave(restarter) == -1){
return NDBT_FAILED;
}
}
return NDBT_OK;
}
int runFail(NDBT_Context* ctx, NDBT_Step* step){
NdbGrep grep(GETNDB(step)->getNodeId()+1);
NdbRestarter restarter;
if (restarter.getNumDbNodes() < 2){
ctx->stopTest();
return NDBT_OK;
}
if(restarter.waitClusterStarted(60) != 0){
g_err << "Cluster failed to start" << endl;
return NDBT_FAILED;
}
if (testMaster) {
if (testSlave) {
if (grep.FailMasterAsSlave(restarter) == -1){
return NDBT_FAILED;
}
} else {
if (grep.FailMaster(restarter) == -1){
return NDBT_FAILED;
}
}
} else {
if (grep.FailSlave(restarter) == -1){
return NDBT_FAILED;
}
}
return NDBT_OK;
}
int runGrepBasic(NDBT_Context* ctx, NDBT_Step* step){
NdbGrep grep(GETNDB(step)->getNodeId()+1);
unsigned grepId = 0;
if (grep.start() == -1){
return NDBT_FAILED;
}
ndbout << "Started grep " << grepId << endl;
ctx->setProperty("GrepId", grepId);
return NDBT_OK;
}
int runVerifyBasic(NDBT_Context* ctx, NDBT_Step* step){
NdbGrep grep(GETNDB(step)->getNodeId()+1, ctx->getRemoteMgm());
ndbout_c("no of nodes %d" ,grep.getNumDbNodes());
int result;
if ((result = grep.verify(ctx)) == -1){
return NDBT_FAILED;
}
return result;
}
int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
int records = ctx->getNumRecords();
UtilTransactions utilTrans(*ctx->getTab());
if (utilTrans.clearTable2(GETNDB(step), records) != 0){
return NDBT_FAILED;
}
return NDBT_OK;
}
#include "bank/Bank.hpp"
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
int overWriteExisting = true;
if (bank.createAndLoadBank(overWriteExisting) != NDBT_OK)
return NDBT_FAILED;
return NDBT_OK;
}
int runBankTimer(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
int wait = 30; // Max seconds between each "day"
int yield = 1; // Loops before bank returns
while (ctx->isTestStopped() == false) {
bank.performIncreaseTime(wait, yield);
}
return NDBT_OK;
}
int runBankTransactions(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
int wait = 10; // Max ms between each transaction
int yield = 100; // Loops before bank returns
while (ctx->isTestStopped() == false) {
bank.performTransactions(wait, yield);
}
return NDBT_OK;
}
int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
int yield = 20; // Loops before bank returns
int result = NDBT_OK;
while (ctx->isTestStopped() == false) {
if (bank.performMakeGLs(yield) != NDBT_OK){
ndbout << "bank.performMakeGLs FAILED" << endl;
result = NDBT_FAILED;
}
}
return NDBT_OK;
}
int runBankSum(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
int wait = 2000; // Max ms between each sum of accounts
int yield = 1; // Loops before bank returns
int result = NDBT_OK;
while (ctx->isTestStopped() == false) {
if (bank.performSumAccounts(wait, yield) != NDBT_OK){
ndbout << "bank.performSumAccounts FAILED" << endl;
result = NDBT_FAILED;
}
}
return result ;
}
int runDropBank(NDBT_Context* ctx, NDBT_Step* step){
Bank bank;
if (bank.dropBank() != NDBT_OK)
return NDBT_FAILED;
return NDBT_OK;
}
int runGrepBank(NDBT_Context* ctx, NDBT_Step* step){
int loops = ctx->getNumLoops();
int l = 0;
int maxSleep = 30; // Max seconds between each grep
Ndb* pNdb = GETNDB(step);
NdbGrep grep(GETNDB(step)->getNodeId()+1);
unsigned minGrepId = ~0;
unsigned maxGrepId = 0;
unsigned grepId = 0;
int result = NDBT_OK;
while (l < loops && result != NDBT_FAILED){
if (pNdb->waitUntilReady() != 0){
result = NDBT_FAILED;
continue;
}
// Sleep for a while
NdbSleep_SecSleep(maxSleep);
// Perform grep
if (grep.start() != 0){
ndbout << "grep.start failed" << endl;
result = NDBT_FAILED;
continue;
}
ndbout << "Started grep " << grepId << endl;
// Remember min and max grepid
if (grepId < minGrepId)
minGrepId = grepId;
if (grepId > maxGrepId)
maxGrepId = grepId;
ndbout << " maxGrepId = " << maxGrepId
<< ", minGrepId = " << minGrepId << endl;
ctx->setProperty("MinGrepId", minGrepId);
ctx->setProperty("MaxGrepId", maxGrepId);
l++;
}
ctx->stopTest();
return result;
}
/*
int runRestoreBankAndVerify(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
NdbGrep grep(GETNDB(step)->getNodeId()+1);
unsigned minGrepId = ctx->getProperty("MinGrepId");
unsigned maxGrepId = ctx->getProperty("MaxGrepId");
unsigned grepId = minGrepId;
int result = NDBT_OK;
int errSumAccounts = 0;
int errValidateGL = 0;
ndbout << " maxGrepId = " << maxGrepId << endl;
ndbout << " minGrepId = " << minGrepId << endl;
while (grepId <= maxGrepId){
// TEMPORARY FIX
// To erase all tables from cache(s)
// To be removed, maybe replaced by ndb.invalidate();
{
Bank bank;
if (bank.dropBank() != NDBT_OK){
result = NDBT_FAILED;
break;
}
}
// END TEMPORARY FIX
ndbout << "Performing initial restart" << endl;
if (restarter.restartAll(true) != 0)
return NDBT_FAILED;
if (restarter.waitClusterStarted() != 0)
return NDBT_FAILED;
ndbout << "Restoring grep " << grepId << endl;
if (grep.restore(grepId) == -1){
return NDBT_FAILED;
}
ndbout << "Grep " << grepId << " restored" << endl;
// Let bank verify
Bank bank;
int wait = 0;
int yield = 1;
if (bank.performSumAccounts(wait, yield) != 0){
ndbout << "bank.performSumAccounts FAILED" << endl;
ndbout << " grepId = " << grepId << endl << endl;
result = NDBT_FAILED;
errSumAccounts++;
}
if (bank.performValidateAllGLs() != 0){
ndbout << "bank.performValidateAllGLs FAILED" << endl;
ndbout << " grepId = " << grepId << endl << endl;
result = NDBT_FAILED;
errValidateGL++;
}
grepId++;
}
if (result != NDBT_OK){
ndbout << "Verification of grep failed" << endl
<< " errValidateGL="<<errValidateGL<<endl
<< " errSumAccounts="<<errSumAccounts<<endl << endl;
}
return result;
}
*/
NDBT_TESTSUITE(testGrep);
TESTCASE("GrepBasic",
"Test that Global Replication works on one table \n"
"1. Load table\n"
"2. Grep\n"
"3. Restart -i\n"
"4. Restore\n"
"5. Verify count and content of table\n"){
INITIALIZER(runLoadTable);
VERIFIER(runVerifyBasic);
FINALIZER(runClearTable);
}
TESTCASE("GrepNodeRestart",
"Test that Global Replication works on one table \n"
"1. Load table\n"
"2. Grep\n"
"3. Restart -i\n"
"4. Restore\n"
"5. Verify count and content of table\n"){
INITIALIZER(runLoadTable);
STEP(runPkUpdate);
STEP(runRestarter);
VERIFIER(runVerifyBasic);
FINALIZER(runClearTable);
}
TESTCASE("GrepBank",
"Test that grep and restore works during transaction load\n"
" by backing up the bank"
"1. Create bank\n"
"2a. Start bank and let it run\n"
"2b. Perform loop number of greps of the bank\n"
" when greps are finished tell bank to close\n"
"3. Restart ndb -i and reload each grep\n"
" let bank verify that the grep is consistent\n"
"4. Drop bank\n"){
INITIALIZER(runCreateBank);
STEP(runBankTimer);
STEP(runBankTransactions);
STEP(runBankGL);
// TODO STEP(runBankSum);
STEP(runGrepBank);
// VERIFIER(runRestoreBankAndVerify);
// FINALIZER(runDropBank);
}
TESTCASE("NFMaster",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setMaster);
STEP(runAbort);
}
TESTCASE("NFMasterAsSlave",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setMasterAsSlave);
STEP(runAbort);
}
TESTCASE("NFSlave",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setSlave);
STEP(runAbort);
}
TESTCASE("FailMaster",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setMaster);
STEP(runFail);
}
TESTCASE("FailMasterAsSlave",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setMasterAsSlave);
STEP(runFail);
}
TESTCASE("FailSlave",
"Test that grep behaves during node failiure\n"){
INITIALIZER(setSlave);
STEP(runFail);
}
NDBT_TESTSUITE_END(testGrep);
int main(int argc, const char** argv){
ndb_init();
return testGrep.execute(argc, argv);
}

View file

@ -18,7 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
#include <mysql_priv.h>
#include "../mysql_priv.h"
#ifdef HAVE_ARCHIVE_DB
#include "ha_archive.h"

View file

@ -58,7 +58,7 @@ public:
ha_archive(TABLE *table): handler(table)
{
/* Set our original buffer from pre-allocated memory */
buffer.set(byte_buffer, IO_SIZE, system_charset_info);
buffer.set((char*)byte_buffer, IO_SIZE, system_charset_info);
/* The size of the offset value we will use for position() */
ref_length = sizeof(z_off_t);

View file

@ -67,7 +67,7 @@
#pragma implementation // gcc: Class implementation
#endif
#include <mysql_priv.h>
#include "../mysql_priv.h"
#ifdef HAVE_EXAMPLE_DB
#include "ha_example.h"

View file

@ -4443,6 +4443,7 @@ ha_innobase::info(
dict_table_t* ib_table;
dict_index_t* index;
ha_rows rec_per_key;
ib_longlong n_rows;
ulong j;
ulong i;
char path[FN_REFLEN];
@ -4507,7 +4508,30 @@ ha_innobase::info(
}
if (flag & HA_STATUS_VARIABLE) {
records = (ha_rows)ib_table->stat_n_rows;
n_rows = ib_table->stat_n_rows;
/* Because we do not protect stat_n_rows by any mutex in a
delete, it is theoretically possible that the value can be
smaller than zero! TODO: fix this race.
The MySQL optimizer seems to assume in a left join that n_rows
is an accurate estimate if it is zero. Of course, it is not,
since we do not have any locks on the rows yet at this phase.
Since SHOW TABLE STATUS seems to call this function with the
HA_STATUS_TIME flag set, while the left join optizer does not
set that flag, we add one to a zero value if the flag is not
set. That way SHOW TABLE STATUS will show the best estimate,
while the optimizer never sees the table empty. */
if (n_rows < 0) {
n_rows = 0;
}
if (n_rows == 0 && !(flag & HA_STATUS_TIME)) {
n_rows++;
}
records = (ha_rows)n_rows;
deleted = 0;
data_file_length = ((ulonglong)
ib_table->stat_clustered_index_size)