summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-05-25 22:54:00 +0300
committerunknown <monty@mysql.com>2004-05-25 22:54:00 +0300
commita9b481d3cd7fbf832b17523c521185db6366492c (patch)
treeb258dbd41e0b45f70adf8c42ee94cce74cd0232f
parentde5edbf8db66e1f896b76d408152cd0094dcf684 (diff)
parenta3d0ce6bc611673e2d5342bc9cd735a9febfe6b4 (diff)
downloadmariadb-git-a9b481d3cd7fbf832b17523c521185db6366492c.tar.gz
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
-rwxr-xr-xBuild-tools/Do-compile16
-rw-r--r--VC++Files/dbug/dbug.dsp27
-rw-r--r--VC++Files/heap/heap.dsp61
-rw-r--r--VC++Files/isam/isam.dsp54
-rw-r--r--VC++Files/libmysql/libmysql.dsp4
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp14
-rw-r--r--VC++Files/myisam/myisam.dsp50
-rw-r--r--VC++Files/myisammrg/myisammrg.dsp52
-rw-r--r--VC++Files/mysys/mysys.dsp69
-rw-r--r--client/mysql.cc25
-rw-r--r--client/mysqladmin.c4
-rw-r--r--client/mysqlbinlog.cc5
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--client/mysqldump.c8
-rw-r--r--client/mysqlimport.c5
-rw-r--r--client/mysqlshow.c6
-rw-r--r--client/mysqltest.c112
-rw-r--r--configure.in11
-rw-r--r--extra/perror.c21
-rw-r--r--include/config-netware.h36
-rw-r--r--include/help_end.h6
-rw-r--r--include/help_start.h7
-rw-r--r--include/my_global.h6
-rw-r--r--include/mysql_com.h10
-rw-r--r--include/thr_alarm.h2
-rw-r--r--innobase/include/Makefile.am2
-rw-r--r--innobase/include/que0que.h22
-rw-r--r--innobase/include/srv0que.h53
-rw-r--r--innobase/include/trx0roll.h21
-rw-r--r--innobase/include/trx0trx.h31
-rw-r--r--innobase/include/usr0sess.h6
-rw-r--r--innobase/que/que0que.c109
-rw-r--r--innobase/srv/Makefile.am2
-rw-r--r--innobase/srv/srv0que.c111
-rw-r--r--innobase/srv/srv0srv.c1
-rw-r--r--innobase/trx/trx0purge.c3
-rw-r--r--innobase/trx/trx0roll.c77
-rw-r--r--innobase/trx/trx0trx.c165
-rw-r--r--innobase/usr/usr0sess.c2
-rw-r--r--isam/isamchk.c6
-rw-r--r--libmysqld/Makefile.am41
-rw-r--r--myisam/myisam_ftdump.c3
-rw-r--r--myisam/myisamchk.c4
-rw-r--r--myisam/myisampack.c4
-rw-r--r--mysys/default.c3
-rw-r--r--mysys/my_getopt.c4
-rw-r--r--mysys/my_init.c10
-rw-r--r--mysys/my_netware.c2
-rw-r--r--mysys/my_pthread.c22
-rwxr-xr-xnetware/BUILD/compile-netware-all4
-rwxr-xr-xnetware/BUILD/compile-netware-standard1
-rwxr-xr-xnetware/BUILD/mwenv6
-rw-r--r--netware/Makefile.am3
-rw-r--r--netware/init_db.sql2
-rw-r--r--netware/my_manage.c8
-rw-r--r--netware/my_manage.h4
-rw-r--r--netware/myisam_ftdump.def12
-rw-r--r--netware/mysql_install_db.c3
-rw-r--r--netware/mysql_test_run.c59
-rw-r--r--netware/mysql_waitpid.def12
-rw-r--r--netware/resolve_stack_dump.def12
-rw-r--r--scripts/make_binary_distribution.sh77
-rw-r--r--scripts/mysqlhotcopy.sh20
-rw-r--r--sql/mysqld.cc212
-rw-r--r--tools/mysqlmanager.c15
-rw-r--r--vio/test-ssl.c2
-rw-r--r--vio/viossl.c25
-rw-r--r--vio/viosslfactories.c41
68 files changed, 1207 insertions, 630 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 434b8d2f719..03571593f77 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -244,14 +244,14 @@ if ($opt_stage <= 1)
# Only enable InnoDB when requested (required to be able to
# build the "Classic" packages that do not include InnoDB)
- if ($opt_innodb)
- {
- $opt_config_options.= " --with-innodb";
- }
- else
- {
- $opt_config_options.= " --without-innodb";
- }
+ if ($opt_innodb)
+ {
+ $opt_config_options.= " --with-innodb";
+ }
+ else
+ {
+ $opt_config_options.= " --without-innodb";
+ }
if ($opt_with_other_libc)
{
diff --git a/VC++Files/dbug/dbug.dsp b/VC++Files/dbug/dbug.dsp
index 8d0ebf2878b..f2962848939 100644
--- a/VC++Files/dbug/dbug.dsp
+++ b/VC++Files/dbug/dbug.dsp
@@ -19,6 +19,7 @@ CFG=dbug - Win32 Debug
!MESSAGE
!MESSAGE "dbug - Win32 Release" (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
# Begin Project
@@ -76,12 +77,38 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# 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
# Begin Target
# Name "dbug - Win32 Release"
# Name "dbug - Win32 Debug"
+# Name "dbug - Win32 TLS_DEBUG"
# Begin Source File
SOURCE=.\dbug.c
diff --git a/VC++Files/heap/heap.dsp b/VC++Files/heap/heap.dsp
index 447777b17ef..8b72560a8b6 100644
--- a/VC++Files/heap/heap.dsp
+++ b/VC++Files/heap/heap.dsp
@@ -19,6 +19,8 @@ CFG=heap - Win32 Debug
!MESSAGE
!MESSAGE "heap - Win32 Release" (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
# Begin Project
@@ -76,12 +78,64 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# 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
# Begin Target
# Name "heap - Win32 Release"
# Name "heap - Win32 Debug"
+# Name "heap - Win32 TLS_DEBUG"
+# Name "heap - Win32 TLS"
# Begin Source File
SOURCE=.\_check.c
@@ -128,6 +182,13 @@ SOURCE=.\hp_hash.c
# SUBTRACT CPP /YX
+!ELSEIF "$(CFG)" == "heap - Win32 TLS_DEBUG"
+
+# SUBTRACT BASE CPP /YX
+# SUBTRACT CPP /YX
+
+!ELSEIF "$(CFG)" == "heap - Win32 TLS"
+
!ENDIF
# End Source File
diff --git a/VC++Files/isam/isam.dsp b/VC++Files/isam/isam.dsp
index 3e1dcf9dc35..759a1b6ee03 100644
--- a/VC++Files/isam/isam.dsp
+++ b/VC++Files/isam/isam.dsp
@@ -19,6 +19,8 @@ CFG=isam - Win32 Debug
!MESSAGE
!MESSAGE "isam - Win32 Release" (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
# Begin Project
@@ -76,12 +78,64 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# 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
# Begin Target
# Name "isam - Win32 Release"
# Name "isam - Win32 Debug"
+# Name "isam - Win32 TLS_DEBUG"
+# Name "isam - Win32 TLS"
# Begin Source File
SOURCE=.\_cache.c
diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp
index 4721fd7de08..c315775443b 100644
--- a/VC++Files/libmysql/libmysql.dsp
+++ b/VC++Files/libmysql/libmysql.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /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
# ADD BASE 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 Target_Dir ""
# 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
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
index d519755eb2e..8d4dac20b6c 100644
--- a/VC++Files/libmysqld/libmysqld.dsp
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -56,7 +56,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
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 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"
@@ -83,7 +84,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
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 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"
@@ -110,9 +112,9 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
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
-# 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
!ELSEIF "$(CFG)" == "libmysqld - Win32 pro"
@@ -140,9 +142,9 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
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
-# 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
!ENDIF
diff --git a/VC++Files/myisam/myisam.dsp b/VC++Files/myisam/myisam.dsp
index 14d0fa416bc..77a5315c549 100644
--- a/VC++Files/myisam/myisam.dsp
+++ b/VC++Files/myisam/myisam.dsp
@@ -19,6 +19,8 @@ CFG=myisam - Win32 Debug
!MESSAGE
!MESSAGE "myisam - Win32 Release" (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
# Begin Project
@@ -74,12 +76,60 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# 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
# Begin Target
# Name "myisam - Win32 Release"
# Name "myisam - Win32 Debug"
+# Name "myisam - Win32 TLS_DEBUG"
+# Name "myisam - Win32 TLS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/myisammrg/myisammrg.dsp b/VC++Files/myisammrg/myisammrg.dsp
index 909f24f81e9..419d36517c9 100644
--- a/VC++Files/myisammrg/myisammrg.dsp
+++ b/VC++Files/myisammrg/myisammrg.dsp
@@ -19,6 +19,8 @@ CFG=myisammrg - Win32 Debug
!MESSAGE
!MESSAGE "myisammrg - Win32 Release" (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
# Begin Project
@@ -75,12 +77,62 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# 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
# Begin Target
# Name "myisammrg - Win32 Release"
# Name "myisammrg - Win32 Debug"
+# Name "myisammrg - Win32 TLS_DEBUG"
+# Name "myisammrg - Win32 TLS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp
index 4e167a3973f..f42357c2249 100644
--- a/VC++Files/mysys/mysys.dsp
+++ b/VC++Files/mysys/mysys.dsp
@@ -20,6 +20,8 @@ CFG=mysys - Win32 Debug
!MESSAGE "mysys - Win32 Release" (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 TLS_DEBUG" (based on "Win32 (x86) Static Library")
+!MESSAGE "mysys - Win32 TLS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -102,6 +104,56 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.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
# Begin Target
@@ -109,6 +161,8 @@ LIB32=xilink6.exe -lib
# Name "mysys - Win32 Release"
# Name "mysys - Win32 Debug"
# Name "mysys - Win32 Max"
+# Name "mysys - Win32 TLS_DEBUG"
+# Name "mysys - Win32 TLS"
# Begin Source File
SOURCE=.\array.c
@@ -121,6 +175,14 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS_DEBUG"
+
+# ADD BASE CPP /FR
+# ADD CPP /FR
+
+!ELSEIF "$(CFG)" == "mysys - Win32 TLS"
+
!ENDIF
# End Source File
@@ -528,6 +590,13 @@ SOURCE=.\thr_lock.c
!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
# End Source File
diff --git a/client/mysql.cc b/client/mysql.cc
index d3885645124..01d867cca07 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -669,6 +669,10 @@ static struct my_option my_long_options[] =
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",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
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);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
+ NETWARE_SET_SCREEN_MODE(1);
+#ifdef __NETWARE__
+#undef printf
+#endif
}
+
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
@@ -916,6 +925,7 @@ static int read_lines(bool execute_commands)
#ifdef __NETWARE__
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
/* Remove the '\n' */
+ if (line)
{
char *p = strrchr(line, '\n');
if (p != NULL)
@@ -931,7 +941,11 @@ static int read_lines(bool execute_commands)
line= readline(prompt);
#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);
}
if (!line) // End of file
@@ -2384,10 +2398,8 @@ static int
com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
-#ifdef __NETWARE__
- // let the screen auto close on a normal shutdown
- setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
-#endif
+ /* let the screen auto close on a normal shutdown */
+ NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT);
status.exit_status=0;
return 1;
}
@@ -2993,6 +3005,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{
va_list args;
+ NETWARE_YIELD;
va_start(args, fmt);
(void) vfprintf(file, fmt, args);
#ifdef OS2
@@ -3006,6 +3019,7 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file)
{
+ NETWARE_YIELD;
fputs(s, file);
#ifdef OS2
fflush( file);
@@ -3017,6 +3031,7 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file)
{
+ NETWARE_YIELD;
fputs(s, file);
fputs("\n", file);
#ifdef OS2
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index a2cce3782d6..e6e90fc628c 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -874,11 +874,13 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 0;
}
+#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION,
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");
}
+#include <help_end.h>
+
static int drop_db(MYSQL *mysql, const char *db)
{
char name_buff[FN_REFLEN+20], buf[10];
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index f8993004467..221015f8c7d 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -490,9 +490,12 @@ static void die(const char* fmt, ...)
exit(1);
}
+#include <help_start.h>
+
static void print_version()
{
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);
}
+#include <help_end.h>
+
extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index aa4c1282cc1..78e82e670f8 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -172,10 +172,13 @@ static void print_result();
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
} /* print_version */
@@ -206,6 +209,7 @@ static void usage(void)
my_print_variables(my_long_options);
} /* usage */
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 97ae0070e04..0366e0da87f 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -332,11 +332,13 @@ static int dump_all_databases();
static char *quote_name(const char *name, char *buff, my_bool force);
static const char *check_if_ignore_table(const char *table_name);
+#include <help_start.h>
static void print_version(void)
{
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 */
@@ -346,8 +348,10 @@ static void short_usage_sub(void)
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
my_progname);
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -367,6 +371,8 @@ static void short_usage(void)
printf("For more options, use %s --help\n", my_progname);
}
+#include <help_end.h>
+
static void write_header(FILE *sql_file, char *db_name)
{
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index d47ae48b1ac..ccf7fd9880d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -147,14 +147,16 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqlimport","client",0 };
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname,
IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
-
static void usage(void)
{
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);
}
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 9dc5c0a30f4..d9e2a1fa92a 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -209,12 +209,16 @@ static struct my_option my_long_options[] =
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -234,6 +238,8 @@ are shown");
my_print_variables(my_long_options);
}
+#include <help_end.h>
+
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 303473ef558..be2270850fa 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -180,6 +180,17 @@ typedef struct
int alloced;
} 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];
/*Perl/shell-like variable registers */
HASH var_hash;
@@ -906,7 +917,7 @@ int do_exec(struct st_query* q)
while (fgets(buf, sizeof(buf), res_file))
replace_dynstr_append_mem(ds, buf, strlen(buf));
-
+
if (glob_replace)
free_replace();
@@ -929,6 +940,7 @@ int do_exec(struct st_query* q)
DBUG_RETURN(error);
}
+
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));
@@ -3674,3 +3686,101 @@ static void get_replace_column(struct st_query *q)
}
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__ */
diff --git a/configure.in b/configure.in
index 7d7c477e0f2..2017a6172fc 100644
--- a/configure.in
+++ b/configure.in
@@ -126,8 +126,10 @@ fi
# The following hack should ensure that configure doesn't add optimizing
# or debugging flags to CFLAGS or CXXFLAGS
-CFLAGS="$CFLAGS "
-CXXFLAGS="$CXXFLAGS "
+# C_EXTRA_FLAGS are flags that are automaticly added to both
+# CFLAGS and CXXFLAGS
+CFLAGS="$CFLAGS $C_EXTRA_FLAGS "
+CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS "
dnl Checks for programs.
AC_PROG_AWK
@@ -1120,8 +1122,8 @@ dnl Is this the right match for DEC OSF on alpha?
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(bdb_libs_with_path) \$(innodb_libs) \$(pstack_libs) \$(innodb_system_libs) \$(openssl_libs)"
cat > $filesed << EOF
-s,\(^.*\$(MAKE) gen_lex_hash\),#\1,
-s,\(\./gen_lex_hash\),\1.linux,
+s,\(^.*\$(MAKE) gen_lex_hash\)\$(EXEEXT),#\1,
+s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \) %\1$lib_DEPENDENCIES %
EOF
;;
@@ -2845,6 +2847,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl
include/Makefile sql-bench/Makefile tools/Makefile dnl
tests/Makefile Docs/Makefile support-files/Makefile dnl
support-files/MacOSX/Makefile mysql-test/Makefile dnl
+ netware/Makefile dnl
include/mysql_version.h dnl
cmd-line-utils/Makefile dnl
cmd-line-utils/libedit/Makefile dnl
diff --git a/extra/perror.c b/extra/perror.c
index 1d3d7c70fac..a31889cc26d 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -16,7 +16,7 @@
/* 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_sys.h>
@@ -207,8 +207,16 @@ int main(int argc,char *argv[])
else
#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++)
{
+
found=0;
code=atoi(*argv);
#ifdef HAVE_NDBCLUSTER_DB
@@ -222,7 +230,14 @@ int main(int argc,char *argv[])
else
#endif
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;
if (verbose)
@@ -241,7 +256,7 @@ int main(int argc,char *argv[])
else
{
if (verbose)
- printf("%3d = %s\n",code,msg);
+ printf("MySql error: %3d = %s\n",code,msg);
else
puts(msg);
}
diff --git a/include/config-netware.h b/include/config-netware.h
index dab365a7127..c4e63056353 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -14,7 +14,10 @@
along with this program; if not, write to the Free Software
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 */
#include <unistd.h>
@@ -32,18 +35,28 @@
#include <pthread.h>
#include <termios.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* required adjustments */
#undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT
#undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H
-#undef HAVE_CRYPT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 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 */
#define USE_OLD_FUNCTIONS 1
@@ -59,6 +72,9 @@
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
+/* On NetWare, stack grows towards lower address*/
+#define STACK_DIRECTION -1
+
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
@@ -80,6 +96,20 @@
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
+/* Kernel call on NetWare that will only yield if our time slice is up */
+void kYieldIfTimeSliceUp(void);
+
/* 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 */
diff --git a/include/help_end.h b/include/help_end.h
new file mode 100644
index 00000000000..a63d9e7ca9f
--- /dev/null
+++ b/include/help_end.h
@@ -0,0 +1,6 @@
+#ifdef __NETWARE__
+#undef printf
+#undef puts
+#undef fputs
+#undef putchar
+#endif
diff --git a/include/help_start.h b/include/help_start.h
new file mode 100644
index 00000000000..38bb91f7655
--- /dev/null
+++ b/include/help_start.h
@@ -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
diff --git a/include/my_global.h b/include/my_global.h
index fafe0425c55..88756742552 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -73,6 +73,12 @@
#endif
#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
Linux kernel. Use them to indicate the likelyhood of the truthfulness
diff --git a/include/mysql_com.h b/include/mysql_com.h
index a1da896af38..801937a9e7b 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -36,6 +36,12 @@
#define MYSQL_SERVICENAME "MySQL"
#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
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@@ -306,8 +312,8 @@ typedef struct st_udf_init
extern "C" {
#endif
-extern unsigned long max_allowed_packet;
-extern unsigned long net_buffer_length;
+dll_import_spec extern unsigned long max_allowed_packet;
+dll_import_spec extern unsigned long net_buffer_length;
/*
These functions are used for authentication by client and server and
diff --git a/include/thr_alarm.h b/include/thr_alarm.h
index 0dbb700b4fc..7a10d6886ce 100644
--- a/include/thr_alarm.h
+++ b/include/thr_alarm.h
@@ -64,7 +64,7 @@ typedef my_bool ALARM;
#define init_thr_alarm(A)
#define thr_alarm_kill(A)
#define resize_thr_alarm(N)
-#define end_thr_alarm()
+#define end_thr_alarm(A)
#else
#if defined(__WIN__)
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am
index 102d25566da..5ec70da97a2 100644
--- a/innobase/include/Makefile.am
+++ b/innobase/include/Makefile.am
@@ -43,7 +43,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
row0purge.ic row0row.h row0row.ic row0sel.h row0sel.ic \
row0types.h row0uins.h row0uins.ic row0umod.h row0umod.ic \
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 \
sync0rw.ic sync0sync.h sync0sync.ic sync0types.h \
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \
diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h
index bcd7aed7e88..a438116781f 100644
--- a/innobase/include/que0que.h
+++ b/innobase/include/que0que.h
@@ -152,17 +152,6 @@ que_run_threads(
/*============*/
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,
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
completion. */
-void
+que_thr_t*
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,
or QUE_THR_PROCEDURE_WAIT, or
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. */
diff --git a/innobase/include/srv0que.h b/innobase/include/srv0que.h
deleted file mode 100644
index 05c339cdd32..00000000000
--- a/innobase/include/srv0que.h
+++ /dev/null
@@ -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
-
diff --git a/innobase/include/trx0roll.h b/innobase/include/trx0roll.h
index 6004551f456..aa88fc249fc 100644
--- a/innobase/include/trx0roll.h
+++ b/innobase/include/trx0roll.h
@@ -91,16 +91,12 @@ trx_undo_rec_release(
/*************************************************************************
Starts a rollback operation. */
-void
+que_thr_t*
trx_rollback(
/*=========*/
+ /* out: next query thread to run */
trx_t* trx, /* in: transaction */
- 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 */
+ trx_sig_t* sig); /* in: signal starting the rollback */
/***********************************************************************
Rollback or clean up transactions which have no user session. If the
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. */
-void
+que_thr_t*
trx_finish_rollback_off_kernel(
/*===========================*/
+ /* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */
- 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_t* trx); /* in: transaction */
/********************************************************************
Builds an undo 'query' graph for a transaction. The actual rollback is
performed by executing this query graph like a query subprocedure call.
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index a8c1df534da..9b7ac22e617 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -194,9 +194,10 @@ trx_end_lock_wait(
/********************************************************************
Sends a signal to a trx object. */
-ibool
+que_thr_t*
trx_sig_send(
/*=========*/
+ /* out: next query thread to run */
/* out: TRUE if the signal was
successfully delivered */
trx_t* trx, /* in: trx handle */
@@ -206,27 +207,17 @@ trx_sig_send(
que_thr_t* receiver_thr, /* in: query thread which wants the
reply, or NULL; if type is
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 */
- 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
been handled. */
-void
+que_thr_t*
trx_sig_reply(
/*==========*/
- trx_sig_t* sig, /* in: signal */
- 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 */
+ /* out: next query thread to run */
+ trx_sig_t* sig); /* in: signal */
/********************************************************************
Removes the signal object from a trx signal queue. */
@@ -238,15 +229,11 @@ trx_sig_remove(
/********************************************************************
Starts handling of a trx signal. */
-void
+que_thr_t*
trx_sig_start_handle(
/*=================*/
- trx_t* trx, /* in: trx handle */
- 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 */
+ /* out: next query thread to run, or NULL */
+ trx_t* trx); /* in: trx handle */
/********************************************************************
Ends signal handling. If the session is in the error state, and
trx->graph_before_signal_handling != NULL, returns control to the error
diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h
index c7bcfb20fed..aeff7191e68 100644
--- a/innobase/include/usr0sess.h
+++ b/innobase/include/usr0sess.h
@@ -38,7 +38,6 @@ sess_try_close(
/* The session handle. All fields are protected by the kernel mutex */
struct sess_struct{
- ulint state; /* state of the session */
trx_t* trx; /* transaction object permanently
assigned for the session: the
transaction instance designated by the
@@ -49,11 +48,6 @@ struct sess_struct{
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
#include "usr0sess.ic"
#endif
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c
index b2608b6d175..08bf7ce3e59 100644
--- a/innobase/que/que0que.c
+++ b/innobase/que/que0que.c
@@ -12,7 +12,6 @@ Created 5/27/1996 Heikki Tuuri
#include "que0que.ic"
#endif
-#include "srv0que.h"
#include "usr0sess.h"
#include "trx0trx.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
completion. */
-void
+que_thr_t*
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,
or QUE_THR_PROCEDURE_WAIT, or
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;
@@ -195,6 +190,8 @@ que_thr_end_wait(
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(thr);
+ ut_ad(next_thr);
+ ut_ad(*next_thr == NULL);
ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT)
|| (thr->state == QUE_THR_SIG_REPLY_WAIT));
@@ -206,17 +203,8 @@ que_thr_end_wait(
que_thr_move_to_run_state(thr);
- if (was_active) {
-
- return;
- }
-
- if (next_thr && *next_thr == NULL) {
- *next_thr = thr;
- } else {
- srv_que_task_enqueue_low(thr);
- }
-}
+ return(was_active ? NULL : thr);
+}
/**************************************************************************
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: */
srv_release_mysql_thread_if_suspended(thr);
-
- /* srv_que_task_enqueue_low(thr); */
}
/**************************************************************************
@@ -355,48 +341,6 @@ que_fork_start_command(
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. */
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
easier to maintain. */
static
-void
+que_thr_t*
que_thr_dec_refer_count(
/*====================*/
- que_thr_t* thr, /* in: query thread */
- 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 */
+ /* out: next query thread to run */
+ que_thr_t* thr) /* in: query thread */
{
que_fork_t* fork;
trx_t* trx;
sess_t* sess;
ulint fork_type;
- ibool stopped;
-
+ que_thr_t* next_thr = NULL;
+
fork = thr->common.parent;
trx = thr->graph->trx;
sess = trx->sess;
@@ -791,9 +731,7 @@ que_thr_dec_refer_count(
if (thr->state == QUE_THR_RUNNING) {
- stopped = que_thr_stop(thr);
-
- if (!stopped) {
+ if (!que_thr_stop(thr)) {
/* The reason for the thr suspension or wait was
already canceled before we came here: continue
running the thread */
@@ -801,15 +739,9 @@ que_thr_dec_refer_count(
/* fputs("!!!!!!!! Wait already ended: continue thr\n",
stderr); */
- if (next_thr && *next_thr == NULL) {
- *next_thr = thr;
- } else {
- srv_que_task_enqueue_low(thr);
- }
-
mutex_exit(&kernel_mutex);
- return;
+ return(thr);
}
}
@@ -825,7 +757,7 @@ que_thr_dec_refer_count(
mutex_exit(&kernel_mutex);
- return;
+ return(next_thr);
}
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(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) {
@@ -863,7 +795,7 @@ que_thr_dec_refer_count(
zero, then we start processing a signal; from it we may get
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) {
@@ -872,6 +804,8 @@ que_thr_dec_refer_count(
}
mutex_exit(&kernel_mutex);
+
+ return(next_thr);
}
/**************************************************************************
@@ -1245,6 +1179,7 @@ loop:
/*-------------------------*/
next_thr = que_thr_step(thr);
/*-------------------------*/
+ ut_a(next_thr == thr || next_thr == NULL);
/* Test the effect on performance of adding extra mutex
reservations */
@@ -1257,7 +1192,7 @@ loop:
loop_count++;
if (next_thr != thr) {
- que_thr_dec_refer_count(thr, &next_thr);
+ next_thr = que_thr_dec_refer_count(thr);
if (next_thr == NULL) {
diff --git a/innobase/srv/Makefile.am b/innobase/srv/Makefile.am
index 752683b82b8..37fd73a4bf0 100644
--- a/innobase/srv/Makefile.am
+++ b/innobase/srv/Makefile.am
@@ -19,6 +19,6 @@ include ../include/Makefile.i
noinst_LIBRARIES = libsrv.a
-libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c
+libsrv_a_SOURCES = srv0srv.c srv0start.c
EXTRA_PROGRAMS =
diff --git a/innobase/srv/srv0que.c b/innobase/srv/srv0que.c
deleted file mode 100644
index ac8bd7d0e65..00000000000
--- a/innobase/srv/srv0que.c
+++ /dev/null
@@ -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);
-}
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index c21dfda6265..33adcaa14b8 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -34,7 +34,6 @@ Created 10/8/1995 Heikki Tuuri
#include "sync0sync.h"
#include "thr0loc.h"
#include "que0que.h"
-#include "srv0que.h"
#include "log0recv.h"
#include "pars0pars.h"
#include "usr0sess.h"
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 3d5f0d3f03a..002775eaac1 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -23,7 +23,6 @@ Created 3/26/1996 Heikki Tuuri
#include "row0purge.h"
#include "row0upd.h"
#include "trx0rec.h"
-#include "srv0que.h"
#include "os0thread.h"
/* The global data structure coordinating a purge */
@@ -1060,8 +1059,6 @@ trx_purge(void)
mutex_exit(&kernel_mutex);
-/* srv_que_task_enqueue(thr2); */
-
if (srv_print_thread_releases) {
fputs("Starting purge\n", stderr);
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index e2e4f24b82e..4343249764e 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -20,7 +20,6 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rec.h"
#include "que0que.h"
#include "usr0sess.h"
-#include "srv0que.h"
#include "srv0start.h"
#include "row0undo.h"
#include "row0mysql.h"
@@ -932,21 +931,15 @@ trx_undo_rec_release(
/*************************************************************************
Starts a rollback operation. */
-void
+que_thr_t*
trx_rollback(
/*=========*/
+ /* out: next query thread to run */
trx_t* trx, /* in: transaction */
- 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 */
+ trx_sig_t* sig) /* in: signal starting the rollback */
{
que_t* roll_graph;
que_thr_t* thr;
-/* que_thr_t* thr2; */
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -988,18 +981,7 @@ trx_rollback(
thr = que_fork_start_command(roll_graph);
ut_ad(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); */
- }
+ return(thr);
}
/********************************************************************
@@ -1071,17 +1053,14 @@ trx_finish_error_processing(
/*************************************************************************
Finishes a partial rollback operation. */
static
-void
+que_thr_t*
trx_finish_partial_rollback_off_kernel(
/*===================================*/
- 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 */
+ /* out: next query thread to run */
+ trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
+ que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG
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
to it */
- trx_sig_reply(sig, next_thr);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
trx->que_state = TRX_QUE_RUNNING;
+ return(next_thr);
}
/********************************************************************
Finishes a transaction rollback. */
-void
+que_thr_t*
trx_finish_rollback_off_kernel(
/*===========================*/
+ /* out: next query thread to run */
que_t* graph, /* in: undo graph which can now be freed */
- 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_t* trx) /* in: transaction */
{
trx_sig_t* sig;
trx_sig_t* next_sig;
+ que_thr_t* next_thr;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -1129,15 +1105,13 @@ trx_finish_rollback_off_kernel(
if (sig->type == TRX_SIG_ROLLBACK_TO_SAVEPT) {
- trx_finish_partial_rollback_off_kernel(trx, next_thr);
-
- return;
+ return(trx_finish_partial_rollback_off_kernel(trx));
} else if (sig->type == TRX_SIG_ERROR_OCCURRED) {
trx_finish_error_processing(trx);
- return;
+ return(NULL);
}
#ifdef UNIV_DEBUG
@@ -1153,19 +1127,23 @@ trx_finish_rollback_off_kernel(
send reply messages to them */
trx->que_state = TRX_QUE_RUNNING;
-
+
+ next_thr = NULL;
while (sig != NULL) {
next_sig = UT_LIST_GET_NEXT(signals, sig);
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);
}
sig = next_sig;
}
+
+ return(next_thr);
}
/*************************************************************************
@@ -1198,7 +1176,6 @@ trx_rollback_step(
que_thr_t* thr) /* in: query thread */
{
roll_node_t* node;
- ibool success;
ulint sig_no;
trx_savept_t* savept;
@@ -1225,19 +1202,13 @@ trx_rollback_step(
/* Send a rollback signal to the transaction */
- success = trx_sig_send(thr_get_trx(thr),
- sig_no, TRX_SIG_SELF,
- thr, savept, NULL);
+ trx_sig_send(thr_get_trx(thr), sig_no, TRX_SIG_SELF,
+ thr, savept);
thr->state = QUE_THR_SIG_REPLY_WAIT;
mutex_exit(&kernel_mutex);
- if (!success) {
- /* Error in delivering the rollback signal */
- que_thr_handle_error(thr, DB_ERROR, NULL, 0);
- }
-
return(NULL);
}
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 8128c8de13e..862229ef032 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -897,18 +897,15 @@ trx_assign_read_view(
/********************************************************************
Commits a transaction. NOTE that the kernel mutex is temporarily released. */
static
-void
+que_thr_t*
trx_handle_commit_sig_off_kernel(
/*=============================*/
- 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 */
+ /* out: next query thread to run */
+ trx_t* trx) /* in: transaction */
{
trx_sig_t* sig;
trx_sig_t* next_sig;
+ que_thr_t* next_thr = NULL;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
@@ -930,7 +927,8 @@ trx_handle_commit_sig_off_kernel(
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);
}
@@ -938,6 +936,8 @@ trx_handle_commit_sig_off_kernel(
}
trx->que_state = TRX_QUE_RUNNING;
+
+ return(next_thr);
}
/***************************************************************
@@ -999,39 +999,6 @@ trx_lock_wait_to_suspended(
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
queue. */
@@ -1111,11 +1078,10 @@ trx_sig_is_compatible(
/********************************************************************
Sends a signal to a trx object. */
-ibool
+que_thr_t*
trx_sig_send(
/*=========*/
- /* out: TRUE if the signal was
- successfully delivered */
+ /* out: next query thread to run */
trx_t* trx, /* in: trx handle */
ulint type, /* in: signal type */
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
reply, or NULL; if type is
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 */
- 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_t* receiver_trx;
@@ -1140,14 +1100,7 @@ trx_sig_send(
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
- if (!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);
- }
+ ut_a(trx_sig_is_compatible(trx, type, sender));
/* Queue the signal object */
@@ -1181,11 +1134,6 @@ trx_sig_send(
sig);
}
- if (trx->sess->state == SESS_ERROR) {
-
- trx_sig_reply_wait_to_suspended(trx);
- }
-
if ((sender != TRX_SIG_SELF) || (type == TRX_SIG_BREAK_EXECUTION)) {
/* 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) {
- 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->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. */
-void
+que_thr_t*
trx_sig_start_handle(
/*=================*/
- trx_t* trx, /* in: trx handle */
- 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 */
+ /* out: next query thread to run, or NULL */
+ trx_t* trx) /* in: trx handle */
{
+ que_thr_t* next_thr = NULL;
trx_sig_t* sig;
ulint type;
loop:
@@ -1261,7 +1200,7 @@ loop:
trx_end_signal_handling(trx);
- return;
+ return(next_thr);
}
if (trx->conc_state == TRX_NOT_STARTED) {
@@ -1277,23 +1216,13 @@ loop:
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
signal, otherwise we have to wait until all query threads of this
transaction are aware of the arrival of the signal. */
if (trx->n_active_thrs > 0) {
- return;
+ return(NULL);
}
if (trx->handling_signals == FALSE) {
@@ -1307,30 +1236,19 @@ loop:
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)
- || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)) {
-
- 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_ERROR_OCCURRED) {
-
- trx_rollback(trx, sig, next_thr);
-
+ || (type == TRX_SIG_ROLLBACK_TO_SAVEPT)
+ || (type == TRX_SIG_ERROR_OCCURRED)) {
/* No further signals can be handled until the rollback
completes, therefore we return */
- return;
+ return(trx_rollback(trx, sig));
} else if (type == TRX_SIG_BREAK_EXECUTION) {
- trx_sig_reply(sig, next_thr);
+ next_thr = trx_sig_reply(sig);
trx_sig_remove(trx, sig);
} else {
ut_error;
@@ -1343,17 +1261,14 @@ loop:
Send the reply message when a signal in the queue of the trx has been
handled. */
-void
+que_thr_t*
trx_sig_reply(
/*==========*/
- trx_sig_t* sig, /* in: signal */
- 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 */
+ /* out: next query thread to run */
+ trx_sig_t* sig) /* in: signal */
{
- trx_t* receiver_trx;
+ trx_t* receiver_trx;
+ que_thr_t* next_thr = NULL;
ut_ad(sig);
#ifdef UNIV_SYNC_DEBUG
@@ -1367,13 +1282,13 @@ trx_sig_reply(
UT_LIST_REMOVE(reply_signals, receiver_trx->reply_signals,
sig);
- ut_ad(receiver_trx->sess->state != SESS_ERROR);
-
- que_thr_end_wait(sig->receiver, next_thr);
+ next_thr = que_thr_end_wait(sig->receiver);
sig->receiver = NULL;
}
+
+ return(next_thr);
}
/********************************************************************
@@ -1429,7 +1344,6 @@ trx_commit_step(
{
commit_node_t* node;
que_thr_t* next_thr;
- ibool success;
node = thr->run_node;
@@ -1444,21 +1358,14 @@ trx_commit_step(
node->state = COMMIT_NODE_WAIT;
- next_thr = NULL;
-
thr->state = QUE_THR_SIG_REPLY_WAIT;
/* Send the commit signal to the transaction */
- success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
- TRX_SIG_SELF, thr, NULL, &next_thr);
-
- mutex_exit(&kernel_mutex);
+ next_thr = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
+ TRX_SIG_SELF, thr, NULL);
- if (!success) {
- /* Error in delivering the commit signal */
- que_thr_handle_error(thr, DB_ERROR, NULL, 0);
- }
+ mutex_exit(&kernel_mutex);
return(next_thr);
}
diff --git a/innobase/usr/usr0sess.c b/innobase/usr/usr0sess.c
index 359c1552421..cc016f2b823 100644
--- a/innobase/usr/usr0sess.c
+++ b/innobase/usr/usr0sess.c
@@ -37,8 +37,6 @@ sess_open(void)
#endif /* UNIV_SYNC_DEBUG */
sess = mem_alloc(sizeof(sess_t));
- sess->state = SESS_ACTIVE;
-
sess->trx = trx_create(sess);
UT_LIST_INIT(sess->graphs);
diff --git a/isam/isamchk.c b/isam/isamchk.c
index 8fa6b7ad4c0..513c1ea3a5d 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -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}
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver 6.01 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
+
static void usage(void)
{
print_version();
@@ -352,6 +356,8 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
+
/* Check table */
static int nisamchk(my_string filename)
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index 25a2d9c1a06..e258b10c6e6 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -77,25 +77,32 @@ INC_LIB= $(top_builddir)/regex/libregex.a \
$(top_builddir)/vio/libvio.a
#
-# To make it easy for the end user to use the embedded library we
-# generate a total libmysqld.a from all library files,
+# To make it easy for the end user to use the embedded library we
+# generate a total libmysqld.a from all library files,
libmysqld.a: libmysqld_int.a $(INC_LIB)
- if test ! -d tmp ; then mkdir tmp ; fi
- rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a
- cp $(INC_LIB) tmp
- cp libmysqld_int.a libmysqld_int2.a ; \
- cd tmp ; \
- for file in *.a ; do \
- bfile=`basename $$file .a` ; \
- $(AR) x $$file; \
- for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
- $(AR) q ../libmysqld_int2.a *.o ; \
- rm -f *.o ; \
- done
- mv libmysqld_int2.a libmysqld.a
- rm -f tmp/*
- $(RANLIB) libmysqld.a
+ if test "$(host_os)" = "netware" ; \
+ then \
+ $(libmysqld_a_AR) libmysqld.a libmysqld_int.a $(INC_LIB) ; \
+ else \
+ if test ! -d tmp ; then mkdir tmp ; fi ; \
+ rm -f $@ libmysqld_int2.a tmp/*.o tmp/*.a ; \
+ cp $(INC_LIB) tmp ; \
+ cp libmysqld_int.a libmysqld_int2.a ; \
+ cd tmp ; \
+ for file in *.a ; do \
+ bfile=`basename $$file .a` ; \
+ $(AR) x $$file; \
+ for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
+ $(AR) q ../libmysqld_int2.a *.o ; \
+ 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
## the version info for libmysqld; however, it's possible for the
diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c
index 075a0fd19e8..eeee96d0ff2 100644
--- a/myisam/myisam_ftdump.c
+++ b/myisam/myisam_ftdump.c
@@ -264,15 +264,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
return 0;
}
+#include <help_start.h>
static void usage()
{
printf("Use: myisam_ftdump <table_name> <index_num>\n");
my_print_help(my_long_options);
my_print_variables(my_long_options);
+ NETWARE_SET_SCREEN_MODE(1);
exit(1);
}
+#include <help_end.h>
static void complain(int val) /* Kinda assert :-) */
{
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 135797b8ff0..ae26b90d0a2 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -336,10 +336,13 @@ static struct my_option my_long_options[] =
};
+#include <help_start.h>
+
static void print_version(void)
{
printf("%s Ver 2.7 for %s at %s\n", my_progname, SYSTEM_TYPE,
MACHINE_TYPE);
+ NETWARE_SET_SCREEN_MODE(1);
}
@@ -452,6 +455,7 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
/* Read options */
diff --git a/myisam/myisampack.c b/myisam/myisampack.c
index b6d862e38b5..de4bd80805a 100644
--- a/myisam/myisampack.c
+++ b/myisam/myisampack.c
@@ -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}
};
+#include <help_start.h>
static void print_version(void)
{
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)
{
print_version();
@@ -290,6 +293,7 @@ static void usage(void)
my_print_variables(my_long_options);
}
+#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
diff --git a/mysys/default.c b/mysys/default.c
index af67520322f..056f686e16f 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -479,6 +479,7 @@ static char *remove_end_comment(char *ptr)
return ptr;
}
+#include <help_start.h>
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-extra-file=# Read this file after the global files are read");
}
+
+#include <help_end.h>
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index efd5789968c..8d0b05d55f7 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -790,6 +790,8 @@ static void init_variables(const struct my_option *options)
Print help for all options and variables.
*/
+#include <help_start.h>
+
void my_print_help(const struct my_option *options)
{
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>
diff --git a/mysys/my_init.c b/mysys/my_init.c
index fc178b0308b..da0e6caf96d 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -353,14 +353,16 @@ static my_bool win32_init_tcp_ip()
#ifdef __NETWARE__
-/****************************************************************************
- Do basic initialisation for netware needed by most programs
-****************************************************************************/
+/*
+ Basic initialisation for netware
+*/
static void netware_init()
{
char cwd[PATH_MAX], *name;
+ DBUG_ENTER("netware_init");
+
/* init only if we are not a client library */
if (my_progname)
{
@@ -398,5 +400,7 @@ static void netware_init()
}
}
}
+
+ DBUG_VOID_RETURN;
}
#endif /* __NETWARE__ */
diff --git a/mysys/my_netware.c b/mysys/my_netware.c
index e41dbd0a029..9c604778c2d 100644
--- a/mysys/my_netware.c
+++ b/mysys/my_netware.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
- Function specific to netware
+ Functions specific to netware
*/
#include <mysys_priv.h>
diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c
index f10a2210064..2667c0670d8 100644
--- a/mysys/my_pthread.c
+++ b/mysys/my_pthread.c
@@ -102,16 +102,20 @@ void my_pthread_exit(void *status)
NXContext_t ctx;
char name[PATH_MAX] = "";
- 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"))
+ /* Do not call pthread_exit if it is not a LibC thread */
+ if (tid != 0)
{
- 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
diff --git a/netware/BUILD/compile-netware-all b/netware/BUILD/compile-netware-all
index 6baff699e94..dbe64e8f97e 100755
--- a/netware/BUILD/compile-netware-all
+++ b/netware/BUILD/compile-netware-all
@@ -11,5 +11,5 @@ path=`dirname $0`
$path/compile-netware-src
$path/compile-netware-standard
$path/compile-netware-debug
-#$path/compile-netware-max
-#$path/compile-netware-max-debug
+$path/compile-netware-max
+$path/compile-netware-max-debug
diff --git a/netware/BUILD/compile-netware-standard b/netware/BUILD/compile-netware-standard
index 45f5021862c..a21ea16a445 100755
--- a/netware/BUILD/compile-netware-standard
+++ b/netware/BUILD/compile-netware-standard
@@ -14,6 +14,7 @@ suffix="standard"
extra_configs=" \
--with-innodb \
+ --enable-thread-safe-client \
"
. $path/compile-netware-END
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index e4e6d509100..6f818b6f7a3 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -6,9 +6,9 @@
# the default is "F:/mydev"
export MYDEV="WINE_BUILD_DIR"
-export MWCNWx86Includes="$MYDEV/libc/include;$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 MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;knetware.imp"
+export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV;$MYDEV/zlib-1.1.4"
+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;neb.imp;zPublics.imp;knetware.imp"
export WINEPATH="$MYDEV/mw/bin"
diff --git a/netware/Makefile.am b/netware/Makefile.am
index 881dafe883e..1f0277ef20e 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -33,7 +33,8 @@ netware_build_files = client/mysql.def client/mysqladmin.def \
isam/isamlog.def isam/pack_isam.def \
libmysqld/libmysqld.def myisam/myisamchk.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:
set -x; \
diff --git a/netware/init_db.sql b/netware/init_db.sql
index 063c1815eb1..52e08333a93 100644
--- a/netware/init_db.sql
+++ b/netware/init_db.sql
@@ -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 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';
diff --git a/netware/my_manage.c b/netware/my_manage.c
index 1c1e75990b4..f5aa3163431 100644
--- a/netware/my_manage.c
+++ b/netware/my_manage.c
@@ -180,7 +180,7 @@ int sleep_until_file_exists(char *pid_file)
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;
int err, i;
@@ -189,7 +189,7 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
// mysqladmin file
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
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,
- char *pid_file)
+ char *pid_file,char *tmp_dir)
{
arg_list_t al;
int err, i, argc = 0;
@@ -292,7 +292,7 @@ int stop_server(char *bin_dir, char *user, char *password, int port,
// mysqladmin file
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
init_args(&al);
diff --git a/netware/my_manage.h b/netware/my_manage.h
index b19662c4ee9..ada02378ee4 100644
--- a/netware/my_manage.h
+++ b/netware/my_manage.h
@@ -71,11 +71,11 @@ void free_args(arg_list_t *);
int sleep_until_file_exists(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 stop_server(char *, char *, char *, int, char *);
+int stop_server(char *, char *, char *, int, char *,char *);
pid_t get_server_pid(char *);
void kill_server(pid_t pid);
diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def
new file mode 100644
index 00000000000..259d6617445
--- /dev/null
+++ b/netware/myisam_ftdump.def
@@ -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
+
diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c
index b4060bfdb7e..355e18b819a 100644
--- a/netware/mysql_install_db.c
+++ b/netware/mysql_install_db.c
@@ -386,7 +386,8 @@ int main(int argc, char **argv)
if (!autoclose) setscreenmode(SCR_NO_MODE);
// 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();
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index e1a07baca6c..06d5e5985c1 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -53,6 +53,7 @@
#define TEST_SKIP "[ skip ]"
#define TEST_FAIL "[ fail ]"
#define TEST_BAD "[ bad ]"
+#define TEST_IGNORE "[ignore]"
/******************************************************************************
@@ -69,7 +70,8 @@ int master_port = 9306;
int slave_port = 9307;
// 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 mysql_test_dir[PATH_MAX];
@@ -107,6 +109,7 @@ int total_pass = 0;
int total_fail = 0;
int total_test = 0;
+int total_ignore = 0;
double total_time = 0;
int use_openssl = FALSE;
@@ -393,7 +396,7 @@ void start_master()
{
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;
}
@@ -582,7 +585,7 @@ void start_slave()
{
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;
}
@@ -633,7 +636,7 @@ void stop_slave()
if (!slave_running) return;
// 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;
}
@@ -657,7 +660,7 @@ void stop_master()
// running?
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;
}
@@ -778,21 +781,31 @@ void run_test(char *test)
char temp[PATH_MAX];
char *rstr;
double elapsed = 0;
- int skip = FALSE;
+ int skip = FALSE, ignore=FALSE;
int restart = FALSE;
int flag = FALSE;
struct stat info;
// single test?
- if (!single_test)
+// if (!single_test)
{
// skip tests in the skip list
snprintf(temp, PATH_MAX, " %s ", test);
skip = (strindex(skip_test, temp) != NULL);
+ if( skip == FALSE )
+ ignore = (strindex(ignore_test, temp) != NULL);
}
- // skip test?
- if (!skip)
+ if(ignore)
+ {
+ // show test
+ log("%-46s ", test);
+
+ // ignore
+ rstr = TEST_IGNORE;
+ ++total_ignore;
+ }
+ else if (!skip) // skip test?
{
char test_file[PATH_MAX];
char master_opt_file[PATH_MAX];
@@ -1148,9 +1161,33 @@ void setup(char *file)
******************************************************************************/
int main(int argc, char **argv)
{
+ int is_ignore_list = 0;
// setup
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
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(DASH);
- if (argc > 1)
+ if ( argc > 1 + is_ignore_list )
{
int i;
// single test
single_test = TRUE;
- for (i = 1; i < argc; i++)
+ for (i = 1 + is_ignore_list; i < argc; i++)
{
// run given test
run_test(argv[i]);
diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def
new file mode 100644
index 00000000000..4d56d29c42f
--- /dev/null
+++ b/netware/mysql_waitpid.def
@@ -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
+
diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def
new file mode 100644
index 00000000000..21fd177fbc7
--- /dev/null
+++ b/netware/resolve_stack_dump.def
@@ -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
+
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index da83e195943..230a62c5f11 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -87,8 +87,8 @@ do
fi
done
-for i in COPYING README Docs/INSTALL-BINARY \
- MySQLEULA.txt LICENSE.doc README.NW
+for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \
+ MySQLEULA.txt LICENSE.doc README.NW
do
if [ -f $i ]
then
@@ -153,6 +153,7 @@ done
if [ $BASE_SYSTEM = "netware" ] ; then
$CP -r netware/*.pl $BASE/scripts
+ $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
fi
for i in \
@@ -169,7 +170,7 @@ do
fi
done
-# convert the libs to .lib for NetWare
+# convert the .a to .lib for NetWare
if [ $BASE_SYSTEM = "netware" ] ; then
for i in $BASE/lib/*.a
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
+
+#
+# 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
# To be removed in MySQL 4.1
(cd $BASE/bin ; ln -s mysqld_safe safe_mysqld )
@@ -311,29 +322,47 @@ which_1 ()
exit 1
}
-#
-# Create the result tar file
-#
+if [ $BASE_SYSTEM != "netware" ] ; then
-tar=`which_1 gnutar gtar`
-if test "$?" = "1" -o "$tar" = ""
-then
- tar=tar
-fi
+ #
+ # 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
-echo "Using $tar to create archive"
-cd $TMP
+ #
+ # Create a zip file for NetWare users
+ #
-OPT=cvf
-if [ x$SILENT = x1 ] ; then
- OPT=cf
-fi
+ 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
-$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.zip created"
-echo "$NEW_NAME.tar.gz created"
+fi
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index ab06215c3ac..6388855eaa6 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -7,6 +7,7 @@ use File::Basename;
use File::Path;
use DBI;
use Sys::Hostname;
+use File::Copy;
=head1 NAME
@@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) {
elsif ( $opt{suffix} ) {
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
{
$tgt_name="" if (!defined($tgt_name));
@@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) {
else {
mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n"
unless -d $tgt_dirpath;
+ if ($^O !~ m/^(NetWare)$/)
+ {
my @f_info= stat "$datadir/$rdb->{src}";
chown $f_info[4], $f_info[5], $tgt_dirpath;
+ }
}
}
}
@@ -578,7 +586,15 @@ sub copy_files {
my @cmd;
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;
# add option to preserve mod time etc of copied files
# not critical, but nice to have
@@ -717,7 +733,7 @@ sub retire_directory {
if ( -d $tgt_oldpath ) {
print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet};
- rmtree([$tgt_oldpath])
+ rmtree([$tgt_oldpath],0,1);
}
rename($dir, $tgt_oldpath)
or die "Can't rename $dir=>$tgt_oldpath: $!\n";
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index c5e5f881a83..2e4a6b5823a 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -138,10 +138,27 @@ int deny_severity = LOG_WARNING;
#include <nks/vm.h>
#include <library.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 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__ */
+
#ifdef _AIX41
int initgroups(const char *,unsigned int);
@@ -1440,6 +1457,7 @@ static void start_signal_handler(void)
static void check_data_home(const char *path)
{}
+
#elif defined(__NETWARE__)
// down server event callback
@@ -1448,27 +1466,196 @@ void mysql_down_server_cb(void *, void *)
kill_server(0);
}
+
// destroy callback resources
void mysql_cb_destroy(void *)
{
UnRegisterEventNotification(eh); // cleanup down event notification
NX_UNWRAP_INTERFACE(ref);
+
+ /* Deregister NSS volume deactivation event */
+ NX_UNWRAP_INTERFACE(refneb);
+ if (neb_consumer_id)
+ UnRegisterConsumer(neb_consumer_id, NULL);
}
+
// initialize callbacks
void mysql_cb_init()
{
// register for down server event
void *handle = getnlmhandle();
- rtag_t rt = AllocateResourceTag(handle, "MySQL Down Server Callback",
- EventSignature);
+ rtag_t rt= AllocateResourceTag(handle, "MySQL Down Server Callback",
+ EventSignature);
NX_WRAP_INTERFACE((void *)mysql_down_server_cb, 2, (void **)&ref);
- eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER,
- EVENT_PRIORITY_APPLICATION,
- NULL, ref, NULL);
+ eh= RegisterForEventNotification(rt, EVENT_PRE_DOWN_SERVER,
+ EVENT_PRIORITY_APPLICATION,
+ 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
}
+
+/ *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)
{
int signals[] = {SIGINT,SIGILL,SIGFPE,SIGSEGV,SIGTERM,SIGABRT};
@@ -1478,6 +1665,7 @@ static void init_signals(void)
mysql_cb_init(); // initialize callbacks
}
+
static void start_signal_handler(void)
{
// 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)
{
@@ -1933,6 +2126,7 @@ extern "C" pthread_handler_decl(handle_shutdown,arg)
return 0;
}
+
int STDCALL handle_kill(ulong ctrl_type)
{
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;
break;
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;
mysqld_port=0;
break;
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index f1efd3be3eb..2e9f980bb5d 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -21,6 +21,8 @@
Sasha Pachev <sasha@mysql.com>
*/
+#ifndef __NETWARE__
+
#include <my_global.h>
#include <my_pthread.h>
#include <mysql.h>
@@ -1850,3 +1852,16 @@ int main(int argc, char** argv)
else
return daemonize();
}
+
+#else
+
+#include <stdio.h>
+
+int main(void)
+{
+ fprintf(stderr,"This tool has not been ported to NetWare\n");
+ return 0;
+}
+
+#endif /* __NETWARE__ */
+
diff --git a/vio/test-ssl.c b/vio/test-ssl.c
index 84bae5fa0c7..88df6936a1f 100644
--- a/vio/test-ssl.c
+++ b/vio/test-ssl.c
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
-#ifdef HAVE_OPENSSL
+#if defined(HAVE_OPENSSL) && !defined(__NETWARE__)
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>
diff --git a/vio/viossl.c b/vio/viossl.c
index fafe48b7a84..a489cb98f98 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -25,6 +25,31 @@
#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
report_errors()
{
diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c
index 0997e3909db..498d10da0ee 100644
--- a/vio/viosslfactories.c
+++ b/vio/viosslfactories.c
@@ -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 **********************************/
/*
TODO:
@@ -188,7 +217,7 @@ new_VioSSLConnectorFd(const char* key_file,
int verify = SSL_VERIFY_NONE;
struct st_VioSSLConnectorFd* ptr;
int result;
- DH *dh=NULL;
+ DH *dh;
DBUG_ENTER("new_VioSSLConnectorFd");
DBUG_PRINT("enter",
("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;
/* FIXME: constants! */
+#ifdef __NETWARE__
+ netware_ssl_init();
+#endif
+
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));
@@ -279,7 +312,7 @@ new_VioSSLAcceptorFd(const char *key_file,
SSL_VERIFY_CLIENT_ONCE);
struct st_VioSSLAcceptorFd* ptr;
int result;
- DH *dh=NULL;
+ DH *dh;
DBUG_ENTER("new_VioSSLAcceptorFd");
DBUG_PRINT("enter",
("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! */
ptr->session_id_context= ptr;
+#ifdef __NETWARE__
+ netware_ssl_init();
+#endif
+
if (!ssl_algorithms_added)
{
DBUG_PRINT("info", ("todo: OpenSSL_add_all_algorithms()"));