Commit 3e9338f8 authored by hf@deer.(none)'s avatar hf@deer.(none)

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

into deer.(none):/home/hf/work/mysql-4.1-w1284
parents 611096a7 b99377f3
......@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid"
. "$path/FINISH.sh"
......@@ -50,6 +50,7 @@ jani@janikt.pp.saunalahti.fi
jani@rhols221.adsl.netsonic.fi
jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi
jani@ua167d18.elisa.omakaista.fi
jcole@abel.spaceapes.com
jcole@main.burghcom.com
jcole@mugatu.spaceapes.com
......
......@@ -26,7 +26,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \
all: $(targets) txt_files
txt_files: ../INSTALL-SOURCE ../COPYING ../COPYING.LIB \
txt_files: ../INSTALL-SOURCE ../COPYING \
INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
CLEAN_FILES: $(BUILD_SOURCES)
......@@ -201,10 +201,7 @@ INSTALL-BINARY: mysql.info $(GT)
perl -w $(GT) mysql.info "Installing binary" "Installing source" > $@
../COPYING: mysql.info $(GT)
perl -w $(GT) mysql.info "GPL license" "LGPL license" > $@
../COPYING.LIB: mysql.info $(GT)
perl -w $(GT) mysql.info "LGPL license" "Function Index" > $@
perl -w $(GT) mysql.info "GPL license" "Function Index" > $@
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
perl -w $(GT) mysql.info "Mac OS X installation" "NetWare installation" > $@
......
......@@ -19,8 +19,7 @@
AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE README \
COPYING COPYING.LIB zlib
EXTRA_DIST = INSTALL-SOURCE README COPYING zlib
SUBDIRS = . include @docs_dirs@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack @sql_client_dirs@ \
......
......@@ -42,8 +42,8 @@ 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 /WX /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
......@@ -69,7 +69,7 @@ LINK32=xilink6.exe
# 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 "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
......
......@@ -100,6 +100,10 @@ SOURCE=..\strings\bmove_upp.c
# End Source File
# Begin Source File
SOURCE="..\mysys\charset-def.c"
# End Source File
# Begin Source File
SOURCE=..\mysys\charset.c
# End Source File
# Begin Source File
......
......@@ -38,7 +38,8 @@ 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 /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCSN" /D "DBUG_OFF" /D "_WINDOWS" /D "__WIN__" /D "_MT" /FR /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /I "..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCSN" /D "DBUG_OFF" /D "_WINDOWS" /D "__WIN__" /D "_MT" /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
......
......@@ -43,8 +43,8 @@ RSC=rc.exe
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "__NT__" /D "WIN32" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /GX /Z7 /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
# SUBTRACT CPP /YX
# ADD CPP /nologo /G6 /MTd /W3 /GX /Z7 /Od /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
......@@ -68,7 +68,7 @@ LIB32=xilink6.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../innobase/include" /I "../include" /D "NDEBUG" /D "_LIB" /D "_WIN32" /D "WIN32" /D "_MBCS" /D "MYSQL_SERVER" /FD /c
# SUBTRACT CPP /YX
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
......
......@@ -119,6 +119,10 @@ SOURCE=..\strings\bmove_upp.c
# End Source File
# Begin Source File
SOURCE="..\mysys\charset-def.c"
# End Source File
# Begin Source File
SOURCE=..\mysys\charset.c
# End Source File
# Begin Source File
......
......@@ -7,24 +7,24 @@
CFG=test_libmysqld - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE
!MESSAGE NMAKE /f "test_libmysqld.mak".
!MESSAGE
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE
!MESSAGE NMAKE /f "test_libmysqld.mak" CFG="test_libmysqld - Win32 Release"
!MESSAGE
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE
!MESSAGE "test_libmysqld - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
......@@ -38,13 +38,14 @@ 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 /MT /W3 /GX /O2 /I "..\..\include" /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "DBUG_OFF" /FR /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "DBUG_OFF" /YX /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBCMTD" /out:"Release/mysql-server.exe"
# Begin Target
......
......@@ -43,7 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FR /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "NDEBUG"
......@@ -70,6 +71,7 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x416 /d "_DEBUG"
......@@ -186,7 +188,6 @@ SOURCE=..\sql\item_create.cpp
# Begin Source File
SOURCE=..\sql\item_func.cpp
# ADD CPP /I "../zlib"
# End Source File
# Begin Source File
......
......@@ -40,7 +40,7 @@ main( int argc, char * argv[] )
MYSQL_ROW row ;
//....just curious....
printf( "sizeof( MYSQL ) == %d\n", sizeof( MYSQL ) ) ;
printf( "sizeof( MYSQL ) == %d\n", (int) sizeof( MYSQL ) ) ;
if ( argc == 2 )
{
strcpy( szDB, argv[ 1 ] ) ;
......@@ -49,27 +49,31 @@ main( int argc, char * argv[] )
{
strcpy( szDB, "mysql" ) ;
printf("Some mysql struct information (size and offset):\n");
printf("net:\t%3d %3d\n",sizeof(myData->net),offsetof(MYSQL,net));
printf("host:\t%3d %3d\n",sizeof(myData->host),offsetof(MYSQL,host));
printf("port:\t%3d %3d\n",sizeof(myData->port),offsetof(MYSQL,port));
printf("protocol_version:\t%3d %3d\n",sizeof(myData->protocol_version),
offsetof(MYSQL,protocol_version));
printf("thread_id:\t%3d %3d\n",sizeof(myData->thread_id),
offsetof(MYSQL,thread_id));
printf("affected_rows:\t%3d %3d\n",sizeof(myData->affected_rows),
offsetof(MYSQL,affected_rows));
printf("packet_length:\t%3d %3d\n",sizeof(myData->packet_length),
offsetof(MYSQL,packet_length));
printf("status:\t%3d %3d\n",sizeof(myData->status),
offsetof(MYSQL,status));
printf("fields:\t%3d %3d\n",sizeof(myData->fields),
offsetof(MYSQL,fields));
printf("field_alloc:\t%3d %3d\n",sizeof(myData->field_alloc),
offsetof(MYSQL,field_alloc));
printf("free_me:\t%3d %3d\n",sizeof(myData->free_me),
offsetof(MYSQL,free_me));
printf("options:\t%3d %3d\n",sizeof(myData->options),
offsetof(MYSQL,options));
printf("net:\t%3d %3d\n",(int) sizeof(myData->net),
(int) offsetof(MYSQL,net));
printf("host:\t%3d %3d\n",(int) sizeof(myData->host),
(int) offsetof(MYSQL,host));
printf("port:\t%3d %3d\n", (int) sizeof(myData->port),
(int) offsetof(MYSQL,port));
printf("protocol_version:\t%3d %3d\n",
(int) sizeof(myData->protocol_version),
(int) offsetof(MYSQL,protocol_version));
printf("thread_id:\t%3d %3d\n",(int) sizeof(myData->thread_id),
(int) offsetof(MYSQL,thread_id));
printf("affected_rows:\t%3d %3d\n",(int) sizeof(myData->affected_rows),
(int) offsetof(MYSQL,affected_rows));
printf("packet_length:\t%3d %3d\n",(int) sizeof(myData->packet_length),
(int) offsetof(MYSQL,packet_length));
printf("status:\t%3d %3d\n",(int) sizeof(myData->status),
(int) offsetof(MYSQL,status));
printf("fields:\t%3d %3d\n",(int) sizeof(myData->fields),
(int) offsetof(MYSQL,fields));
printf("field_alloc:\t%3d %3d\n",(int) sizeof(myData->field_alloc),
(int) offsetof(MYSQL,field_alloc));
printf("free_me:\t%3d %3d\n",(int) sizeof(myData->free_me),
(int) offsetof(MYSQL,free_me));
printf("options:\t%3d %3d\n",(int) sizeof(myData->options),
(int) offsetof(MYSQL,options));
puts("");
}
}
......
......@@ -25,7 +25,7 @@ CFG=myisam - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "myisam - Win32 Release"
......@@ -47,7 +47,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\myisam.lib"
......@@ -70,7 +70,7 @@ LIB32=link.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib"
......@@ -169,6 +169,10 @@ SOURCE=.\mi_key.c
# End Source File
# Begin Source File
SOURCE=.\mi_keycache.c
# End Source File
# Begin Source File
SOURCE=.\mi_locking.c
# End Source File
# Begin Source File
......
......@@ -25,7 +25,7 @@ CFG=myisamchk - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "myisamchk - Win32 Release"
......@@ -42,14 +42,14 @@ 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 "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
# SUBTRACT CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisamchk.exe"
......@@ -74,7 +74,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisamchk.exe" /pdbtype:sept
......
......@@ -42,7 +42,8 @@ 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 "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
......
......@@ -25,7 +25,7 @@ CFG=myisampack - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "myisampack - Win32 Release"
......@@ -42,13 +42,14 @@ 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 "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386
......@@ -73,7 +74,7 @@ LINK32=link.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept
......
......@@ -251,6 +251,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......@@ -275,6 +278,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......@@ -311,6 +317,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
Begin Project Dependency
Project_Dep_Name zlib
End Project Dependency
}}}
###############################################################################
......
......@@ -43,8 +43,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /GX /O1 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD CPP /nologo /G6 /MT /W3 /GX /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /WX /Fr /YX /Yc /Yu
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
......
......@@ -44,7 +44,7 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
# SUBTRACT CPP /YX
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
......@@ -72,8 +72,8 @@ LINK32=xilink6.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /W3 /Z7 /O2 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
# SUBTRACT CPP /YX
# ADD CPP /nologo /G6 /W3 /Z7 /Od /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /c
# SUBTRACT CPP /Fr /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
......
......@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
......@@ -117,7 +117,7 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Debug"
# ADD CPP /FR
# SUBTRACT CPP /Fr
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
......@@ -126,6 +126,10 @@ SOURCE=.\array.c
# End Source File
# Begin Source File
SOURCE=".\charset-def.c"
# End Source File
# Begin Source File
SOURCE=.\charset.c
# End Source File
# Begin Source File
......@@ -294,6 +298,10 @@ SOURCE=.\my_copy.c
# End Source File
# Begin Source File
SOURCE=.\my_crc32.c
# End Source File
# Begin Source File
SOURCE=.\my_create.c
# End Source File
# Begin Source File
......
......@@ -44,7 +44,7 @@
#include <locale.h>
#endif
const char *VER= "14.2";
const char *VER= "14.3";
/* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024
......@@ -1621,7 +1621,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
char buff[200], time_buff[32], *pos;
MYSQL_RES *result;
ulong timer, warnings;
uint error=0;
uint error= 0;
int err= 0;
if (!status.batch)
{
......@@ -1665,79 +1666,84 @@ com_go(String *buffer,char *line __attribute__((unused)))
buffer->length(0); // Remove query on error
return error;
}
error=0;
buffer->length(0);
if (quick)
{
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
return put_error(&mysql);
}
else
{
error= mysql_store_result_for_lazy(&result);
if (error)
return error;
}
if (verbose >= 3 || !opt_silent)
mysql_end_timer(timer,time_buff);
else
time_buff[0]=0;
if (result)
do
{
if (!mysql_num_rows(result) && ! quick)
if (quick)
{
strmov(buff, "Empty set");
if (!(result=mysql_use_result(&mysql)) && mysql_field_count(&mysql))
return put_error(&mysql);
}
else
{
init_pager();
if (opt_html)
print_table_data_html(result);
else if (opt_xml)
print_table_data_xml(result);
else if (vertical)
print_table_data_vertically(result);
else if (opt_silent && verbose <= 2 && !output_tables)
print_tab_data(result);
error= mysql_store_result_for_lazy(&result);
if (error)
return error;
}
if (verbose >= 3 || !opt_silent)
mysql_end_timer(timer,time_buff);
else
time_buff[0]=0;
if (result)
{
if (!mysql_num_rows(result) && ! quick)
{
strmov(buff, "Empty set");
}
else
print_table_data(result);
sprintf(buff,"%ld %s in set",
(long) mysql_num_rows(result),
(long) mysql_num_rows(result) == 1 ? "row" : "rows");
end_pager();
{
init_pager();
if (opt_html)
print_table_data_html(result);
else if (opt_xml)
print_table_data_xml(result);
else if (vertical)
print_table_data_vertically(result);
else if (opt_silent && verbose <= 2 && !output_tables)
print_tab_data(result);
else
print_table_data(result);
sprintf(buff,"%ld %s in set",
(long) mysql_num_rows(result),
(long) mysql_num_rows(result) == 1 ? "row" : "rows");
end_pager();
}
}
}
else if (mysql_affected_rows(&mysql) == ~(ulonglong) 0)
strmov(buff,"Query OK");
else
sprintf(buff,"Query OK, %ld %s affected",
(long) mysql_affected_rows(&mysql),
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows");
pos=strend(buff);
if ((warnings= mysql_warning_count(&mysql)))
{
*pos++= ',';
*pos++= ' ';
pos=int2str(warnings, pos, 10);
pos=strmov(pos, " warning");
if (warnings != 1)
*pos++= 's';
}
strmov(pos, time_buff);
put_info(buff,INFO_RESULT);
if (mysql_info(&mysql))
put_info(mysql_info(&mysql),INFO_RESULT);
put_info("",INFO_RESULT); // Empty row
if (result && !mysql_eof(result)) /* Something wrong when using quick */
else if (mysql_affected_rows(&mysql) == ~(ulonglong) 0)
strmov(buff,"Query OK");
else
sprintf(buff,"Query OK, %ld %s affected",
(long) mysql_affected_rows(&mysql),
(long) mysql_affected_rows(&mysql) == 1 ? "row" : "rows");
pos=strend(buff);
if ((warnings= mysql_warning_count(&mysql)))
{
*pos++= ',';
*pos++= ' ';
pos=int2str(warnings, pos, 10);
pos=strmov(pos, " warning");
if (warnings != 1)
*pos++= 's';
}
strmov(pos, time_buff);
put_info(buff,INFO_RESULT);
if (mysql_info(&mysql))
put_info(mysql_info(&mysql),INFO_RESULT);
put_info("",INFO_RESULT); // Empty row
if (result && !mysql_eof(result)) /* Something wrong when using quick */
error= put_error(&mysql);
else if (unbuffered)
fflush(stdout);
mysql_free_result(result);
} while (!(err= mysql_next_result(&mysql)));
if (err >= 1)
error= put_error(&mysql);
else if (unbuffered)
fflush(stdout);
mysql_free_result(result);
return error; /* New command follows */
}
......@@ -2416,6 +2422,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
}
strmake(delimiter, tmp, sizeof(delimiter) - 1);
delimiter_length= strlen(delimiter);
delimiter_str= delimiter;
return 0;
}
......
......@@ -309,6 +309,8 @@ static int get_options(int *argc, char ***argv)
else
what_to_do = DO_CHECK;
}
/* TODO: This variable is not yet used */
if (!(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME))))
exit(1);
......
......@@ -118,7 +118,6 @@ static FILE** cur_file;
static FILE** file_stack_end;
static uint lineno_stack[MAX_INCLUDE_DEPTH];
static char TMPDIR[FN_REFLEN];
static int *block_ok_stack_end;
static int *cur_block, *block_stack_end;
static int block_stack[BLOCK_STACK_DEPTH];
......@@ -1495,7 +1494,6 @@ int do_connect(struct st_query* q)
char* p=q->first_argument;
char buff[FN_REFLEN];
int con_port;
int con_error;
int free_con_sock = 0;
DBUG_ENTER("do_connect");
......@@ -1560,9 +1558,9 @@ int do_connect(struct st_query* q)
/* Special database to allow one to connect without a database name */
if (con_db && !strcmp(con_db,"*NO-ONE*"))
con_db=0;
if ((con_error = safe_connect(&next_con->mysql, con_host,
con_user, con_pass,
con_db, con_port, con_sock ? con_sock: 0)))
if ((safe_connect(&next_con->mysql, con_host,
con_user, con_pass,
con_db, con_port, con_sock ? con_sock: 0)))
die("Could not open connection '%s': %s", con_name,
mysql_error(&next_con->mysql));
......@@ -2018,12 +2016,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int parse_args(int argc, char **argv)
{
int ho_error;
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(1);
if (argc > 1)
......@@ -2454,7 +2450,6 @@ int main(int argc, char **argv)
memset(block_stack, 0, sizeof(block_stack));
block_stack_end = block_stack + BLOCK_STACK_DEPTH;
memset(block_ok_stack, 0, sizeof(block_stack));
block_ok_stack_end = block_ok_stack + BLOCK_STACK_DEPTH;
cur_block = block_stack;
block_ok = block_ok_stack;
*block_ok = 1;
......
......@@ -91,7 +91,7 @@ int main(int argc, char **argv)
{
if (i == remove_ant) { VOID(heap_close(file)) ; return (0) ; }
sprintf(key,"%6d",(j=(int) ((rand() & 32767)/32767.*25)));
if ((error = heap_rkey(file,record,0,key,0,6)))
if ((error = heap_rkey(file,record,0,key,6,HA_READ_KEY_EXACT)))
{
if (verbose || (flags[j] == 1 ||
(error && my_errno != HA_ERR_KEY_NOT_FOUND)))
......@@ -119,7 +119,7 @@ int main(int argc, char **argv)
sprintf(key,"%6d",i);
bmove(record+1,key,6);
my_errno=0;
error=heap_rkey(file,record,0,key,0,6);
error=heap_rkey(file,record,0,key,6,HA_READ_KEY_EXACT);
if (verbose ||
(error == 0 && flags[i] != 1) ||
(error && (flags[i] != 0 || my_errno != HA_ERR_KEY_NOT_FOUND)))
......
......@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
if (j != 0)
{
sprintf(key,"%6d",j);
if (heap_rkey(file,record,0,key,6,0))
if (heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
......@@ -239,7 +239,7 @@ int main(int argc, char *argv[])
if (!key1[j])
continue;
sprintf(key,"%6d",j);
if (heap_rkey(file,record,0,key,6,0))
if (heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT))
{
printf("can't find key1: \"%s\"\n",key);
goto err;
......@@ -289,7 +289,7 @@ int main(int argc, char *argv[])
printf("- Read first key - next - delete - next -> last\n");
DBUG_PRINT("progpos",("first - next - delete - next -> last"));
if (heap_rkey(file,record,0,key,6,0))
if (heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT))
goto err;
if (heap_rnext(file,record3)) goto err;
if (heap_delete(file,record3)) goto err;
......@@ -513,7 +513,7 @@ int main(int argc, char *argv[])
}
printf("- Read through all keys with first-next-last-prev\n");
ant=0;
for (error=heap_rkey(file,record,0,key,6,0);
for (error=heap_rkey(file,record,0,key,6, HA_READ_KEY_EXACT);
! error ;
error=heap_rnext(file,record))
ant++;
......@@ -550,7 +550,8 @@ int main(int argc, char *argv[])
{
if (error == 0)
{
if (heap_rkey(file2,record2,2,record+keyinfo[2].seg[0].start,8,0))
if (heap_rkey(file2,record2,2,record+keyinfo[2].seg[0].start,8,
HA_READ_KEY_EXACT))
{
printf("can't find key3: \"%.8s\"\n",
record+keyinfo[2].seg[0].start);
......
......@@ -21,7 +21,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \
my_semaphore.h my_pthread.h my_no_pthread.h raid.h \
errmsg.h my_global.h my_net.h my_alloc.h \
my_getopt.h sslopt-longopts.h my_dir.h typelib.h \
sslopt-vars.h sslopt-case.h sql_common.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
sql_state.h $(BUILT_SOURCES)
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
nisam.h heap.h merge.h my_bitmap.h\
......
......@@ -22,14 +22,15 @@
extern "C" {
#endif
/*
Overhead to store an element in hash
Can be used to approximate memory consumption for a hash
*/
#define HASH_OVERHEAD (sizeof(char*)*2)
typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
typedef void (*hash_free_key)(void *);
typedef struct st_hash_info {
uint next; /* index to next key */
byte *data; /* data for current entry */
} HASH_LINK;
typedef struct st_hash {
uint key_offset,key_length; /* Length of key if const length */
uint records,blength,current_record;
......
/* 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 */
/* Key cache variable structures */
#ifndef _keycache_h
#define _keycache_h
C_MODE_START
/* declare structures that is used by st_key_cache */
struct st_block_link;
typedef struct st_block_link BLOCK_LINK;
struct st_keycache_page;
typedef struct st_keycache_page KEYCACHE_PAGE;
struct st_hash_link;
typedef struct st_hash_link HASH_LINK;
/* info about requests in a waiting queue */
typedef struct st_keycache_wqueue
{
struct st_my_thread_var *last_thread; /* circular list of waiting threads */
} KEYCACHE_WQUEUE;
#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
/*
The key cache structure
It also contains read-only statistics parameters.
*/
typedef struct st_key_cache
{
my_bool key_cache_inited;
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
uint key_cache_shift;
ulong key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */
ulonglong keycache_time; /* total number of block link operations */
uint hash_entries; /* max number of entries in the hash table */
int hash_links; /* max number of hash links */
int hash_links_used; /* number of hash links currently used */
int disk_blocks; /* max number of blocks in the cache */
ulong blocks_used; /* number of currently used blocks */
ulong blocks_changed; /* number of currently dirty blocks */
ulong warm_blocks; /* number of blocks in warm sub-chain */
ulong cnt_for_resize_op; /* counter to block resize operation */
long blocks_available; /* number of blocks available in the LRU chain */
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
HASH_LINK *hash_link_root; /* memory for hash table links */
HASH_LINK *free_hash_list; /* list of free hash links */
BLOCK_LINK *block_root; /* memory for block links */
byte HUGE_PTR *block_mem; /* memory for block buffers */
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
pthread_mutex_t cache_lock; /* to lock access to the cache structure */
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */
BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/
BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/
/*
The following variables are and variables used to hold parameters for
initializing the key cache.
*/
ulonglong param_buff_size; /* size the memory allocated for the cache */
ulong param_block_size; /* size of the blocks in the key cache */
ulong param_division_limit; /* min. percentage of warm blocks */
ulong param_age_threshold; /* determines when hot block is downgraded */
/* Statistics variables */
ulong global_blocks_used; /* number of currently used blocks */
ulong global_blocks_changed; /* number of currently dirty blocks */
ulong global_cache_w_requests;/* number of write requests (write hits) */
ulong global_cache_write; /* number of writes from the cache to files */
ulong global_cache_r_requests;/* number of read requests (read hits) */
ulong global_cache_read; /* number of reads from files to the cache */
int blocks; /* max number of blocks in the cache */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
} KEY_CACHE;
/* The default key cache */
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ulong use_mem, uint division_limit,
uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
ulong use_mem, uint division_limit,
uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
uint age_threshold);
extern byte *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
byte *buff, uint length,
uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
byte *buff, uint length);
extern int key_cache_write(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
byte *buff, uint length,
uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE *keycache,
int file, enum flush_type type);
extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
/* Functions to handle multiple key caches */
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
extern KEY_CACHE *multi_key_cache_search(byte *key, uint length);
extern my_bool multi_key_cache_set(const byte *key, uint length,
KEY_CACHE *key_cache);
extern void multi_key_cache_change(KEY_CACHE *old_data,
KEY_CACHE *new_data);
C_MODE_END
#endif /* _keycache_h */
......@@ -335,6 +335,14 @@ uint my_instr_mb(struct charset_info_st *,
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
#undef _U
#undef _L
#undef _NMR
#undef _SPC
#undef _PNT
#undef _CTR
#undef _B
#undef _X
#define _U 01 /* Upper case */
#define _L 02 /* Lower case */
......
......@@ -46,7 +46,6 @@
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
#define HA_OPEN_ABORT_IF_CRASHED 16
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
#define HA_OPEN_TO_ASSIGN 64 /* Open for key cache assignment */
/* The following is parameter to ha_rkey() how to use key */
......
......@@ -468,7 +468,7 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
typedef struct st_safe_mutex_t
{
pthread_mutex_t global,mutex;
char *file;
const char *file;
uint line,count;
pthread_t thread;
#ifdef SAFE_MUTEX_DETECT_DESTROY
......@@ -487,7 +487,7 @@ typedef struct st_safe_mutex_info_t
{
struct st_safe_mutex_info_t *next;
struct st_safe_mutex_info_t *prev;
char *init_file;
const char *init_file;
uint32 init_line;
} safe_mutex_info_t;
#endif /* SAFE_MUTEX_DETECT_DESTROY */
......
......@@ -265,8 +265,7 @@ enum cache_type
enum flush_type
{
FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE,
FLUSH_REMOVE
FLUSH_KEEP, FLUSH_RELEASE, FLUSH_IGNORE_CHANGED, FLUSH_FORCE_WRITE
};
typedef struct st_record_cache /* Used when cacheing records */
......@@ -505,44 +504,6 @@ my_off_t my_b_append_tell(IO_CACHE* info);
typedef uint32 ha_checksum;
/* Pointer to a key cache data structure (see the key cache module) */
typedef struct st_key_cache* KEY_CACHE_HANDLE;
/* Key cache variable structure */
/*
The structure contains the parameters of a key cache that can
be set and undated by regular set global statements.
It also contains read-only statistics parameters.
If the corresponding key cache data structure has been already
created the variable contains the key cache handle.
The variables are put into a named list called key_caches.
At present the variables are only added to this list.
*/
typedef struct st_key_cache_var
{
ulonglong buff_size; /* size the memory allocated for the cache */
ulong block_size; /* size of the blocks in the key cache */
ulong division_limit; /* min. percentage of warm blocks */
ulong age_threshold; /* determines when hot block is downgraded */
KEY_CACHE_HANDLE cache; /* handles for the current and registered */
ulong blocks_used; /* number of currently used blocks */
ulong blocks_changed; /* number of currently dirty blocks */
ulong cache_w_requests; /* number of write requests (write hits) */
ulong cache_write; /* number of writes from the cache to files */
ulong cache_r_requests; /* number of read requests (read hits) */
ulong cache_read; /* number of reads from files to the cache */
int blocks; /* max number of blocks in the cache */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
struct st_key_cache_asmt *assign_list; /* list of assignments to the cache */
int assignments; /* number of not completed assignments */
void (*action)(void *); /* optional call back function */
void *extra_info; /* ptr to extra info */
} KEY_CACHE_VAR;
extern KEY_CACHE_HANDLE *dflt_keycache;
extern KEY_CACHE_VAR dflt_key_cache_var;
#include <my_alloc.h>
/* Prototypes for mysys and my_func functions */
......@@ -682,33 +643,6 @@ extern int flush_write_cache(RECORD_CACHE *info);
extern long my_clock(void);
extern sig_handler sigtstp_handler(int signal_number);
extern void handle_recived_signals(void);
extern int init_key_cache(KEY_CACHE_HANDLE *pkeycache,
uint key_cache_block_size,
ulong use_mem, KEY_CACHE_VAR* env);
extern int resize_key_cache(KEY_CACHE_HANDLE *pkeycache,
uint key_cache_block_size, ulong use_mem);
extern void change_key_cache_param(KEY_CACHE_HANDLE keycache);
extern byte *key_cache_read(KEY_CACHE_HANDLE keycache,
File file, my_off_t filepos, int level,
byte* buff, uint length,
uint block_length,int return_buffer);
extern int key_cache_insert(KEY_CACHE_HANDLE keycache,
File file, my_off_t filepos, int level,
byte *buff, uint length);
extern int key_cache_write(KEY_CACHE_HANDLE keycache,
File file, my_off_t filepos, int level,
byte* buff, uint length,
uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE_HANDLE keycache,
int file, enum flush_type type);
extern void end_key_cache(KEY_CACHE_HANDLE keycache, my_bool cleanup);
extern my_bool multi_keycache_init(void);
extern void multi_keycache_free(void);
extern KEY_CACHE_HANDLE *multi_key_cache_search(byte *key, uint length);
extern my_bool multi_key_cache_set(const byte *key, uint length,
KEY_CACHE_HANDLE *key_cache);
extern void multi_key_cache_change(KEY_CACHE_HANDLE *old_data,
KEY_CACHE_HANDLE *new_data);
extern sig_handler my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(void *base,uint items,size_s size);
......
......@@ -28,6 +28,9 @@ extern "C" {
#ifndef _m_ctype_h
#include <m_ctype.h>
#endif
#ifndef _keycache_h
#include "keycache.h"
#endif
#include "my_handler.h"
/* defines used by myisam-funktions */
......@@ -315,6 +318,7 @@ typedef struct st_mi_check_param
ulonglong auto_increment_value;
ulonglong max_data_file_length;
ulonglong keys_in_use;
ulonglong max_record_length;
my_off_t search_after_block;
my_off_t new_file_pos,key_file_blocks;
my_off_t keydata,totaldata,key_blocks,start_check_pos;
......@@ -408,9 +412,9 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows);
void mi_flush_bulk_insert(MI_INFO *info, uint inx);
void mi_end_bulk_insert(MI_INFO *info);
int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map,
KEY_CACHE_VAR *key_cache);
void mi_change_key_cache(KEY_CACHE_VAR *old_key_cache,
KEY_CACHE_VAR *new_key_cache);
KEY_CACHE *key_cache);
void mi_change_key_cache(KEY_CACHE *old_key_cache,
KEY_CACHE *new_key_cache);
int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves);
#ifdef __cplusplus
......
......@@ -535,10 +535,10 @@ typedef struct st_mysql_stmt
char *query; /* query buffer */
MEM_ROOT mem_root; /* root allocations */
my_ulonglong last_fetched_column; /* last fetched column */
unsigned long param_count; /* parameters count */
unsigned long field_count; /* fields count */
unsigned long stmt_id; /* Id for prepared statement */
unsigned int last_errno; /* error code */
unsigned int param_count; /* parameters count */
unsigned int field_count; /* fields count */
enum PREP_STMT_STATE state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
char sqlstate[SQLSTATE_LENGTH+1];
......@@ -552,27 +552,27 @@ typedef struct st_mysql_stmt
typedef struct st_mysql_methods
{
my_bool (* STDCALL read_query_result)(MYSQL *mysql);
my_bool (* STDCALL advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const char *header,
unsigned long header_length,
const char *arg,
unsigned long arg_length,
my_bool skip_check);
MYSQL_DATA *(* STDCALL read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (* STDCALL use_result)(MYSQL *mysql);
void (* STDCALL fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
my_bool (*read_query_result)(MYSQL *mysql);
my_bool (*advanced_command)(MYSQL *mysql,
enum enum_server_command command,
const char *header,
unsigned long header_length,
const char *arg,
unsigned long arg_length,
my_bool skip_check);
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
unsigned int fields);
MYSQL_RES * (*use_result)(MYSQL *mysql);
void (*fetch_lengths)(unsigned long *to,
MYSQL_ROW column, unsigned int field_count);
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
MYSQL_FIELD * (* STDCALL list_fields)(MYSQL *mysql);
my_bool (* STDCALL read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (* STDCALL stmt_execute)(MYSQL_STMT *stmt);
MYSQL_DATA *(* STDCALL read_binary_rows)(MYSQL_STMT *stmt);
int (* STDCALL unbuffered_fetch)(MYSQL *mysql, char **row);
void (* STDCALL free_embedded_thd)(MYSQL *mysql);
const char *(* STDCALL read_statistic)(MYSQL *mysql);
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
MYSQL_DATA *(*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
const char *(*read_statistic)(MYSQL *mysql);
#endif
} MYSQL_METHODS;
......
......@@ -118,7 +118,7 @@ enum enum_server_command
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
#define CLIENT_REMEMBER_OPTIONS (1L << 31)
#define CLIENT_REMEMBER_OPTIONS ((ulong) (1L << 31))
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
......
......@@ -34,7 +34,7 @@ void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql);
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
my_bool STDCALL
my_bool
cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
const char *header, ulong header_length,
const char *arg, ulong arg_length, my_bool skip_check);
......
......@@ -177,7 +177,7 @@ struct st_vio
void (*viodelete)(Vio*);
int (*vioerrno)(Vio*);
int (*read)(Vio*, gptr, int);
int (*write)(Vio*, gptr, int);
int (*write)(Vio*, const gptr, int);
int (*vioblocking)(Vio*, my_bool, my_bool *);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
......
......@@ -600,8 +600,8 @@ btr_page_get_father_for_rec(
"InnoDB: father ptr page no %lu, child page no %lu\n",
(UT_LIST_GET_FIRST(tree->tree_indexes))->table_name,
(UT_LIST_GET_FIRST(tree->tree_indexes))->name,
btr_node_ptr_get_child_page_no(node_ptr),
buf_frame_get_page_no(page));
(unsigned long) btr_node_ptr_get_child_page_no(node_ptr),
(unsigned long) buf_frame_get_page_no(page));
page_rec_print(page_rec_get_next(page_get_infimum_rec(page)));
page_rec_print(node_ptr);
......@@ -877,7 +877,9 @@ btr_page_reorganize_low(
"InnoDB: Error: page old data size %lu new data size %lu\n"
"InnoDB: Error: page old max ins size %lu new max ins size %lu\n"
"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n",
data_size1, data_size2, max_ins_size1, max_ins_size2);
(unsigned long) data_size1, (unsigned long) data_size2,
(unsigned long) max_ins_size1,
(unsigned long) max_ins_size2);
}
buf_frame_free(new_page);
......@@ -2356,8 +2358,10 @@ btr_index_rec_validate(
"InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n"
"InnoDB: has %lu fields, should have %lu\n",
index->name, index->table_name,
buf_frame_get_page_no(page), (ulint)(rec - page),
rec_get_n_fields(rec), n);
(unsigned long) buf_frame_get_page_no(page),
(unsigned long) (rec - page),
(unsigned long) rec_get_n_fields(rec),
(unsigned long) n);
if (!dump_on_error) {
......@@ -2390,9 +2394,11 @@ btr_index_rec_validate(
"InnoDB: Record in index %s in table %s, page %lu, at offset %lu\n"
"InnoDB: field %lu len is %lu, should be %lu\n",
index->name, index->table_name,
buf_frame_get_page_no(page),
(ulint)(rec - page),
i, len, dtype_get_fixed_size(type));
(unsigned long) buf_frame_get_page_no(page),
(unsigned long) (rec - page),
(unsigned long) i,
(unsigned long) len,
(unsigned long) dtype_get_fixed_size(type));
if (!dump_on_error) {
......@@ -2541,7 +2547,7 @@ btr_validate_level(
fprintf(stderr,
"InnoDB: Error on pages %lu and %lu in index %s table %s\n",
buf_frame_get_page_no(page),
right_page_no,
(unsigned long) right_page_no,
index->name, index->table_name);
fprintf(stderr,
......@@ -2581,7 +2587,7 @@ btr_validate_level(
&mtr)) {
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
buf_frame_get_page_no(page),
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
fprintf(stderr,
......@@ -2596,7 +2602,7 @@ btr_validate_level(
fprintf(stderr,
"InnoDB: node ptr child page n:o %lu\n",
btr_node_ptr_get_child_page_no(node_ptr));
(unsigned long) btr_node_ptr_get_child_page_no(node_ptr));
rec_sprintf(err_buf, 900,
btr_page_get_father_for_rec(tree, page,
......@@ -2679,7 +2685,7 @@ btr_validate_level(
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
buf_frame_get_page_no(page),
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
buf_page_print(father_page);
......@@ -2699,7 +2705,7 @@ btr_validate_level(
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
buf_frame_get_page_no(page),
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
buf_page_print(father_page);
......@@ -2717,7 +2723,7 @@ btr_validate_level(
fprintf(stderr,
"InnoDB: Error on page %lu in index %s table %s\n",
buf_frame_get_page_no(page),
(unsigned long) buf_frame_get_page_no(page),
index->name, index->table_name);
buf_page_print(father_page);
......
......@@ -874,8 +874,8 @@ btr_cur_optimistic_insert(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to insert to table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
dtuple_print(entry);
}
......@@ -978,7 +978,8 @@ btr_cur_optimistic_insert(
fprintf(stderr,
"InnoDB: Error: cannot insert tuple %s to index %s of table %s\n"
"InnoDB: max insert size %lu\n",
err_buf, index->name, index->table->name, max_size);
err_buf, index->name, index->table->name,
(unsigned long) max_size);
mem_free(err_buf);
}
......@@ -1343,8 +1344,8 @@ btr_cur_update_sec_rec_in_place(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to update table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
}
......@@ -1407,8 +1408,8 @@ btr_cur_update_in_place(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to update table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
}
......@@ -1509,8 +1510,8 @@ btr_cur_optimistic_update(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to update table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
}
......@@ -2059,8 +2060,8 @@ btr_cur_del_mark_set_clust_rec(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to del mark table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
index->table_name, index->name);
rec_print(rec);
}
......@@ -2199,8 +2200,8 @@ btr_cur_del_mark_set_sec_rec(
if (btr_cur_print_record_ops && thr) {
printf(
"Trx with id %lu %lu going to del mark table %s index %s\n",
ut_dulint_get_high(thr_get_trx(thr)->id),
ut_dulint_get_low(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
(unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
cursor->index->table_name, cursor->index->name);
rec_print(rec);
}
......
......@@ -332,8 +332,12 @@ dict_boot(void)
dict_mem_table_add_col(table, (char *) "PAGE_NO", DATA_INT, 0, 4, 0);
/* The '+ 2' below comes from the 2 system fields */
ut_ad(DICT_SYS_INDEXES_PAGE_NO_FIELD == 6 + 2);
ut_ad(DICT_SYS_INDEXES_SPACE_NO_FIELD == 5 + 2);
#if DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2
#error "DICT_SYS_INDEXES_PAGE_NO_FIELD != 6 + 2"
#endif
#if DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2
#error "DICT_SYS_INDEXES_SPACE_NO_FIELD != 5 + 2"
#endif
table->id = DICT_INDEXES_ID;
dict_table_add_to_cache(table);
......
......@@ -84,7 +84,8 @@ completes, we decrement the count and return the file node to the LRU-list if
the count drops to zero. */
/* When mysqld is run, the default directory "." is the mysqld datadir,
but in ibbackup we must set it explicitly */
but in the MySQL Embedded Server Library and ibbackup it is not the default
directory, and we must set the base file path explicitly */
char* fil_path_to_mysql_datadir = (char*)".";
ulint fil_n_pending_log_flushes = 0;
......@@ -1576,7 +1577,8 @@ fil_op_write_log(
mlog_close(mtr, log_ptr);
mlog_catenate_string(mtr, (byte*) new_name, ut_strlen(new_name) + 1);
mlog_catenate_string(mtr, (byte*) new_name,
ut_strlen(new_name) + 1);
}
}
#endif
......@@ -1696,7 +1698,9 @@ fil_op_log_parse_or_replay(
if (fil_get_space_id_for_table(new_name)
== ULINT_UNDEFINED) {
ut_a(fil_rename_tablespace(name, space_id,
/* We do not care of the old name, that is
why we pass NULL as the first argument */
ut_a(fil_rename_tablespace(NULL, space_id,
new_name));
}
}
......@@ -1956,7 +1960,9 @@ fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char* old_name, /* in: old table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
ulint id, /* in: space id */
char* new_name) /* in: new table name in the standard
databasename/tablename format of InnoDB */
......@@ -1967,9 +1973,15 @@ fil_rename_tablespace(
fil_node_t* node;
ulint count = 0;
char* path = NULL;
ibool old_name_was_specified = TRUE;
char old_path[OS_FILE_MAX_PATH];
ut_a(id != 0);
if (old_name == NULL) {
old_name = (char*)"(name not specified)";
old_name_was_specified = FALSE;
}
retry:
count++;
......@@ -2038,16 +2050,19 @@ fil_rename_tablespace(
}
/* Check that the old name in the space is right */
ut_a(strlen(old_name) + strlen(fil_path_to_mysql_datadir)
< OS_FILE_MAX_PATH - 10);
sprintf(old_path, "%s/%s.ibd", fil_path_to_mysql_datadir, old_name);
srv_normalize_path_for_win(old_path);
if (old_name_was_specified) {
ut_a(strlen(old_name) + strlen(fil_path_to_mysql_datadir)
< OS_FILE_MAX_PATH - 10);
sprintf(old_path, "%s/%s.ibd", fil_path_to_mysql_datadir,
old_name);
srv_normalize_path_for_win(old_path);
ut_a(strcmp(space->name, old_path) == 0);
ut_a(strcmp(node->name, old_path) == 0);
ut_a(strcmp(space->name, old_path) == 0);
ut_a(strcmp(node->name, old_path) == 0);
} else {
sprintf(old_path, "%s", space->name);
}
/* Rename the tablespace and the node in the memory cache */
......@@ -2066,8 +2081,6 @@ fil_rename_tablespace(
goto func_exit;
}
/* printf("Renaming tablespace %s to %s id %lu\n", path, old_path, id);
*/
success = os_file_rename(old_path, path);
if (!success) {
......
......@@ -203,7 +203,7 @@ btr_node_ptr_get_child_page_no(
if (page_no == 0) {
fprintf(stderr,
"InnoDB: a nonsensical page number 0 in a node ptr record at offset %lu\n",
(ulint)(rec - buf_frame_align(rec)));
(unsigned long)(rec - buf_frame_align(rec)));
buf_page_print(buf_frame_align(rec));
}
......
......@@ -219,8 +219,8 @@ buf_block_align(
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
(ulint)ptr, (ulint)frame_zero,
(ulint)(buf_pool->high_end));
(long)ptr, (long)frame_zero,
(long)(buf_pool->high_end));
ut_a(0);
}
......@@ -255,8 +255,8 @@ buf_frame_align(
"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
(ulint)ptr, (ulint)(buf_pool->frame_zero),
(ulint)(buf_pool->high_end));
(long)ptr, (long)(buf_pool->frame_zero),
(long)(buf_pool->high_end));
ut_a(0);
}
......
......@@ -329,7 +329,9 @@ fil_rename_tablespace(
/*==================*/
/* out: TRUE if success */
char* old_name, /* in: old table name in the standard
databasename/tablename format of InnoDB */
databasename/tablename format of InnoDB, or
NULL if we do the rename based on the space
id only */
ulint id, /* in: space id */
char* new_name); /* in: new table name in the standard
databasename/tablename format of InnoDB */
......
......@@ -282,6 +282,15 @@ os_file_delete(
/*===========*/
/* out: TRUE if success */
char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Deletes a file if it exists. The file has to be closed before calling this. */
ibool
os_file_delete_if_exists(
/*=====================*/
/* out: TRUE if success */
char* name); /* in: file path as a null-terminated string */
/***************************************************************************
Renames a file (can also move it to another directory). It is safest that the
file is closed before calling this function. */
......@@ -379,6 +388,23 @@ os_file_read(
offset */
ulint n); /* in: number of bytes to read */
/***********************************************************************
Requests a synchronous positioned read operation. This function does not do
any error handling. In case of error it returns FALSE. */
ibool
os_file_read_no_error_handling(
/*===========================*/
/* out: TRUE if request was
successful, FALSE if fail */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read */
ulint offset, /* in: least significant 32 bits of file
offset where to read */
ulint offset_high,/* in: most significant 32 bits of
offset */
ulint n); /* in: number of bytes to read */
/***********************************************************************
Requests a synchronous write operation. */
ibool
......
......@@ -77,7 +77,7 @@ open_step(
if (err != DB_SUCCESS) {
/* SQL error detected */
printf("SQL error %lu\n", err);
printf("SQL error %lu\n", (unsigned long) err);
ut_error;
que_thr_handle_error(thr, err, NULL, 0);
......
......@@ -86,8 +86,8 @@ upd_field_set_field_no(
fprintf(stderr,
"InnoDB: Error: trying to access field %lu in table %s\n"
"InnoDB: index %s, but index has only %lu fields\n",
field_no, index->table_name, index->name,
dict_index_get_n_fields(index));
(unsigned long) field_no, index->table_name, index->name,
(unsigned long) dict_index_get_n_fields(index));
}
dtype_copy(dfield_get_type(&(upd_field->new_val)),
......
......@@ -63,7 +63,7 @@ trx_rsegf_get_nth_undo(
{
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to get slot %lu of rseg\n", n);
"InnoDB: Error: trying to get slot %lu of rseg\n", (unsigned long) n);
ut_a(0);
}
......@@ -84,7 +84,7 @@ trx_rsegf_set_nth_undo(
{
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to set slot %lu of rseg\n", n);
"InnoDB: Error: trying to set slot %lu of rseg\n", (unsigned long) n);
ut_a(0);
}
......
......@@ -346,6 +346,7 @@ os_file_handle_error(
return(FALSE);
} else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
return(TRUE);
} else if (err == OS_FILE_ALREADY_EXISTS) {
......@@ -368,6 +369,68 @@ os_file_handle_error(
return(FALSE);
}
/********************************************************************
Does error handling when a file operation fails. */
static
ibool
os_file_handle_error_no_exit(
/*=========================*/
/* out: TRUE if we should retry the
operation */
os_file_t file, /* in: file pointer */
char* name, /* in: name of a file or NULL */
const char* operation)/* in: operation */
{
ulint err;
UT_NOT_USED(file);
err = os_file_get_last_error(FALSE);
if (err == OS_FILE_DISK_FULL) {
/* We only print a warning about disk full once */
if (os_has_said_disk_full) {
return(FALSE);
}
if (name) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Encountered a problem with file %s\n", name);
}
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Disk is full. Try to clean the disk to free space.\n");
os_has_said_disk_full = TRUE;
fflush(stderr);
return(FALSE);
} else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
return(TRUE);
} else if (err == OS_FILE_ALREADY_EXISTS) {
return(FALSE);
} else {
if (name) {
fprintf(stderr, "InnoDB: File name %s\n", name);
}
fprintf(stderr, "InnoDB: File operation call: '%s'.\n",
operation);
return (FALSE);
}
return(FALSE);
}
/********************************************************************
Creates the seek mutexes used in positioned reads and writes. */
......@@ -409,7 +472,7 @@ os_file_opendir(
ut_a(strlen(dirname) < OS_FILE_MAX_PATH);
strcpy(path, dirname);
strcpy(path + strlen(path), "\\");
strcpy(path + strlen(path), "\\*");
/* Note that in Windows opening the 'directory stream' also retrieves
the first entry in the directory. Since it is '.', that is no problem,
......@@ -457,7 +520,7 @@ os_file_closedir(
ret = FindClose(dir);
if (!ret) {
os_file_handle_error(NULL, NULL, "closedir");
os_file_handle_error_no_exit(NULL, NULL, "closedir");
return(-1);
}
......@@ -469,7 +532,7 @@ os_file_closedir(
ret = closedir(dir);
if (ret) {
os_file_handle_error(0, NULL, "closedir");
os_file_handle_error_no_exit(0, NULL, "closedir");
}
return(ret);
......@@ -538,8 +601,8 @@ dbname.sym can redirect a database directory:
return(1);
} else {
os_file_handle_error(NULL, dirname, "readdir_next_file");
os_file_handle_error_no_exit(NULL, dirname,
"readdir_next_file");
return(-1);
}
#else
......@@ -570,7 +633,7 @@ dbname.sym can redirect a database directory:
ret = stat(full_path, &statinfo);
if (ret) {
os_file_handle_error(0, full_path, "stat");
os_file_handle_error_no_exit(0, full_path, "stat");
ut_free(full_path);
......@@ -1063,6 +1126,67 @@ os_file_create(
#endif
}
/***************************************************************************
Deletes a file if it exists. The file has to be closed before calling this. */
ibool
os_file_delete_if_exists(
/*=====================*/
/* out: TRUE if success */
char* name) /* in: file path as a null-terminated string */
{
#ifdef __WIN__
BOOL ret;
ulint count = 0;
loop:
/* In Windows, deleting an .ibd file may fail if ibbackup is copying
it */
ret = DeleteFile((LPCTSTR)name);
if (ret) {
return(TRUE);
}
if (GetLastError() == ERROR_PATH_NOT_FOUND) {
/* the file does not exist, this not an error */
return(TRUE);
}
count++;
if (count > 100 && 0 == (count % 10)) {
fprintf(stderr,
"InnoDB: Warning: cannot delete file %s\n"
"InnoDB: Are you running ibbackup to back up the file?\n", name);
os_file_get_last_error(TRUE); /* print error information */
}
os_thread_sleep(1000000); /* sleep for a second */
if (count > 2000) {
return(FALSE);
}
goto loop;
#else
int ret;
ret = unlink((const char*)name);
if (ret != 0 && errno != ENOENT) {
os_file_handle_error(0, name, "delete");
return(FALSE);
}
return(TRUE);
#endif
}
/***************************************************************************
Deletes a file. The file has to be closed before calling this. */
......@@ -1746,6 +1870,92 @@ os_file_read(
return(FALSE);
}
/***********************************************************************
Requests a synchronous positioned read operation. This function does not do
any error handling. In case of error it returns FALSE. */
ibool
os_file_read_no_error_handling(
/*===========================*/
/* out: TRUE if request was
successful, FALSE if fail */
os_file_t file, /* in: handle to a file */
void* buf, /* in: buffer where to read */
ulint offset, /* in: least significant 32 bits of file
offset where to read */
ulint offset_high, /* in: most significant 32 bits of
offset */
ulint n) /* in: number of bytes to read */
{
#ifdef __WIN__
BOOL ret;
DWORD len;
DWORD ret2;
DWORD low;
DWORD high;
ibool retry;
ulint i;
ut_a((offset & 0xFFFFFFFFUL) == offset);
os_n_file_reads++;
os_bytes_read_since_printout += n;
try_again:
ut_ad(file);
ut_ad(buf);
ut_ad(n > 0);
low = offset;
high = offset_high;
/* Protect the seek / read operation with a mutex */
i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
os_mutex_enter(os_file_seek_mutexes[i]);
ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
os_mutex_exit(os_file_seek_mutexes[i]);
goto error_handling;
}
ret = ReadFile(file, buf, n, &len, NULL);
os_mutex_exit(os_file_seek_mutexes[i]);
if (ret && len == n) {
return(TRUE);
}
#else
ibool retry;
ssize_t ret;
os_bytes_read_since_printout += n;
try_again:
ret = os_file_pread(file, buf, n, offset, offset_high);
if ((ulint)ret == n) {
return(TRUE);
}
#endif
#ifdef __WIN__
error_handling:
#endif
retry = os_file_handle_error_no_exit(file, NULL, "read");
if (retry) {
goto try_again;
}
return(FALSE);
}
/***********************************************************************
Requests a synchronous write operation. */
......
......@@ -1235,7 +1235,8 @@ opt_print_query_plan(
printf(
"Table %s index %s; exact m. %lu, match %lu, end conds %lu\n",
plan->table->name, plan->index->name,
plan->n_exact_match, n_fields,
UT_LIST_GET_LEN(plan->end_conds));
(unsigned long) plan->n_exact_match,
(unsigned long) n_fields,
(unsigned long) UT_LIST_GET_LEN(plan->end_conds));
}
}
......@@ -513,7 +513,7 @@ que_graph_free_recursive(
if (thr->magic_n != QUE_THR_MAGIC_N) {
fprintf(stderr,
"que_thr struct appears corrupt; magic n %lu\n",
thr->magic_n);
(unsigned long) thr->magic_n);
mem_analyze_corruption((byte*)thr);
ut_a(0);
}
......@@ -625,7 +625,7 @@ que_graph_free_recursive(
default:
fprintf(stderr,
"que_node struct appears corrupt; type %lu\n",
que_node_get_type(node));
(unsigned long) que_node_get_type(node));
mem_analyze_corruption((byte*)node);
ut_a(0);
}
......@@ -1105,7 +1105,8 @@ que_thr_move_to_run_state_for_mysql(
{
if (thr->magic_n != QUE_THR_MAGIC_N) {
fprintf(stderr,
"que_thr struct appears corrupt; magic n %lu\n", thr->magic_n);
"que_thr struct appears corrupt; magic n %lu\n",
(unsigned long) thr->magic_n);
mem_analyze_corruption((byte*)thr);
......@@ -1141,7 +1142,8 @@ que_thr_stop_for_mysql_no_error(
if (thr->magic_n != QUE_THR_MAGIC_N) {
fprintf(stderr,
"que_thr struct appears corrupt; magic n %lu\n", thr->magic_n);
"que_thr struct appears corrupt; magic n %lu\n",
(unsigned long) thr->magic_n);
mem_analyze_corruption((byte*)thr);
......@@ -1216,7 +1218,8 @@ que_node_print_info(
str = (char *) "UNKNOWN NODE TYPE";
}
printf("Node type %lu: %s, address %lx\n", type, str, addr);
printf("Node type %lu: %s, address %lx\n", (unsigned long) type, str,
(unsigned long) addr);
}
/**************************************************************************
......
......@@ -50,7 +50,7 @@ int nisam_lock_database(N_INFO *info, int lock_type)
else
count= --share->w_locks;
if (info->lock_type == F_WRLCK && !share->w_locks &&
flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_KEEP))
flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_KEEP))
error=my_errno;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
if (end_io_cache(&info->rec_cache))
......@@ -329,7 +329,7 @@ int _nisam_test_if_changed(register N_INFO *info)
share->state.uniq != info->last_uniq)
{ /* Keyfile has changed */
if (share->state.process != share->this_process)
VOID(flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_RELEASE));
VOID(flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_RELEASE));
share->last_process=share->state.process;
info->last_loop= share->state.loop;
info->last_uniq= share->state.uniq;
......
......@@ -27,7 +27,7 @@ uchar *_nisam_fetch_keypage(register N_INFO *info, N_KEYDEF *keyinfo,
my_off_t page, uchar *buff, int return_buffer)
{
uchar *tmp;
tmp=(uchar*) key_cache_read(*dflt_keycache,
tmp=(uchar*) key_cache_read(dflt_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,(byte*) buff,
(uint) keyinfo->base.block_length,
(uint) keyinfo->base.block_length,
......@@ -84,7 +84,7 @@ int _nisam_write_keypage(register N_INFO *info, register N_KEYDEF *keyinfo,
length=keyinfo->base.block_length;
}
#endif
return (key_cache_write(*dflt_keycache,
return (key_cache_write(dflt_key_cache,
info->s->kfile,page,DFLT_INIT_HITS,
(byte*) buff,length,
(uint) keyinfo->base.block_length,
......@@ -102,7 +102,7 @@ int _nisam_dispose(register N_INFO *info, N_KEYDEF *keyinfo, my_off_t pos)
old_link=info->s->state.key_del[keynr];
info->s->state.key_del[keynr]=(ulong) pos;
DBUG_RETURN(key_cache_write(*dflt_keycache,
DBUG_RETURN(key_cache_write(dflt_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &old_link,
sizeof(long),
......@@ -131,7 +131,7 @@ ulong _nisam_new(register N_INFO *info, N_KEYDEF *keyinfo)
}
else
{
if (!key_cache_read(*dflt_keycache,
if (!key_cache_read(dflt_key_cache,
info->s->kfile,pos,DFLT_INIT_HITS,
(byte*) &info->s->state.key_del[keynr],
(uint) sizeof(long),
......
......@@ -57,7 +57,7 @@ int nisam_close(register N_INFO *info)
if (flag)
{
if (share->kfile >= 0 &&
flush_key_blocks(*dflt_keycache,share->kfile,FLUSH_RELEASE))
flush_key_blocks(dflt_key_cache,share->kfile,FLUSH_RELEASE))
error=my_errno;
if (share->kfile >= 0 && my_close(share->kfile,MYF(0)))
error = my_errno;
......
......@@ -215,7 +215,7 @@ int nisam_extra(N_INFO *info, enum ha_extra_function function)
info->s->last_version= 0L; /* Impossible version */
#ifdef __WIN__
/* Close the isam and data files as Win32 can't drop an open table */
if (flush_key_blocks(info->s->kfile,FLUSH_RELEASE))
if (flush_key_blocks(dflt_key_cache, info->s->kfile, FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
......
......@@ -516,8 +516,8 @@ static int nisamchk(my_string filename)
if (!rep_quick)
{
if (testflag & T_EXTEND)
VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,
use_buffers,&dflt_key_cache_var));
VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,
use_buffers,0,0));
VOID(init_io_cache(&read_cache,datafile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,
MYF(MY_WME)));
......@@ -1460,8 +1460,7 @@ my_string name;
printf("Data records: %lu\n",(ulong) share->state.records);
}
VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
&dflt_key_cache_var));
VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers,0,0));
if (init_io_cache(&read_cache,info->dfile,(uint) read_buffer_length,
READ_CACHE,share->pack.header_length,1,MYF(MY_WME)))
goto err;
......@@ -1889,12 +1888,12 @@ static void lock_memory(void)
static int flush_blocks(file)
File file;
{
if (flush_key_blocks(dflt_keycache,file,FLUSH_RELEASE))
if (flush_key_blocks(dflt_key_cache,file,FLUSH_RELEASE))
{
print_error("%d when trying to write bufferts",my_errno);
return(1);
}
end_key_cache(dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
return 0;
} /* flush_blocks */
......@@ -1938,8 +1937,7 @@ int write_info;
if (share->state.key_root[sort_key] == NI_POS_ERROR)
DBUG_RETURN(0); /* Nothing to do */
init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,use_buffers,
&dflt_key_cache_var);
init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,use_buffers, 0, 0);
if (init_io_cache(&info->rec_cache,-1,(uint) write_buffer_length,
WRITE_CACHE,share->pack.header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL)))
......
......@@ -24,6 +24,7 @@
#else
#include <my_no_pthread.h>
#endif
#include <keycache.h>
#ifdef my_write
#undef my_write /* We want test if disk full */
......
......@@ -329,8 +329,8 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
&dflt_key_cache_var));
VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
0,0));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
!my_b_read(&cache,(byte*) head,9))
......@@ -622,7 +622,7 @@ static int examine_log(my_string file_name, char **table_names)
goto end;
}
}
end_key_cache(dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
......@@ -642,7 +642,7 @@ static int examine_log(my_string file_name, char **table_names)
llstr(isamlog_filepos,llbuff)));
fflush(stderr);
end:
end_key_cache(dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
......
......@@ -48,7 +48,7 @@ int nisam_panic(enum ha_panic_function flag)
if (info->s->base.options & HA_OPTION_READ_ONLY_DATA)
break;
#endif
if (flush_key_blocks(*dflt_keycache,info->s->kfile,FLUSH_RELEASE))
if (flush_key_blocks(dflt_key_cache,info->s->kfile,FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & WRITE_CACHE_USED)
if (flush_io_cache(&info->rec_cache))
......
......@@ -156,7 +156,7 @@ int main(int argc, char *argv[])
goto err;
printf("- Writing key:s\n");
if (key_cacheing)
init_key_cache(dflt_keycache,512,IO_SIZE*16,0); /* Use a small cache */
init_key_cache(dflt_key_cache,512,IO_SIZE*16,0,0); /* Use a small cache */
if (locking)
nisam_lock_database(file,F_WRLCK);
if (write_cacheing)
......@@ -674,7 +674,7 @@ int main(int argc, char *argv[])
puts("Locking used");
if (use_blob)
puts("blobs used");
end_key_cache(&dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
if (blob_buffer)
my_free(blob_buffer,MYF(0));
my_end(MY_CHECK_ERROR | MY_GIVE_INFO);
......
......@@ -20,6 +20,7 @@
#include "nisam.h"
#include <sys/types.h>
#include <keycache.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
......@@ -173,7 +174,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
init_key_cache(dflt_keycache,512,65536L,0);
init_key_cache(dflt_key_cache,512,65536L,0,0);
printf("Process %d, pid: %d\n",id,(int) getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
......
......@@ -43,18 +43,18 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename);
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
MYSQL * STDCALL
MYSQL *
cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag);
void STDCALL cli_mysql_close(MYSQL *mysql);
void cli_mysql_close(MYSQL *mysql);
MYSQL_FIELD * STDCALL cli_list_fields(MYSQL *mysql);
my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
MYSQL_DATA * STDCALL cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
MYSQL_FIELD * cli_list_fields(MYSQL *mysql);
my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
uint fields);
int STDCALL cli_stmt_execute(MYSQL_STMT *stmt);
MYSQL_DATA * STDCALL cli_read_binary_rows(MYSQL_STMT *stmt);
int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row);
const char * STDCALL cli_read_statistic(MYSQL *mysql);
int cli_stmt_execute(MYSQL_STMT *stmt);
MYSQL_DATA * cli_read_binary_rows(MYSQL_STMT *stmt);
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
const char * cli_read_statistic(MYSQL *mysql);
......@@ -15,10 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
#include <winsock.h>
#include <odbcinst.h>
#endif
#include <my_sys.h>
#include <mysys_err.h>
#include <m_string.h>
......@@ -973,16 +969,16 @@ mysql_list_tables(MYSQL *mysql, const char *wild)
DBUG_RETURN (mysql_store_result(mysql));
}
MYSQL_FIELD * STDCALL cli_list_fields(MYSQL *mysql)
MYSQL_FIELD *cli_list_fields(MYSQL *mysql)
{
MYSQL_DATA *query;
if (!(query= cli_read_rows(mysql,(MYSQL_FIELD*) 0,
protocol_41(mysql) ? 8 : 6)))
return NULL;
mysql->field_count= query->rows;
mysql->field_count= (uint) query->rows;
return unpack_fields(query,&mysql->field_alloc,
query->rows, 1, mysql->server_capabilities);
mysql->field_count, 1, mysql->server_capabilities);
}
......@@ -1112,7 +1108,7 @@ mysql_dump_debug_info(MYSQL *mysql)
DBUG_RETURN(simple_command(mysql,COM_DEBUG,0,0,0));
}
const char * STDCALL cli_read_statistic(MYSQL *mysql)
const char *cli_read_statistic(MYSQL *mysql)
{
mysql->net.read_pos[mysql->packet_length]=0; /* End of stat string */
if (!mysql->net.read_pos[0])
......@@ -1589,7 +1585,7 @@ static my_bool my_realloc_str(NET *net, ulong length)
1 error
*/
my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
{
uchar *pos;
uint field_count;
......@@ -2010,7 +2006,8 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
DBUG_RETURN(0);
}
int STDCALL cli_stmt_execute(MYSQL_STMT *stmt)
int cli_stmt_execute(MYSQL_STMT *stmt)
{
DBUG_ENTER("cli_stmt_execute");
......@@ -2985,7 +2982,7 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
return 0;
}
int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row)
int cli_unbuffered_fetch(MYSQL *mysql, char **row)
{
if (packet_error == net_safe_read(mysql))
return 1;
......@@ -3109,7 +3106,7 @@ int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
Read all rows of data from server (binary format)
*/
MYSQL_DATA * STDCALL cli_read_binary_rows(MYSQL_STMT *stmt)
MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt)
{
ulong pkt_len;
uchar *cp;
......
......@@ -19,7 +19,7 @@
target = libmysqlclient_r.la
target_defs = -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
## LIBS = @LIBS@
LIBS = @LIBS@ @openssl_libs@
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes)
......
......@@ -61,10 +61,11 @@ typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
{
FTB_EXPR *up;
byte *quot, *qend;
my_off_t docid[2]; /* for index search and for scan */
my_off_t docid[2];
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
float weight;
float cur_weight;
byte *quot, *qend;
uint flags;
uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */
......@@ -77,6 +78,7 @@ typedef struct st_ftb_word
FTB_EXPR *up;
MI_KEYDEF *keyinfo;
my_off_t docid[2]; /* for index search and for scan */
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t key_root;
float weight;
uint ndepth;
......@@ -166,11 +168,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw->word[0]=w.len;
if (param.yesno > 0) up->ythresh++;
queue_insert(& ftb->queue, (byte *)ftbw);
#ifdef TO_BE_REMOVED
/* after removing the following line,
ftb->with_scan handling can be simplified (no longer a bitmap) */
ftb->with_scan|=(param.trunc & FTB_FLAG_TRUNC);
#endif
break;
case 2: /* left bracket */
ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR));
......@@ -251,7 +249,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
}
/* going up to the first-level tree to continue search there */
_mi_dpointer(info, ftbw->word+ftbw->off+HA_FT_WLEN, ftbw->key_root);
_mi_dpointer(info, (uchar*) (ftbw->word+ftbw->off+HA_FT_WLEN),
ftbw->key_root);
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
......@@ -298,13 +297,15 @@ static void _ftb_init_index_search(FT_INFO *ftb)
if (ftbw->flags & FTB_FLAG_TRUNC)
{
/*
special treatment for truncation operator :((
1. +trunc* and there're other (not +trunc*) words
special treatment for truncation operator
1. there are some (besides this) +words
| no need to search in the index, it can never ADD new rows
| to the result, and to remove half-matched rows we do scan anyway
2. -trunc*
| same as 1.
3. trunc*
3. in 1 and 2, +/- need not be on the same expr. level,
but can be on any upper level, as in +word +(trunc1* trunc2*)
4. otherwise
| We have to index-search for this prefix.
| It may cause duplicates, as in the index (sorted by <word,docid>)
| <aaaa,row1>
......@@ -312,22 +313,31 @@ static void _ftb_init_index_search(FT_INFO *ftb)
| <aacc,row1>
| Searching for "aa*" will find row1 twice...
*/
if ( test(ftbw->flags&FTB_FLAG_NO) || /* 2 */
(test(ftbw->flags&FTB_FLAG_YES) && /* 1 */
ftbw->up->ythresh - ftbw->up->yweaks >1)) /* 1 */
{
ftbw->docid[0]=HA_POS_ERROR;
ftbw->up->yweaks++;
continue;
}
else /* 3 */
FTB_EXPR *ftbe;
for (ftbe=(FTB_EXPR*)ftbw;
ftbe->up && !(ftbe->up->flags & FTB_FLAG_TRUNC);
ftbe->up->flags|= FTB_FLAG_TRUNC, ftbe=ftbe->up)
{
if (!is_tree_inited(& ftb->no_dupes))
init_tree(&ftb->no_dupes,0,0,sizeof(my_off_t),
_ftb_no_dupes_cmp, 0, NULL, NULL);
else
reset_tree(& ftb->no_dupes);
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */
{
FTB_EXPR *top_ftbe=ftbe->up->up;
ftbw->docid[0]=HA_POS_ERROR;
for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up)
if (ftbe->flags & FTB_FLAG_YES)
ftbe->yweaks++;
ftbe=0;
break;
}
}
if (!ftbe)
continue;
/* 3 */
if (!is_tree_inited(& ftb->no_dupes))
init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t),
_ftb_no_dupes_cmp,0,0,0);
else
reset_tree(& ftb->no_dupes);
}
if (_ft2_search(ftb, ftbw, 1))
......
......@@ -80,7 +80,7 @@ int main(int argc,char *argv[])
if (argc < 2)
usage();
init_key_cache(dflt_keycache,MI_KEY_BLOCK_LENGTH,USE_BUFFER_INIT,0);
init_key_cache(dflt_key_cache,MI_KEY_BLOCK_LENGTH,USE_BUFFER_INIT, 0, 0);
if (!(info=mi_open(argv[0],2,HA_OPEN_ABORT_IF_LOCKED)))
goto err;
......@@ -172,9 +172,9 @@ int main(int argc,char *argv[])
if (dump)
{
if (subkeys>=0)
printf("%9qx %20.7f %s\n",info->lastpos,weight,buf);
printf("%9lx %20.7f %s\n", (long) info->lastpos,weight,buf);
else
printf("%9qx => %17d %s\n",info->lastpos,-subkeys,buf);
printf("%9lx => %17d %s\n",(long) info->lastpos,-subkeys,buf);
}
if (verbose && (total%HOW_OFTEN_TO_WRITE)==0)
printf("%10ld\r",total);
......@@ -189,12 +189,12 @@ int main(int argc,char *argv[])
if ((ulong) count >= total/2)
break;
}
printf("Total rows: %qu\nTotal words: %lu\n"
printf("Total rows: %lu\nTotal words: %lu\n"
"Unique words: %lu\nLongest word: %lu chars (%s)\n"
"Median length: %u\n"
"Average global weight: %f\n"
"Most common word: %lu times, weight: %f (%s)\n",
(ulonglong)info->state->records, total, uniq, maxlen, buf_maxlen,
(long) info->state->records, total, uniq, maxlen, buf_maxlen,
inx, avg_gws/uniq, max_doc_cnt, min_gws, buf_min_gws);
}
if (lstats)
......
......@@ -304,7 +304,7 @@ uint _mi_ft_convert_to_ft2(MI_INFO *info, uint keynr, uchar *key)
my_off_t root;
DYNAMIC_ARRAY *da=info->ft1_to_ft2;
MI_KEYDEF *keyinfo=&info->s->ft2_keyinfo;
uchar *key_ptr=dynamic_array_ptr(da, 0), *end;
uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end;
uint length, key_length;
DBUG_ENTER("_mi_ft_convert_to_ft2");
......@@ -329,13 +329,13 @@ uint _mi_ft_convert_to_ft2(MI_INFO *info, uint keynr, uchar *key)
DBUG_RETURN(-1);
/* inserting the rest of key values */
end=dynamic_array_ptr(da, da->elements);
end= (uchar*) dynamic_array_ptr(da, da->elements);
for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength)
if(_mi_ck_real_write_btree(info, keyinfo, key_ptr, 0, &root, SEARCH_SAME))
DBUG_RETURN(-1);
/* now, writing the word key entry */
ft_intXstore(key+key_length, -da->elements);
ft_intXstore(key+key_length, - (int) da->elements);
_mi_dpointer(info, key+key_length+HA_FT_WLEN, root);
DBUG_RETURN(_mi_ck_real_write_btree(info,
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ int mi_close(register MI_INFO *info)
if (flag)
{
if (share->kfile >= 0 &&
flush_key_blocks(*share->key_cache, share->kfile,
flush_key_blocks(share->key_cache, share->kfile,
share->temporary ? FLUSH_IGNORE_CHANGED :
FLUSH_RELEASE))
error=my_errno;
......
......@@ -53,7 +53,7 @@ int mi_delete_all_rows(MI_INFO *info)
If we are using delayed keys or if the user has done changes to the tables
since it was locked then there may be key blocks in the key cache
*/
flush_key_blocks(*share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED);
flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED);
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
goto err;
......
......@@ -283,7 +283,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
#ifdef __WIN__
/* Close the isam and data files as Win32 can't drop an open table */
pthread_mutex_lock(&share->intern_lock);
if (flush_key_blocks(*share->keycache, share->kfile,
if (flush_key_blocks(share->key_cache, share->kfile,
(function == HA_EXTRA_FORCE_REOPEN ?
FLUSH_RELEASE : FLUSH_IGNORE_CHANGED)))
{
......@@ -329,7 +329,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
break;
case HA_EXTRA_FLUSH:
if (!share->temporary)
flush_key_blocks(*share->key_cache, share->kfile, FLUSH_KEEP);
flush_key_blocks(share->key_cache, share->kfile, FLUSH_KEEP);
#ifdef HAVE_PWRITE
_mi_decrement_open_count(info);
#endif
......
......@@ -49,19 +49,19 @@
int mi_assign_to_key_cache(MI_INFO *info,
ulonglong key_map __attribute__((unused)),
KEY_CACHE_VAR *key_cache)
KEY_CACHE *key_cache)
{
int error= 0;
MYISAM_SHARE* share= info->s;
DBUG_ENTER("mi_assign_to_key_cache");
DBUG_PRINT("enter",("old_key_cache_handle: %lx new_key_cache_handle: %lx",
share->key_cache, &key_cache->cache));
share->key_cache, key_cache));
/*
Skip operation if we didn't change key cache. This can happen if we
call this for all open instances of the same table
*/
if (*share->key_cache == key_cache->cache)
if (share->key_cache == key_cache)
DBUG_RETURN(0);
/*
......@@ -76,7 +76,7 @@ int mi_assign_to_key_cache(MI_INFO *info,
in the old key cache.
*/
if (flush_key_blocks(*share->key_cache, share->kfile, FLUSH_REMOVE))
if (flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE))
{
error= my_errno;
mi_mark_crashed(info); /* Mark that table must be checked */
......@@ -90,18 +90,24 @@ int mi_assign_to_key_cache(MI_INFO *info,
(This can never fail as there is never any not written data in the
new key cache)
*/
(void) flush_key_blocks(key_cache->cache, share->kfile, FLUSH_REMOVE);
(void) flush_key_blocks(key_cache, share->kfile, FLUSH_RELEASE);
/*
ensure that setting the key cache and changing the multi_key_cache
is done atomicly
*/
pthread_mutex_lock(&share->intern_lock);
/*
Tell all threads to use the new key cache
This should be seen at the lastes for the next call to an myisam function.
*/
share->key_cache= &key_cache->cache;
share->key_cache= key_cache;
/* store the key cache in the global hash structure for future opens */
if (multi_key_cache_set(share->unique_file_name, share->unique_name_length,
share->key_cache))
error= my_errno;
pthread_mutex_unlock(&share->intern_lock);
DBUG_RETURN(error);
}
......@@ -127,8 +133,8 @@ int mi_assign_to_key_cache(MI_INFO *info,
*/
void mi_change_key_cache(KEY_CACHE_VAR *old_key_cache,
KEY_CACHE_VAR *new_key_cache)
void mi_change_key_cache(KEY_CACHE *old_key_cache,
KEY_CACHE *new_key_cache)
{
LIST *pos;
DBUG_ENTER("mi_change_key_cache");
......@@ -141,7 +147,7 @@ void mi_change_key_cache(KEY_CACHE_VAR *old_key_cache,
{
MI_INFO *info= (MI_INFO*) pos->data;
MYISAM_SHARE *share= info->s;
if (share->key_cache == &old_key_cache->cache)
if (share->key_cache == old_key_cache)
mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache);
}
......@@ -150,6 +156,6 @@ void mi_change_key_cache(KEY_CACHE_VAR *old_key_cache,
MyISAM list structure to ensure that another thread is not trying to
open a new table that will be associted with the old key cache
*/
multi_key_cache_change(&old_key_cache->cache, &new_key_cache->cache);
multi_key_cache_change(old_key_cache, new_key_cache);
pthread_mutex_unlock(&THR_LOCK_myisam);
}
......@@ -61,7 +61,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
count= --share->w_locks;
--share->tot_locks;
if (info->lock_type == F_WRLCK && !share->w_locks &&
!share->delay_key_write && flush_key_blocks(*share->key_cache,
!share->delay_key_write && flush_key_blocks(share->key_cache,
share->kfile,FLUSH_KEEP))
{
error=my_errno;
......@@ -389,7 +389,7 @@ int _mi_test_if_changed(register MI_INFO *info)
{ /* Keyfile has changed */
DBUG_PRINT("info",("index file changed"));
if (share->state.process != share->this_process)
VOID(flush_key_blocks(*share->key_cache, share->kfile, FLUSH_RELEASE));
VOID(flush_key_blocks(share->key_cache, share->kfile, FLUSH_RELEASE));
share->last_process=share->state.process;
info->last_unique= share->state.unique;
info->last_loop= share->state.update_count;
......
......@@ -32,7 +32,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_ENTER("_mi_fetch_keypage");
DBUG_PRINT("enter",("page: %ld",page));
tmp=(uchar*) key_cache_read(*info->s->key_cache,
tmp=(uchar*) key_cache_read(info->s->key_cache,
info->s->kfile, page, level, (byte*) buff,
(uint) keyinfo->block_length,
(uint) keyinfo->block_length,
......@@ -95,7 +95,7 @@ int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo,
length=keyinfo->block_length;
}
#endif
DBUG_RETURN((key_cache_write(*info->s->key_cache,
DBUG_RETURN((key_cache_write(info->s->key_cache,
info->s->kfile,page, level, (byte*) buff,length,
(uint) keyinfo->block_length,
(int) ((info->lock_type != F_UNLCK) ||
......@@ -117,7 +117,7 @@ int _mi_dispose(register MI_INFO *info, MI_KEYDEF *keyinfo, my_off_t pos,
info->s->state.key_del[keyinfo->block_size]=pos;
mi_sizestore(buff,old_link);
info->s->state.changed|= STATE_NOT_SORTED_PAGES;
DBUG_RETURN(key_cache_write(*info->s->key_cache,
DBUG_RETURN(key_cache_write(info->s->key_cache,
info->s->kfile, pos , level, buff,
sizeof(buff),
(uint) keyinfo->block_length,
......@@ -146,7 +146,7 @@ my_off_t _mi_new(register MI_INFO *info, MI_KEYDEF *keyinfo, int level)
}
else
{
if (!key_cache_read(*info->s->key_cache,
if (!key_cache_read(info->s->key_cache,
info->s->kfile, pos, level,
buff,
(uint) sizeof(buff),
......
......@@ -48,7 +48,7 @@ int mi_panic(enum ha_panic_function flag)
if (info->s->options & HA_OPTION_READ_ONLY_DATA)
break;
#endif
if (flush_key_blocks(*info->s->key_cache, info->s->kfile, FLUSH_RELEASE))
if (flush_key_blocks(info->s->key_cache, info->s->kfile, FLUSH_RELEASE))
error=my_errno;
if (info->opt_flag & WRITE_CACHE_USED)
if (flush_io_cache(&info->rec_cache))
......
......@@ -69,7 +69,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if (!(buff= (uchar *) my_malloc(length, MYF(MY_WME))))
DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM);
if (flush_key_blocks(*share->key_cache,share->kfile, FLUSH_RELEASE))
if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE))
goto err;
do
......@@ -87,7 +87,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
{
if (mi_test_if_nod(buff))
{
if (key_cache_insert(*share->key_cache,
if (key_cache_insert(share->key_cache,
share->kfile, pos, DFLT_INIT_HITS,
(byte*) buff, block_length))
goto err;
......@@ -99,7 +99,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
}
else
{
if (key_cache_insert(*share->key_cache,
if (key_cache_insert(share->key_cache,
share->kfile, pos, DFLT_INIT_HITS,
(byte*) buff, length))
goto err;
......
......@@ -50,7 +50,7 @@ int main(int argc,char *argv[])
MY_INIT(argv[0]);
my_init();
if (key_cacheing)
init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,IO_SIZE*16,0);
init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,IO_SIZE*16,0,0);
get_options(argc,argv);
exit(run_test("test1"));
......
......@@ -215,7 +215,7 @@ int main(int argc, char *argv[])
if (!silent)
printf("- Writing key:s\n");
if (key_cacheing)
init_key_cache(dflt_keycache,key_cache_block_size,key_cache_size,0); /* Use a small cache */
init_key_cache(dflt_key_cache,key_cache_block_size,key_cache_size,0,0);
if (locking)
mi_lock_database(file,F_WRLCK);
if (write_cacheing)
......@@ -276,7 +276,7 @@ int main(int argc, char *argv[])
}
}
if (key_cacheing)
resize_key_cache(dflt_keycache,key_cache_block_size,key_cache_size*2);
resize_key_cache(dflt_key_cache,key_cache_block_size,key_cache_size*2,0,0);
if (!silent)
printf("- Delete\n");
......@@ -829,7 +829,7 @@ reads: %10lu\n",
my_cache_r_requests, my_cache_read);
#endif
}
end_key_cache(*dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
if (blob_buffer)
my_free(blob_buffer,MYF(0));
my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO);
......
......@@ -177,7 +177,7 @@ void start_test(int id)
exit(1);
}
if (key_cacheing && rnd(2) == 0)
init_key_cache(dflt_keycache, KEY_CACHE_BLOCK_SIZE, 65536L,0);
init_key_cache(dflt_key_cache, KEY_CACHE_BLOCK_SIZE, 65536L, 0, 0);
printf("Process %d, pid: %d\n",id,getpid()); fflush(stdout);
for (error=i=0 ; i < tests && !error; i++)
......
......@@ -110,7 +110,8 @@ int main(int argc, char **argv)
VOID(fflush(stderr));
if ((check_param.error_printed | check_param.warning_printed) &&
(check_param.testflag & T_FORCE_CREATE) &&
(!(check_param.testflag & (T_REP | T_SORT_RECORDS | T_SORT_INDEX))))
(!(check_param.testflag & (T_REP | T_REP_BY_SORT | T_SORT_RECORDS |
T_SORT_INDEX))))
{
uint old_testflag=check_param.testflag;
if (!(check_param.testflag & T_REP))
......@@ -153,7 +154,7 @@ enum options_mc {
OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE,
OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE,
OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN,
OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT
OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT, OPT_MAX_RECORD_LENGTH
};
static struct my_option my_long_options[] =
......@@ -215,6 +216,11 @@ static struct my_option my_long_options[] =
(gptr*) &check_param.keys_in_use,
(gptr*) &check_param.keys_in_use,
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
{"max-record-length", OPT_MAX_RECORD_LENGTH,
"Skip rows bigger than this if myisamchk can't allocate memory to hold it",
(gptr*) &check_param.max_record_length,
(gptr*) &check_param.max_record_length,
0, GET_ULL, REQUIRED_ARG, LONGLONG_MAX, 0, LONGLONG_MAX, 0, 0, 0},
{"medium-check", 'm',
"Faster than extend-check, but only finds 99.99% of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
......@@ -321,13 +327,13 @@ static struct my_option my_long_options[] =
{ "ft_max_word_len", OPT_FT_MAX_WORD_LEN, "", (gptr*) &ft_max_word_len,
(gptr*) &ft_max_word_len, 0, GET_ULONG, REQUIRED_ARG, HA_FT_MAXLEN, 10,
HA_FT_MAXLEN, 0, 1, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void print_version(void)
{
printf("%s Ver 2.6 for %s at %s\n", my_progname, SYSTEM_TYPE,
printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
}
......@@ -394,6 +400,9 @@ static void usage(void)
-k, --keys-used=# Tell MyISAM to update only some specific keys. # is a\n\
bit mask of which keys to use. This can be used to\n\
get faster inserts.\n\
--max-record-length=#\n\
Skip rows bigger than this if myisamchk can't allocate\n\
memory to hold it.\n\
-r, --recover Can fix almost anything except unique keys that aren't\n\
unique.\n\
-n, --sort-recover Forces recovering with sorting even if the temporary\n\
......@@ -1032,8 +1041,8 @@ static int myisamchk(MI_CHECK *param, my_string filename)
!(param->testflag & (T_FAST | T_FORCE_CREATE)))
{
if (param->testflag & (T_EXTEND | T_MEDIUM))
VOID(init_key_cache(dflt_keycache,opt_key_cache_block_size,
param->use_buffers,&dflt_key_cache_var));
VOID(init_key_cache(dflt_key_cache,opt_key_cache_block_size,
param->use_buffers, 0, 0));
VOID(init_io_cache(&param->read_cache,datafile,
(uint) param->read_buffer_length,
READ_CACHE,
......@@ -1047,7 +1056,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
HA_OPTION_COMPRESS_RECORD)) ||
(param->testflag & (T_EXTEND | T_MEDIUM)))
error|=chk_data_link(param, info, param->testflag & T_EXTEND);
error|=flush_blocks(param, *share->key_cache, share->kfile);
error|=flush_blocks(param, share->key_cache, share->kfile);
VOID(end_io_cache(&param->read_cache));
}
if (!error)
......@@ -1456,8 +1465,8 @@ static int mi_sort_records(MI_CHECK *param,
if (share->state.key_root[sort_key] == HA_OFFSET_ERROR)
DBUG_RETURN(0); /* Nothing to do */
init_key_cache(dflt_keycache, opt_key_cache_block_size, param->use_buffers,
&dflt_key_cache_var);
init_key_cache(dflt_key_cache, opt_key_cache_block_size, param->use_buffers,
0, 0);
if (init_io_cache(&info->rec_cache,-1,(uint) param->write_buffer_length,
WRITE_CACHE,share->pack.header_length,1,
MYF(MY_WME | MY_WAIT_IF_FULL)))
......@@ -1571,7 +1580,7 @@ static int mi_sort_records(MI_CHECK *param,
my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
sort_info.buff=0;
share->state.sortkey=sort_key;
DBUG_RETURN(flush_blocks(param, *share->key_cache, share->kfile) |
DBUG_RETURN(flush_blocks(param, share->key_cache, share->kfile) |
got_error);
} /* sort_records */
......
......@@ -166,7 +166,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */
char *data_file_name, /* Resolved path names from symlinks */
*index_file_name;
byte *file_map; /* mem-map of file if possible */
KEY_CACHE_HANDLE *key_cache; /* ref to the current key cache */
KEY_CACHE *key_cache; /* ref to the current key cache */
MI_DECODE_TREE *decode_trees;
uint16 *decode_tables;
int (*read_record)(struct st_myisam_info*, my_off_t, byte*);
......@@ -713,7 +713,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param);
#ifdef THREAD
pthread_handler_decl(thr_find_all_keys,arg);
#endif
int flush_blocks(MI_CHECK *param, KEY_CACHE_HANDLE key_cache, File file);
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);
int sort_write_record(MI_SORT_PARAM *sort_param);
int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulong);
......
......@@ -71,7 +71,7 @@ static void printf_log(const char *str,...);
static bool cmp_filename(struct file_info *file_info,my_string name);
static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0,
recover=0,prefix_remove=0,opt_processes=0,opt_myisam_with_debug=0;
recover=0,prefix_remove=0,opt_processes=0;
static my_string log_filename=0,filepath=0,write_filename=0,record_pos_file=0;
static ulong com_count[10][3],number_of_commands=(ulong) ~0L,
isamlog_process;
......@@ -201,9 +201,6 @@ static void get_options(register int *argc, register char ***argv)
update=1;
recover++;
break;
case 'D':
opt_myisam_with_debug=1;
break;
case 'P':
opt_processes=1;
break;
......@@ -333,8 +330,8 @@ static int examine_log(my_string file_name, char **table_names)
bzero((gptr) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1,
(tree_element_free) file_info_free, NULL);
VOID(init_key_cache(dflt_keycache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
&dflt_key_cache_var));
VOID(init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
0, 0));
files_open=0; access_time=0;
while (access_time++ != number_of_commands &&
......@@ -648,7 +645,7 @@ static int examine_log(my_string file_name, char **table_names)
goto end;
}
}
end_key_cache(*dflt_keycache,1);
end_key_cache(dflt_key_cache,1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
......@@ -668,7 +665,7 @@ static int examine_log(my_string file_name, char **table_names)
llstr(isamlog_filepos,llbuff)));
fflush(stderr);
end:
end_key_cache(*dflt_keycache, 1);
end_key_cache(dflt_key_cache, 1);
delete_tree(&tree);
VOID(end_io_cache(&cache));
VOID(my_close(file,MYF(0)));
......
......@@ -84,7 +84,7 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
IO_CACHE *to_file,
char* key, uint sort_length,
uint count);
inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file,char *bufs);
inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs);
/*
Creates a index of sorted keys
......@@ -622,21 +622,25 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys,
DBUG_RETURN(0);
} /* write_keys */
inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file,char *bufs)
inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs)
{
int err;
uint16 len = _mi_keylength(info->keyinfo,bufs);
uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs);
if ((err= my_b_write(to_file,(byte*)&len,sizeof(len))))
/* The following is safe as this is a local file */
if ((err= my_b_write(to_file, (byte*)&len, sizeof(len))))
return (err);
if ((err= my_b_write(to_file,(byte*)bufs,(uint) len)))
if ((err= my_b_write(to_file,bufs, (uint) len)))
return (err);
return (0);
}
static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info, register uchar **sort_keys,
uint count, BUFFPEK *buffpek, IO_CACHE *tempfile)
static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info,
register uchar **sort_keys,
uint count, BUFFPEK *buffpek,
IO_CACHE *tempfile)
{
uchar **end;
int err;
......@@ -653,7 +657,7 @@ static int NEAR_F write_keys_varlen(MI_SORT_PARAM *info, register uchar **sort_k
buffpek->count=count;
for (end=sort_keys+count ; sort_keys != end ; sort_keys++)
{
if ((err= my_var_write(info,tempfile,*sort_keys)))
if ((err= my_var_write(info,tempfile, (byte*) *sort_keys)))
DBUG_RETURN(err);
}
DBUG_RETURN(0);
......@@ -816,7 +820,7 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info,
for (idx=1;idx<=count;idx++)
{
int err;
if ((err= my_var_write(info,to_file,bufs)))
if ((err= my_var_write(info,to_file, (byte*) bufs)))
return (err);
bufs=bufs+sort_length;
}
......
......@@ -271,7 +271,8 @@ int run_test(const char *filename)
create_key(key, nrecords*upd);
print_key(key," INTERSECT\n");
hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,0);
hrows=mi_records_in_range(file,0,key,0,HA_READ_MBR_INTERSECT,record+1,0,
HA_READ_KEY_EXACT);
printf(" %ld rows\n", (long) hrows);
......@@ -351,7 +352,7 @@ static void print_record(char * record, my_off_t offs,const char * tail)
printf(" len=%d ",len);
memcpy_fixed(&ptr,pos,sizeof(char*));
if(ptr)
rtree_PrintWKB(ptr,SPDIMS);
rtree_PrintWKB((uchar*) ptr,SPDIMS);
else
printf("<NULL> ");
printf(" offs=%ld ",(long int)offs);
......@@ -406,7 +407,7 @@ static void create_linestring(char *record,uint rownr)
pos++;
memset(blob_key,0,sizeof(blob_key));
tmp=rtree_CreateLineStringWKB(x,SPDIMS,npoints,blob_key);
tmp=rtree_CreateLineStringWKB(x,SPDIMS,npoints, (uchar*) blob_key);
int4store(pos,tmp);
pos+=4;
......
......@@ -12,11 +12,13 @@ if [ x$1 = x"-bin" ]; then
BINARY_DIST=1
fix_bin=mysql-test
scriptdir=../bin
libexecdir=../libexec
else
execdir=../sql
bindir=../client
fix_bin=.
scriptdir=../scripts
libexecdir=../libexec
fi
vardir=var
......@@ -36,8 +38,13 @@ EXTRA_ARG=""
if test ! -x $execdir/mysqld
then
echo "mysqld is missing - looked in $execdir"
exit 1
if test ! -x $libexecdir/mysqld
then
echo "mysqld is missing - looked in $execdir and in $libexecdir"
exit 1
else
execdir=$libexecdir
fi
fi
# On IRIX hostname is in /usr/bsd so add this to the path
......
#! /bin/sh
# mysql-test-run - originally written by Matt Wagner <matt@mysql.com>
# modified by Sasha Pachev <sasha@mysql.com>
# Sligtly updated by Monty
# Slightly updated by Monty
# Cleaned up again by Matt
# Fixed by Sergei
# :-)
......@@ -229,6 +229,7 @@ while test $# -gt 0; do
--local) USE_RUNNING_SERVER="" ;;
--extern) USE_RUNNING_SERVER="1" ;;
--tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;;
--start-from=*) START_FROM=`$ECHO "$1" | $SED -e "s;--start-from=;;"` ;;
--local-master)
MASTER_MYPORT=3306;
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --host=127.0.0.1 \
......@@ -1185,6 +1186,11 @@ run_testcase ()
fi
fi
if [ "$tname" '<' "$START_FROM" ] ; then
# skip_test $tname;
return;
fi
if [ -n "$DO_TEST" ] ; then
DO_THIS_TEST=`$EXPR \( $tname : "$DO_TEST" \) != 0`
if [ x$DO_THIS_TEST = x0 ] ;
......
......@@ -18,9 +18,11 @@ select -(0-3),round(-(0-3)), round(9999999999999999999);
-(0-3) round(-(0-3)) round(9999999999999999999)
3 3 10000000000000000000
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
18446744073709551615
select * from t1 where a=18446744073709551615;
......@@ -29,6 +31,8 @@ a
delete from t1 where a=18446744073709551615;
select * from t1;
a
18446744073709551612
18446744073709551613
18446744073709551614
drop table t1;
create table t1 ( a int not null default 1, big bigint );
......@@ -70,3 +74,13 @@ select * from t1 limit 9999999999;
id a
9999999999 1
drop table t1;
CREATE TABLE t1 ( quantity decimal(60,0));
insert into t1 values (10000000000000000000);
insert into t1 values (10000000000000000000.0);
insert into t1 values ('10000000000000000000');
select * from t1;
quantity
-8446744073709551616
10000000000000000000
10000000000000000000
drop table t1;
......@@ -90,19 +90,21 @@ CASE WHEN 1 THEN 1 ELSE 'a' END AS c4,
CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5,
CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6,
CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7,
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8
CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8,
CASE WHEN 1 THEN 1.0 END AS c9
;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` char(1) character set latin1 collate latin1_danish_ci default NULL,
`c2` char(1) character set latin1 collate latin1_danish_ci default NULL,
`c3` char(1) default NULL,
`c4` char(1) default NULL,
`c5` char(3) default NULL,
`c6` char(3) default NULL,
`c7` double(3,1) default NULL,
`c8` double(3,1) default NULL
`c1` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
`c2` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
`c3` char(1) NOT NULL default '',
`c4` char(1) NOT NULL default '',
`c5` char(3) NOT NULL default '',
`c6` char(3) NOT NULL default '',
`c7` double(3,1) NOT NULL default '0.0',
`c8` double(3,1) NOT NULL default '0.0',
`c9` double(3,1) default NULL
) TYPE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SELECT CASE
......
......@@ -5,3 +5,4 @@ COUNT(*)
4181000
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
DROP TABLE t1;
set @@read_buffer_size=default;
drop table if exists t1,t2,t3;
drop database if exists test_$1;
create table t1 (b char(0));
insert into t1 values (""),(null);
select * from t1;
......@@ -302,9 +303,6 @@ t3 CREATE TABLE `t3` (
select * from t3;
id name
drop table t2, t3;
drop database if exists test_$1;
Warnings:
Note 1008 Can't drop database 'test_$1'; database doesn't exist
create database test_$1;
create table test_$1.t3 like t1;
create temporary table t3 like test_$1.t3;
......@@ -404,14 +402,13 @@ d date 0000-00-00
e char(1)
f datetime 0000-00-00 00:00:00
g time 00:00:00
h mediumblob
h longblob
dd time 00:00:00
select * from t2;
a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
drop table t1, t2;
drop database if exists test_$1;
create database test_$1;
use test_$1;
select database();
......
......@@ -120,7 +120,7 @@ date format str_to_date
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
......@@ -144,7 +144,7 @@ date format con
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
......@@ -168,7 +168,7 @@ date format datetime
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-01-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
15 MAY 2001 %d %b %Y 2001-05-15 00:00:00
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15 00:00:00
......@@ -192,7 +192,7 @@ date format date2
10:20:10.44AM %h:%i:%s.%f%p 0000-00-00
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15
15 September 2001 %d %M %Y 2001-09-15
15 SEPTEMB 2001 %d %M %Y 2001-01-15
15 SEPTEMB 2001 %d %M %Y 2001-09-15
15 MAY 2001 %d %b %Y 2001-05-15
Sunday 15 MAY 2001 %W %d %b %Y 2001-05-15
Sund 15 MAY 2001 %W %d %b %Y 2001-05-15
......
......@@ -228,3 +228,20 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
drop table t1;
create table t1 (a int);
insert into t1 values (1),(2);
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
a a
1 1
2 1
1 2
2 2
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
4 DERIVED t1 ALL NULL NULL NULL NULL 2
5 UNION t1 ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
3 UNION t1 ALL NULL NULL NULL NULL 2
drop table t1;
......@@ -161,6 +161,23 @@ Only MyISAM tables support collections
Function MATCH ... AGAINST() is used to do a search
some test foobar implements vector space model
drop table t1;
create table t1 (a varchar(200) not null, fulltext (a));
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
a
aaa10 bbb20
aaa20 bbb15
aaa30 bbb10
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
a
aaa20 bbb15
aaa30 bbb10
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
a
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
a
aaa10 bbb20
drop table t1;
CREATE TABLE t1 (
id int(11),
ticket int(11),
......
......@@ -41,4 +41,12 @@ venue_id venue_text dt name entity_id
select * from t1 left join t2 on venue_id = entity_id where match(name) against('aberdeen') and dt = '2003-05-23 19:30:00';
venue_id venue_text dt name entity_id
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen' in boolean mode)) where dt = '2003-05-23 19:30:00';
venue_id venue_text dt name entity_id
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
NULL a2 2003-05-23 19:30:00 NULL NULL
select * from t1 left join t2 on (venue_id = entity_id and match(name) against('aberdeen')) where dt = '2003-05-23 19:30:00';
venue_id venue_text dt name entity_id
1 a1 2003-05-23 19:30:00 aberdeen town hall 1
NULL a2 2003-05-23 19:30:00 NULL NULL
drop table t1,t2;
create database test_raid;
create table test_raid.r1 (i int) raid_type=1;
drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
DROP DATABASE IF EXISTS test_$1;
create database test_$1;
create table test_$1.r1 (i int) raid_type=1;
drop database test_$1;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
c char(255) not null
......@@ -99,7 +100,6 @@ count(*)
450
DROP TABLE t2;
/* variable rows */
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
c varchar(255) not null
......
reset master;
show master status;
File Position Binlog_do_db Binlog_ignore_db
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 79
reset slave;
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
change master to master_host='127.0.0.1';
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 test MASTER_PORT 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
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 7 4 slave-relay-bin.000001 4 No No 0 0 0 4 None 0 No #
start slave;
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 7 master-bin.000001 79 slave-relay-bin.000001 123 master-bin.000001 Yes Yes 0 0 79 123 None 0 No #
drop table if exists t1;
create table t1 (n int);
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
select get_lock("a",5);
get_lock("a",5)
1
create table t1(n int);
insert into t1 values(1+get_lock("a",15)*0);
insert into t1 values(2);
stop slave;
select * from t1;
n
1
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
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
change master to master_user='root';
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
# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 214 slave-relay-bin.000001 4 master-bin.000001 No No 0 0 214 4 None 0 No #
select release_lock("a");
release_lock("a")
1
start slave;
select * from t1;
n
1
2
drop table t1;
......@@ -5,7 +5,7 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
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
load table t1 from master;
ERROR 08S01: Error connecting to master: Master is not configured
load table t1 from master;
......
......@@ -8,7 +8,7 @@ create table t1 (a int primary key);
insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
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 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t1 0 0 213 257 None 0 No #
show tables like 't1';
Tables_in_test (t1)
......
......@@ -13,5 +13,5 @@ master_password='',master_port=SLAVE_PORT;
start slave;
flush logs;
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 SLAVE_PORT 60 slave-bin.000001 79 relay-log.000002 4 slave-bin.000001 Yes Yes 0 0 79 4 None 0 No #
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment