1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

merge with 4.0 to get Netware patches and fixes for libmysqld.dll

configure.in:
  Auto merged
Build-tools/Do-compile:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqladmin.c:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqlshow.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
include/thr_alarm.h:
  Auto merged
innobase/include/trx0roll.h:
  Auto merged
innobase/include/trx0trx.h:
  Auto merged
innobase/que/que0que.c:
  Auto merged
innobase/srv/srv0srv.c:
  Auto merged
innobase/trx/trx0purge.c:
  Auto merged
innobase/trx/trx0roll.c:
  Auto merged
innobase/trx/trx0trx.c:
  Auto merged
innobase/usr/usr0sess.c:
  Auto merged
isam/isamchk.c:
  Auto merged
myisam/myisam_ftdump.c:
  Auto merged
myisam/myisamchk.c:
  Auto merged
myisam/myisampack.c:
  Auto merged
mysys/default.c:
  Auto merged
mysys/my_getopt.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_pthread.c:
  Auto merged
netware/Makefile.am:
  Auto merged
netware/init_db.sql:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
tools/mysqlmanager.c:
  Auto merged
VC++Files/dbug/dbug.dsp:
  Auto merged
VC++Files/heap/heap.dsp:
  Auto merged
VC++Files/isam/isam.dsp:
  Auto merged
VC++Files/libmysql/libmysql.dsp:
  Auto merged
VC++Files/myisam/myisam.dsp:
  Auto merged
VC++Files/myisammrg/myisammrg.dsp:
  Auto merged
VC++Files/mysys/mysys.dsp:
  Auto merged
VC++Files/libmysqld/libmysqld.dsp:
  merge
client/mysqlbinlog.cc:
  merge
extra/perror.c:
  merge
include/mysql_com.h:
  merge
libmysqld/Makefile.am:
  merge
netware/BUILD/mwenv:
  merge
sql/mysqld.cc:
  merge
This commit is contained in:
unknown
2004-05-25 22:54:00 +03:00
68 changed files with 1209 additions and 632 deletions

View File

@ -244,14 +244,14 @@ if ($opt_stage <= 1)
# Only enable InnoDB when requested (required to be able to # Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB) # build the "Classic" packages that do not include InnoDB)
if ($opt_innodb) if ($opt_innodb)
{ {
$opt_config_options.= " --with-innodb"; $opt_config_options.= " --with-innodb";
} }
else else
{ {
$opt_config_options.= " --without-innodb"; $opt_config_options.= " --without-innodb";
} }
if ($opt_with_other_libc) if ($opt_with_other_libc)
{ {

View File

@ -19,6 +19,7 @@ CFG=dbug - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "dbug - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "dbug - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "dbug - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "dbug - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "dbug - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -76,12 +77,38 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\dbug.lib" # ADD LIB32 /nologo /out:"..\lib_debug\dbug.lib"
!ELSEIF "$(CFG)" == "dbug - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "dbug___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "dbug___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "dbug___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "dbug___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "__WIN32__" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\dbug_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "dbug - Win32 Release" # Name "dbug - Win32 Release"
# Name "dbug - Win32 Debug" # Name "dbug - Win32 Debug"
# Name "dbug - Win32 TLS_DEBUG"
# Begin Source File # Begin Source File
SOURCE=.\dbug.c SOURCE=.\dbug.c

View File

@ -19,6 +19,8 @@ CFG=heap - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "heap - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "heap - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "heap - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "heap - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "heap - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "heap - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -76,12 +78,64 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\heap.lib" # ADD LIB32 /nologo /out:"..\lib_debug\heap.lib"
!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "heap___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "heap___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "heap___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "heap___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_debug\heap_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\heap_tls.lib"
!ELSEIF "$(CFG)" == "heap - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "heap___Win32_TLS"
# PROP BASE Intermediate_Dir "heap___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "heap___Win32_TLS"
# PROP Intermediate_Dir "heap___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\heap_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\heap_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "heap - Win32 Release" # Name "heap - Win32 Release"
# Name "heap - Win32 Debug" # Name "heap - Win32 Debug"
# Name "heap - Win32 TLS_DEBUG"
# Name "heap - Win32 TLS"
# Begin Source File # Begin Source File
SOURCE=.\_check.c SOURCE=.\_check.c
@ -128,6 +182,13 @@ SOURCE=.\hp_hash.c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG"
# SUBTRACT BASE CPP /YX
# SUBTRACT CPP /YX
!ELSEIF "$(CFG)" == "heap - Win32 TLS"
!ENDIF !ENDIF
# End Source File # End Source File

View File

@ -19,6 +19,8 @@ CFG=isam - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "isam - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "isam - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "isam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "isam - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -76,12 +78,64 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib" # ADD LIB32 /nologo /out:"..\lib_Debug\isam.lib"
!ELSEIF "$(CFG)" == "isam - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "isam___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "isam___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "isam___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "isam___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_Debug\isam_tls.lib"
!ELSEIF "$(CFG)" == "isam - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "isam___Win32_TLS"
# PROP BASE Intermediate_Dir "isam___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "isam___Win32_TLS"
# PROP Intermediate_Dir "isam___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\isam_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "isam - Win32 Release" # Name "isam - Win32 Release"
# Name "isam - Win32 Debug" # Name "isam - Win32 Debug"
# Name "isam - Win32 TLS_DEBUG"
# Name "isam - Win32 TLS"
# Begin Source File # Begin Source File
SOURCE=.\_cache.c SOURCE=.\_cache.c

View File

@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c # ADD CPP /nologo /G6 /MT /W3 /O2 /I "." /I "..\include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /D "MYSQL_CLIENT" /FD /c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
@ -76,7 +76,7 @@ PostBuild_Cmds=xcopy release\libmysql.lib ..\lib_release /y
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /FD /c # ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "." /I "..\include" /I "../zlib" /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /FD /c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32

View File

@ -56,7 +56,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /dll /machine:I386 # 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 /nologo /dll /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 Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /pdb:none /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # 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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libmysqld - Win32 Debug" !ELSEIF "$(CFG)" == "libmysqld - Win32 Debug"
@ -83,7 +84,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /dll /debug /machine:I386 /pdbtype:sept # 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 /nologo /dll /debug /machine:I386 /pdbtype:sept
# 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 Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\innodb.lib ..\lib_debug\bdb.lib /nologo /dll /pdb:none /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" # 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 Wsock32.lib ..\lib_debug\dbug_tls.lib ..\lib_debug\mysys_tls.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap_tls.lib ..\lib_debug\innodb.lib /nologo /dll /incremental:no /debug /machine:I386 /nodefaultlib:"LIBCMTD" /out:"../lib_debug/libmysqld.dll" /implib:"../lib_debug/libmysqld.lib" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libmysqld - Win32 classic" !ELSEIF "$(CFG)" == "libmysqld - Win32 classic"
@ -110,9 +112,9 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.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 Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # 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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_release/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# 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 Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # 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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "libmysqld - Win32 pro" !ELSEIF "$(CFG)" == "libmysqld - Win32 pro"
@ -140,9 +142,9 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=xilink6.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 Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # 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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_classic/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# 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 Wsock32.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_pro/libmysqld.dll" /implib:"../lib_release/libmysqld.lib" # 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 Wsock32.lib ..\lib_release\myisam_tls.lib ..\lib_release\myisammrg_tls.lib ..\lib_release\mysys_tls.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap_tls.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /dll /machine:I386 /out:"../lib_pro/libmysqld.dll" /implib:"../lib_release/libmysqld.lib"
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ENDIF !ENDIF

View File

@ -19,6 +19,8 @@ CFG=myisam - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "myisam - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "myisam - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "myisam - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "myisam - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "myisam - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "myisam - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -74,12 +76,60 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib" # ADD LIB32 /nologo /out:"..\lib_Debug\myisam.lib"
!ELSEIF "$(CFG)" == "myisam - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "myisam___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "myisam___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "myisam___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "myisam___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_Debug\myisam_tls.lib"
!ELSEIF "$(CFG)" == "myisam - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "myisam___Win32_TLS"
# PROP BASE Intermediate_Dir "myisam___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "myisam___Win32_TLS"
# PROP Intermediate_Dir "myisam___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\myisam_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\myisam_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "myisam - Win32 Release" # Name "myisam - Win32 Release"
# Name "myisam - Win32 Debug" # Name "myisam - Win32 Debug"
# Name "myisam - Win32 TLS_DEBUG"
# Name "myisam - Win32 TLS"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

View File

@ -19,6 +19,8 @@ CFG=myisammrg - Win32 Debug
!MESSAGE !MESSAGE
!MESSAGE "myisammrg - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "myisammrg - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "myisammrg - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "myisammrg - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "myisammrg - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "myisammrg - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -75,12 +77,62 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg.lib" # ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg.lib"
!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "myisammrg___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "myisammrg___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "myisammrg___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
# SUBTRACT BASE CPP /Fr
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /Fo".\Debug/" /Fd".\Debug/" /FD /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_Debug\myisammrg_tls.lib"
!ELSEIF "$(CFG)" == "myisammrg - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "myisammrg___Win32_TLS"
# PROP BASE Intermediate_Dir "myisammrg___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "myisammrg___Win32_TLS"
# PROP Intermediate_Dir "myisammrg___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\myisammrg_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "myisammrg - Win32 Release" # Name "myisammrg - Win32 Release"
# Name "myisammrg - Win32 Debug" # Name "myisammrg - Win32 Debug"
# Name "myisammrg - Win32 TLS_DEBUG"
# Name "myisammrg - Win32 TLS"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

View File

@ -20,6 +20,8 @@ CFG=mysys - Win32 Debug
!MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@ -102,6 +104,56 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" # ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" # ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib"
!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "mysys___Win32_TLS_DEBUG"
# PROP BASE Intermediate_Dir "mysys___Win32_TLS_DEBUG"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "mysys___Win32_TLS_DEBUG"
# PROP Intermediate_Dir "mysys___Win32_TLS_DEBUG"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
# SUBTRACT BASE CPP /Fr
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_TLS" /FD /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\mysys_tls.lib"
!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "mysys___Win32_TLS"
# PROP BASE Intermediate_Dir "mysys___Win32_TLS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "mysys___Win32_TLS"
# PROP Intermediate_Dir "mysys___Win32_TLS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys_tls.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys_tls.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
@ -109,6 +161,8 @@ LIB32=xilink6.exe -lib
# Name "mysys - Win32 Release" # Name "mysys - Win32 Release"
# Name "mysys - Win32 Debug" # Name "mysys - Win32 Debug"
# Name "mysys - Win32 Max" # Name "mysys - Win32 Max"
# Name "mysys - Win32 TLS_DEBUG"
# Name "mysys - Win32 TLS"
# Begin Source File # Begin Source File
SOURCE=.\array.c SOURCE=.\array.c
@ -121,6 +175,14 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max" !ELSEIF "$(CFG)" == "mysys - Win32 Max"
!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
# ADD BASE CPP /FR
# ADD CPP /FR
!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
!ENDIF !ENDIF
# End Source File # End Source File
@ -528,6 +590,13 @@ SOURCE=.\thr_lock.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max" !ELSEIF "$(CFG)" == "mysys - Win32 Max"
!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
# ADD BASE CPP /D "EXTRA_DEBUG"
# ADD CPP /D "EXTRA_DEBUG"
!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
!ENDIF !ENDIF
# End Source File # End Source File

View File

@ -669,6 +669,10 @@ static struct my_option my_long_options[] =
static void usage(int version) static void usage(int version)
{ {
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#endif
printf("%s Ver %s Distrib %s, for %s (%s)\n", printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
if (version) if (version)
@ -681,8 +685,13 @@ and you are welcome to modify and redistribute it under the GPL license\n");
my_print_help(my_long_options); my_print_help(my_long_options);
print_defaults("my", load_default_groups); print_defaults("my", load_default_groups);
my_print_variables(my_long_options); my_print_variables(my_long_options);
NETWARE_SET_SCREEN_MODE(1);
#ifdef __NETWARE__
#undef printf
#endif
} }
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
@ -916,6 +925,7 @@ static int read_lines(bool execute_commands)
#ifdef __NETWARE__ #ifdef __NETWARE__
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin); line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
/* Remove the '\n' */ /* Remove the '\n' */
if (line)
{ {
char *p = strrchr(line, '\n'); char *p = strrchr(line, '\n');
if (p != NULL) if (p != NULL)
@ -931,7 +941,11 @@ static int read_lines(bool execute_commands)
line= readline(prompt); line= readline(prompt);
#endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */ #endif /* defined( __WIN__) || defined(OS2) || defined(__NETWARE__) */
if (opt_outfile) /*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
which may cause coredump.
*/
if (opt_outfile && line)
fprintf(OUTFILE, "%s\n", line); fprintf(OUTFILE, "%s\n", line);
} }
if (!line) // End of file if (!line) // End of file
@ -2384,10 +2398,8 @@ static int
com_quit(String *buffer __attribute__((unused)), com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused))) char *line __attribute__((unused)))
{ {
#ifdef __NETWARE__ /* let the screen auto close on a normal shutdown */
// let the screen auto close on a normal shutdown NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT);
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif
status.exit_status=0; status.exit_status=0;
return 1; return 1;
} }
@ -2993,6 +3005,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{ {
va_list args; va_list args;
NETWARE_YIELD;
va_start(args, fmt); va_start(args, fmt);
(void) vfprintf(file, fmt, args); (void) vfprintf(file, fmt, args);
#ifdef OS2 #ifdef OS2
@ -3006,6 +3019,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file) void tee_fputs(const char *s, FILE *file)
{ {
NETWARE_YIELD;
fputs(s, file); fputs(s, file);
#ifdef OS2 #ifdef OS2
fflush( file); fflush( file);
@ -3017,6 +3031,7 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file) void tee_puts(const char *s, FILE *file)
{ {
NETWARE_YIELD;
fputs(s, file); fputs(s, file);
fputs("\n", file); fputs("\n", file);
#ifdef OS2 #ifdef OS2

View File

@ -874,11 +874,13 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 0; return 0;
} }
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION, printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -921,6 +923,8 @@ static void usage(void)
version Get version info from server"); version Get version info from server");
} }
#include <help_end.h>
static int drop_db(MYSQL *mysql, const char *db) static int drop_db(MYSQL *mysql, const char *db)
{ {
char name_buff[FN_REFLEN+20], buf[10]; char name_buff[FN_REFLEN+20], buf[10];

View File

@ -490,9 +490,12 @@ static void die(const char* fmt, ...)
exit(1); exit(1);
} }
#include <help_start.h>
static void print_version() static void print_version()
{ {
printf("%s Ver 3.0 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); printf("%s Ver 3.0 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -511,6 +514,8 @@ the mysql command line client\n\n");
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
extern "C" my_bool extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)

View File

@ -172,10 +172,13 @@ static void print_result();
static char *fix_table_name(char *dest, char *src); static char *fix_table_name(char *dest, char *src);
int what_to_do = 0; int what_to_do = 0;
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */ } /* print_version */
@ -206,6 +209,7 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} /* usage */ } /* usage */
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),

View File

@ -332,11 +332,13 @@ static int dump_all_databases();
static char *quote_name(const char *name, char *buff, my_bool force); static char *quote_name(const char *name, char *buff, my_bool force);
static const char *check_if_ignore_table(const char *table_name); static const char *check_if_ignore_table(const char *table_name);
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */ } /* print_version */
@ -346,8 +348,10 @@ static void short_usage_sub(void)
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n", printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
my_progname); my_progname);
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname); printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
NETWARE_SET_SCREEN_MODE(1);
} }
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
@ -367,6 +371,8 @@ static void short_usage(void)
printf("For more options, use %s --help\n", my_progname); printf("For more options, use %s --help\n", my_progname);
} }
#include <help_end.h>
static void write_header(FILE *sql_file, char *db_name) static void write_header(FILE *sql_file, char *db_name)
{ {

View File

@ -147,14 +147,16 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqlimport","client",0 }; static const char *load_default_groups[]= { "mysqlimport","client",0 };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname, printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname,
IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
@ -173,6 +175,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),

View File

@ -209,12 +209,16 @@ static struct my_option my_long_options[] =
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION, printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
@ -234,6 +238,8 @@ are shown");
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)

View File

@ -180,6 +180,17 @@ typedef struct
int alloced; int alloced;
} VAR; } VAR;
#ifdef __NETWARE__
/*
Netware doesn't proved environment variable substitution that is done
by the shell in unix environments. We do this in the following function:
*/
static char *subst_env_var(const char *cmd);
static int my_popen(const char *cmd, const char *mode);
#define popen(A,B) my_popen((A),(B))
#endif /* __NETWARE__ */
VAR var_reg[10]; VAR var_reg[10];
/*Perl/shell-like variable registers */ /*Perl/shell-like variable registers */
HASH var_hash; HASH var_hash;
@ -906,7 +917,7 @@ int do_exec(struct st_query* q)
while (fgets(buf, sizeof(buf), res_file)) while (fgets(buf, sizeof(buf), res_file))
replace_dynstr_append_mem(ds, buf, strlen(buf)); replace_dynstr_append_mem(ds, buf, strlen(buf));
if (glob_replace) if (glob_replace)
free_replace(); free_replace();
@ -929,6 +940,7 @@ int do_exec(struct st_query* q)
DBUG_RETURN(error); DBUG_RETURN(error);
} }
int var_query_set(VAR* v, const char* p, const char** p_end) int var_query_set(VAR* v, const char* p, const char** p_end)
{ {
char* end = (char*)((p_end && *p_end) ? *p_end : p + strlen(p)); char* end = (char*)((p_end && *p_end) ? *p_end : p + strlen(p));
@ -3674,3 +3686,101 @@ static void get_replace_column(struct st_query *q)
} }
my_free(start, MYF(0)); my_free(start, MYF(0));
} }
#ifdef __NETWARE__
/*
Substitute environment variables with text.
SYNOPSIS
subst_env_var()
arg String that should be substitute
DESCRIPTION
This function takes a string as an input and replaces the
environment variables, that starts with '$' character, with it value.
NOTES
Return string must be freed with my_free()
RETURN
String with environment variables replaced.
*/
static char *subst_env_var(const char *str)
{
char *result;
result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE));
while (*str)
{
/*
need this only when we want to provide the functionality of
escaping through \ 'backslash'
if ((result == pos && *str=='$') ||
(result != pos && *str=='$' && str[-1] !='\\'))
*/
if (*str == '$')
{
char env_var[256], *env_pos= env_var, *subst;
/* Search for end of environment variable */
for (str++;
*str && !isspace(*str) && *str != '\\' && *str != '/' &&
*str != '$';
str++)
*env_pos++ *str;
*env_pos= 0;
if (!(subst= getenv(env_var)))
{
my_free(result, MYF(0));
die("MYSQLTEST.NLM: Environment variable %s is not defined\n",
env_var);
}
/* get the string to be substitued for env_var */
pos= strmov(pos, subst);
/* Process delimiter in *str again */
}
else
*pos++= *str++;
}
*pos= 0;
return result;
}
/*
popen replacement for Netware
SYNPOSIS
my_popen()
name Command to execute (with possible env variables)
mode Mode for popen.
NOTES
Environment variable expansion does not take place for popen function
on NetWare, so we use this function to wrap around popen to do this.
For the moment we ignore 'mode' and always use 'r0'
RETURN
# >= 0 File handle
-1 Error
*/
#undef popen /* Remove wrapper */
int my_popen(const char *cmd, const char *mode __attribute__((unused)) t)
{
char *subst_cmd;
int res_file;
subst_cmd= subst_env_var(cmd);
res_file= popen(subst_cmd, "r0");
my_free(subst_cmd, MYF(0));
return res_file;
}
#endif /* __NETWARE__ */

View File

@ -126,8 +126,10 @@ fi
# The following hack should ensure that configure doesn't add optimizing # The following hack should ensure that configure doesn't add optimizing
# or debugging flags to CFLAGS or CXXFLAGS # or debugging flags to CFLAGS or CXXFLAGS
CFLAGS="$CFLAGS " # C_EXTRA_FLAGS are flags that are automaticly added to both
CXXFLAGS="$CXXFLAGS " # CFLAGS and CXXFLAGS
CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
dnl Checks for programs. dnl Checks for programs.
AC_PROG_AWK AC_PROG_AWK
@ -1120,8 +1122,8 @@ dnl Is this the right match for DEC OSF on alpha?
# Add library dependencies to mysqld_DEPENDENCIES # Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)" lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
cat > $filesed << EOF cat > $filesed << EOF
s,\(^.*\$(MAKE) gen_lex_hash\),#\1, s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1,
s,\(\./gen_lex_hash\),\1.linux, s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES % s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
EOF EOF
;; ;;
@ -2845,6 +2847,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
include/Makefile sql-bench/Makefile tools/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl
netware/Makefile dnl
include/mysql_version.h dnl include/mysql_version.h dnl
cmd-line-utils/Makefile dnl cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl cmd-line-utils/libedit/Makefile dnl

View File

@ -16,7 +16,7 @@
/* Return error-text for system error messages and nisam messages */ /* Return error-text for system error messages and nisam messages */
#define PERROR_VERSION "2.9" #define PERROR_VERSION "2.10"
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_sys.h>
@ -207,8 +207,16 @@ int main(int argc,char *argv[])
else else
#endif #endif
{ {
/*
On some system, like NETWARE, strerror(unknown_error) returns a
string 'Unknown Error'. To avoid printing it we try to find the
error string by asking for an impossible big error message.
*/
const char *unknown_error= strerror(10000);
for ( ; argc-- > 0 ; argv++) for ( ; argc-- > 0 ; argv++)
{ {
found=0; found=0;
code=atoi(*argv); code=atoi(*argv);
#ifdef HAVE_NDBCLUSTER_DB #ifdef HAVE_NDBCLUSTER_DB
@ -222,7 +230,14 @@ int main(int argc,char *argv[])
else else
#endif #endif
msg = strerror(code); msg = strerror(code);
if (msg)
/*
Don't print message for not existing error messages or for
unknown errors. We test for 'Uknown Errors' just as an
extra safety for Netware
*/
if (msg && strcmp(msg, "Unknown Error") &&
(!unknown_error || strcmp(msg, unknown_error)))
{ {
found=1; found=1;
if (verbose) if (verbose)
@ -241,7 +256,7 @@ int main(int argc,char *argv[])
else else
{ {
if (verbose) if (verbose)
printf("%3d = %s\n",code,msg); printf("MySql error: %3d = %s\n",code,msg);
else else
puts(msg); puts(msg);
} }

View File

@ -14,7 +14,10 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Defines for netware compatible with MySQL */ /* Header for NetWare compatible with MySQL */
#ifndef _config_netware_h
#define _config_netware_h
/* required headers */ /* required headers */
#include <unistd.h> #include <unistd.h>
@ -32,18 +35,28 @@
#include <pthread.h> #include <pthread.h>
#include <termios.h> #include <termios.h>
#ifdef __cplusplus
extern "C" {
#endif
/* required adjustments */ /* required adjustments */
#undef HAVE_READDIR_R #undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT #undef HAVE_RWLOCK_INIT
#undef HAVE_SCHED_H #undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H #undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H #undef HAVE_SYNCH_H
#undef HAVE_CRYPT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1 #define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1 #define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1 #define HAVE_BROKEN_REALPATH 1
/* no libc crypt() function */
#ifdef HAVE_OPENSSL
#define HAVE_CRYPT 1
#else
#undef HAVE_CRYPT
#endif /* HAVE_OPENSSL */
/* include the old function apis */ /* include the old function apis */
#define USE_OLD_FUNCTIONS 1 #define USE_OLD_FUNCTIONS 1
@ -59,6 +72,9 @@
/* signal by closing the sockets */ /* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1 #define SIGNAL_WITH_VIO_CLOSE 1
/* On NetWare, stack grows towards lower address*/
#define STACK_DIRECTION -1
/* default directory information */ /* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql" #define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql" #define PACKAGE "mysql"
@ -80,6 +96,20 @@
/* do not use the extended time in LibC sys\stat.h */ /* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE #define _POSIX_SOURCE
/* Kernel call on NetWare that will only yield if our time slice is up */
void kYieldIfTimeSliceUp(void);
/* Some macros for portability */ /* Some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; } #define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
/* extra protection against CPU Hogs on NetWare */
#define NETWARE_YIELD kYieldIfTimeSliceUp()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */

6
include/help_end.h Normal file
View File

@ -0,0 +1,6 @@
#ifdef __NETWARE__
#undef printf
#undef puts
#undef fputs
#undef putchar
#endif

7
include/help_start.h Normal file
View File

@ -0,0 +1,7 @@
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#define puts(s) consoleprintf("%s\n",s)
#define fputs(s,f) puts(s)
#endif

View File

@ -73,6 +73,12 @@
#endif #endif
#endif /* _WIN32... */ #endif /* _WIN32... */
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
#define NETWARE_SET_SCREEN_MODE(A)
#endif
/* /*
The macros below are borrowed from include/linux/compiler.h in the The macros below are borrowed from include/linux/compiler.h in the
Linux kernel. Use them to indicate the likelyhood of the truthfulness Linux kernel. Use them to indicate the likelyhood of the truthfulness

View File

@ -36,6 +36,12 @@
#define MYSQL_SERVICENAME "MySQL" #define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */ #endif /* __WIN__ */
#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY)
#define dll_import_spec __declspec( dllimport )
#else
#define dll_import_spec
#endif
enum enum_server_command enum enum_server_command
{ {
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@ -306,8 +312,8 @@ typedef struct st_udf_init
extern "C" { extern "C" {
#endif #endif
extern unsigned long max_allowed_packet; dll_import_spec extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length; dll_import_spec extern unsigned long net_buffer_length;
/* /*
These functions are used for authentication by client and server and These functions are used for authentication by client and server and

View File

@ -64,7 +64,7 @@ typedef my_bool ALARM;
#define init_thr_alarm(A) #define init_thr_alarm(A)
#define thr_alarm_kill(A) #define thr_alarm_kill(A)
#define resize_thr_alarm(N) #define resize_thr_alarm(N)
#define end_thr_alarm() #define end_thr_alarm(A)
#else #else
#if defined(__WIN__) #if defined(__WIN__)

View File

@ -43,7 +43,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \ row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \
row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \ row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \
row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \ row0undo.h row0undo.ic row0upd.h row0upd.ic row0vers.h \
row0vers.ic srv0que.h srv0srv.h srv0srv.ic srv0start.h \ row0vers.ic srv0srv.h srv0srv.ic srv0start.h \
sync0arr.h sync0arr.ic sync0rw.h \ sync0arr.h sync0arr.ic sync0rw.h \
sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \ sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \

View File

@ -152,17 +152,6 @@ que_run_threads(
/*============*/ /*============*/
que_thr_t* thr); /* in: query thread which is run initially */ que_thr_t* thr); /* in: query thread which is run initially */
/************************************************************************** /**************************************************************************
After signal handling is finished, returns control to a query graph error
handling routine. (Currently, just returns the control to the root of the
graph so that the graph can communicate an error message to the client.) */
void
que_fork_error_handle(
/*==================*/
trx_t* trx, /* in: trx */
que_t* fork); /* in: query graph which was run before signal
handling started, NULL not allowed */
/**************************************************************************
Handles an SQL error noticed during query thread execution. At the moment, Handles an SQL error noticed during query thread execution. At the moment,
does nothing! */ does nothing! */
@ -181,18 +170,15 @@ a single worker thread to execute it. This function should be used to end
the wait state of a query thread waiting for a lock or a stored procedure the wait state of a query thread waiting for a lock or a stored procedure
completion. */ completion. */
void que_thr_t*
que_thr_end_wait( que_thr_end_wait(
/*=============*/ /*=============*/
que_thr_t* thr, /* in: query thread in the /* out: next query thread to run;
NULL if none */
que_thr_t* thr); /* in: query thread in the
QUE_THR_LOCK_WAIT, QUE_THR_LOCK_WAIT,
or QUE_THR_PROCEDURE_WAIT, or or QUE_THR_PROCEDURE_WAIT, or
QUE_THR_SIG_REPLY_WAIT state */ QUE_THR_SIG_REPLY_WAIT state */
que_thr_t** next_thr); /* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
/************************************************************************** /**************************************************************************
Same as que_thr_end_wait, but no parameter next_thr available. */ Same as que_thr_end_wait, but no parameter next_thr available. */

View File

@ -1,53 +0,0 @@
/******************************************************
Server query execution
(c) 1996 Innobase Oy
Created 6/5/1996 Heikki Tuuri
*******************************************************/
#ifndef srv0que_h
#define srv0que_h
#include "univ.i"
#include "que0types.h"
/**************************************************************************
Checks if there is work to do in the server task queue. If there is, the
thread starts processing a task. Before leaving, it again checks the task
queue and picks a new task if any exists. This is called by a SRV_WORKER
thread. */
void
srv_que_task_queue_check(void);
/*==========================*/
/**************************************************************************
Performs round-robin on the server tasks. This is called by a SRV_WORKER
thread every second or so. */
que_thr_t*
srv_que_round_robin(
/*================*/
/* out: the new (may be == thr) query thread
to run */
que_thr_t* thr); /* in: query thread */
/**************************************************************************
Enqueues a task to server task queue and releases a worker thread, if
there exists one suspended. */
void
srv_que_task_enqueue(
/*=================*/
que_thr_t* thr); /* in: query thread */
/**************************************************************************
Enqueues a task to server task queue and releases a worker thread, if
there exists one suspended. */
void
srv_que_task_enqueue_low(
/*=====================*/
que_thr_t* thr); /* in: query thread */
#endif

View File

@ -91,16 +91,12 @@ trx_undo_rec_release(
/************************************************************************* /*************************************************************************
Starts a rollback operation. */ Starts a rollback operation. */
void que_thr_t*
trx_rollback( trx_rollback(
/*=========*/ /*=========*/
/* out: next query thread to run */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
trx_sig_t* sig, /* in: signal starting the rollback */ trx_sig_t* sig); /* in: signal starting the rollback */
que_thr_t** next_thr);/* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
/*********************************************************************** /***********************************************************************
Rollback or clean up transactions which have no user session. If the Rollback or clean up transactions which have no user session. If the
transaction already was committed, then we clean up a possible insert transaction already was committed, then we clean up a possible insert
@ -112,17 +108,12 @@ trx_rollback_or_clean_all_without_sess(void);
/******************************************************************** /********************************************************************
Finishes a transaction rollback. */ Finishes a transaction rollback. */
void que_thr_t*
trx_finish_rollback_off_kernel( trx_finish_rollback_off_kernel(
/*===========================*/ /*===========================*/
/* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */ que_t* graph, /* in: undo graph which can now be freed */
trx_t* trx, /* in: transaction */ trx_t* trx); /* in: transaction */
que_thr_t** next_thr);/* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if this parameter is
NULL, it is ignored */
/******************************************************************** /********************************************************************
Builds an undo 'query' graph for a transaction. The actual rollback is Builds an undo 'query' graph for a transaction. The actual rollback is
performed by executing this query graph like a query subprocedure call. performed by executing this query graph like a query subprocedure call.

View File

@ -194,9 +194,10 @@ trx_end_lock_wait(
/******************************************************************** /********************************************************************
Sends a signal to a trx object. */ Sends a signal to a trx object. */
ibool que_thr_t*
trx_sig_send( trx_sig_send(
/*=========*/ /*=========*/
/* out: next query thread to run */
/* out: TRUE if the signal was /* out: TRUE if the signal was
successfully delivered */ successfully delivered */
trx_t* trx, /* in: trx handle */ trx_t* trx, /* in: trx handle */
@ -206,27 +207,17 @@ trx_sig_send(
que_thr_t* receiver_thr, /* in: query thread which wants the que_thr_t* receiver_thr, /* in: query thread which wants the
reply, or NULL; if type is reply, or NULL; if type is
TRX_SIG_END_WAIT, this must be NULL */ TRX_SIG_END_WAIT, this must be NULL */
trx_savept_t* savept, /* in: possible rollback savepoint, or trx_savept_t* savept); /* in: possible rollback savepoint, or
NULL */ NULL */
que_thr_t** next_thr); /* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if the parameter
is NULL, it is ignored */
/******************************************************************** /********************************************************************
Send the reply message when a signal in the queue of the trx has Send the reply message when a signal in the queue of the trx has
been handled. */ been handled. */
void que_thr_t*
trx_sig_reply( trx_sig_reply(
/*==========*/ /*==========*/
trx_sig_t* sig, /* in: signal */ /* out: next query thread to run */
que_thr_t** next_thr); /* in/out: next query thread to run; trx_sig_t* sig); /* in: signal */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
/******************************************************************** /********************************************************************
Removes the signal object from a trx signal queue. */ Removes the signal object from a trx signal queue. */
@ -238,15 +229,11 @@ trx_sig_remove(
/******************************************************************** /********************************************************************
Starts handling of a trx signal. */ Starts handling of a trx signal. */
void que_thr_t*
trx_sig_start_handle( trx_sig_start_handle(
/*=================*/ /*=================*/
trx_t* trx, /* in: trx handle */ /* out: next query thread to run, or NULL */
que_thr_t** next_thr); /* in/out: next query thread to run; trx_t* trx); /* in: trx handle */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
/******************************************************************** /********************************************************************
Ends signal handling. If the session is in the error state, and Ends signal handling. If the session is in the error state, and
trx->graph_before_signal_handling != NULL, returns control to the error trx->graph_before_signal_handling != NULL, returns control to the error

View File

@ -38,7 +38,6 @@ sess_try_close(
/* The session handle. All fields are protected by the kernel mutex */ /* The session handle. All fields are protected by the kernel mutex */
struct sess_struct{ struct sess_struct{
ulint state; /* state of the session */
trx_t* trx; /* transaction object permanently trx_t* trx; /* transaction object permanently
assigned for the session: the assigned for the session: the
transaction instance designated by the transaction instance designated by the
@ -49,11 +48,6 @@ struct sess_struct{
session */ session */
}; };
/* Session states */
#define SESS_ACTIVE 1
#define SESS_ERROR 2 /* session contains an error message
which has not yet been communicated
to the client */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "usr0sess.ic" #include "usr0sess.ic"
#endif #endif

View File

@ -12,7 +12,6 @@ Created 5/27/1996 Heikki Tuuri
#include "que0que.ic" #include "que0que.ic"
#endif #endif
#include "srv0que.h"
#include "usr0sess.h" #include "usr0sess.h"
#include "trx0trx.h" #include "trx0trx.h"
#include "trx0roll.h" #include "trx0roll.h"
@ -175,19 +174,15 @@ a single worker thread to execute it. This function should be used to end
the wait state of a query thread waiting for a lock or a stored procedure the wait state of a query thread waiting for a lock or a stored procedure
completion. */ completion. */
void que_thr_t*
que_thr_end_wait( que_thr_end_wait(
/*=============*/ /*=============*/
que_thr_t* thr, /* in: query thread in the /* out: next query thread to run;
NULL if none */
que_thr_t* thr) /* in: query thread in the
QUE_THR_LOCK_WAIT, QUE_THR_LOCK_WAIT,
or QUE_THR_PROCEDURE_WAIT, or or QUE_THR_PROCEDURE_WAIT, or
QUE_THR_SIG_REPLY_WAIT state */ QUE_THR_SIG_REPLY_WAIT state */
que_thr_t** next_thr) /* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if NULL is passed
as the parameter, it is ignored */
{ {
ibool was_active; ibool was_active;
@ -195,6 +190,8 @@ que_thr_end_wait(
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_ad(thr); ut_ad(thr);
ut_ad(next_thr);
ut_ad(*next_thr == NULL);
ut_ad((thr->state == QUE_THR_LOCK_WAIT) ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT)
|| (thr->state == QUE_THR_SIG_REPLY_WAIT)); || (thr->state == QUE_THR_SIG_REPLY_WAIT));
@ -206,17 +203,8 @@ que_thr_end_wait(
que_thr_move_to_run_state(thr); que_thr_move_to_run_state(thr);
if (was_active) { return(was_active ? NULL : thr);
}
return;
}
if (next_thr && *next_thr == NULL) {
*next_thr = thr;
} else {
srv_que_task_enqueue_low(thr);
}
}
/************************************************************************** /**************************************************************************
Same as que_thr_end_wait, but no parameter next_thr available. */ Same as que_thr_end_wait, but no parameter next_thr available. */
@ -253,8 +241,6 @@ que_thr_end_wait_no_next_thr(
for the lock to be released: */ for the lock to be released: */
srv_release_mysql_thread_if_suspended(thr); srv_release_mysql_thread_if_suspended(thr);
/* srv_que_task_enqueue_low(thr); */
} }
/************************************************************************** /**************************************************************************
@ -355,48 +341,6 @@ que_fork_start_command(
return(NULL); return(NULL);
} }
/**************************************************************************
After signal handling is finished, returns control to a query graph error
handling routine. (Currently, just returns the control to the root of the
graph so that the graph can communicate an error message to the client.) */
void
que_fork_error_handle(
/*==================*/
trx_t* trx __attribute__((unused)), /* in: trx */
que_t* fork) /* in: query graph which was run before signal
handling started, NULL not allowed */
{
que_thr_t* thr;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->sess->state == SESS_ERROR);
ut_ad(UT_LIST_GET_LEN(trx->reply_signals) == 0);
ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0);
thr = UT_LIST_GET_FIRST(fork->thrs);
while (thr != NULL) {
ut_ad(!thr->is_active);
ut_ad(thr->state != QUE_THR_SIG_REPLY_WAIT);
ut_ad(thr->state != QUE_THR_LOCK_WAIT);
thr->run_node = thr;
thr->prev_node = thr->child;
thr->state = QUE_THR_COMPLETED;
thr = UT_LIST_GET_NEXT(thrs, thr);
}
thr = UT_LIST_GET_FIRST(fork->thrs);
que_thr_move_to_run_state(thr);
srv_que_task_enqueue_low(thr);
}
/******************************************************************** /********************************************************************
Tests if all the query threads in the same fork have a given state. */ Tests if all the query threads in the same fork have a given state. */
UNIV_INLINE UNIV_INLINE
@ -765,22 +709,18 @@ this function may only be called from inside que_run_threads or
que_thr_check_if_switch! These restrictions exist to make the rollback code que_thr_check_if_switch! These restrictions exist to make the rollback code
easier to maintain. */ easier to maintain. */
static static
void que_thr_t*
que_thr_dec_refer_count( que_thr_dec_refer_count(
/*====================*/ /*====================*/
que_thr_t* thr, /* in: query thread */ /* out: next query thread to run */
que_thr_t** next_thr) /* in/out: next query thread to run; que_thr_t* thr) /* in: query thread */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
{ {
que_fork_t* fork; que_fork_t* fork;
trx_t* trx; trx_t* trx;
sess_t* sess; sess_t* sess;
ulint fork_type; ulint fork_type;
ibool stopped; que_thr_t* next_thr = NULL;
fork = thr->common.parent; fork = thr->common.parent;
trx = thr->graph->trx; trx = thr->graph->trx;
sess = trx->sess; sess = trx->sess;
@ -791,9 +731,7 @@ que_thr_dec_refer_count(
if (thr->state == QUE_THR_RUNNING) { if (thr->state == QUE_THR_RUNNING) {
stopped = que_thr_stop(thr); if (!que_thr_stop(thr)) {
if (!stopped) {
/* The reason for the thr suspension or wait was /* The reason for the thr suspension or wait was
already canceled before we came here: continue already canceled before we came here: continue
running the thread */ running the thread */
@ -801,15 +739,9 @@ que_thr_dec_refer_count(
/* fputs("!!!!!!!! Wait already ended: continue thr\n", /* fputs("!!!!!!!! Wait already ended: continue thr\n",
stderr); */ stderr); */
if (next_thr && *next_thr == NULL) {
*next_thr = thr;
} else {
srv_que_task_enqueue_low(thr);
}
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
return; return(thr);
} }
} }
@ -825,7 +757,7 @@ que_thr_dec_refer_count(
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
return; return(next_thr);
} }
fork_type = fork->fork_type; fork_type = fork->fork_type;
@ -841,7 +773,7 @@ que_thr_dec_refer_count(
ut_ad(UT_LIST_GET_LEN(trx->signals) > 0); ut_ad(UT_LIST_GET_LEN(trx->signals) > 0);
ut_ad(trx->handling_signals == TRUE); ut_ad(trx->handling_signals == TRUE);
trx_finish_rollback_off_kernel(fork, trx, next_thr); next_thr = trx_finish_rollback_off_kernel(fork, trx);
} else if (fork_type == QUE_FORK_PURGE) { } else if (fork_type == QUE_FORK_PURGE) {
@ -863,7 +795,7 @@ que_thr_dec_refer_count(
zero, then we start processing a signal; from it we may get zero, then we start processing a signal; from it we may get
a new query thread to run */ a new query thread to run */
trx_sig_start_handle(trx, next_thr); next_thr = trx_sig_start_handle(trx);
} }
if (trx->handling_signals && UT_LIST_GET_LEN(trx->signals) == 0) { if (trx->handling_signals && UT_LIST_GET_LEN(trx->signals) == 0) {
@ -872,6 +804,8 @@ que_thr_dec_refer_count(
} }
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
return(next_thr);
} }
/************************************************************************** /**************************************************************************
@ -1245,6 +1179,7 @@ loop:
/*-------------------------*/ /*-------------------------*/
next_thr = que_thr_step(thr); next_thr = que_thr_step(thr);
/*-------------------------*/ /*-------------------------*/
ut_a(next_thr == thr || next_thr == NULL);
/* Test the effect on performance of adding extra mutex /* Test the effect on performance of adding extra mutex
reservations */ reservations */
@ -1257,7 +1192,7 @@ loop:
loop_count++; loop_count++;
if (next_thr != thr) { if (next_thr != thr) {
que_thr_dec_refer_count(thr, &next_thr); next_thr = que_thr_dec_refer_count(thr);
if (next_thr == NULL) { if (next_thr == NULL) {

View File

@ -19,6 +19,6 @@ include ../include/Makefile.i
noinst_LIBRARIES = libsrv.a noinst_LIBRARIES = libsrv.a
libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c libsrv_a_SOURCES = srv0srv.c srv0start.c
EXTRA_PROGRAMS = EXTRA_PROGRAMS =

View File

@ -1,111 +0,0 @@
/******************************************************
Server query execution
(c) 1996 Innobase Oy
Created 6/5/1996 Heikki Tuuri
*******************************************************/
#include "srv0que.h"
#include "srv0srv.h"
#include "sync0sync.h"
#include "os0thread.h"
#include "usr0sess.h"
#include "que0que.h"
/**************************************************************************
Checks if there is work to do in the server task queue. If there is, the
thread starts processing a task. Before leaving, it again checks the task
queue and picks a new task if any exists. This is called by a SRV_WORKER
thread. */
void
srv_que_task_queue_check(void)
/*==========================*/
{
que_thr_t* thr;
for (;;) {
mutex_enter(&kernel_mutex);
thr = UT_LIST_GET_FIRST(srv_sys->tasks);
if (thr == NULL) {
mutex_exit(&kernel_mutex);
return;
}
UT_LIST_REMOVE(queue, srv_sys->tasks, thr);
mutex_exit(&kernel_mutex);
que_run_threads(thr);
}
}
/**************************************************************************
Performs round-robin on the server tasks. This is called by a SRV_WORKER
thread every second or so. */
que_thr_t*
srv_que_round_robin(
/*================*/
/* out: the new (may be == thr) query thread
to run */
que_thr_t* thr) /* in: query thread */
{
que_thr_t* new_thr;
ut_ad(thr);
ut_ad(thr->state == QUE_THR_RUNNING);
mutex_enter(&kernel_mutex);
UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
new_thr = UT_LIST_GET_FIRST(srv_sys->tasks);
mutex_exit(&kernel_mutex);
return(new_thr);
}
/**************************************************************************
Enqueues a task to server task queue and releases a worker thread, if there
is a suspended one. */
void
srv_que_task_enqueue_low(
/*=====================*/
que_thr_t* thr) /* in: query thread */
{
ut_ad(thr);
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
UT_LIST_ADD_LAST(queue, srv_sys->tasks, thr);
srv_release_threads(SRV_WORKER, 1);
}
/**************************************************************************
Enqueues a task to server task queue and releases a worker thread, if there
is a suspended one. */
void
srv_que_task_enqueue(
/*=================*/
que_thr_t* thr) /* in: query thread */
{
ut_ad(thr);
mutex_enter(&kernel_mutex);
srv_que_task_enqueue_low(thr);
mutex_exit(&kernel_mutex);
}

View File

@ -34,7 +34,6 @@ Created 10/8/1995 Heikki Tuuri
#include "sync0sync.h" #include "sync0sync.h"
#include "thr0loc.h" #include "thr0loc.h"
#include "que0que.h" #include "que0que.h"
#include "srv0que.h"
#include "log0recv.h" #include "log0recv.h"
#include "pars0pars.h" #include "pars0pars.h"
#include "usr0sess.h" #include "usr0sess.h"

View File

@ -23,7 +23,6 @@ Created 3/26/1996 Heikki Tuuri
#include "row0purge.h" #include "row0purge.h"
#include "row0upd.h" #include "row0upd.h"
#include "trx0rec.h" #include "trx0rec.h"
#include "srv0que.h"
#include "os0thread.h" #include "os0thread.h"
/* The global data structure coordinating a purge */ /* The global data structure coordinating a purge */
@ -1060,8 +1059,6 @@ trx_purge(void)
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
/* srv_que_task_enqueue(thr2); */
if (srv_print_thread_releases) { if (srv_print_thread_releases) {
fputs("Starting purge\n", stderr); fputs("Starting purge\n", stderr);

View File

@ -20,7 +20,6 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rec.h" #include "trx0rec.h"
#include "que0que.h" #include "que0que.h"
#include "usr0sess.h" #include "usr0sess.h"
#include "srv0que.h"
#include "srv0start.h" #include "srv0start.h"
#include "row0undo.h" #include "row0undo.h"
#include "row0mysql.h" #include "row0mysql.h"
@ -932,21 +931,15 @@ trx_undo_rec_release(
/************************************************************************* /*************************************************************************
Starts a rollback operation. */ Starts a rollback operation. */
void que_thr_t*
trx_rollback( trx_rollback(
/*=========*/ /*=========*/
/* out: next query thread to run */
trx_t* trx, /* in: transaction */ trx_t* trx, /* in: transaction */
trx_sig_t* sig, /* in: signal starting the rollback */ trx_sig_t* sig) /* in: signal starting the rollback */
que_thr_t** next_thr)/* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if the passed value is
NULL, the parameter is ignored */
{ {
que_t* roll_graph; que_t* roll_graph;
que_thr_t* thr; que_thr_t* thr;
/* que_thr_t* thr2; */
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
@ -988,18 +981,7 @@ trx_rollback(
thr = que_fork_start_command(roll_graph); thr = que_fork_start_command(roll_graph);
ut_ad(thr); ut_ad(thr);
return(thr);
/* thr2 = que_fork_start_command(roll_graph);
ut_ad(thr2); */
if (next_thr && (*next_thr == NULL)) {
*next_thr = thr;
/* srv_que_task_enqueue_low(thr2); */
} else {
srv_que_task_enqueue_low(thr);
/* srv_que_task_enqueue_low(thr2); */
}
} }
/******************************************************************** /********************************************************************
@ -1071,17 +1053,14 @@ trx_finish_error_processing(
/************************************************************************* /*************************************************************************
Finishes a partial rollback operation. */ Finishes a partial rollback operation. */
static static
void que_thr_t*
trx_finish_partial_rollback_off_kernel( trx_finish_partial_rollback_off_kernel(
/*===================================*/ /*===================================*/
trx_t* trx, /* in: transaction */ /* out: next query thread to run */
que_thr_t** next_thr)/* in/out: next query thread to run; trx_t* trx) /* in: transaction */
if the value which is passed in is a pointer
to a NULL pointer, then the calling function
can start running a new query thread; if this
parameter is NULL, it is ignored */
{ {
trx_sig_t* sig; trx_sig_t* sig;
que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
@ -1092,29 +1071,26 @@ trx_finish_partial_rollback_off_kernel(
/* Remove the signal from the signal queue and send reply message /* Remove the signal from the signal queue and send reply message
to it */ to it */
trx_sig_reply(sig, next_thr); next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig); trx_sig_remove(trx, sig);
trx->que_state = TRX_QUE_RUNNING; trx->que_state = TRX_QUE_RUNNING;
return(next_thr);
} }
/******************************************************************** /********************************************************************
Finishes a transaction rollback. */ Finishes a transaction rollback. */
void que_thr_t*
trx_finish_rollback_off_kernel( trx_finish_rollback_off_kernel(
/*===========================*/ /*===========================*/
/* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */ que_t* graph, /* in: undo graph which can now be freed */
trx_t* trx, /* in: transaction */ trx_t* trx) /* in: transaction */
que_thr_t** next_thr)/* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if this parameter is
NULL, it is ignored */
{ {
trx_sig_t* sig; trx_sig_t* sig;
trx_sig_t* next_sig; trx_sig_t* next_sig;
que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
@ -1129,15 +1105,13 @@ trx_finish_rollback_off_kernel(
if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) { if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) {
trx_finish_partial_rollback_off_kernel(trx, next_thr); return(trx_finish_partial_rollback_off_kernel(trx));
return;
} else if (sig->type == TRX_SIG_ERROR_OCCURRED) { } else if (sig->type == TRX_SIG_ERROR_OCCURRED) {
trx_finish_error_processing(trx); trx_finish_error_processing(trx);
return; return(NULL);
} }
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
@ -1153,19 +1127,23 @@ trx_finish_rollback_off_kernel(
send reply messages to them */ send reply messages to them */
trx->que_state = TRX_QUE_RUNNING; trx->que_state = TRX_QUE_RUNNING;
next_thr = NULL;
while (sig != NULL) { while (sig != NULL) {
next_sig = UT_LIST_GET_NEXT(signals, sig); next_sig = UT_LIST_GET_NEXT(signals, sig);
if (sig->type == TRX_SIG_TOTAL_ROLLBACK) { if (sig->type == TRX_SIG_TOTAL_ROLLBACK) {
trx_sig_reply(sig, next_thr); ut_a(next_thr == NULL);
next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig); trx_sig_remove(trx, sig);
} }
sig = next_sig; sig = next_sig;
} }
return(next_thr);
} }
/************************************************************************* /*************************************************************************
@ -1198,7 +1176,6 @@ trx_rollback_step(
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
roll_node_t* node; roll_node_t* node;
ibool success;
ulint sig_no; ulint sig_no;
trx_savept_t* savept; trx_savept_t* savept;
@ -1225,19 +1202,13 @@ trx_rollback_step(
/* Send a rollback signal to the transaction */ /* Send a rollback signal to the transaction */
success = trx_sig_send(thr_get_trx(thr), trx_sig_send(thr_get_trx(thr), sig_no, TRX_SIG_SELF,
sig_no, TRX_SIG_SELF, thr, savept);
thr, savept, NULL);
thr->state = QUE_THR_SIG_REPLY_WAIT; thr->state = QUE_THR_SIG_REPLY_WAIT;
mutex_exit(&kernel_mutex); mutex_exit(&kernel_mutex);
if (!success) {
/* Error in delivering the rollback signal */
que_thr_handle_error(thr, DB_ERROR, NULL, 0);
}
return(NULL); return(NULL);
} }

View File

@ -897,18 +897,15 @@ trx_assign_read_view(
/******************************************************************** /********************************************************************
Commits a transaction. NOTE that the kernel mutex is temporarily released. */ Commits a transaction. NOTE that the kernel mutex is temporarily released. */
static static
void que_thr_t*
trx_handle_commit_sig_off_kernel( trx_handle_commit_sig_off_kernel(
/*=============================*/ /*=============================*/
trx_t* trx, /* in: transaction */ /* out: next query thread to run */
que_thr_t** next_thr) /* in/out: next query thread to run; trx_t* trx) /* in: transaction */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
{ {
trx_sig_t* sig; trx_sig_t* sig;
trx_sig_t* next_sig; trx_sig_t* next_sig;
que_thr_t* next_thr = NULL;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
@ -930,7 +927,8 @@ trx_handle_commit_sig_off_kernel(
if (sig->type == TRX_SIG_COMMIT) { if (sig->type == TRX_SIG_COMMIT) {
trx_sig_reply(sig, next_thr); ut_a(next_thr == NULL);
next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig); trx_sig_remove(trx, sig);
} }
@ -938,6 +936,8 @@ trx_handle_commit_sig_off_kernel(
} }
trx->que_state = TRX_QUE_RUNNING; trx->que_state = TRX_QUE_RUNNING;
return(next_thr);
} }
/*************************************************************** /***************************************************************
@ -999,39 +999,6 @@ trx_lock_wait_to_suspended(
trx->que_state = TRX_QUE_RUNNING; trx->que_state = TRX_QUE_RUNNING;
} }
/***************************************************************
Moves the query threads in the sig reply wait list of trx to the SUSPENDED
state. */
static
void
trx_sig_reply_wait_to_suspended(
/*============================*/
trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
que_thr_t* thr;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->reply_signals);
while (sig != NULL) {
thr = sig->receiver;
ut_ad(thr->state == QUE_THR_SIG_REPLY_WAIT);
thr->state = QUE_THR_SUSPENDED;
sig->receiver = NULL;
UT_LIST_REMOVE(reply_signals, trx->reply_signals, sig);
sig = UT_LIST_GET_FIRST(trx->reply_signals);
}
}
/********************************************************************* /*********************************************************************
Checks the compatibility of a new signal with the other signals in the Checks the compatibility of a new signal with the other signals in the
queue. */ queue. */
@ -1111,11 +1078,10 @@ trx_sig_is_compatible(
/******************************************************************** /********************************************************************
Sends a signal to a trx object. */ Sends a signal to a trx object. */
ibool que_thr_t*
trx_sig_send( trx_sig_send(
/*=========*/ /*=========*/
/* out: TRUE if the signal was /* out: next query thread to run */
successfully delivered */
trx_t* trx, /* in: trx handle */ trx_t* trx, /* in: trx handle */
ulint type, /* in: signal type */ ulint type, /* in: signal type */
ulint sender, /* in: TRX_SIG_SELF or ulint sender, /* in: TRX_SIG_SELF or
@ -1123,14 +1089,8 @@ trx_sig_send(
que_thr_t* receiver_thr, /* in: query thread which wants the que_thr_t* receiver_thr, /* in: query thread which wants the
reply, or NULL; if type is reply, or NULL; if type is
TRX_SIG_END_WAIT, this must be NULL */ TRX_SIG_END_WAIT, this must be NULL */
trx_savept_t* savept, /* in: possible rollback savepoint, or trx_savept_t* savept) /* in: possible rollback savepoint, or
NULL */ NULL */
que_thr_t** next_thr) /* in/out: next query thread to run;
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if the parameter
is NULL, it is ignored */
{ {
trx_sig_t* sig; trx_sig_t* sig;
trx_t* receiver_trx; trx_t* receiver_trx;
@ -1140,14 +1100,7 @@ trx_sig_send(
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
if (!trx_sig_is_compatible(trx, type, sender)) { ut_a(trx_sig_is_compatible(trx, type, sender));
/* The signal is not compatible with the other signals in
the queue: do nothing */
ut_error;
return(FALSE);
}
/* Queue the signal object */ /* Queue the signal object */
@ -1181,11 +1134,6 @@ trx_sig_send(
sig); sig);
} }
if (trx->sess->state == SESS_ERROR) {
trx_sig_reply_wait_to_suspended(trx);
}
if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) { if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) {
/* The following call will add a TRX_SIG_ERROR_OCCURRED /* The following call will add a TRX_SIG_ERROR_OCCURRED
@ -1200,10 +1148,10 @@ trx_sig_send(
if (UT_LIST_GET_FIRST(trx->signals) == sig) { if (UT_LIST_GET_FIRST(trx->signals) == sig) {
trx_sig_start_handle(trx, next_thr); return(trx_sig_start_handle(trx));
} }
return(TRUE); return(NULL);
} }
/******************************************************************** /********************************************************************
@ -1225,27 +1173,18 @@ trx_end_signal_handling(
trx->handling_signals = FALSE; trx->handling_signals = FALSE;
trx->graph = trx->graph_before_signal_handling; trx->graph = trx->graph_before_signal_handling;
if (trx->graph && (trx->sess->state == SESS_ERROR)) {
que_fork_error_handle(trx, trx->graph);
}
} }
/******************************************************************** /********************************************************************
Starts handling of a trx signal. */ Starts handling of a trx signal. */
void que_thr_t*
trx_sig_start_handle( trx_sig_start_handle(
/*=================*/ /*=================*/
trx_t* trx, /* in: trx handle */ /* out: next query thread to run, or NULL */
que_thr_t** next_thr) /* in/out: next query thread to run; trx_t* trx) /* in: trx handle */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread; if the parameter
is NULL, it is ignored */
{ {
que_thr_t* next_thr = NULL;
trx_sig_t* sig; trx_sig_t* sig;
ulint type; ulint type;
loop: loop:
@ -1261,7 +1200,7 @@ loop:
trx_end_signal_handling(trx); trx_end_signal_handling(trx);
return; return(next_thr);
} }
if (trx->conc_state == TRX_NOT_STARTED) { if (trx->conc_state == TRX_NOT_STARTED) {
@ -1277,23 +1216,13 @@ loop:
trx_lock_wait_to_suspended(trx); trx_lock_wait_to_suspended(trx);
} }
/* If the session is in the error state and this trx has threads
waiting for reply from signals, moves these threads to the suspended
state, canceling wait reservations; note that if the transaction has
sent a commit or rollback signal to itself, and its session is not in
the error state, then nothing is done here. */
if (trx->sess->state == SESS_ERROR) {
trx_sig_reply_wait_to_suspended(trx);
}
/* If there are no running query threads, we can start processing of a /* If there are no running query threads, we can start processing of a
signal, otherwise we have to wait until all query threads of this signal, otherwise we have to wait until all query threads of this
transaction are aware of the arrival of the signal. */ transaction are aware of the arrival of the signal. */
if (trx->n_active_thrs > 0) { if (trx->n_active_thrs > 0) {
return; return(NULL);
} }
if (trx->handling_signals == FALSE) { if (trx->handling_signals == FALSE) {
@ -1307,30 +1236,19 @@ loop:
if (type == TRX_SIG_COMMIT) { if (type == TRX_SIG_COMMIT) {
trx_handle_commit_sig_off_kernel(trx, next_thr); next_thr = trx_handle_commit_sig_off_kernel(trx);
} else if ((type == TRX_SIG_TOTAL_ROLLBACK) } else if ((type == TRX_SIG_TOTAL_ROLLBACK)
|| (type == TRX_SIG_ROLLBACK_TO_SAVEPT)) { || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)
|| (type == TRX_SIG_ERROR_OCCURRED)) {
trx_rollback(trx, sig, next_thr);
/* No further signals can be handled until the rollback /* No further signals can be handled until the rollback
completes, therefore we return */ completes, therefore we return */
return; return(trx_rollback(trx, sig));
} else if (type == TRX_SIG_ERROR_OCCURRED) {
trx_rollback(trx, sig, next_thr);
/* No further signals can be handled until the rollback
completes, therefore we return */
return;
} else if (type == TRX_SIG_BREAK_EXECUTION) { } else if (type == TRX_SIG_BREAK_EXECUTION) {
trx_sig_reply(sig, next_thr); next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig); trx_sig_remove(trx, sig);
} else { } else {
ut_error; ut_error;
@ -1343,17 +1261,14 @@ loop:
Send the reply message when a signal in the queue of the trx has been Send the reply message when a signal in the queue of the trx has been
handled. */ handled. */
void que_thr_t*
trx_sig_reply( trx_sig_reply(
/*==========*/ /*==========*/
trx_sig_t* sig, /* in: signal */ /* out: next query thread to run */
que_thr_t** next_thr) /* in/out: next query thread to run; trx_sig_t* sig) /* in: signal */
if the value which is passed in is
a pointer to a NULL pointer, then the
calling function can start running
a new query thread */
{ {
trx_t* receiver_trx; trx_t* receiver_trx;
que_thr_t* next_thr = NULL;
ut_ad(sig); ut_ad(sig);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
@ -1367,13 +1282,13 @@ trx_sig_reply(
UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals, UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals,
sig); sig);
ut_ad(receiver_trx->sess->state != SESS_ERROR); next_thr = que_thr_end_wait(sig->receiver);
que_thr_end_wait(sig->receiver, next_thr);
sig->receiver = NULL; sig->receiver = NULL;
} }
return(next_thr);
} }
/******************************************************************** /********************************************************************
@ -1429,7 +1344,6 @@ trx_commit_step(
{ {
commit_node_t* node; commit_node_t* node;
que_thr_t* next_thr; que_thr_t* next_thr;
ibool success;
node = thr->run_node; node = thr->run_node;
@ -1444,21 +1358,14 @@ trx_commit_step(
node->state = COMMIT_NODE_WAIT; node->state = COMMIT_NODE_WAIT;
next_thr = NULL;
thr->state = QUE_THR_SIG_REPLY_WAIT; thr->state = QUE_THR_SIG_REPLY_WAIT;
/* Send the commit signal to the transaction */ /* Send the commit signal to the transaction */
success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT, next_thr = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
TRX_SIG_SELF, thr, NULL, &next_thr); TRX_SIG_SELF, thr, NULL);
mutex_exit(&kernel_mutex);
if (!success) { mutex_exit(&kernel_mutex);
/* Error in delivering the commit signal */
que_thr_handle_error(thr, DB_ERROR, NULL, 0);
}
return(next_thr); return(next_thr);
} }

View File

@ -37,8 +37,6 @@ sess_open(void)
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
sess = mem_alloc(sizeof(sess_t)); sess = mem_alloc(sizeof(sess_t));
sess->state = SESS_ACTIVE;
sess->trx = trx_create(sess); sess->trx = trx_create(sess);
UT_LIST_INIT(sess->graphs); UT_LIST_INIT(sess->graphs);

View File

@ -333,12 +333,16 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver 6.01 for %s at %s\n", my_progname, SYSTEM_TYPE, printf("%s Ver 6.01 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE); MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
@ -352,6 +356,8 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
/* Check table */ /* Check table */
static int nisamchk(my_string filename) static int nisamchk(my_string filename)

View File

@ -77,25 +77,32 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/vio/libvio.a $(top_builddir)/vio/libvio.a
# #
# To make it easy for the end user to use the embedded library we # To make it easy for the end user to use the embedded library we
# generate a total libmysqld.a from all library files, # generate a total libmysqld.a from all library files,
libmysqld.a: libmysqld_int.a $(INC_LIB) libmysqld.a: libmysqld_int.a $(INC_LIB)
if test ! -d tmp ; then mkdir tmp ; fi if test "$(host_os)" = "netware" ; \
rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a then \
cp $(INC_LIB) tmp $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
cp libmysqld_int.a libmysqld_int2.a ; \ else \
cd tmp ; \ if test ! -d tmp ; then mkdir tmp ; fi ; \
for file in *.a ; do \ rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \
bfile=`basename $$file .a` ; \ cp $(INC_LIB) tmp ; \
$(AR) x $$file; \ cp libmysqld_int.a libmysqld_int2.a ; \
for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \ cd tmp ; \
$(AR) q ../libmysqld_int2.a *.o ; \ for file in *.a ; do \
rm -f *.o ; \ bfile=`basename $$file .a` ; \
done $(AR) x $$file; \
mv libmysqld_int2.a libmysqld.a for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
rm -f tmp/* $(AR) q ../libmysqld_int2.a *.o ; \
$(RANLIB) libmysqld.a rm -f *.o ; \
done ; \
cd .. ; \
mv libmysqld_int2.a libmysqld.a ; \
rm -f tmp/* ; \
$(RANLIB) libmysqld.a ; \
fi
## XXX: any time the client interface changes, we'll need to bump ## XXX: any time the client interface changes, we'll need to bump
## the version info for libmysqld; however, it's possible for the ## the version info for libmysqld; however, it's possible for the

View File

@ -264,15 +264,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0; return 0;
} }
#include <help_start.h>
static void usage() static void usage()
{ {
printf("Use: myisam_ftdump <table_name> <index_num>\n"); printf("Use: myisam_ftdump <table_name> <index_num>\n");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
NETWARE_SET_SCREEN_MODE(1);
exit(1); exit(1);
} }
#include <help_end.h>
static void complain(int val) /* Kinda assert :-) */ static void complain(int val) /* Kinda assert :-) */
{ {

View File

@ -336,10 +336,13 @@ static struct my_option my_long_options[] =
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver 2.7 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); MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
@ -452,6 +455,7 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
/* Read options */ /* Read options */

View File

@ -266,12 +266,15 @@ static struct my_option my_long_options[] =
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
}; };
#include <help_start.h>
static void print_version(void) static void print_version(void)
{ {
printf("%s Ver 1.22 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); printf("%s Ver 1.22 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} }
static void usage(void) static void usage(void)
{ {
print_version(); print_version();
@ -290,6 +293,7 @@ static void usage(void)
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
#include <help_end.h>
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),

View File

@ -479,6 +479,7 @@ static char *remove_end_comment(char *ptr)
return ptr; return ptr;
} }
#include <help_start.h>
void print_defaults(const char *conf_file, const char **groups) void print_defaults(const char *conf_file, const char **groups)
{ {
@ -531,3 +532,5 @@ void print_defaults(const char *conf_file, const char **groups)
--defaults-file=# Only read default options from the given file #\n\ --defaults-file=# Only read default options from the given file #\n\
--defaults-extra-file=# Read this file after the global files are read"); --defaults-extra-file=# Read this file after the global files are read");
} }
#include <help_end.h>

View File

@ -790,6 +790,8 @@ static void init_variables(const struct my_option *options)
Print help for all options and variables. Print help for all options and variables.
*/ */
#include <help_start.h>
void my_print_help(const struct my_option *options) void my_print_help(const struct my_option *options)
{ {
uint col, name_space= 22, comment_space= 57; uint col, name_space= 22, comment_space= 57;
@ -920,3 +922,5 @@ void my_print_variables(const struct my_option *options)
} }
} }
} }
#include <help_end.h>

View File

@ -353,14 +353,16 @@ static my_bool win32_init_tcp_ip()
#ifdef __NETWARE__ #ifdef __NETWARE__
/**************************************************************************** /*
Do basic initialisation for netware needed by most programs Basic initialisation for netware
****************************************************************************/ */
static void netware_init() static void netware_init()
{ {
char cwd[PATH_MAX], *name; char cwd[PATH_MAX], *name;
DBUG_ENTER("netware_init");
/* init only if we are not a client library */ /* init only if we are not a client library */
if (my_progname) if (my_progname)
{ {
@ -398,5 +400,7 @@ static void netware_init()
} }
} }
} }
DBUG_VOID_RETURN;
} }
#endif /* __NETWARE__ */ #endif /* __NETWARE__ */

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* /*
Function specific to netware Functions specific to netware
*/ */
#include <mysys_priv.h> #include <mysys_priv.h>

View File

@ -102,16 +102,20 @@ void my_pthread_exit(void *status)
NXContext_t ctx; NXContext_t ctx;
char name[PATH_MAX] = ""; char name[PATH_MAX] = "";
NXThreadGetContext(tid, &ctx); /* Do not call pthread_exit if it is not a LibC thread */
NXContextGetName(ctx, name, PATH_MAX); if (tid != 0)
/*
"MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
with a debug build of LibC the reaper can have different names
*/
if (!strindex(name, "\'s"))
{ {
pthread_exit(status); NXThreadGetContext(tid, &ctx);
NXContextGetName(ctx, name, PATH_MAX);
/*
"MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
with a debug build of LibC the reaper can have different names
*/
if (!strindex(name, "\'s"))
{
pthread_exit(status);
}
} }
} }
#endif #endif

View File

@ -11,5 +11,5 @@ path=`dirname $0`
$path/compile-netware-src $path/compile-netware-src
$path/compile-netware-standard $path/compile-netware-standard
$path/compile-netware-debug $path/compile-netware-debug
#$path/compile-netware-max $path/compile-netware-max
#$path/compile-netware-max-debug $path/compile-netware-max-debug

View File

@ -14,6 +14,7 @@ suffix="standard"
extra_configs=" \ extra_configs=" \
--with-innodb \ --with-innodb \
--enable-thread-safe-client \
" "
. $path/compile-netware-END . $path/compile-netware-END

View File

@ -6,9 +6,9 @@
# the default is "F:/mydev" # the default is "F:/mydev"
export MYDEV="WINE_BUILD_DIR" export MYDEV="WINE_BUILD_DIR"
export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV;$MYDEV/zlib-1.1.4"" export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV;$MYDEV/zlib-1.1.4"
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD" export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD"
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;knetware.imp" export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp"
export WINEPATH="$MYDEV/mw/bin" export WINEPATH="$MYDEV/mw/bin"

View File

@ -33,7 +33,8 @@ netware_build_files = client/mysql.def client/mysqladmin.def \
isam/isamlog.def isam/pack_isam.def \ isam/isamlog.def isam/pack_isam.def \
libmysqld/libmysqld.def myisam/myisamchk.def \ libmysqld/libmysqld.def myisam/myisamchk.def \
myisam/myisamlog.def myisam/myisampack.def \ myisam/myisamlog.def myisam/myisampack.def \
sql/mysqld.def sql/mysqld.def extra/mysql_waitpid.def \
extra/resolve_stack_dump.def myisam/myisam_ftdump.def
link_sources: link_sources:
set -x; \ set -x; \

View File

@ -20,7 +20,7 @@ INSERT INTO user (host,user) values ('','');
CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';

View File

@ -180,7 +180,7 @@ int sleep_until_file_exists(char *pid_file)
Wait for the server on the given port to start. Wait for the server on the given port to start.
******************************************************************************/ ******************************************************************************/
int wait_for_server_start(char *bin_dir, char *user, char *password, int port) int wait_for_server_start(char *bin_dir, char *user, char *password, int port,char *tmp_dir)
{ {
arg_list_t al; arg_list_t al;
int err, i; int err, i;
@ -189,7 +189,7 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
// mysqladmin file // mysqladmin file
snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
snprintf(trash, PATH_MAX, "/tmp/trash.out"); snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
// args // args
init_args(&al); init_args(&al);
@ -283,7 +283,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
******************************************************************************/ ******************************************************************************/
int stop_server(char *bin_dir, char *user, char *password, int port, int stop_server(char *bin_dir, char *user, char *password, int port,
char *pid_file) char *pid_file,char *tmp_dir)
{ {
arg_list_t al; arg_list_t al;
int err, i, argc = 0; int err, i, argc = 0;
@ -292,7 +292,7 @@ int stop_server(char *bin_dir, char *user, char *password, int port,
// mysqladmin file // mysqladmin file
snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
snprintf(trash, PATH_MAX, "/tmp/trash.out"); snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir);
// args // args
init_args(&al); init_args(&al);

View File

@ -71,11 +71,11 @@ void free_args(arg_list_t *);
int sleep_until_file_exists(char *); int sleep_until_file_exists(char *);
int sleep_until_file_deleted(char *); int sleep_until_file_deleted(char *);
int wait_for_server_start(char *, char *, char *, int); int wait_for_server_start(char *, char *, char *, int,char *);
int spawn(char *, arg_list_t *, int, char *, char *, char *); int spawn(char *, arg_list_t *, int, char *, char *, char *);
int stop_server(char *, char *, char *, int, char *); int stop_server(char *, char *, char *, int, char *,char *);
pid_t get_server_pid(char *); pid_t get_server_pid(char *);
void kill_server(pid_t pid); void kill_server(pid_t pid);

12
netware/myisam_ftdump.def Normal file
View File

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# MySQL MyISAM Dump Tool
#------------------------------------------------------------------------------
MODULE libc.nlm
SCREENNAME "MySQL MyISAM Table Dump Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Dump Tool"
VERSION 4, 0
STACKSIZE 65536
XDCDATA ../netware/mysql.xdc
#DEBUG

View File

@ -386,7 +386,8 @@ int main(int argc, char **argv)
if (!autoclose) setscreenmode(SCR_NO_MODE); if (!autoclose) setscreenmode(SCR_NO_MODE);
// header // header
printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); printf("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE,
MACHINE_TYPE);
// create paths // create paths
create_paths(); create_paths();

View File

@ -53,6 +53,7 @@
#define TEST_SKIP "[ skip ]" #define TEST_SKIP "[ skip ]"
#define TEST_FAIL "[ fail ]" #define TEST_FAIL "[ fail ]"
#define TEST_BAD "[ bad ]" #define TEST_BAD "[ bad ]"
#define TEST_IGNORE "[ignore]"
/****************************************************************************** /******************************************************************************
@ -69,7 +70,8 @@ int master_port = 9306;
int slave_port = 9307; int slave_port = 9307;
// comma delimited list of tests to skip or empty string // comma delimited list of tests to skip or empty string
char skip_test[PATH_MAX] = ""; char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix ";
char ignore_test[PATH_MAX] = "";
char bin_dir[PATH_MAX]; char bin_dir[PATH_MAX];
char mysql_test_dir[PATH_MAX]; char mysql_test_dir[PATH_MAX];
@ -107,6 +109,7 @@ int total_pass = 0;
int total_fail = 0; int total_fail = 0;
int total_test = 0; int total_test = 0;
int total_ignore = 0;
double total_time = 0; double total_time = 0;
int use_openssl = FALSE; int use_openssl = FALSE;
@ -393,7 +396,7 @@ void start_master()
{ {
sleep_until_file_exists(master_pid); sleep_until_file_exists(master_pid);
if ((err = wait_for_server_start(bin_dir, user, password, master_port)) == 0) if ((err = wait_for_server_start(bin_dir, user, password, master_port,mysql_tmp_dir)) == 0)
{ {
master_running = TRUE; master_running = TRUE;
} }
@ -582,7 +585,7 @@ void start_slave()
{ {
sleep_until_file_exists(slave_pid); sleep_until_file_exists(slave_pid);
if ((err = wait_for_server_start(bin_dir, user, password, slave_port)) == 0) if ((err = wait_for_server_start(bin_dir, user, password, slave_port,mysql_tmp_dir)) == 0)
{ {
slave_running = TRUE; slave_running = TRUE;
} }
@ -633,7 +636,7 @@ void stop_slave()
if (!slave_running) return; if (!slave_running) return;
// stop // stop
if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid)) == 0) if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,mysql_tmp_dir)) == 0)
{ {
slave_running = FALSE; slave_running = FALSE;
} }
@ -657,7 +660,7 @@ void stop_master()
// running? // running?
if (!master_running) return; if (!master_running) return;
if ((err = stop_server(bin_dir, user, password, master_port, master_pid)) == 0) if ((err = stop_server(bin_dir, user, password, master_port, master_pid,mysql_tmp_dir)) == 0)
{ {
master_running = FALSE; master_running = FALSE;
} }
@ -778,21 +781,31 @@ void run_test(char *test)
char temp[PATH_MAX]; char temp[PATH_MAX];
char *rstr; char *rstr;
double elapsed = 0; double elapsed = 0;
int skip = FALSE; int skip = FALSE, ignore=FALSE;
int restart = FALSE; int restart = FALSE;
int flag = FALSE; int flag = FALSE;
struct stat info; struct stat info;
// single test? // single test?
if (!single_test) // if (!single_test)
{ {
// skip tests in the skip list // skip tests in the skip list
snprintf(temp, PATH_MAX, " %s ", test); snprintf(temp, PATH_MAX, " %s ", test);
skip = (strindex(skip_test, temp) != NULL); skip = (strindex(skip_test, temp) != NULL);
if( skip == FALSE )
ignore = (strindex(ignore_test, temp) != NULL);
} }
// skip test? if(ignore)
if (!skip) {
// show test
log("%-46s ", test);
// ignore
rstr = TEST_IGNORE;
++total_ignore;
}
else if (!skip) // skip test?
{ {
char test_file[PATH_MAX]; char test_file[PATH_MAX];
char master_opt_file[PATH_MAX]; char master_opt_file[PATH_MAX];
@ -1148,9 +1161,33 @@ void setup(char *file)
******************************************************************************/ ******************************************************************************/
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int is_ignore_list = 0;
// setup // setup
setup(argv[0]); setup(argv[0]);
/* The --ignore option is comma saperated list of test cases to skip and should
* be very first command line option to the test suite.
* The usage is now:
* mysql_test_run --ignore=test1,test2 test3 test4
* where test1 and test2 are test cases to ignore
* and test3 and test4 are test cases to run. */
if( argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1) )
{
char *temp, *token;
temp=strdup(strchr(argv[1],'=') + 1);
for(token=strtok(temp, ","); token != NULL; token=strtok(NULL, ","))
{
if( strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1 )
sprintf( ignore_test+strlen(ignore_test), " %s ", token);
else
{
free(temp);
die("ignore list too long.");
}
}
free(temp);
is_ignore_list = 1;
}
// header // header
log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
@ -1165,14 +1202,14 @@ int main(int argc, char **argv)
log(HEADER); log(HEADER);
log(DASH); log(DASH);
if (argc > 1) if ( argc > 1 + is_ignore_list )
{ {
int i; int i;
// single test // single test
single_test = TRUE; single_test = TRUE;
for (i = 1; i < argc; i++) for (i = 1 + is_ignore_list; i < argc; i++)
{ {
// run given test // run given test
run_test(argv[i]); run_test(argv[i]);

12
netware/mysql_waitpid.def Normal file
View File

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# Wait for a Program to Terminate
#------------------------------------------------------------------------------
MODULE libc.nlm
#SCREENNAME "MySQL Tool - Wait for a Program to Terminate"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Tool - Wait for a Program to Terminate"
VERSION 4, 0
STACKSIZE 65536
XDCDATA ../netware/mysql.xdc
#DEBUG

View File

@ -0,0 +1,12 @@
#------------------------------------------------------------------------------
# Resolve Stack Dump
#------------------------------------------------------------------------------
MODULE libc.nlm
#SCREENNAME "MySQL Stack Dump Resolve Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Stack Dump Resolve Tool"
VERSION 4, 0
STACKSIZE 65536
XDCDATA ../netware/mysql.xdc
#DEBUG

View File

@ -87,8 +87,8 @@ do
fi fi
done done
for i in COPYING README Docs/INSTALL-BINARY \ for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \
MySQLEULA.txt LICENSE.doc README.NW MySQLEULA.txt LICENSE.doc README.NW
do do
if [ -f $i ] if [ -f $i ]
then then
@ -153,6 +153,7 @@ done
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
$CP -r netware/*.pl $BASE/scripts $CP -r netware/*.pl $BASE/scripts
$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
fi fi
for i in \ for i in \
@ -169,7 +170,7 @@ do
fi fi
done done
# convert the libs to .lib for NetWare # convert the .a to .lib for NetWare
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
for i in $BASE/lib/*.a for i in $BASE/lib/*.a
do do
@ -238,6 +239,16 @@ fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
#
# Remove system dependent files
#
if [ $BASE_SYSTEM = "netware" ] ; then
rm -f $BASE/MySQLEULA.txt
else
rm -f $BASE/README.NW
fi
# Make safe_mysqld a symlink to mysqld_safe for backwards portability # Make safe_mysqld a symlink to mysqld_safe for backwards portability
# To be removed in MySQL 4.1 # To be removed in MySQL 4.1
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
@ -311,29 +322,47 @@ which_1 ()
exit 1 exit 1
} }
# if [ $BASE_SYSTEM != "netware" ] ; then
# Create the result tar file
# #
# Create the result tar file
#
tar=`which_1 gnutar gtar`
if test "$?" = "1" -o "$tar" = ""
then
tar=tar
fi
echo "Using $tar to create archive"
cd $TMP
OPT=cvf
if [ x$SILENT = x1 ] ; then
OPT=cf
fi
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
cd $SOURCE
echo "Compressing archive"
rm -f $NEW_NAME.tar.gz
gzip -9 $NEW_NAME.tar
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.tar.gz created"
else
#
# Create a zip file for NetWare users
#
cd $TMP
if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.zip created"
tar=`which_1 gnutar gtar`
if test "$?" = "1" -o "$tar" = ""
then
tar=tar
fi fi
echo "Using $tar to create archive"
cd $TMP
OPT=cvf
if [ x$SILENT = x1 ] ; then
OPT=cf
fi
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
cd $SOURCE
echo "Compressing archive"
gzip -9 $NEW_NAME.tar
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.tar.gz created"

View File

@ -7,6 +7,7 @@ use File::Basename;
use File::Path; use File::Path;
use DBI; use DBI;
use Sys::Hostname; use Sys::Hostname;
use File::Copy;
=head1 NAME =head1 NAME
@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) {
elsif ( $opt{suffix} ) { elsif ( $opt{suffix} ) {
print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet};
} }
elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.'))
{
$tgt_dirname = $tgt_name;
}
else else
{ {
$tgt_name="" if (!defined($tgt_name)); $tgt_name="" if (!defined($tgt_name));
@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) {
else { else {
mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n"
unless -d $tgt_dirpath; unless -d $tgt_dirpath;
if ($^O !~ m/^(NetWare)$/)
{
my @f_info= stat "$datadir/$rdb->{src}"; my @f_info= stat "$datadir/$rdb->{src}";
chown $f_info[4], $f_info[5], $tgt_dirpath; chown $f_info[4], $f_info[5], $tgt_dirpath;
}
} }
} }
} }
@ -578,7 +586,15 @@ sub copy_files {
my @cmd; my @cmd;
print "Copying ".@$files." files...\n" unless $opt{quiet}; print "Copying ".@$files." files...\n" unless $opt{quiet};
if ($method =~ /^s?cp\b/) { # cp or scp with optional flags if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower)
{
foreach my $file ( @$files )
{
copy($file, $target."/".basename($file));
}
}
elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags
{
my $cp = $method; my $cp = $method;
# add option to preserve mod time etc of copied files # add option to preserve mod time etc of copied files
# not critical, but nice to have # not critical, but nice to have
@ -717,7 +733,7 @@ sub retire_directory {
if ( -d $tgt_oldpath ) { if ( -d $tgt_oldpath ) {
print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet}; print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet};
rmtree([$tgt_oldpath]) rmtree([$tgt_oldpath],0,1);
} }
rename($dir, $tgt_oldpath) rename($dir, $tgt_oldpath)
or die "Can't rename $dir=>$tgt_oldpath: $!\n"; or die "Can't rename $dir=>$tgt_oldpath: $!\n";

View File

@ -138,10 +138,27 @@ int deny_severity = LOG_WARNING;
#include <nks/vm.h> #include <nks/vm.h>
#include <library.h> #include <library.h>
#include <monitor.h> #include <monitor.h>
#include <zOmni.h> //For NEB
#include <neb.h> //For NEB
#include <nebpub.h> //For NEB
#include <zEvent.h> //For NSS event structures
#include <zPublics.h>
static void *neb_consumer_id= NULL; //For storing NEB consumer id
static char datavolname[256]= {0};
static VolumeID_t datavolid;
static event_handle_t eh; static event_handle_t eh;
static Report_t ref; static Report_t ref;
static void *refneb= NULL;
static int volumeid= -1;
/* NEB event callback */
unsigned long neb_event_callback(struct EventBlock *eblock);
static void registerwithneb();
static void getvolumename();
static void getvolumeID(BYTE *volumeName);
#endif /* __NETWARE__ */ #endif /* __NETWARE__ */
#ifdef _AIX41 #ifdef _AIX41
int initgroups(const char *,unsigned int); int initgroups(const char *,unsigned int);
@ -1440,6 +1457,7 @@ static void start_signal_handler(void)
static void check_data_home(const char *path) static void check_data_home(const char *path)
{} {}
#elif defined(__NETWARE__) #elif defined(__NETWARE__)
// down server event callback // down server event callback
@ -1448,27 +1466,196 @@ void mysql_down_server_cb(void *, void *)
kill_server(0); kill_server(0);
} }
// destroy callback resources // destroy callback resources
void mysql_cb_destroy(void *) void mysql_cb_destroy(void *)
{ {
UnRegisterEventNotification(eh); // cleanup down event notification UnRegisterEventNotification(eh); // cleanup down event notification
NX_UNWRAP_INTERFACE(ref); NX_UNWRAP_INTERFACE(ref);
/* Deregister NSS volume deactivation event */
NX_UNWRAP_INTERFACE(refneb);
if (neb_consumer_id)
UnRegisterConsumer(neb_consumer_id, NULL);
} }
// initialize callbacks // initialize callbacks
void mysql_cb_init() void mysql_cb_init()
{ {
// register for down server event // register for down server event
void *handle = getnlmhandle(); void *handle = getnlmhandle();
rtag_t rt = AllocateResourceTag(handle, "MySQL Down Server Callback", rtag_t rt= AllocateResourceTag(handle, "MySQL Down Server Callback",
EventSignature); EventSignature);
NX_WRAP_INTERFACE((void *)mysql_down_server_cb, 2, (void **)&ref); NX_WRAP_INTERFACE((void *)mysql_down_server_cb, 2, (void **)&ref);
eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER, eh= RegisterForEventNotification(rt, EVENT_PRE_DOWN_SERVER,
EVENT_PRIORITY_APPLICATION, EVENT_PRIORITY_APPLICATION,
NULL, ref, NULL); NULL, ref, NULL);
/*
Register for volume deactivation event
Wrap the callback function, as it is called by non-LibC thread
*/
(void)NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb);
registerwithneb();
NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up
} }
/ *To get the name of the NetWare volume having MySQL data folder */
static void getvolumename()
{
char *p;
/*
We assume that data path is already set.
If not it won't come here. Terminate after volume name
*/
if ((p= strchr(mysql_real_data_home, ':')))
strmake(datavolname, mysql_real_data_home,
(uint) (p - mysql_real_data_home));
}
/*
Registering with NEB for NSS Volume Deactivation event
*/
static void registerwithneb()
{
ConsumerRegistrationInfo reg_info;
/* Clear NEB registration structure */
bzero((char*) &reg_info, sizeof(struct ConsumerRegistrationInfo));
/* Fill the NEB consumer information structure */
reg_info.CRIVersion= 1; // NEB version
/* NEB Consumer name */
reg_info.CRIConsumerName= (BYTE *) "MySQL Database Server";
/* Event of interest */
reg_info.CRIEventName= (BYTE *) "NSS.ChangeVolState.Enter";
reg_info.CRIUserParameter= NULL; // Consumer Info
reg_info.CRIEventFlags= 0; // Event flags
/* Consumer NLM handle */
reg_info.CRIOwnerID= (LoadDefinitionStructure *)getnlmhandle();
reg_info.CRIConsumerESR= NULL; // No consumer ESR required
reg_info.CRISecurityToken= 0; // No security token for the event
reg_info.CRIConsumerFlags= 0; // SMP_ENABLED_BIT;
reg_info.CRIFilterName= 0; // No event filtering
reg_info.CRIFilterDataLength= 0; // No filtering data
reg_info.CRIFilterData= 0; // No filtering data
/* Callback function for the event */
(void *)reg_info.CRIConsumerCallback= (void *) refneb;
reg_info.CRIOrder= 0; // Event callback order
reg_info.CRIConsumerType= CHECK_CONSUMER; // Consumer type
/* Register for the event with NEB */
if (RegisterConsumer(&reg_info))
{
consoleprintf("Failed to register for NSS Volume Deactivation event \n");
return;
}
/* This ID is required for deregistration */
neb_consumer_id= reg_info.CRIConsumerID;
/* Get MySQL data volume name, stored in global variable datavolname */
getvolumename();
/*
Get the NSS volume ID of the MySQL Data volume.
Volume ID is stored in a global variable
*/
getvolumeID((BYTE*) datavolname);
}
/*
Callback for NSS Volume Deactivation event
*/
ulong neb_event_callback(struct EventBlock *eblock)
{
EventChangeVolStateEnter_s *voldata;
voldata= (EventChangeVolStateEnter_s *)eblock->EBEventData;
/* Deactivation of a volume */
if ((voldata->oldState == 6 && voldata->newState == 2))
{
/*
Ensure that we bring down MySQL server only for MySQL data
volume deactivation
*/
if (!memcmp(&voldata->volID, &datavolid, sizeof(VolumeID_t)))
{
consoleprintf("MySQL data volume is deactivated, shutting down MySQL Server \n");
kill_server(0);
}
}
return 0;
}
/*
Function to get NSS volume ID of the MySQL data
*/
#define ADMIN_VOL_PATH "_ADMIN:/Volumes/"
staticvoid getvolumeID(BYTE *volumeName)
{
char path[zMAX_FULL_NAME];
Key_t rootKey= 0, fileKey= 0;
QUAD getInfoMask;
zInfo_s info;
STATUS status;
/* Get the root key */
if ((status= zRootKey(0, &rootKey)) != zOK)
{
consoleprintf("\nGetNSSVolumeProperties - Failed to get root key, status: %d\n.", (int) status);
goto exit;
}
/*
Get the file key. This is the key to the volume object in the
NSS admin volumes directory.
*/
strxmov(path, (const char *) ADMIN_VOL_PATH, (const char *) volumeName,
NullS);
if ((status= zOpen(rootKey, zNSS_TASK, zNSPACE_LONG|zMODE_UTF8,
(BYTE *) path, zRR_READ_ACCESS, &fileKey)) != zOK)
{
consoleprintf("\nGetNSSVolumeProperties - Failed to get file, status: %d\n.", (int) status);
goto exit;
}
getInfoMask= zGET_IDS | zGET_VOLUME_INFO ;
if ((status= zGetInfo(fileKey, getInfoMask, sizeof(info),
zINFO_VERSION_A, &info)) != zOK)
{
consoleprintf("\nGetNSSVolumeProperties - Failed in zGetInfo, status: %d\n.", (int) status);
goto exit;
}
/* Copy the data to global variable */
datavolid.timeLow= info.vol.volumeID.timeLow;
datavolid.timeMid= info.vol.volumeID.timeMid;
datavolid.timeHighAndVersion= info.vol.volumeID.timeHighAndVersion;
datavolid.clockSeqHighAndReserved= info.vol.volumeID.clockSeqHighAndReserved;
datavolid.clockSeqLow= info.vol.volumeID.clockSeqLow;
/* This is guranteed to be 6-byte length (but sizeof() would be better) */
memcpy(datavolid.node, info.vol.volumeID.node, (unsigned int) 6);
exit:
if (rootKey)
zClose(rootKey);
if (fileKey)
zClose(fileKey);
}
static void init_signals(void) static void init_signals(void)
{ {
int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT}; int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT};
@ -1478,6 +1665,7 @@ static void init_signals(void)
mysql_cb_init(); // initialize callbacks mysql_cb_init(); // initialize callbacks
} }
static void start_signal_handler(void) static void start_signal_handler(void)
{ {
// Save vm id of this process // Save vm id of this process
@ -1487,7 +1675,12 @@ static void start_signal_handler(void)
} }
/* Warn if the data is on a Traditional volume */ /*
Warn if the data is on a Traditional volume
NOTE
Already done by mysqld_safe
*/
static void check_data_home(const char *path) static void check_data_home(const char *path)
{ {
@ -1933,6 +2126,7 @@ extern "C" pthread_handler_decl(handle_shutdown,arg)
return 0; return 0;
} }
int STDCALL handle_kill(ulong ctrl_type) int STDCALL handle_kill(ulong ctrl_type)
{ {
if (ctrl_type == CTRL_CLOSE_EVENT || if (ctrl_type == CTRL_CLOSE_EVENT ||
@ -5443,6 +5637,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_specialflag|=SPECIAL_NO_RESOLVE; opt_specialflag|=SPECIAL_NO_RESOLVE;
break; break;
case (int) OPT_SKIP_NETWORKING: case (int) OPT_SKIP_NETWORKING:
#if defined(__NETWARE__)
sql_perror("Can't start server: skip-networking option is currently not supported on NetWare");
exit(1);
#endif
opt_disable_networking=1; opt_disable_networking=1;
mysqld_port=0; mysqld_port=0;
break; break;

View File

@ -21,6 +21,8 @@
Sasha Pachev <sasha@mysql.com> Sasha Pachev <sasha@mysql.com>
*/ */
#ifndef __NETWARE__
#include <my_global.h> #include <my_global.h>
#include <my_pthread.h> #include <my_pthread.h>
#include <mysql.h> #include <mysql.h>
@ -1850,3 +1852,16 @@ int main(int argc, char** argv)
else else
return daemonize(); return daemonize();
} }
#else
#include <stdio.h>
int main(void)
{
fprintf(stderr,"This tool has not been ported to NetWare\n");
return 0;
}
#endif /* __NETWARE__ */

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include <my_global.h>
#ifdef HAVE_OPENSSL #if defined(HAVE_OPENSSL) && !defined(__NETWARE__)
#include <my_sys.h> #include <my_sys.h>
#include <m_string.h> #include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>

View File

@ -25,6 +25,31 @@
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
#ifdef __NETWARE__
/*
The default OpenSSL implementation on NetWare uses WinSock.
This code allows us to use the BSD sockets.
*/
static int SSL_set_fd_bsd(SSL *s, int fd)
{
int result= -1;
BIO_METHOD *BIO_s_bsdsocket();
BIO *bio;
if ((bio= BIO_new(BIO_s_bsdsocket())))
{
result= BIO_set_fd(bio, fd, BIO_NOCLOSE);
SSL_set_bio(s, bio, bio);
}
return result;
}
#define SSL_set_fd(A, B) SSL_set_fd_bsd((A), (B))
#endif /* __NETWARE__ */
static void static void
report_errors() report_errors()
{ {

View File

@ -172,6 +172,35 @@ vio_verify_callback(int ok, X509_STORE_CTX *ctx)
} }
#ifdef __NETWARE__
/* NetWare SSL cleanup */
void netware_ssl_cleanup()
{
/* free memory from SSL_library_init() */
EVP_cleanup();
/* free global X509 method */
X509_STORE_method_cleanup();
/* free the thread_hash error table */
ERR_free_state_table();
}
/* NetWare SSL initialization */
static void netware_ssl_init()
{
/* initialize OpenSSL library */
SSL_library_init();
/* cleanup OpenSSL library */
NXVmRegisterExitHandler(netware_ssl_cleanup, NULL);
}
#endif /* __NETWARE__ */
/************************ VioSSLConnectorFd **********************************/ /************************ VioSSLConnectorFd **********************************/
/* /*
TODO: TODO:
@ -188,7 +217,7 @@ new_VioSSLConnectorFd(const char* key_file,
int verify = SSL_VERIFY_NONE; int verify = SSL_VERIFY_NONE;
struct st_VioSSLConnectorFd* ptr; struct st_VioSSLConnectorFd* ptr;
int result; int result;
DH *dh=NULL; DH *dh;
DBUG_ENTER("new_VioSSLConnectorFd"); DBUG_ENTER("new_VioSSLConnectorFd");
DBUG_PRINT("enter", DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s", ("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@ -202,6 +231,10 @@ new_VioSSLConnectorFd(const char* key_file,
ptr->ssl_method= 0; ptr->ssl_method= 0;
/* FIXME: constants! */ /* FIXME: constants! */
#ifdef __NETWARE__
netware_ssl_init();
#endif
if (!ssl_algorithms_added) if (!ssl_algorithms_added)
{ {
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()")); DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));
@ -279,7 +312,7 @@ new_VioSSLAcceptorFd(const char *key_file,
SSL_VERIFY_CLIENT_ONCE); SSL_VERIFY_CLIENT_ONCE);
struct st_VioSSLAcceptorFd* ptr; struct st_VioSSLAcceptorFd* ptr;
int result; int result;
DH *dh=NULL; DH *dh;
DBUG_ENTER("new_VioSSLAcceptorFd"); DBUG_ENTER("new_VioSSLAcceptorFd");
DBUG_PRINT("enter", DBUG_PRINT("enter",
("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s", ("key_file=%s, cert_file=%s, ca_path=%s, ca_file=%s, cipher=%s",
@ -292,6 +325,10 @@ new_VioSSLAcceptorFd(const char *key_file,
/* FIXME: constants! */ /* FIXME: constants! */
ptr->session_id_context= ptr; ptr->session_id_context= ptr;
#ifdef __NETWARE__
netware_ssl_init();
#endif
if (!ssl_algorithms_added) if (!ssl_algorithms_added)
{ {
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()")); DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));