Commit 494e43c1 authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

merge with 4.0 to get security fixes and latest bug fixes

parents f8b4732a e1fee022
...@@ -67,6 +67,7 @@ konstantin@mysql.com ...@@ -67,6 +67,7 @@ konstantin@mysql.com
kostja@oak.local kostja@oak.local
lenz@kallisto.mysql.com lenz@kallisto.mysql.com
lenz@mysql.com lenz@mysql.com
marko@hundin.mysql.fi
miguel@hegel.(none) miguel@hegel.(none)
miguel@hegel.br miguel@hegel.br
miguel@hegel.local miguel@hegel.local
......
...@@ -22,6 +22,7 @@ if (!$opt_builddir) { ...@@ -22,6 +22,7 @@ if (!$opt_builddir) {
$opt_tarball =~ /(mysql[^\/]*)-win-src\.tar/; $opt_tarball =~ /(mysql[^\/]*)-win-src\.tar/;
$mysqlver=$1; $mysqlver=$1;
$basedir = "$opt_builddir/$mysqlver"; $basedir = "$opt_builddir/$mysqlver";
$scriptdir = `pwd`;
# Make sure build dir exists # Make sure build dir exists
mkdir($opt_builddir); mkdir($opt_builddir);
...@@ -47,6 +48,8 @@ chdir($mysqlver); ...@@ -47,6 +48,8 @@ chdir($mysqlver);
system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log"); system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
system("cp $mysqlver-build.log $scriptdir");
# #
# Print a help text message # Print a help text message
# #
...@@ -55,10 +58,10 @@ sub print_help ...@@ -55,10 +58,10 @@ sub print_help
print <<EOF; print <<EOF;
Usage: Do-compile-win [options] source-tarball Usage: Do-compile-win [options] source-tarball
Unpacks a Windows source distribution on the local machine and Unpacks a Windows source distribution on the local machine and
compiles it using VC++ 6.0. compiles it using VC++ 6.0.
This script is intended for Cygwin Perl. You must have a working This script is intended for Cygwin Perl. You must have a working
MSDEV.EXE in your path for compilation. MSDEV.EXE in your path for compilation.
...@@ -68,8 +71,8 @@ Options: ...@@ -68,8 +71,8 @@ Options:
Print this text. Print this text.
--builddir=<dir> --builddir=<dir>
Set the Cygwin path to build under; the tarball will actually Set the Cygwin path to build under; the tarball will actually
be moved to <builddir>/mysql-<version>/tarball and extracted under be moved to <builddir>/mysql-<version>/tarball and extracted under
<builddir>/mysql-<version>/build. <builddir>/mysql-<version>/build.
Default: /cygdrive/c/mysql-win-build Default: /cygdrive/c/mysql-win-build
......
...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe ...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe file20=C:\mysql\bin\winmysqladmin.exe
file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe file10=C:\mysql\bin\mysqlimport.exe
fulldirectory= fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe file11=C:\mysql\bin\mysqlshow.exe
......
...@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh ...@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows file10=C:\mysql\scripts\mysql_find_rows
fulldirectory= fulldirectory=
file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl file11=C:\mysql\scripts\mysql_find_rows.pl
......
...@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf ...@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf
file2=C:\mysql\my-medium.cnf file2=C:\mysql\my-medium.cnf
file3=C:\mysql\my-small.cnf file3=C:\mysql\my-small.cnf
file4=C:\mysql\MySQLEULA.txt file4=C:\mysql\MySQLEULA.txt
file5=C:\mysql\README.txt
SubDir0=bin SubDir0=bin
SubDir1=share SubDir1=share
SubDir2=Embedded SubDir2=Embedded
......
This diff is collapsed.
...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe ...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe file20=C:\mysql\bin\winmysqladmin.exe
file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe file10=C:\mysql\bin\mysqlimport.exe
fulldirectory= fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe file11=C:\mysql\bin\mysqlshow.exe
......
...@@ -220,6 +220,7 @@ file32=C:\mysql\scripts\mysqlbug.sh ...@@ -220,6 +220,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows file10=C:\mysql\scripts\mysql_find_rows
fulldirectory= fulldirectory=
file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl file11=C:\mysql\scripts\mysql_find_rows.pl
......
...@@ -132,12 +132,12 @@ file1=C:\mysql\share\greek\errmsg.txt ...@@ -132,12 +132,12 @@ file1=C:\mysql\share\greek\errmsg.txt
fulldirectory= fulldirectory=
[TopDir] [TopDir]
file0=C:\mysql\Readme file0=C:\mysql\mysqlbug.txt
file1=C:\mysql\mysqlbug.txt file1=C:\mysql\my-huge.cnf
file2=C:\mysql\my-huge.cnf file2=C:\mysql\my-large.cnf
file3=C:\mysql\my-large.cnf file3=C:\mysql\my-medium.cnf
file4=C:\mysql\my-medium.cnf file4=C:\mysql\my-small.cnf
file5=C:\mysql\my-small.cnf file5=C:\mysql\README.txt
SubDir0=bin SubDir0=bin
SubDir1=share SubDir1=share
SubDir2=Embedded SubDir2=Embedded
......
This diff is collapsed.
...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe ...@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe file20=C:\mysql\bin\winmysqladmin.exe
file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe file10=C:\mysql\bin\mysqlimport.exe
fulldirectory= fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe file11=C:\mysql\bin\mysqlshow.exe
......
...@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh ...@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows file10=C:\mysql\scripts\mysql_find_rows
fulldirectory= fulldirectory=
file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl file11=C:\mysql\scripts\mysql_find_rows.pl
......
...@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf ...@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf
file2=C:\mysql\my-medium.cnf file2=C:\mysql\my-medium.cnf
file3=C:\mysql\my-small.cnf file3=C:\mysql\my-small.cnf
file4=C:\mysql\MySQLEULA.txt file4=C:\mysql\MySQLEULA.txt
file5=C:\mysql\README.txt
SubDir0=bin SubDir0=bin
SubDir1=share SubDir1=share
SubDir2=Embedded SubDir2=Embedded
......
This diff is collapsed.
# Microsoft Developer Studio Project File - Name="myisam_ftdump" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=myisam_ftdump - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "myisam_ftdump.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "myisam_ftdump.mak" CFG="myisam_ftdump - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "myisam_ftdump - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisam_ftdump - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "myisam_ftdump - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "myisam_ftdump - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../myisam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /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
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "myisam_ftdump - Win32 Release"
# Name "myisam_ftdump - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\myisam\myisam_ftdump.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
...@@ -231,6 +231,30 @@ Package=<4> ...@@ -231,6 +231,30 @@ Package=<4>
############################################################################### ###############################################################################
Project: "myisam_ftdump"=".\myisam_ftdump\myisam_ftdump.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name dbug
End Project Dependency
Begin Project Dependency
Project_Dep_Name myisam
End Project Dependency
Begin Project Dependency
Project_Dep_Name mysys
End Project Dependency
Begin Project Dependency
Project_Dep_Name strings
End Project Dependency
}}}
###############################################################################
Project: "myisamchk"=".\myisamchk\myisamchk.dsp" - Package Owner=<4> Project: "myisamchk"=".\myisamchk\myisamchk.dsp" - Package Owner=<4>
Package=<5> Package=<5>
...@@ -797,3 +821,4 @@ Package=<3> ...@@ -797,3 +821,4 @@ Package=<3>
}}} }}}
############################################################################### ###############################################################################
...@@ -7,26 +7,26 @@ ...@@ -7,26 +7,26 @@
CFG=mysys - Win32 Debug CFG=mysys - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "mysys.mak". !MESSAGE NMAKE /f "mysys.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug" !MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library") !MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "" # PROP Scc_ProjName ""
# PROP Scc_LocalPath "" # PROP Scc_LocalPath ""
CPP=xicl6.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "mysys - Win32 Release" !IF "$(CFG)" == "mysys - Win32 Release"
...@@ -42,14 +42,14 @@ RSC=rc.exe ...@@ -42,14 +42,14 @@ RSC=rc.exe
# PROP Intermediate_Dir "release" # PROP Intermediate_Dir "release"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c # ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMLINK" /FD /c
# SUBTRACT CPP /WX /Fr /YX # SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=xilink6.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysys.lib" # ADD LIB32 /nologo /out:"..\lib_release\mysys.lib"
...@@ -66,14 +66,14 @@ LIB32=xilink6.exe -lib ...@@ -66,14 +66,14 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "debug" # PROP Intermediate_Dir "debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD 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 # 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_SYMLINK" /FD /c
# SUBTRACT CPP /Fr # SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=xilink6.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo # ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib" # ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib"
...@@ -91,18 +91,18 @@ LIB32=xilink6.exe -lib ...@@ -91,18 +91,18 @@ LIB32=xilink6.exe -lib
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c # ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX # SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c # ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LIB32=xilink6.exe -lib LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib" # ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib" # ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib"
!ENDIF !ENDIF
# Begin Target # Begin Target
...@@ -121,7 +121,7 @@ SOURCE=.\array.c ...@@ -121,7 +121,7 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max" !ELSEIF "$(CFG)" == "mysys - Win32 Max"
!ENDIF !ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -516,7 +516,7 @@ SOURCE=.\thr_lock.c ...@@ -516,7 +516,7 @@ SOURCE=.\thr_lock.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max" !ELSEIF "$(CFG)" == "mysys - Win32 Max"
!ENDIF !ENDIF
# End Source File # End Source File
# Begin Source File # Begin Source File
......
This diff is collapsed.
...@@ -1029,6 +1029,15 @@ case $SYSTEM_TYPE in ...@@ -1029,6 +1029,15 @@ case $SYSTEM_TYPE in
MAX_C_OPTIMIZE="-O" MAX_C_OPTIMIZE="-O"
fi fi
;; ;;
*darwin7*)
if test "$ac_cv_prog_gcc" = "yes"
then
FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DFN_NO_CASE_SENCE"
CFLAGS="$CFLAGS $FLAGS"
CXXFLAGS="$CXXFLAGS $FLAGS"
MAX_C_OPTIMIZE="-O"
fi
;;
*freebsd*) *freebsd*)
echo "Adding fix for interrupted reads" echo "Adding fix for interrupted reads"
OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'` OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
......
/************************************************************************
Test for the client: interactive SQL
(c) 1996-1997 Innobase Oy
Created 2/16/1996 Heikki Tuuri
*************************************************************************/
#include "univ.i"
#include "ib_odbc.h"
#include "mem0mem.h"
#include "sync0sync.h"
#include "os0thread.h"
#include "os0proc.h"
#include "os0sync.h"
#include "srv0srv.h"
ulint n_exited = 0;
char cli_srv_endpoint_name[100];
char cli_user_name[100];
ulint n_warehouses = ULINT_MAX;
ulint n_customers_d = ULINT_MAX;
bool is_tpc_d = FALSE;
ulint n_rounds = ULINT_MAX;
ulint n_users = ULINT_MAX;
ulint startdate = 0;
ulint enddate = 0;
bool own_warehouse = FALSE;
ulint mem_pool_size = ULINT_MAX;
/*************************************************************************
Reads a keywords and a values from an initfile. In case of an error, exits
from the process. */
static
void
cli_read_initfile(
/*==============*/
FILE* initfile) /* in: file pointer */
{
char str_buf[10000];
ulint ulint_val;
srv_read_init_val(initfile, FALSE, "SRV_ENDPOINT_NAME", str_buf,
&ulint_val);
ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
ut_memcpy(cli_srv_endpoint_name, str_buf, COM_MAX_ADDR_LEN);
srv_read_init_val(initfile, FALSE, "USER_NAME", str_buf,
&ulint_val);
ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
ut_memcpy(cli_user_name, str_buf, COM_MAX_ADDR_LEN);
srv_read_init_val(initfile, TRUE, "MEM_POOL_SIZE", str_buf,
&mem_pool_size);
srv_read_init_val(initfile, TRUE, "N_WAREHOUSES", str_buf,
&n_warehouses);
srv_read_init_val(initfile, TRUE, "N_CUSTOMERS_D", str_buf,
&n_customers_d);
srv_read_init_val(initfile, TRUE, "IS_TPC_D", str_buf,
&is_tpc_d);
srv_read_init_val(initfile, TRUE, "N_ROUNDS", str_buf,
&n_rounds);
srv_read_init_val(initfile, TRUE, "N_USERS", str_buf,
&n_users);
srv_read_init_val(initfile, TRUE, "STARTDATE", str_buf,
&startdate);
srv_read_init_val(initfile, TRUE, "ENDDATE", str_buf,
&enddate);
srv_read_init_val(initfile, TRUE, "OWN_WAREHOUSE", str_buf,
&own_warehouse);
}
/*************************************************************************
Reads configuration info for the client. */
static
void
cli_boot(
/*=====*/
char* name) /* in: the initialization file name */
{
FILE* initfile;
initfile = fopen(name, "r");
if (initfile == NULL) {
printf(
"Error in client booting: could not open initfile whose name is %s!\n",
name);
os_process_exit(1);
}
cli_read_initfile(initfile);
fclose(initfile);
}
/*********************************************************************
Interactive SQL loop. */
static
void
isql(
/*=*/
FILE* inputfile) /* in: input file containing SQL strings,
or stdin */
{
HENV env;
HDBC conn;
RETCODE ret;
HSTMT sql_query;
ulint tm, oldtm;
char buf[1000];
char* str;
ulint count;
ulint n_begins;
ulint len;
ulint n;
ulint i;
ulint n_lines;
ret = SQLAllocEnv(&env);
ut_a(ret == SQL_SUCCESS);
ret = SQLAllocConnect(env, &conn);
ut_a(ret == SQL_SUCCESS);
ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
(SWORD)ut_strlen(cli_srv_endpoint_name),
cli_user_name,
(SWORD)ut_strlen(cli_user_name),
(UCHAR*)"password", 8);
ut_a(ret == SQL_SUCCESS);
printf("Connection established\n");
printf("Interactive SQL performs queries by first making a stored\n");
printf("procedure from them, and then calling the procedure.\n");
printf("Put a semicolon after each statement and\n");
printf("end your query with two <enter>s.\n\n");
printf("You can also give a single input file\n");
printf("as a command line argument to isql.\n\n");
printf("In the file separate SQL queries and procedure bodies\n");
printf("by a single empty line. Do not write the final END; into\n");
printf("a procedure body.\n\n");
count = 0;
loop:
count++;
n = 0;
n_lines = 0;
sprintf(buf, "PROCEDURE P%s%lu () IS\nBEGIN ", cli_user_name,
count);
for (;;) {
len = ut_strlen(buf + n) - 1;
n += len;
if (len == 0) {
break;
} else {
sprintf(buf + n, "\n");
n++;
n_lines++;
}
str = fgets(buf + n, 1000, inputfile);
if ((str == NULL) && (inputfile != stdin)) {
/* Reached end-of-file: switch to input from
keyboard */
inputfile = stdin;
break;
}
ut_a(str);
}
if (n_lines == 1) {
/* Empty procedure */
goto loop;
}
/* If the statement is actually the body of a procedure,
erase the first BEGIN from the string: */
n_begins = 0;
for (i = 0; i < n - 5; i++) {
if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
n_begins++;
}
}
if (n_begins > 1) {
for (i = 0; i < n - 5; i++) {
if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
/* Erase the first BEGIN: */
ut_memcpy(buf + i, " ", 5);
break;
}
}
}
sprintf(buf + n, "END;\n");
printf("SQL procedure to execute:\n%s\n", buf);
ret = SQLAllocStmt(conn, &sql_query);
ut_a(ret == SQL_SUCCESS);
ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
ut_a(ret == SQL_SUCCESS);
ret = SQLExecute(sql_query);
ut_a(ret == SQL_SUCCESS);
sprintf(buf, "{P%s%lu ()}", cli_user_name, count);
ret = SQLAllocStmt(conn, &sql_query);
ut_a(ret == SQL_SUCCESS);
ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
ut_a(ret == SQL_SUCCESS);
printf("Starting to execute the query\n");
oldtm = ut_clock();
ret = SQLExecute(sql_query);
tm = ut_clock();
printf("Wall time for query %lu milliseconds\n\n", tm - oldtm);
ut_a(ret == SQL_SUCCESS);
goto loop;
}
/********************************************************************
Main test function. */
void
main(int argc, char* argv[])
/*========================*/
{
ulint tm, oldtm;
FILE* inputfile;
if (argc > 2) {
printf("Only one input file allowed\n");
os_process_exit(1);
} else if (argc == 2) {
inputfile = fopen(argv[1], "r");
if (inputfile == NULL) {
printf(
"Error: could not open the inputfile whose name is %s!\n",
argv[1]);
os_process_exit(1);
}
} else {
inputfile = stdin;
}
cli_boot("cli_init");
sync_init();
mem_init(mem_pool_size);
oldtm = ut_clock();
isql(inputfile);
tm = ut_clock();
printf("Wall time for test %lu milliseconds\n", tm - oldtm);
printf("TESTS COMPLETED SUCCESSFULLY!\n");
}
include ..\..\makefile.i
doall: tssrv tscli isql
tssrv: ..\btr.lib tssrv.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tssrv.c $(LFL)
tscli: ..\btr.lib tscli.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tscli.c $(LFL)
isql: ..\btr.lib isql.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib isql.c $(LFL)
tsrecv: ..\btr.lib tsrecv.c
$(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsrecv.c $(LFL)
/************************************************************************
The test module for the record manager of MVB.
(c) 1994 Heikki Tuuri
Created 1/25/1994 Heikki Tuuri
*************************************************************************/
#include "rm0phr.h"
#include "rm0lgr.h"
#include "ut0ut.h"
#include "buf0mem.h"
#include "rm0ipg.h"
#include "../it0it.h"
#include "../it0hi.h"
#include "../it0ads.h"
byte buf[100];
byte buf2[100];
lint lintbuf[2048];
byte numbuf[6000];
byte numlogrecbuf[100];
phr_record_t* qs_table[100000];
lint qs_comp = 0;
extern
void
test1(void);
#ifdef NOT_DEFINED
void
q_sort(lint low, lint up)
{
phr_record_t* temp, *pivot;
lint i, j;
pivot = qs_table[(low + up) / 2];
i = low;
j = up;
while (i < j) {
qs_comp++;
if (cmp_phr_compare(qs_table[i], pivot)<= 0) {
i++;
} else {
j--;
temp = qs_table[i];
qs_table[i] = qs_table[j];
qs_table[j] = temp;
}
}
if (j == up) {
temp = qs_table[(low + up) / 2];
qs_table[(low + up) / 2] = qs_table[up - 1];
qs_table[up - 1] = temp;
j--;
}
if (j - low <= 1) {
/* do nothing */
} else if (j - low == 2) {
qs_comp++;
if (cmp_phr_compare(qs_table[low],
qs_table[low + 1])
<= 0) {
/* do nothing */
} else {
temp = qs_table[low];
qs_table[low] = qs_table[low + 1];
qs_table[low + 1] = temp;
}
} else {
q_sort(low, j);
}
if (up - j <= 1) {
/* do nothing */
} else if (up - j == 2) {
qs_comp++;
if (cmp_phr_compare(qs_table[j],
qs_table[j + 1])
<= 0) {
/* do nothing */
} else {
temp = qs_table[j];
qs_table[j] = qs_table[j + 1];
qs_table[j + 1] = temp;
}
} else {
q_sort(j, up);
}
}
#endif
extern
void
test1(void)
{
phr_record_t* physrec;
phr_record_t* rec1;
phr_record_t* rec2;
lgr_record_t* logrec;
lgrf_field_t* logfield;
lint len;
byte* str;
lint len2;
lint tm;
lint oldtm;
lint i, j, k, l, m;
bool b;
it_cur_cursor_t cursor;
ipg_cur_cursor_t* page_cursor;
ipg_page_t* page;
byte c4, c3, c2, c1, c0;
lint rand, rnd1, rnd2;
byte* nb;
lgr_record_t* numlogrec;
byte* pgbuf;
mem_stream_t* stream;
lint tree1, tree2, tree3;
lint dummy1, dummy2;
pgbuf = (byte*)lintbuf;
stream = mem_stream_create(0);
printf("-------------------------------------------\n");
printf("TEST 1. Speed and basic tests.\n");
logrec = lgr_create_logical_record(stream, 2);
nb = numbuf;
c4 = '0';
c3 = '0';
for (c2 = '0'; c2 <= '9'; c2++) {
for (c1 = '0'; c1 <= '9'; c1++) {
for (c0 = '0'; c0 <= '9'; c0++) {
*nb = c4; nb++;
*nb = c3; nb++;
*nb = c2; nb++;
*nb = c1; nb++;
*nb = c0; nb++;
*nb = '\0'; nb++;
}
}
}
numlogrec = lgr_create_logical_record(stream, 2);
tree1 = it_create_index_tree();
oldtm = ut_clock();
rand = 99900;
rnd1 = 67;
for (j = 0; j < 1; j++) {
for (i = 0 ; i < 100000; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
/*
it_insert(tree1, numlogrec);
*/
it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
/*
it_cur_set_to_first(tree1, &cursor);
*/
it_cur_insert_record(&cursor, numlogrec);
}
}
tm = ut_clock();
printf("Time for inserting %ld recs = %ld \n", i* j, tm - oldtm);
/* it_print_tree(tree1, 10);*/
hi_print_info();
ads_print_info();
/*
oldtm = ut_clock();
rand = 11113;
for (i = 0; i < 5000; i++) {
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
}
tm = ut_clock();
printf("Time for searching %ld recs = %ld \n", i, tm - oldtm);
*/
it_cur_set_to_first(tree1, &cursor);
rec1 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
for (i = 0;; i++) {
it_cur_move_to_next(&cursor);
if (it_cur_end_of_level(&cursor)) {
break;
}
rec2 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
ut_a(cmp_phr_compare(rec1, rec2) == -1);
rec1 = rec2;
}
printf("tree1 checked for right sorted order!\n");
#ifdef not_defined
oldtm = ut_clock();
for (j = 0; j < 1; j++) {
rand = 11113;
for (i = 0; i < 3000; i++) {
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
physrec = hi_search(numlogrec);
ut_a(physrec);
}
}
ut_a(physrec);
tm = ut_clock();
printf("Time for hi_search %ld recs = %ld \n", i * j,
tm - oldtm);
oldtm = ut_clock();
for (i = 0; i < 100000; i++) {
/* j += lgr_fold(numlogrec, -1, -1);*/
/* b += phr_lgr_equal(physrec, numlogrec, -1);*/
k += ut_hash_lint(j, HI_TABLE_SIZE);
}
/* ut_a(b);*/
tm = ut_clock();
printf("Time for fold + equal %ld recs %s = %ld \n", i, physrec,
tm - oldtm);
printf("%ld %ld %ld\n", j, b, k);
hi_print_info();
tree2 = it_create_index_tree();
rand = 90000;
for (i = 0; i < 300; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
oldtm = ut_clock();
rand = 10000;
for (i = 0; i < 3000; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
tm = ut_clock();
printf("Time for inserting sequentially %ld recs = %ld \n",
i, tm - oldtm);
/* it_print_tree(tree2, 10); */
tree3 = it_create_index_tree();
rand = 0;
for (i = 0; i < 300; i++) {
rand = (rand + 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
oldtm = ut_clock();
rand = 100000;
for (i = 0; i < 3000; i++) {
rand = (rand - 1) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
IPG_SE_L_GE, &cursor);
it_cur_insert_record(&cursor, numlogrec);
}
tm = ut_clock();
printf("Time for inserting sequentially downw. %ld recs = %ld \n",
i, tm - oldtm);
/* it_print_tree(tree3, 10); */
#endif
}
#ifdef NOT_DEFINED
/* Test of quicksort */
void
test2(void)
{
mem_stream_t* stream;
byte* stbuf;
lgrf_field_t* logfield;
lint tm;
lint oldtm;
lint i, j, k, l, m;
lint rand;
lgr_record_t* numlogrec;
phr_record_t* ph_rec;
stream = mem_stream_create(1000);
numlogrec = lgr_create_logical_record(stream, 2);
oldtm = ut_clock();
rand = 11113;
for (i = 0; i < 50000; i++) {
stbuf = mem_stream_alloc(stream, 30);
rand = (rand + 57123) % 100000;
logfield = lgr_get_nth_field(numlogrec, 0);
lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
lgrf_set_len(logfield, 6);
logfield = lgr_get_nth_field(numlogrec, 1);
lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
lgrf_set_len(logfield, 6);
ph_rec = phr_create_physical_record(stbuf, 30, numlogrec);
qs_table[i] = ph_rec;
}
tm = ut_clock();
printf("Time for inserting %ld recs to mem stream = %ld \n",
i, tm - oldtm);
oldtm = ut_clock();
q_sort(0, 50000);
tm = ut_clock();
printf("Time for quicksort of %ld recs = %ld, comps: %ld \n",
i, tm - oldtm, qs_comp);
for (i = 1; i < 49999; i++) {
ut_a(-1 ==
cmp_phr_compare(qs_table[i], qs_table[i+1]
));
}
tm = ut_clock();
oldtm = ut_clock();
for (i = 1; i < 50000; i++) {
k += cmp_phr_compare(qs_table[i & 0xF],
qs_table[5]);
}
tm = ut_clock();
printf("%ld\n", k);
printf("Time for cmp of %ld ph_recs = %ld \n",
i, tm - oldtm);
mem_stream_free(stream);
}
#endif
void
main(void)
{
test1();
/* test2(); */
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/************************************************************************
Test for the server
(c) 1996-1997 Innobase Oy
Created 2/16/1996 Heikki Tuuri
*************************************************************************/
#include "os0proc.h"
#include "sync0sync.h"
#include "ut0mem.h"
#include "mem0mem.h"
#include "mem0pool.h"
#include "data0data.h"
#include "data0type.h"
#include "dict0dict.h"
#include "buf0buf.h"
#include "buf0flu.h"
#include "os0file.h"
#include "os0thread.h"
#include "fil0fil.h"
#include "fsp0fsp.h"
#include "rem0rec.h"
#include "rem0cmp.h"
#include "mtr0mtr.h"
#include "log0log.h"
#include "log0recv.h"
#include "page0page.h"
#include "page0cur.h"
#include "trx0trx.h"
#include "dict0boot.h"
#include "trx0sys.h"
#include "dict0crea.h"
#include "btr0btr.h"
#include "btr0pcur.h"
#include "btr0cur.h"
#include "btr0sea.h"
#include "rem0rec.h"
#include "srv0srv.h"
#include "que0que.h"
#include "com0com.h"
#include "usr0sess.h"
#include "lock0lock.h"
#include "trx0roll.h"
#include "trx0purge.h"
#include "row0ins.h"
#include "row0sel.h"
#include "row0upd.h"
#include "row0row.h"
#include "lock0lock.h"
#include "ibuf0ibuf.h"
#include "pars0pars.h"
#include "btr0sea.h"
bool measure_cont = FALSE;
os_file_t files[1000];
mutex_t ios_mutex;
ulint ios;
ulint n[10];
mutex_t incs_mutex;
ulint incs;
byte rnd_buf[67000];
/************************************************************************
Io-handler thread function. */
ulint
handler_thread(
/*===========*/
void* arg)
{
ulint segment;
ulint i;
segment = *((ulint*)arg);
printf("Io handler thread %lu starts\n", segment);
for (i = 0;; i++) {
fil_aio_wait(segment);
mutex_enter(&ios_mutex);
ios++;
mutex_exit(&ios_mutex);
}
return(0);
}
/*************************************************************************
Creates or opens the log files. */
void
create_log_files(void)
/*==================*/
{
bool ret;
ulint i, k;
char name[20];
printf("--------------------------------------------------------\n");
printf("Create or open log files\n");
strcpy(name, "logfile00");
for (k = 0; k < srv_n_log_groups; k++) {
for (i = 0; i < srv_n_log_files; i++) {
name[6] = (char)((ulint)'0' + k);
name[7] = (char)((ulint)'0' + i);
files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
&ret);
if (ret == FALSE) {
ut_a(os_file_get_last_error() ==
OS_FILE_ALREADY_EXISTS);
files[i] = os_file_create(
name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
ut_a(ret);
} else {
ut_a(os_file_set_size(files[i],
8192 * srv_log_file_size, 0));
}
ret = os_file_close(files[i]);
ut_a(ret);
if (i == 0) {
fil_space_create(name, k + 100, FIL_LOG);
}
ut_a(fil_validate());
fil_node_create(name, srv_log_file_size, k + 100);
}
fil_space_create(name, k + 200, FIL_LOG);
log_group_init(k, srv_n_log_files,
srv_log_file_size * UNIV_PAGE_SIZE,
k + 100, k + 200);
}
}
/*************************************************************************
Creates the files for the file system test and inserts them to the file
system. */
void
create_files(void)
/*==============*/
{
bool ret;
ulint i, k;
char name[20];
os_thread_t thr[10];
os_thread_id_t id[10];
printf("--------------------------------------------------------\n");
printf("Create or open database files\n");
strcpy(name, "tsfile00");
for (k = 0; k < 2 * srv_n_spaces; k += 2) {
for (i = 0; i < srv_n_files; i++) {
name[6] = (char)((ulint)'0' + k);
name[7] = (char)((ulint)'0' + i);
files[i] = os_file_create(name, OS_FILE_CREATE,
OS_FILE_NORMAL, &ret);
if (ret == FALSE) {
ut_a(os_file_get_last_error() ==
OS_FILE_ALREADY_EXISTS);
files[i] = os_file_create(
name, OS_FILE_OPEN, OS_FILE_NORMAL, &ret);
ut_a(ret);
} else {
ut_a(os_file_set_size(files[i],
UNIV_PAGE_SIZE * srv_file_size, 0));
/* Initialize the file contents to a random value */
/*
for (j = 0; j < srv_file_size; j++) {
for (c = 0; c < UNIV_PAGE_SIZE; c++) {
rnd_buf[c] = 0xFF;
}
os_file_write(files[i], rnd_buf,
UNIV_PAGE_SIZE * j, 0,
UNIV_PAGE_SIZE);
}
*/
}
ret = os_file_close(files[i]);
ut_a(ret);
if (i == 0) {
fil_space_create(name, k, FIL_TABLESPACE);
}
ut_a(fil_validate());
fil_node_create(name, srv_file_size, k);
}
}
ios = 0;
mutex_create(&ios_mutex);
mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
/* Create i/o-handler threads: */
for (i = 0; i < 9; i++) {
n[i] = i;
thr[i] = os_thread_create(handler_thread, n + i, id + i);
}
}
/************************************************************************
Inits space header of space. */
void
init_spaces(void)
/*=============*/
{
mtr_t mtr;
mtr_start(&mtr);
fsp_header_init(0, srv_file_size * srv_n_files, &mtr);
mtr_commit(&mtr);
}
/*********************************************************************
This thread is used to measure contention of latches. */
ulint
test_measure_cont(
/*==============*/
void* arg)
{
ulint i, j, k;
ulint count[8];
ulint lcount[8];
ulint lscount;
ulint lkcount;
ulint pcount, kcount, scount;
UT_NOT_USED(arg);
printf("Starting contention measurement\n");
for (i = 0; i < 1000; i++) {
for (k = 0; k < 8; k++) {
count[k] = 0;
lcount[k] = 0;
}
pcount = 0;
kcount = 0;
scount = 0;
lscount = 0;
lkcount = 0;
for (j = 0; j < 100; j++) {
if (srv_measure_by_spin) {
ut_delay(ut_rnd_interval(0, 20000));
} else {
os_thread_sleep(20000);
}
if (kernel_mutex.lock_word) {
kcount++;
}
if (lock_kernel_reserved) {
lkcount++;
}
if (buf_pool->mutex.lock_word) {
pcount++;
}
if (btr_search_mutex.lock_word) {
scount++;
}
for (k = 0; k < 8; k++) {
if (btr_search_sys->
hash_index->mutexes[k].lock_word) {
count[k]++;
}
}
for (k = 0; k < 2; k++) {
if (lock_sys->rec_hash->mutexes[k].lock_word) {
lcount[k]++;
}
}
if (kernel_mutex.lock_word
|| lock_sys->rec_hash->mutexes[0].lock_word
|| lock_sys->rec_hash->mutexes[1].lock_word) {
lscount++;
}
}
printf(
"Mutex res. p %lu, k %lu %lu, %lu %lu %lu s %lu, %lu %lu %lu %lu %lu %lu %lu %lu of %lu\n",
pcount, kcount, lkcount, lcount[0], lcount[1], lscount, scount,
count[0], count[1], count[2], count[3],
count[4], count[5], count[6], count[7], j);
sync_print_wait_info();
printf("N log i/os %lu, n non sea %lu, n sea succ %lu\n",
log_sys->n_log_ios, btr_cur_n_non_sea,
btr_search_n_succ);
}
return(0);
}
/********************************************************************
Main test function. */
void
main(void)
/*======*/
{
os_thread_id_t thread_id;
log_do_write = TRUE;
/* yydebug = TRUE; */
srv_boot("srv_init");
os_aio_init(576, 9, 100);
fil_init(25);
buf_pool_init(srv_pool_size, srv_pool_size);
fsp_init();
log_init();
lock_sys_create(srv_lock_table_size);
create_files();
create_log_files();
init_spaces();
sess_sys_init_at_db_start();
trx_sys_create();
dict_create();
log_make_checkpoint_at(ut_dulint_max);
if (srv_measure_contention) {
os_thread_create(&test_measure_cont, NULL, &thread_id);
}
if (!srv_log_archive_on) {
ut_a(DB_SUCCESS == log_archive_noarchivelog());
}
srv_master_thread();
printf("TESTS COMPLETED SUCCESSFULLY!\n");
os_process_exit(0);
}
This diff is collapsed.
...@@ -1106,13 +1106,13 @@ buf_page_get_gen( ...@@ -1106,13 +1106,13 @@ buf_page_get_gen(
buf_read_page(space, offset); buf_read_page(space, offset);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
buf_dbg_counter++; buf_dbg_counter++;
if (buf_dbg_counter % 37 == 0) { if (buf_dbg_counter % 37 == 0) {
ut_ad(buf_validate()); ut_ad(buf_validate());
} }
#endif #endif
goto loop; goto loop;
} }
......
include ..\..\makefile.i
doall: tsbuf
tsbuf: ..\buf.lib tsbuf.c
$(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsbuf.c $(LFL)
tsos: ..\buf.lib tsos.c
$(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\mach.lib ..\..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsos.c $(LFL)
This diff is collapsed.
/************************************************************************
The test module for the operating system interface
(c) 1995 Innobase Oy
Created 9/27/1995 Heikki Tuuri
*************************************************************************/
#include "../os0thread.h"
#include "../os0shm.h"
#include "../os0proc.h"
#include "../os0sync.h"
#include "../os0file.h"
#include "ut0ut.h"
#include "sync0sync.h"
#include "mem0mem.h"
ulint last_thr = 1;
byte global_buf[1000000];
os_file_t file;
os_file_t file2;
os_event_t gl_ready;
mutex_t ios_mutex;
ulint ios;
/************************************************************************
Io-handler thread function. */
ulint
handler_thread(
/*===========*/
void* arg)
{
ulint segment;
void* mess;
ulint i;
bool ret;
segment = *((ulint*)arg);
printf("Thread %lu starts\n", segment);
for (i = 0;; i++) {
ret = os_aio_wait(segment, &mess);
mutex_enter(&ios_mutex);
ios++;
mutex_exit(&ios_mutex);
ut_a(ret);
/* printf("Message for thread %lu %lu\n", segment,
(ulint)mess); */
if ((ulint)mess == 3333) {
os_event_set(gl_ready);
}
}
return(0);
}
/************************************************************************
Test of io-handler threads */
void
test4(void)
/*=======*/
{
ulint i;
bool ret;
void* buf;
ulint rnd;
ulint tm, oldtm;
os_thread_t thr[5];
os_thread_id_t id[5];
ulint n[5];
printf("-------------------------------------------\n");
printf("OS-TEST 4. Test of asynchronous file io\n");
/* Align the buffer for file io */
buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
gl_ready = os_event_create(NULL);
ios = 0;
sync_init();
mem_init();
mutex_create(&ios_mutex);
for (i = 0; i < 5; i++) {
n[i] = i;
thr[i] = os_thread_create(handler_thread, n + i, id + i);
}
rnd = 0;
oldtm = ut_clock();
for (i = 0; i < 4096; i++) {
ret = os_aio_read(file, (byte*)buf + 8192 * (rnd % 100),
8192 * (rnd % 4096), 0,
8192, (void*)i);
ut_a(ret);
rnd += 1;
}
ret = os_aio_read(file, buf, 8192 * (rnd % 1024), 0, 8192,
(void*)3333);
ut_a(ret);
ut_a(!os_aio_all_slots_free());
tm = ut_clock();
printf("All ios queued! N ios: %lu\n", ios);
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
os_event_wait(gl_ready);
tm = ut_clock();
printf("N ios: %lu\n", ios);
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
os_thread_sleep(2000000);
printf("N ios: %lu\n", ios);
ut_a(os_aio_all_slots_free());
}
/*************************************************************************
Initializes the asyncronous io system for tests. */
void
init_aio(void)
/*==========*/
{
bool ret;
void* buf;
buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
os_aio_init(160, 5);
file = os_file_create("j:\\tsfile4", OS_FILE_CREATE, OS_FILE_TABLESPACE,
&ret);
if (ret == FALSE) {
ut_a(os_file_get_last_error() == OS_FILE_ALREADY_EXISTS);
file = os_file_create("j:\\tsfile4", OS_FILE_OPEN,
OS_FILE_TABLESPACE, &ret);
ut_a(ret);
}
}
/************************************************************************
Main test function. */
void
main(void)
/*======*/
{
ulint tm, oldtm;
oldtm = ut_clock();
init_aio();
test4();
tm = ut_clock();
printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
printf("TESTS COMPLETED SUCCESSFULLY!\n");
}
include ..\..\makefile.i
doall: tscom tscli
tscom: ..\com.lib tscom.c makefile
$(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscom.c $(LFL)
tscli: ..\com.lib tscli.c makefile
$(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscli.c $(LFL)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -50,7 +50,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \ ...@@ -50,7 +50,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \ thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \
trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \ trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \
trx0sys.h trx0sys.ic trx0trx.h trx0trx.ic trx0types.h \ trx0sys.h trx0sys.ic trx0trx.h trx0trx.ic trx0types.h \
trx0undo.h trx0undo.ic univ.i univold.i univoldmysql.i \ trx0undo.h trx0undo.ic univ.i \
usr0sess.h usr0sess.ic usr0types.h ut0byte.h ut0byte.ic \ usr0sess.h usr0sess.ic usr0types.h ut0byte.h ut0byte.ic \
ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \ ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \
ut0sort.h ut0ut.h ut0ut.ic ut0sort.h ut0ut.h ut0ut.ic
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment