summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2004-02-22 09:50:59 +0200
committerunknown <monty@mashka.mysql.fi>2004-02-22 09:50:59 +0200
commit192bf819eb2bb91e383327d3bde6f596c20a82db (patch)
treedceddcd17cf1278b50f8838476df5644f764efe9
parent984750e13ef4a559c5da05b5fbd6fa363d3650b2 (diff)
parent522e83b64ab46d400ccb6aa8d7b749eefc28f4d5 (diff)
downloadmariadb-git-192bf819eb2bb91e383327d3bde6f596c20a82db.tar.gz
merge with 4.0
BitKeeper/etc/ignore: auto-union VC++Files/comp_err/comp_err.dsp: Auto merged VC++Files/my_print_defaults/my_print_defaults.dsp: Auto merged VC++Files/myisampack/myisampack.dsp: Auto merged acinclude.m4: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/com/com0shm.c: Auto merged innobase/data/data0data.c: Auto merged innobase/ha/ha0ha.c: Auto merged innobase/include/buf0buf.ic: Auto merged innobase/include/dict0dict.h: Auto merged innobase/include/ibuf0ibuf.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/mtr0log.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/os0proc.h: Auto merged innobase/include/os0thread.h: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/log/log0recv.c: Auto merged innobase/mem/mem0dbg.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0proc.c: Auto merged innobase/page/page0page.c: Auto merged innobase/que/que0que.c: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/trx/trx0rec.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0mem.c: Auto merged innobase/ut/ut0ut.c: Auto merged libmysql/libmysql.c: Auto merged scripts/mysql_config.sh: Auto merged sql/net_serv.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_yacc.yy: Auto merged
-rw-r--r--.bzrignore1
-rwxr-xr-xBuild-tools/Do-win-build67
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul)0
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul)0
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul)0
-rw-r--r--VC++Files/comp_err/comp_err.dsp18
-rw-r--r--VC++Files/my_print_defaults/my_print_defaults.dsp25
-rwxr-xr-xVC++Files/myisam_ftdump/myisam_ftdump.dsp4
-rw-r--r--VC++Files/myisampack/myisampack.dsp18
-rw-r--r--acinclude.m41
-rw-r--r--innobase/Makefile.am2
-rw-r--r--innobase/btr/btr0sea.c69
-rw-r--r--innobase/buf/buf0buf.c15
-rw-r--r--innobase/com/com0shm.c41
-rw-r--r--innobase/data/data0data.c413
-rw-r--r--innobase/dict/dict0crea.c81
-rw-r--r--innobase/fsp/fsp0fsp.c14
-rw-r--r--innobase/ha/ha0ha.c27
-rw-r--r--innobase/include/btr0cur.h11
-rw-r--r--innobase/include/btr0sea.h35
-rw-r--r--innobase/include/buf0buf.ic5
-rw-r--r--innobase/include/data0data.h78
-rw-r--r--innobase/include/dict0crea.h9
-rw-r--r--innobase/include/dict0dict.h7
-rw-r--r--innobase/include/ibuf0ibuf.h9
-rw-r--r--innobase/include/lock0lock.h8
-rw-r--r--innobase/include/mem0dbg.h18
-rw-r--r--innobase/include/mem0mem.ic20
-rw-r--r--innobase/include/mtr0log.h9
-rw-r--r--innobase/include/mtr0mtr.h10
-rw-r--r--innobase/include/os0proc.h31
-rw-r--r--innobase/include/os0thread.h7
-rw-r--r--innobase/include/rem0cmp.ic18
-rw-r--r--innobase/include/row0row.h25
-rw-r--r--innobase/include/srv0srv.h25
-rw-r--r--innobase/include/sync0sync.h9
-rw-r--r--innobase/lock/lock0lock.c183
-rw-r--r--innobase/log/log0recv.c10
-rw-r--r--innobase/mem/mem0dbg.c145
-rw-r--r--innobase/mtr/mtr0mtr.c2
-rw-r--r--innobase/odbc/Makefile.am24
-rw-r--r--innobase/odbc/makefilewin7
-rw-r--r--innobase/odbc/odbc0dummy.c62
-rw-r--r--innobase/odbc/odbc0odbc.c714
-rw-r--r--innobase/os/os0proc.c77
-rw-r--r--innobase/os/os0trash.c43
-rw-r--r--innobase/page/page0page.c28
-rw-r--r--innobase/que/que0que.c147
-rw-r--r--innobase/rem/rem0cmp.c2
-rw-r--r--innobase/row/row0ins.c61
-rw-r--r--innobase/row/row0mysql.c6
-rw-r--r--innobase/row/row0row.c55
-rw-r--r--innobase/srv/srv0srv.c259
-rw-r--r--innobase/srv/srv0start.c74
-rw-r--r--innobase/sync/sync0sync.c40
-rw-r--r--innobase/trx/trx0rec.c41
-rw-r--r--innobase/trx/trx0trx.c23
-rw-r--r--innobase/ut/ut0dbg.c1
-rw-r--r--innobase/ut/ut0mem.c2
-rw-r--r--myisam/myisam_ftdump.c30
-rw-r--r--mysql-test/r/multi_update.result13
-rw-r--r--mysql-test/t/multi_update.test14
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/make_win_binary_distribution.sh178
-rw-r--r--scripts/mysql_config.sh13
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_yacc.yy1
67 files changed, 392 insertions, 3001 deletions
diff --git a/.bzrignore b/.bzrignore
index 0b5bb0bc33e..fbc25f32f7a 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -522,6 +522,7 @@ scripts/fill_help_tables
scripts/fill_help_tables.sql
scripts/make_binary_distribution
scripts/make_sharedlib_distribution
+scripts/make_win_binary_distribution
scripts/make_win_src_distribution
scripts/msql2mysql
scripts/mysql_config
diff --git a/Build-tools/Do-win-build b/Build-tools/Do-win-build
index 0885507588c..a78b091a737 100755
--- a/Build-tools/Do-win-build
+++ b/Build-tools/Do-win-build
@@ -3,12 +3,13 @@
use Getopt::Long;
$opt_help=0;
-$opt_tarball=$opt_builddir="";
+$opt_tarball=$opt_builddir=$opt_suffix="";
GetOptions(
"help",
- "tarball=s",
- "builddir=s",
+ "tarball=s",
+ "builddir=s",
+ "suffix=s"
) || print_help();
print_help() if ($opt_help);
@@ -28,27 +29,54 @@ $scriptdir = `pwd`;
mkdir($opt_builddir);
# Clean out any previous build
system("rm -rf $basedir");
-mkdir($basedir);
-mkdir("$basedir/tarball");
-system("cp $opt_tarball $basedir/tarball");
+# Unpack in the script directory
+system("tar -zxvf $opt_tarball");
+# Move to the build directory
+system("mv $mysqlver $opt_builddir");
if (!chdir($basedir))
{
- print "Do-win-build error: Could not change to $opt_builddir";
+ print "Do-win-build error: Could not change to $basedir";
exit 1;
}
-mkdir("build");
-chdir("build");
+# Check whether this is a classic edition build
+if ($opt_suffix =~ /-classic/)
+{
+ # Blank out ha_innodb.cpp
+ chmod 0644, 'sql/ha_innodb.cpp';
+ open(OUT, '>', 'sql/ha_innodb.cpp');
+ close(OUT);
+
+ # Remove HAVE_INNOBASE_DB from the requisite project files
+ for $dspfile ('libmysqld/libmysqld.dsp', 'mysqldemb/mysqldemb.dsp', 'mysqlserver/mysqlserver.dsp', 'sql/mysqld.dsp', 'sql/mysqldmax.dsp')
+ {
+ open(IN, '<', $dspfile);
+ open(OUT, '>', "$dspfile.tmp");
+ while (readline IN)
+ {
+ s/\D \"HAVE_INNOBASE_DB\" //g;
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+ unlink $dspfile;
+ rename "$dspfile.tmp", $dspfile;
+ }
+}
-system("tar -zxvf ../tarball/$mysqlver-win-src.tar.gz");
+# Perform compilation
+system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
-chdir($mysqlver);
+# Package binary
+system("./scripts/make_win_binary_distribution --suffix=$opt_suffix");
-system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
+# Copy log back to script directory
+system("cp $mysqlver$suffix-build.log $scriptdir");
-system("cp $mysqlver-build.log $scriptdir");
+# Move binary package to script directory
+system("mv *.zip $scriptdir");
#
# Print a help text message
@@ -62,7 +90,11 @@ Unpacks a Windows source distribution on the local machine and
compiles it using VC++ 6.0.
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, as well as the following:
+
+sed
+tar (GNU tar)
+which
Options:
@@ -76,6 +108,13 @@ be moved to <builddir>/mysql-<version>/tarball and extracted under
<builddir>/mysql-<version>/build.
Default: /cygdrive/c/mysql-win-build
+--suffix=<suffix>
+If specified, the resulting binary will have the specified suffix
+in its name. If the suffix is "-classic", the project files will
+be stripped of all occurrences of HAVE_INNOBASE_DB and
+ha_innodb.cpp will be blanked out, to create classic edition
+server binaries.
+
--tarball=<file>
Windows source tarball to use for this build. Must be of the form
mysql[com]-x.x.x-win-src.tar.gz (REQUIRED)
diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old
diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old
diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old
diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp
index d9fc740ced8..e28855aed41 100644
--- a/VC++Files/comp_err/comp_err.dsp
+++ b/VC++Files/comp_err/comp_err.dsp
@@ -7,24 +7,24 @@
CFG=comp_err - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "comp_err.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -45,9 +45,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+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 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 ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"Release/comp-err.exe"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe"
# Begin Target
# Name "comp_err - Win32 Release"
diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp
index 25f5332eb0f..80178116930 100644
--- a/VC++Files/my_print_defaults/my_print_defaults.dsp
+++ b/VC++Files/my_print_defaults/my_print_defaults.dsp
@@ -7,25 +7,25 @@
CFG=my_print_defaults - 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
!MESSAGE NMAKE /f "my_print_defaults.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "my_print_defaults - Win32 Release"
@@ -39,6 +39,7 @@ RSC=rc.exe
# 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 /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -47,9 +48,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe"
!ELSEIF "$(CFG)" == "my_print_defaults - Win32 Debug"
@@ -71,11 +72,11 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+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 gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /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 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /out:"../client_debug/my_print_defaults.exe" /pdbtype:sept
-!ENDIF
+!ENDIF
# Begin Target
diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.dsp b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
index 52dc6a4e273..71701f3c656 100755
--- a/VC++Files/myisam_ftdump/myisam_ftdump.dsp
+++ b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
# 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
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe"
!ELSEIF "$(CFG)" == "myisam_ftdump - Win32 Debug"
@@ -75,7 +75,7 @@ BSC32=bscmake.exe
# 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
+# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept
!ENDIF
diff --git a/VC++Files/myisampack/myisampack.dsp b/VC++Files/myisampack/myisampack.dsp
index d4d05ec4591..3331b6e17f8 100644
--- a/VC++Files/myisampack/myisampack.dsp
+++ b/VC++Files/myisampack/myisampack.dsp
@@ -7,19 +7,19 @@
CFG=myisampack - 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
!MESSAGE NMAKE /f "myisampack.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "myisampack.mak" CFG="myisampack - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "myisampack - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisampack - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -51,7 +51,7 @@ 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 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
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe"
!ELSEIF "$(CFG)" == "myisampack - Win32 Debug"
@@ -76,9 +76,9 @@ 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 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
+# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisampack.exe" /pdbtype:sept
-!ENDIF
+!ENDIF
# Begin Target
diff --git a/acinclude.m4 b/acinclude.m4
index d3a404e5fb0..1fc357ff7c6 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1252,7 +1252,6 @@ dnl Some libs are listed several times, in order for gcc to sort out
dnl circular references.
innodb_libs="\
\$(top_builddir)/innobase/usr/libusr.a\
- \$(top_builddir)/innobase/odbc/libodbc.a\
\$(top_builddir)/innobase/srv/libsrv.a\
\$(top_builddir)/innobase/dict/libdict.a\
\$(top_builddir)/innobase/que/libque.a\
diff --git a/innobase/Makefile.am b/innobase/Makefile.am
index cc4ce312d8d..17d7130f3e0 100644
--- a/innobase/Makefile.am
+++ b/innobase/Makefile.am
@@ -23,7 +23,7 @@ TAR = gtar
noinst_HEADERS = ib_config.h
SUBDIRS = os ut btr buf com data dict dyn eval fil fsp fut \
- ha ibuf include lock log mach mem mtr odbc page \
+ ha ibuf include lock log mach mem mtr page \
pars que read rem row srv sync thr trx usr
# Don't update the files from bitkeeper
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index 207ebcfb641..8a59be12a32 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -1500,75 +1500,6 @@ function_exit:
}
/************************************************************************
-Prints info of the search system. */
-
-void
-btr_search_print_info(void)
-/*=======================*/
-{
- printf("SEARCH SYSTEM INFO\n");
-
- rw_lock_x_lock(&btr_search_latch);
-
-/* ha_print_info(btr_search_sys->hash_index); */
-
- rw_lock_x_unlock(&btr_search_latch);
-}
-
-/************************************************************************
-Prints info of searches on an index. */
-
-void
-btr_search_index_print_info(
-/*========================*/
- dict_index_t* index) /* in: index */
-{
- btr_search_t* info;
-
- printf("INDEX SEARCH INFO\n");
-
- rw_lock_x_lock(&btr_search_latch);
-
- info = btr_search_get_info(index);
-
- printf("Searches %lu, hash succ %lu, fail %lu, patt succ %lu\n",
- (ulong) info->n_searches, (ulong) info->n_hash_succ,
- (ulong) info->n_hash_fail, (ulong) info->n_patt_succ);
-
- printf("Total of page cur short succ for all indexes %lu\n",
- (ulong) page_cur_short_succ);
- rw_lock_x_unlock(&btr_search_latch);
-}
-
-/************************************************************************
-Prints info of searches on a table. */
-
-void
-btr_search_table_print_info(
-/*========================*/
- char* name) /* in: table name */
-{
- dict_table_t* table;
- dict_index_t* index;
-
- mutex_enter(&(dict_sys->mutex));
-
- table = dict_table_get_low(name);
-
- ut_a(table);
-
- mutex_exit(&(dict_sys->mutex));
-
- index = dict_table_get_first_index(table);
-
- while (index) {
- btr_search_index_print_info(index);
-
- index = dict_table_get_next_index(index);
- }
-}
-
-/************************************************************************
Validates the search system. */
ibool
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index c60132896ef..2af971d38fd 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -1813,21 +1813,6 @@ buf_page_io_complete(
"InnoDB: Error: page n:o stored in the page read in is %lu, should be %lu!\n",
(ulong) read_page_no, (ulong) block->offset);
}
-#ifdef notdefined
- if (block->offset != 0 && read_page_no == 0) {
- /* Check that the page is really uninited */
-
- for (i = 0; i < UNIV_PAGE_SIZE; i++) {
-
- if (*((block->frame) + i) != '\0') {
- fprintf(stderr,
-"InnoDB: Error: page n:o in the page read in is 0, but page %lu is inited!\n",
- block->offset);
- break;
- }
- }
- }
-#endif
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
diff --git a/innobase/com/com0shm.c b/innobase/com/com0shm.c
index 834ba3a5220..09876e6e8b5 100644
--- a/innobase/com/com0shm.c
+++ b/innobase/com/com0shm.c
@@ -964,19 +964,6 @@ loop:
ut_ad(loop_count < 2);
-#ifdef notdefined
- if (!com_shm_get_not_empty(map)) {
-
- /* There was no datagram, give up the time slice
- for some writer thread to insert a datagram */
-
- com_shm_exit(ep);
-
- os_thread_yield();
-
- com_shm_enter(ep);
- }
-#endif
com_shm_enter(ep);
if (!com_shm_get_not_empty(map)) {
@@ -1131,33 +1118,13 @@ loop:
ut_memcpy(com_shm_get_addr(map), com_shm_endpoint_get_addr(ep),
sender_len);
com_shm_set_not_empty(map, TRUE);
-#ifdef notdefined
- com_shm_exit(ep2);
-
- /* Now we give up our time slice voluntarily to give some reader
- thread chance to fetch the datagram */
-
- os_thread_yield();
-
- com_shm_enter(ep2);
-
- if (com_shm_get_not_empty(map)) {
-#endif
- com_shm_system_call_count++;
-
- com_shm_exit(ep2);
-
- /* Signal the event */
+ com_shm_system_call_count++;
- os_event_set(com_shm_endpoint_get_not_empty(ep2));
+ com_shm_exit(ep2);
- return(0);
+ /* Signal the event */
-#ifdef notdefined
- }
+ os_event_set(com_shm_endpoint_get_not_empty(ep2));
- com_shm_exit(ep2);
-
return(0);
-#endif
}
diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c
index 78cee31a29d..9df933c0ac6 100644
--- a/innobase/data/data0data.c
+++ b/innobase/data/data0data.c
@@ -727,416 +727,3 @@ dtuple_big_rec_free(
{
mem_heap_free(vector->heap);
}
-
-#ifdef notdefined
-
-/******************************************************************
-Generates random numbers, where 10/16 is uniformly
-distributed between 0 and n1, 5/16 between 0 and n2,
-and 1/16 between 0 and n3. */
-static
-ulint
-dtuple_gen_rnd_ulint(
-/*=================*/
- /* out: random ulint */
- ulint n1,
- ulint n2,
- ulint n3)
-{
- ulint m;
- ulint n;
-
- m = ut_rnd_gen_ulint() % 16;
-
- if (m < 10) {
- n = n1;
- } else if (m < 15) {
- n = n2;
- } else {
- n = n3;
- }
-
- m = ut_rnd_gen_ulint();
-
- return(m % n);
-}
-
-/***************************************************************
-Generates a random tuple. */
-
-dtuple_t*
-dtuple_gen_rnd_tuple(
-/*=================*/
- /* out: pointer to the tuple */
- mem_heap_t* heap) /* in: memory heap where generated */
-{
- ulint n_fields;
- dfield_t* field;
- ulint len;
- dtuple_t* tuple;
- ulint i;
- ulint j;
- byte* ptr;
-
- n_fields = dtuple_gen_rnd_ulint(5, 30, 300) + 1;
-
- tuple = dtuple_create(heap, n_fields);
-
- for (i = 0; i < n_fields; i++) {
-
- if (n_fields < 7) {
- len = dtuple_gen_rnd_ulint(5, 30, 400);
- } else {
- len = dtuple_gen_rnd_ulint(7, 5, 17);
- }
-
- field = dtuple_get_nth_field(tuple, i);
-
- if (len == 0) {
- dfield_set_data(field, NULL, UNIV_SQL_NULL);
- } else {
- ptr = mem_heap_alloc(heap, len);
- dfield_set_data(field, ptr, len - 1);
-
- for (j = 0; j < len; j++) {
- *ptr = (byte)(65 +
- dtuple_gen_rnd_ulint(22, 22, 22));
- ptr++;
- }
- }
-
- dtype_set(dfield_get_type(field), DATA_VARCHAR,
- DATA_ENGLISH, 500, 0);
- }
-
- ut_a(dtuple_validate(tuple));
-
- return(tuple);
-}
-
-/*******************************************************************
-Generates a test tuple for sort and comparison tests. */
-
-void
-dtuple_gen_test_tuple(
-/*==================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i) /* in: a number < 512 */
-{
- ulint j;
- dfield_t* field;
- void* data = NULL;
- ulint len = 0;
-
- for (j = 0; j < 3; j++) {
- switch (i % 8) {
- case 0:
- data = ""; len = 0; break;
- case 1:
- data = "A"; len = 1; break;
- case 2:
- data = "AA"; len = 2; break;
- case 3:
- data = "AB"; len = 2; break;
- case 4:
- data = "B"; len = 1; break;
- case 5:
- data = "BA"; len = 2; break;
- case 6:
- data = "BB"; len = 2; break;
- case 7:
- len = UNIV_SQL_NULL; break;
- }
-
- field = dtuple_get_nth_field(tuple, 2 - j);
-
- dfield_set_data(field, data, len);
- dtype_set(dfield_get_type(field), DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
-
- i = i / 8;
- }
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_test_tuple3(
-/*===================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 1000000 */
- ulint type, /* in: DTUPLE_TEST_FIXED30, ... */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint third_size;
-
- ut_ad(tuple && buf);
- ut_ad(i < 1000000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000000");
-
- buf[1] = (byte)('0' + (i / 100000) % 10);
- buf[2] = (byte)('0' + (i / 10000) % 10);
- buf[3] = (byte)('0' + (i / 1000) % 10);
- buf[4] = (byte)('0' + (i / 100) % 10);
- buf[5] = (byte)('0' + (i / 10) % 10);
- buf[6] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- i = i % 1000; /* ut_rnd_gen_ulint() % 1000000; */
-
- ut_strcpy((char*)buf + 8, "0000000");
-
- buf[9] = (byte)('0' + (i / 100000) % 10);
- buf[10] = (byte)('0' + (i / 10000) % 10);
- buf[11] = (byte)('0' + (i / 1000) % 10);
- buf[12] = (byte)('0' + (i / 100) % 10);
- buf[13] = (byte)('0' + (i / 10) % 10);
- buf[14] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf + 8, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 2);
-
- data_rnd += 8757651;
-
- if (type == DTUPLE_TEST_FIXED30) {
- third_size = 30;
- } else if (type == DTUPLE_TEST_RND30) {
- third_size = data_rnd % 30;
- } else if (type == DTUPLE_TEST_RND3500) {
- third_size = data_rnd % 3500;
- } else if (type == DTUPLE_TEST_FIXED2000) {
- third_size = 2000;
- } else if (type == DTUPLE_TEST_FIXED3) {
- third_size = 3;
- } else {
- ut_error;
- }
-
- if (type == DTUPLE_TEST_FIXED30) {
- dfield_set_data(field,
- "12345678901234567890123456789", third_size);
- } else {
- dfield_set_data(field, data_buf, third_size);
- }
-
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple3(
-/*=====================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 or 2 fields */
- ulint i, /* in: a number < 1000000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 1000000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000000");
-
- buf[1] = (byte)('0' + (i / 100000) % 10);
- buf[2] = (byte)('0' + (i / 10000) % 10);
- buf[3] = (byte)('0' + (i / 1000) % 10);
- buf[4] = (byte)('0' + (i / 100) % 10);
- buf[5] = (byte)('0' + (i / 10) % 10);
- buf[6] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- if (dtuple_get_n_fields(tuple) == 1) {
-
- return;
- }
-
- field = dtuple_get_nth_field(tuple, 1);
-
- i = (i * 1000) % 1000000;
-
- ut_strcpy((char*)buf + 8, "0000000");
-
- buf[9] = (byte)('0' + (i / 100000) % 10);
- buf[10] = (byte)('0' + (i / 10000) % 10);
- buf[11] = (byte)('0' + (i / 1000) % 10);
- buf[12] = (byte)('0' + (i / 100) % 10);
- buf[13] = (byte)('0' + (i / 10) % 10);
- buf[14] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf + 8, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for TPC-A speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_A(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 10000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint third_size;
-
- ut_ad(tuple && buf);
- ut_ad(i < 10000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000");
-
- buf[0] = (byte)('0' + (i / 1000) % 10);
- buf[1] = (byte)('0' + (i / 100) % 10);
- buf[2] = (byte)('0' + (i / 10) % 10);
- buf[3] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- dfield_set_data(field, buf + 8, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 2);
-
- third_size = 90;
-
- dfield_set_data(field, data_buf, third_size);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_A(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 10000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 10000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000");
-
- buf[0] = (byte)('0' + (i / 1000) % 10);
- buf[1] = (byte)('0' + (i / 100) % 10);
- buf[2] = (byte)('0' + (i / 10) % 10);
- buf[3] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for TPC-C speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_C(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 12 fields */
- ulint i, /* in: a number < 100000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint size;
- ulint j;
-
- ut_ad(tuple && buf);
- ut_ad(i < 100000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- buf[0] = (byte)('0' + (i / 10000) % 10);
- buf[1] = (byte)('0' + (i / 1000) % 10);
- buf[2] = (byte)('0' + (i / 100) % 10);
- buf[3] = (byte)('0' + (i / 10) % 10);
- buf[4] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- for (j = 0; j < 10; j++) {
-
- field = dtuple_get_nth_field(tuple, 2 + j);
-
- size = 24;
-
- dfield_set_data(field, data_buf, size);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH,
- 100, 0);
- }
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_C(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 100000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 100000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- buf[0] = (byte)('0' + (i / 10000) % 10);
- buf[1] = (byte)('0' + (i / 1000) % 10);
- buf[2] = (byte)('0' + (i / 100) % 10);
- buf[3] = (byte)('0' + (i / 10) % 10);
- buf[4] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-#endif /* notdefined */
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index 5fc2f26fc31..ec54bb2d712 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -25,6 +25,11 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
+/* Maximum lengths of identifiers in MySQL, in bytes */
+#define MAX_TABLE_NAME_LEN 64
+#define MAX_COLUMN_NAME_LEN 64
+#define MAX_IDENTIFIER_LEN 255
+
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_TABLES system table. */
@@ -344,33 +349,6 @@ dict_build_col_def_step(
return(DB_SUCCESS);
}
-#ifdef notdefined
-/*************************************************************************
-Creates the single index for a cluster: it contains all the columns of
-the cluster definition in the order they were defined. */
-static
-void
-dict_create_index_for_cluster_step(
-/*===============================*/
- tab_node_t* node) /* in: table create node */
-{
- dict_index_t* index;
- ulint i;
- dict_col_t* col;
-
- index = dict_mem_index_create(table->name, "IND_DEFAULT_CLUSTERED",
- table->space, DICT_CLUSTERED,
- table->n_cols);
-
- for (i = 0; i < table->n_cols; i++) {
- col = dict_table_get_nth_col(table, i);
- dict_mem_index_add_field(index, col->name, 0, 0);
- }
-
- (node->cluster)->index = index;
-}
-#endif
-
/*********************************************************************
Based on an index object, this function builds the entry to be inserted
in the SYS_INDEXES system table. */
@@ -766,26 +744,6 @@ dict_drop_index_tree(
page_rec_write_index_page_no(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
FIL_NULL, mtr);
}
-
-#ifdef notdefined
-/*************************************************************************
-Creates the default clustered index for a table: the records are ordered
-by row id. */
-
-void
-dict_create_default_index(
-/*======================*/
- dict_table_t* table, /* in: table */
- trx_t* trx) /* in: transaction handle */
-{
- dict_index_t* index;
-
- index = dict_mem_index_create(table->name, "IND_DEFAULT_CLUSTERED",
- table->space, DICT_CLUSTERED, 0);
-
- dict_create_index(index, trx);
-}
-#endif
/*************************************************************************
Creates a table create graph. */
@@ -1237,6 +1195,7 @@ dict_create_add_foreigns_to_dictionary(
que_t* graph;
ulint number = start_id + 1;
ulint len;
+ ulint namelen;
ulint error;
char* ebuf = dict_foreign_err_buf;
ulint i;
@@ -1267,15 +1226,21 @@ loop:
"PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n"
"BEGIN\n");
+ namelen = strlen(table->name);
+ ut_a(namelen < MAX_TABLE_NAME_LEN);
+
if (foreign->id == NULL) {
/* Generate a new constraint id */
- foreign->id = mem_heap_alloc(foreign->heap,
- ut_strlen(table->name)
- + 20);
+ foreign->id = mem_heap_alloc(foreign->heap, namelen + 20);
+ /* no overflow if number < 1e13 */
sprintf(foreign->id, "%s_ibfk_%lu", table->name, (ulong) number);
number++;
}
+ ut_a(strlen(foreign->id) < MAX_IDENTIFIER_LEN);
+ ut_a(len < (sizeof buf)
+ - 46 - 2 * MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 20);
+
len += sprintf(buf + len,
"INSERT INTO SYS_FOREIGN VALUES('%s', '%s', '%s', %lu);\n",
foreign->id,
@@ -1285,6 +1250,9 @@ loop:
+ (foreign->type << 24)));
for (i = 0; i < foreign->n_fields; i++) {
+ ut_a(len < (sizeof buf)
+ - 51 - 2 * MAX_COLUMN_NAME_LEN
+ - MAX_IDENTIFIER_LEN - 20);
len += sprintf(buf + len,
"INSERT INTO SYS_FOREIGN_COLS VALUES('%s', %lu, '%s', '%s');\n",
@@ -1294,6 +1262,7 @@ loop:
foreign->referenced_col_names[i]);
}
+ ut_a(len < (sizeof buf) - 19)
len += sprintf(buf + len,"COMMIT WORK;\nEND;\n");
graph = pars_sql(buf);
@@ -1316,14 +1285,14 @@ loop:
if (error == DB_DUPLICATE_KEY) {
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(ebuf);
+ ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
+ - MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 201);
sprintf(ebuf + strlen(ebuf),
-" Error in foreign key constraint creation for table %.500s.\n"
-"A foreign key constraint of name %.500s\n"
+" Error in foreign key constraint creation for table %s.\n"
+"A foreign key constraint of name %s\n"
"already exists (note that internally InnoDB adds 'databasename/'\n"
"in front of the user-defined constraint name).\n", table->name, foreign->id);
- ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN);
-
mutex_exit(&dict_foreign_err_mutex);
return(error);
@@ -1336,8 +1305,10 @@ loop:
mutex_enter(&dict_foreign_err_mutex);
ut_sprintf_timestamp(ebuf);
+ ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
+ - MAX_TABLE_NAME_LEN - 124);
sprintf(ebuf + strlen(ebuf),
-" Internal error in foreign key constraint creation for table %.500s.\n"
+" Internal error in foreign key constraint creation for table %s.\n"
"See the MySQL .err log in the datadir for more information.\n", table->name);
mutex_exit(&dict_foreign_err_mutex);
diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c
index 9d76387c6cb..0781da3e223 100644
--- a/innobase/fsp/fsp0fsp.c
+++ b/innobase/fsp/fsp0fsp.c
@@ -790,19 +790,12 @@ fsp_init_file_page_low(
byte* ptr) /* in: pointer to a page */
{
page_t* page;
-#ifdef UNIV_BASIC_LOG_DEBUG
- ulint i;
-#endif
page = buf_frame_align(ptr);
buf_block_align(page)->check_index_page_at_flush = FALSE;
-
-#ifdef UNIV_BASIC_LOG_DEBUG
-/* printf("In log debug version: Erase the contents of the file page\n");
-*/
- for (i = 0; i < UNIV_PAGE_SIZE; i++) {
- page[i] = (byte)0xFF;
- }
+
+#ifdef UNIV_BASIC_LOG_DEBUG
+ memset(page, 0xff, UNIV_PAGE_SIZE);
#endif
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
ut_dulint_zero);
@@ -812,6 +805,7 @@ fsp_init_file_page_low(
/***************************************************************
Inits a file page whose prior contents should be ignored. */
+static
void
fsp_init_file_page(
/*===============*/
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c
index 3f36879e80b..32d50b5546e 100644
--- a/innobase/ha/ha0ha.c
+++ b/innobase/ha/ha0ha.c
@@ -66,33 +66,6 @@ ha_create(
}
/*****************************************************************
-Checks that a hash table node is in the chain. */
-
-ibool
-ha_node_in_chain(
-/*=============*/
- /* out: TRUE if in chain */
- hash_cell_t* cell, /* in: hash table cell */
- ha_node_t* node) /* in: external chain node */
-{
- ha_node_t* node2;
-
- node2 = cell->node;
-
- while (node2 != NULL) {
-
- if (node2 == node) {
-
- return(TRUE);
- }
-
- node2 = node2->next;
- }
-
- return(FALSE);
-}
-
-/*****************************************************************
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
is inserted. */
diff --git a/innobase/include/btr0cur.h b/innobase/include/btr0cur.h
index 31aecef8104..221f479df40 100644
--- a/innobase/include/btr0cur.h
+++ b/innobase/include/btr0cur.h
@@ -365,17 +365,6 @@ btr_cur_parse_update_in_place(
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
page_t* page); /* in: page or NULL */
-/***************************************************************
-Parses a redo log record of updating a record, but not in-place. */
-
-byte*
-btr_cur_parse_opt_update(
-/*=====================*/
- /* out: end of log record or NULL */
- byte* ptr, /* in: buffer */
- byte* end_ptr,/* in: buffer end */
- page_t* page, /* in: page or NULL */
- mtr_t* mtr); /* in: mtr or NULL */
/********************************************************************
Parses the redo log record for delete marking or unmarking of a clustered
index record. */
diff --git a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h
index ee762a12221..68396d47193 100644
--- a/innobase/include/btr0sea.h
+++ b/innobase/include/btr0sea.h
@@ -49,21 +49,6 @@ btr_search_info_update(
dict_index_t* index, /* in: index of the cursor */
btr_cur_t* cursor);/* in: cursor which was just positioned */
/**********************************************************************
-Tries to guess the right search position based on the search pattern info
-of the index. */
-
-ibool
-btr_search_guess_on_pattern(
-/*========================*/
- /* out: TRUE if succeeded */
- dict_index_t* index, /* in: index */
- btr_search_t* info, /* in: index search info */
- dtuple_t* tuple, /* in: logical record */
- ulint mode, /* in: PAGE_CUR_L, ... */
- ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
- btr_cur_t* cursor, /* out: tree cursor */
- mtr_t* mtr); /* in: mtr */
-/**********************************************************************
Tries to guess the right search position based on the hash search info
of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts,
and the function returns TRUE, then cursor->up_match and cursor->low_match
@@ -140,26 +125,6 @@ btr_search_update_hash_on_delete(
record to delete using btr_cur_search_...,
the record is not yet deleted */
/************************************************************************
-Prints info of the search system. */
-
-void
-btr_search_print_info(void);
-/*=======================*/
-/************************************************************************
-Prints info of searches on an index. */
-
-void
-btr_search_index_print_info(
-/*========================*/
- dict_index_t* index); /* in: index */
-/************************************************************************
-Prints info of searches on a table. */
-
-void
-btr_search_table_print_info(
-/*========================*/
- char* name); /* in: table name */
-/************************************************************************
Validates the search system. */
ibool
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index eb22bae7ff0..0df8570e4e2 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -496,6 +496,7 @@ buf_frame_get_modify_clock(
return(block->modify_clock);
}
+#ifdef UNIV_SYNC_DEBUG
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
@@ -515,7 +516,7 @@ buf_block_buf_fix_inc_debug(
#endif
block->buf_fix_count++;
}
-
+#else /* UNIV_SYNC_DEBUG */
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
@@ -526,7 +527,7 @@ buf_block_buf_fix_inc(
{
block->buf_fix_count++;
}
-
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Returns the control block of a file page, NULL if not found. */
UNIV_INLINE
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h
index 2ec94a9517a..2501d2b809f 100644
--- a/innobase/include/data0data.h
+++ b/innobase/include/data0data.h
@@ -375,84 +375,6 @@ dtuple_big_rec_free(
/*================*/
big_rec_t* vector); /* in, own: big rec vector; it is
freed in this function */
-/***************************************************************
-Generates a random tuple. */
-
-dtuple_t*
-dtuple_gen_rnd_tuple(
-/*=================*/
- /* out: pointer to the tuple */
- mem_heap_t* heap); /* in: memory heap where generated */
-/*******************************************************************
-Generates a test tuple for sort and comparison tests. */
-
-void
-dtuple_gen_test_tuple(
-/*==================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i); /* in: a number, 0 <= i < 512 */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_test_tuple3(
-/*===================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i, /* in: a number < 1000000 */
- ulint type, /* in: DTUPLE_TEST_FIXED30, ... */
- byte* buf); /* in: a buffer of size >= 8 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple3(
-/*=====================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 or 2 fields */
- ulint i, /* in: a number < 1000000 */
- byte* buf); /* in: a buffer of size >= 8 bytes */
-/*******************************************************************
-Generates a test tuple for TPC-A speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_A(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 10000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_A(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 10000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for TPC-C speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_C(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 12 fields */
- ulint i, /* in: a number < 100000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_C(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 100000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-
-/* Types of the third field in dtuple_gen_test_tuple3 */
-#define DTUPLE_TEST_FIXED30 1
-#define DTUPLE_TEST_RND30 2
-#define DTUPLE_TEST_RND3500 3
-#define DTUPLE_TEST_FIXED2000 4
-#define DTUPLE_TEST_FIXED3 5
/*######################################################################*/
diff --git a/innobase/include/dict0crea.h b/innobase/include/dict0crea.h
index b2c3ad7ca96..8b6944fc605 100644
--- a/innobase/include/dict0crea.h
+++ b/innobase/include/dict0crea.h
@@ -17,15 +17,6 @@ Created 1/8/1996 Heikki Tuuri
#include "mtr0mtr.h"
/*************************************************************************
-Creates the default clustered index for a table: the records are ordered
-by row id. */
-
-void
-dict_create_default_index(
-/*======================*/
- dict_table_t* table, /* in: table */
- trx_t* trx); /* in: transaction handle */
-/*************************************************************************
Creates a table create graph. */
tab_node_t*
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index 07184d8e28d..534c9e380b8 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -677,13 +677,6 @@ dict_index_get_tree(
/* out: index tree */
dict_index_t* index); /* in: index */
/*************************************************************************
-Gets the column data type. */
-UNIV_INLINE
-dtype_t*
-dict_col_get_type(
-/*==============*/
- dict_col_t* col);
-/*************************************************************************
Gets the field order criterion. */
UNIV_INLINE
ulint
diff --git a/innobase/include/ibuf0ibuf.h b/innobase/include/ibuf0ibuf.h
index bf03b06bd28..8ef67df26f8 100644
--- a/innobase/include/ibuf0ibuf.h
+++ b/innobase/include/ibuf0ibuf.h
@@ -177,15 +177,6 @@ ibuf_page_low(
mtr_t* mtr); /* in: mtr which will contain an x-latch to the
bitmap page if the page is not one of the fixed
address ibuf pages */
-/*************************************************************************
-Checks if an index page has so much free space that the free bit should
-be set TRUE in the ibuf bitmap. */
-
-ibool
-ibuf_index_page_has_free(
-/*=====================*/
- /* out: TRUE if there is enough free space */
- page_t* page); /* in: non-unique secondary index page */
/***************************************************************************
Frees excess pages from the ibuf free list. This function is called when an OS
thread calls fsp services to allocate a new file segment, or a new page to a
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 49f4597b30c..103d28cd130 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -442,14 +442,6 @@ lock_rec_hash(
ulint space, /* in: space */
ulint page_no);/* in: page number */
/*************************************************************************
-Gets the mutex protecting record locks on a given page address. */
-
-mutex_t*
-lock_rec_get_mutex_for_addr(
-/*========================*/
- ulint space, /* in: space id */
- ulint page_no);/* in: page number */
-/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool
diff --git a/innobase/include/mem0dbg.h b/innobase/include/mem0dbg.h
index 0b1aa53d694..6c92d669be3 100644
--- a/innobase/include/mem0dbg.h
+++ b/innobase/include/mem0dbg.h
@@ -60,6 +60,7 @@ mem_heap_validate_or_print(
ulint* n_blocks); /* out: number of blocks in the heap,
if a NULL pointer is passed as this
argument, it is ignored */
+#ifdef UNIV_MEM_DEBUG
/******************************************************************
Prints the contents of a memory heap. */
@@ -67,6 +68,7 @@ void
mem_heap_print(
/*===========*/
mem_heap_t* heap); /* in: memory heap */
+#endif /* UNIV_MEM_DEBUG */
/******************************************************************
Checks that an object is a memory heap (or a block of it) */
@@ -83,20 +85,7 @@ mem_heap_validate(
/*==============*/
/* out: TRUE if ok */
mem_heap_t* heap); /* in: memory heap */
-/*********************************************************************
-Prints information of dynamic memory usage and currently live
-memory heaps or buffers. Can only be used in the debug version. */
-
-void
-mem_print_info(void);
-/*=================*/
-/*********************************************************************
-Prints information of dynamic memory usage and currently allocated memory
-heaps or buffers since the last ..._print_info or..._print_new_info. */
-
-void
-mem_print_new_info(void);
-/*====================*/
+#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */
@@ -118,6 +107,7 @@ ibool
mem_validate(void);
/*===============*/
/* out: TRUE if ok */
+#endif /* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
the neighborhood of a given pointer. */
diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
index e863fe41c4b..fb4cef49ec9 100644
--- a/innobase/include/mem0mem.ic
+++ b/innobase/include/mem0mem.ic
@@ -493,18 +493,6 @@ mem_alloc_func(
ulint line /* in: line where created */
)
{
-#ifdef notdefined
- void* buf;
-
- buf = mem_area_alloc(n, mem_comm_pool);
-
-#ifdef UNIV_SET_MEM_TO_ZERO
- memset(buf, '\0', n);
-#endif
- return(buf);
-
-#else
-
mem_heap_t* heap;
void* buf;
@@ -525,8 +513,6 @@ mem_alloc_func(
ut_a((byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
return(buf);
-
-#endif
}
/*******************************************************************
@@ -542,17 +528,11 @@ mem_free_func(
ulint line /* in: line where created */
)
{
-#ifdef notdefined
-
- mem_area_free(ptr, mem_comm_pool);
-
-#else
mem_heap_t* heap;
heap = (mem_heap_t*)((byte*)ptr - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
mem_heap_free_func(heap, file_name, line);
-#endif
}
/*********************************************************************
diff --git a/innobase/include/mtr0log.h b/innobase/include/mtr0log.h
index da942dd45d7..cc42924fe4d 100644
--- a/innobase/include/mtr0log.h
+++ b/innobase/include/mtr0log.h
@@ -133,15 +133,6 @@ mlog_write_initial_log_record_fast(
byte type, /* in: log item type: MLOG_1BYTE, ... */
byte* log_ptr,/* in: pointer to mtr log which has been opened */
mtr_t* mtr); /* in: mtr */
-/****************************************************************
-Writes the contents of a mini-transaction log, if any, to the database log. */
-
-dulint
-mlog_write(
-/*=======*/
- dyn_array_t* mlog, /* in: mlog */
- ibool* modifications); /* out: TRUE if there were
- log items to write */
/************************************************************
Parses an initial log record written by mlog_write_initial_log_record. */
diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h
index c47fb54a6f8..8408abf43e4 100644
--- a/innobase/include/mtr0mtr.h
+++ b/innobase/include/mtr0mtr.h
@@ -132,16 +132,6 @@ void
mtr_commit(
/*=======*/
mtr_t* mtr); /* in: mini-transaction */
-/****************************************************************
-Writes to the database log the full contents of the pages that this mtr is
-the first to modify in the buffer pool. This function is called when the
-database is in the online backup state. */
-
-void
-mtr_log_write_backup_entries(
-/*=========================*/
- mtr_t* mtr, /* in: mini-transaction */
- dulint backup_lsn); /* in: online backup lsn */
/**************************************************************
Sets and returns a savepoint in mtr. */
UNIV_INLINE
diff --git a/innobase/include/os0proc.h b/innobase/include/os0proc.h
index 664952bd166..d0d3cf82e38 100644
--- a/innobase/include/os0proc.h
+++ b/innobase/include/os0proc.h
@@ -102,37 +102,6 @@ os_mem_alloc_nocache(
/*=================*/
/* out: allocated memory */
ulint n); /* in: number of bytes */
-#ifdef notdefined
-/********************************************************************
-Creates a new process. */
-
-ibool
-os_process_create(
-/*==============*/
- char* name, /* in: name of the executable to start
- or its full path name */
- char* cmd, /* in: command line for the starting
- process, or NULL if no command line
- specified */
- os_process_t* proc, /* out: handle to the process */
- os_process_id_t* id); /* out: process id */
-/**************************************************************************
-Exits a process. */
-
-void
-os_process_exit(
-/*============*/
- ulint code); /* in: exit code */
-/**************************************************************************
-Gets process exit code. */
-
-ibool
-os_process_get_exit_code(
-/*=====================*/
- /* out: TRUE if succeed, FALSE if fail */
- os_process_t proc, /* in: handle to the process */
- ulint* code); /* out: exit code */
-#endif
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
diff --git a/innobase/include/os0thread.h b/innobase/include/os0thread.h
index 554ca0563e4..6603229e524 100644
--- a/innobase/include/os0thread.h
+++ b/innobase/include/os0thread.h
@@ -99,13 +99,6 @@ os_thread_t
os_thread_get_curr(void);
/*====================*/
/*********************************************************************
-Waits for a thread to terminate. */
-
-void
-os_thread_wait(
-/*===========*/
- os_thread_t thread); /* in: thread to wait */
-/*********************************************************************
Advises the os to give up remainder of the thread's time slice. */
void
diff --git a/innobase/include/rem0cmp.ic b/innobase/include/rem0cmp.ic
index ebf513f538c..75cb3ef04e8 100644
--- a/innobase/include/rem0cmp.ic
+++ b/innobase/include/rem0cmp.ic
@@ -9,24 +9,6 @@ Created 7/1/1994 Heikki Tuuri
/*****************************************************************
This function is used to compare two data fields for which we know the
data type. */
-
-int
-cmp_data_data_slow(
-/*===============*/
- /* out: 1, 0, -1, if data1 is greater, equal,
- less than data2, respectively */
- dtype_t* cur_type,/* in: data type of the fields */
- byte* data1, /* in: data field (== a pointer to a memory
- buffer) */
- ulint len1, /* in: data field length or UNIV_SQL_NULL */
- byte* data2, /* in: data field (== a pointer to a memory
- buffer) */
- ulint len2); /* in: data field length or UNIV_SQL_NULL */
-
-
-/*****************************************************************
-This function is used to compare two data fields for which we know the
-data type. */
UNIV_INLINE
int
cmp_data_data(
diff --git a/innobase/include/row0row.h b/innobase/include/row0row.h
index d1befbbbad3..3956f3c1692 100644
--- a/innobase/include/row0row.h
+++ b/innobase/include/row0row.h
@@ -68,16 +68,6 @@ row_build_index_entry(
dict_index_t* index, /* in: index on the table */
mem_heap_t* heap); /* in: memory heap from which the memory for
the index entry is allocated */
-/*********************************************************************
-Builds an index entry from a row. */
-
-void
-row_build_index_entry_to_tuple(
-/*===========================*/
- dtuple_t* entry, /* in/out: index entry; the dtuple must have
- enough fields for the index! */
- dtuple_t* row, /* in: row */
- dict_index_t* index); /* in: index on the table */
/***********************************************************************
An inverse function to dict_row_build_index_entry. Builds a row from a
record in a clustered index. */
@@ -103,21 +93,6 @@ row_build(
mem_heap_t* heap); /* in: memory heap from which the memory
needed is allocated */
/***********************************************************************
-An inverse function to dict_row_build_index_entry. Builds a row from a
-record in a clustered index. */
-
-void
-row_build_to_tuple(
-/*===============*/
- dtuple_t* row, /* in/out: row built; see the NOTE below! */
- dict_index_t* index, /* in: clustered index */
- rec_t* rec); /* in: record in the clustered index;
- NOTE: the data fields in the row will point
- directly into this record, therefore,
- the buffer page of this record must be
- at least s-latched and the latch held
- as long as the row dtuple is used! */
-/***********************************************************************
Converts an index record to a typed data tuple. */
dtuple_t*
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 6e47c468d26..23c30554f08 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -216,13 +216,7 @@ srv_boot(void);
/*==========*/
/* out: DB_SUCCESS or error code */
/*************************************************************************
-Initializes the server. */
-
-void
-srv_init(void);
-/*==========*/
-/*************************************************************************
-Frees the OS fast mutex created in srv_init(). */
+Frees the OS fast mutex created in srv_boot(). */
void
srv_free(void);
@@ -272,23 +266,6 @@ srv_master_thread(
/* out: a dummy parameter */
void* arg); /* in: a dummy parameter required by
os_thread_create */
-/*************************************************************************
-Reads a keyword and a value from a file. */
-
-ulint
-srv_read_init_val(
-/*==============*/
- /* out: DB_SUCCESS or error code */
- FILE* initfile, /* in: file pointer */
- char* keyword, /* in: keyword before value(s), or NULL if
- no keyword read */
- char* str_buf, /* in/out: buffer for a string value to read,
- buffer size must be 10000 bytes, if NULL
- then not read */
- ulint* num_val, /* out: numerical value to read, if NULL
- then not read */
- ibool print_not_err); /* in: if TRUE, then we will not print
- error messages to console */
/***********************************************************************
Tells the Innobase server that there has been activity in the database
and wakes up the master thread if it is suspended (not sleeping). Used
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 330b6b77b08..f83f8cbe712 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -234,15 +234,6 @@ mutex_get_waiters(
/*==============*/
/* out: value to set */
mutex_t* mutex); /* in: mutex */
-/**********************************************************************
-Implements the memory barrier operation which makes a serialization point to
-the instruction flow. This is needed because the Pentium may speculatively
-execute reads before preceding writes are committed. We could also use here
-any LOCKed instruction (see Intel Software Dev. Manual, Vol. 3). */
-
-void
-mutex_fence(void);
-/*=============*/
/*
LATCHING ORDER WITHIN THE DATABASE
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index deff4166ee4..4e6abf32c9e 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -343,179 +343,6 @@ lock_deadlock_recursive(
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
#define lock_mutex_exit_kernel() mutex_exit(&kernel_mutex)
-#ifdef notdefined
-/*************************************************************************
-Reserves the kernel mutex. This function is used in this module to allow
-monitoring the contention degree on the kernel mutex caused by the lock
-operations. */
-UNIV_INLINE
-void
-lock_mutex_enter_kernel(void)
-/*=========================*/
-{
- mutex_enter(&kernel_mutex);
-}
-
-/*************************************************************************
-Releases the kernel mutex. This function is used in this module to allow
-monitoring the contention degree on the kernel mutex caused by the lock
-operations. */
-UNIV_INLINE
-void
-lock_mutex_exit_kernel(void)
-/*=========================*/
-{
- mutex_exit(&kernel_mutex);
-}
-#endif
-
-#ifdef notdefined
-
-/*************************************************************************
-Gets the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-mutex_t*
-lock_rec_get_mutex(
-/*===============*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- return(buf_frame_get_lock_mutex(ptr));
-}
-
-/*************************************************************************
-Reserves the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-void
-lock_rec_mutex_enter(
-/*=================*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- mutex_enter(lock_rec_get_mutex(ptr));
-}
-
-/*************************************************************************
-Releases the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-void
-lock_rec_mutex_exit(
-/*================*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- mutex_exit(lock_rec_get_mutex(ptr));
-}
-
-/*************************************************************************
-Checks if the caller owns the mutex to record locks of a page. Works only in
-the debug version. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own(
-/*===============*/
- /* out: TRUE if the current OS thread has reserved the
- mutex */
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- return(mutex_own(lock_rec_get_mutex(ptr)));
-}
-
-/*************************************************************************
-Gets the mutex protecting record locks on a given page address. */
-
-mutex_t*
-lock_rec_get_mutex_for_addr(
-/*========================*/
- ulint space, /* in: space id */
- ulint page_no)/* in: page number */
-{
- return(hash_get_mutex(lock_sys->rec_hash,
- lock_rec_fold(space, page_no)));
-}
-
-/*************************************************************************
-Checks if the caller owns the mutex to record locks of a page. Works only in
-the debug version. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own_addr(
-/*====================*/
- ulint space, /* in: space id */
- ulint page_no)/* in: page number */
-{
- return(mutex_own(lock_rec_get_mutex_for_addr(space, page_no)));
-}
-
-/*************************************************************************
-Reserves all the mutexes protecting record locks. */
-UNIV_INLINE
-void
-lock_rec_mutex_enter_all(void)
-/*==========================*/
-{
- hash_table_t* table;
- ulint n_mutexes;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
-
- mutex_enter(hash_get_nth_mutex(table, i));
- }
-}
-
-/*************************************************************************
-Releases all the mutexes protecting record locks. */
-UNIV_INLINE
-void
-lock_rec_mutex_exit_all(void)
-/*=========================*/
-{
- hash_table_t* table;
- ulint n_mutexes;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
-
- mutex_exit(hash_get_nth_mutex(table, i));
- }
-}
-
-/*************************************************************************
-Checks that the current OS thread owns all the mutexes protecting record
-locks. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own_all(void)
-/*========================*/
- /* out: TRUE if owns all */
-{
- hash_table_t* table;
- ulint n_mutexes;
- ibool owns_yes = TRUE;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
- if (!mutex_own(hash_get_nth_mutex(table, i))) {
-
- owns_yes = FALSE;
- }
- }
-
- return(owns_yes);
-}
-
-#endif
-
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
@@ -2023,7 +1850,7 @@ possible, enqueues a waiting lock request. This is a low-level function
which does NOT look at implicit locks! Checks lock compatibility within
explicit locks. This function sets a normal next-key lock, or in the case
of a page supremum record, a gap type lock. */
-
+static
ulint
lock_rec_lock(
/*==========*/
@@ -2105,7 +1932,7 @@ lock_rec_has_to_wait_in_queue(
/*****************************************************************
Grants a lock to a waiting lock request and releases the waiting
transaction. */
-
+static
void
lock_grant(
/*=======*/
@@ -2172,7 +1999,7 @@ lock_rec_cancel(
Removes a record lock request, waiting or granted, from the queue and
grants locks to other transactions in the queue if they now are entitled
to a lock. NOTE: all record locks contained in in_lock are removed. */
-
+static
void
lock_rec_dequeue_from_page(
/*=======================*/
@@ -2343,7 +2170,7 @@ lock_rec_inherit_to_gap(
Makes a record to inherit the gap locks (except LOCK_INSERT_INTENTION type)
of another record as gap type locks, but does not reset the lock bits of the
other record. Also waiting lock requests are inherited as GRANTED gap locks. */
-
+static
void
lock_rec_inherit_to_gap_if_gap_lock(
/*================================*/
@@ -3583,7 +3410,7 @@ lock_table_has_to_wait_in_queue(
Removes a table lock request, waiting or granted, from the queue and grants
locks to other transactions in the queue, if they now are entitled to a
lock. */
-
+static
void
lock_table_dequeue(
/*===============*/
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index 01679a374b0..0a1115a6891 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -181,9 +181,10 @@ recv_sys_empty_hash(void)
recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256);
}
+#ifndef UNIV_LOG_DEBUG
/************************************************************
Frees the recovery system. */
-
+static
void
recv_sys_free(void)
/*===============*/
@@ -200,6 +201,7 @@ recv_sys_free(void)
mutex_exit(&(recv_sys->mutex));
}
+#endif /* !UNIV_LOG_DEBUG */
/************************************************************
Truncates possible corrupted or extra records from a log group. */
@@ -358,7 +360,7 @@ Copies a log segment from the most up-to-date log group to the other log
groups, so that they all contain the latest log data. Also writes the info
about the latest checkpoint to the groups, and inits the fields in the group
memory structs to up-to-date values. */
-
+static
void
recv_synchronize_groups(
/*====================*/
@@ -1803,10 +1805,11 @@ recv_calc_lsn_on_data_add(
return(ut_dulint_add(lsn, lsn_len));
}
+#ifdef UNIV_LOG_DEBUG
/***********************************************************
Checks that the parser recognizes incomplete initial segments of a log
record as incomplete. */
-
+static
void
recv_check_incomplete_log_recs(
/*===========================*/
@@ -1824,6 +1827,7 @@ recv_check_incomplete_log_recs(
&page_no, &body));
}
}
+#endif /* UNIV_LOG_DEBUG */
/***********************************************************
Prints diagnostic info of corrupt log. */
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index 5831dc4c451..89ca68a1232 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -603,130 +603,7 @@ mem_heap_validate(
return(TRUE);
}
-/*********************************************************************
-Prints information of dynamic memory usage and currently allocated
-memory heaps or buffers. Can only be used in the debug version. */
-static
-void
-mem_print_info_low(
-/*===============*/
- ibool print_all __attribute__((unused)))
- /* in: if TRUE, all heaps are printed,
- else only the heaps allocated after the
- previous call of this function */
-{
#ifdef UNIV_MEM_DEBUG
- mem_hash_node_t* node;
- ulint n_heaps = 0;
- ulint allocated_mem;
- ulint ph_size;
- ulint total_allocated_mem = 0;
- ibool error;
- ulint n_blocks;
-#endif
- FILE* outfile;
-
- /* outfile = fopen("ibdebug", "a"); */
-
- outfile = stdout;
-
- fprintf(outfile, "\n");
- fprintf(outfile,
- "________________________________________________________\n");
- fprintf(outfile, "MEMORY ALLOCATION INFORMATION\n\n");
-
-#ifndef UNIV_MEM_DEBUG
-
- mem_pool_print_info(outfile, mem_comm_pool);
-
- fprintf(outfile,
- "Sorry, non-debug version cannot give more memory info\n");
-
- /* fclose(outfile); */
-
- return;
-#else
- mutex_enter(&mem_hash_mutex);
-
- fprintf(outfile, "LIST OF CREATED HEAPS AND ALLOCATED BUFFERS: \n\n");
-
- if (!print_all) {
- fprintf(outfile, "AFTER THE LAST PRINT INFO\n");
- }
-
- node = UT_LIST_GET_FIRST(mem_all_list_base);
-
- while (node != NULL) {
- n_heaps++;
-
- if (!print_all && node->nth_heap < mem_last_print_info) {
-
- goto next_heap;
- }
-
- mem_heap_validate_or_print(node->heap, NULL,
- FALSE, &error, &allocated_mem,
- &ph_size, &n_blocks);
- total_allocated_mem += allocated_mem;
-
- fprintf(outfile,
- "%lu: file %s line %lu of size %lu phys.size %lu with %lu blocks, type %lu\n",
- node->nth_heap, node->file_name, node->line,
- allocated_mem, ph_size, n_blocks,
- (node->heap)->type);
- next_heap:
- node = UT_LIST_GET_NEXT(all_list, node);
- }
-
- fprintf(outfile, "\n");
-
- fprintf(outfile, "Current allocated memory : %lu\n",
- mem_current_allocated_memory);
- fprintf(outfile, "Current allocated heaps and buffers : %lu\n",
- n_heaps);
- fprintf(outfile, "Cumulative allocated memory : %lu\n",
- mem_total_allocated_memory);
- fprintf(outfile, "Maximum allocated memory : %lu\n",
- mem_max_allocated_memory);
- fprintf(outfile, "Cumulative created heaps and buffers : %lu\n",
- mem_n_created_heaps);
- fprintf(outfile, "Cumulative number of allocations : %lu\n",
- mem_n_allocations);
-
- mem_last_print_info = mem_n_created_heaps;
-
- mutex_exit(&mem_hash_mutex);
-
- mem_pool_print_info(outfile, mem_comm_pool);
-
-/* mem_validate(); */
-
-/* fclose(outfile); */
-#endif
-}
-
-/*********************************************************************
-Prints information of dynamic memory usage and currently allocated memory
-heaps or buffers. Can only be used in the debug version. */
-
-void
-mem_print_info(void)
-/*================*/
-{
- mem_print_info_low(TRUE);
-}
-
-/*********************************************************************
-Prints information of dynamic memory usage and currently allocated memory
-heaps or buffers since the last ..._print_info or..._print_new_info. */
-
-void
-mem_print_new_info(void)
-/*====================*/
-{
- mem_print_info_low(FALSE);
-}
-
/*********************************************************************
TRUE if no memory is currently allocated. */
@@ -735,8 +612,6 @@ mem_all_freed(void)
/*===============*/
/* out: TRUE if no heaps exist */
{
-#ifdef UNIV_MEM_DEBUG
-
mem_hash_node_t* node;
ulint heap_count = 0;
ulint i;
@@ -764,15 +639,6 @@ mem_all_freed(void)
} else {
return(FALSE);
}
-
-#else
-
- printf(
- "Sorry, non-debug version cannot check if all memory is freed.\n");
-
- return(FALSE);
-
-#endif
}
/*********************************************************************
@@ -783,8 +649,6 @@ mem_validate_no_assert(void)
/*========================*/
/* out: TRUE if error */
{
-#ifdef UNIV_MEM_DEBUG
-
mem_hash_node_t* node;
ulint n_heaps = 0;
ulint allocated_mem;
@@ -843,14 +707,6 @@ mem_validate_no_assert(void)
mutex_exit(&mem_hash_mutex);
return(error);
-
-#else
-
- printf("Sorry, non-debug version cannot validate dynamic memory\n");
-
- return(FALSE);
-
-#endif
}
/****************************************************************
@@ -865,6 +721,7 @@ mem_validate(void)
return(TRUE);
}
+#endif /* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c
index 63ce491523b..60e3ecfe150 100644
--- a/innobase/mtr/mtr0mtr.c
+++ b/innobase/mtr/mtr0mtr.c
@@ -171,7 +171,7 @@ mtr_log_parse_full_page(
/****************************************************************
Writes to the database log the full contents of the pages that this mtr has
modified. */
-
+static
void
mtr_log_write_backup_full_pages(
/*============================*/
diff --git a/innobase/odbc/Makefile.am b/innobase/odbc/Makefile.am
deleted file mode 100644
index f4282ba3907..00000000000
--- a/innobase/odbc/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-include ../include/Makefile.i
-
-noinst_LIBRARIES = libodbc.a
-
-libodbc_a_SOURCES = odbc0odbc.c
-
-EXTRA_PROGRAMS =
diff --git a/innobase/odbc/makefilewin b/innobase/odbc/makefilewin
deleted file mode 100644
index 969043e096d..00000000000
--- a/innobase/odbc/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-innobase.lib: odbc0odbc.obj
- lib -out:..\libs\innobase.lib odbc0odbc.obj ..\libs\btr.lib ..\libs\eval.lib ..\libs\ibuf.lib ..\libs\trx.lib ..\libs\pars.lib ..\libs\que.lib ..\libs\lock.lib ..\libs\row.lib ..\libs\read.lib ..\libs\srv.lib ..\libs\com.lib ..\libs\usr.lib ..\libs\thr.lib ..\libs\fut.lib ..\libs\fsp.lib ..\libs\page.lib ..\libs\dyn.lib ..\libs\mtr.lib ..\libs\log.lib ..\libs\rem.lib ..\libs\fil.lib ..\libs\buf.lib ..\libs\dict.lib ..\libs\data.lib ..\libs\mach.lib ..\libs\ha.lib ..\libs\ut.lib ..\libs\sync.lib ..\libs\mem.lib ..\libs\os.lib
-
-odbc0odbc.obj: odbc0odbc.c
- $(CCOM) $(CFL) -c odbc0odbc.c
diff --git a/innobase/odbc/odbc0dummy.c b/innobase/odbc/odbc0dummy.c
deleted file mode 100644
index e44677aa266..00000000000
--- a/innobase/odbc/odbc0dummy.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Used to screen off linker 'undefined symbol' errors
-when making an ODBC client library */
-
-
-unsigned long srv_test_cache_evict;
-
-void buf_frame_alloc(void)
-{}
-
-void buf_frame_free(void)
-{}
-
-void trx_create(void)
-{}
-
-void* kernel_mutex_temp;
-
-void trx_sig_send(void)
-{}
-
-void rec_sprintf(void)
-{}
-
-void dtuple_sprintf(void)
-{}
-
-void pars_write_query_param_info (void)
-{}
-
-void que_graph_try_free (void)
-{}
-
-void pars_sql (void)
-{}
-
-void que_run_threads (void)
-{}
-
-void que_fork_start_command(void)
-{}
-
-void dict_procedure_add_to_cache(void)
-{}
-
-void dict_mem_procedure_create(void)
-{}
-
-void pars_proc_read_input_params_from_buf(void)
-{}
-
-void dict_procedure_reserve_parsed_copy(void)
-{}
-
-void* srv_sys;
-
-void* srv_print_latch_waits;
-
-void* srv_spin_wait_delay;
-
-void* srv_n_spin_wait_rounds;
-
-void* buf_debug_prints;
diff --git a/innobase/odbc/odbc0odbc.c b/innobase/odbc/odbc0odbc.c
deleted file mode 100644
index 0deb17c6714..00000000000
--- a/innobase/odbc/odbc0odbc.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/******************************************************
-Innobase ODBC client library
-
-(c) 1998 Innobase Oy
-
-Created 2/22/1998 Heikki Tuuri
-*******************************************************/
-
-#include "odbc0odbc.h"
-
-#include "mem0mem.h"
-#include "com0com.h"
-#include "usr0sess.h"
-
-#define ODBC_STAT_INITIAL 1
-#define ODBC_STAT_PREPARED 2
-#define ODBC_STAT_EXECUTED 3
-
-
-typedef struct odbc_conn_struct odbc_conn_t;
-typedef struct odbc_env_struct odbc_env_t;
-
-/* ODBC parameter description struct */
-
-typedef struct odbc_param_struct odbc_param_t;
-struct odbc_param_struct{
- ulint data_type; /* SQL_CHAR, ... */
- ibool is_input; /* TRUE if an input parameter of a stored
- procedure, FALSE if an output parameter */
- byte* buf; /* buffer where the value is stored before
- SQLExecute, or where it comes after SQLExecute
- in the case of an output parameter */
- lint* data_len; /* pointer to where the data len or the value
- SQL_NULL_DATA is stored */
- ulint buf_len; /* buffer size */
-};
-
-/* ODBC statement data structure */
-
-typedef struct odbc_stat_struct odbc_stat_t;
-struct odbc_stat_struct{
- ulint state; /* ODBC_STAT_INITIAL,
- ODBC_STAT_PREPARED,
- ODBC_STAT_EXECUTED */
- ulint id; /* statement id */
- ulint n_params; /* number of parameters */
- odbc_param_t* params; /* pointer to an array describing
- the parameters, if any */
- ulint n_params_bound; /* number of parameters that have
- been bound: the statement cannot be
- executed before n_params_bound
- == n_params */
- byte* error_msg; /* possible error message, or NULL;
- allocated separately from dynamic
- memory */
- ulint error_msg_len; /* error mesage length if it is
- non-NULL */
- odbc_conn_t* conn; /* connection */
- UT_LIST_NODE_T(odbc_stat_t)
- stat_list; /* list of the statements of the
- connection */
-};
-
-/* ODBC connection data structure */
-
-struct odbc_conn_struct{
- ibool connected; /* TRUE if connected */
- char* server_name; /* server name where connected
- (= server address) */
- ulint server_name_len;/* length of the server name */
- com_endpoint_t* com_endpoint; /* connection endpoint for this client
- connection */
- dulint out_msg_count; /* count of outgoing messages */
- byte* out_datagram_buf;/* buffer for outgoing datagrams to
- the server */
- byte* in_datagram_buf;/* buffer for incoming datagrams from
- the server */
- byte* addr_buf; /* buffer for the address from which
- an incoming datagram came; in practice,
- this will be the server address */
- dulint sess_id; /* user session id, once the
- connection to the server is
- established */
- odbc_env_t* env; /* environment */
- UT_LIST_BASE_NODE_T(odbc_stat_t)
- stat_list; /* list of the statements of the
- connection */
- UT_LIST_NODE_T(odbc_conn_t)
- conn_list; /* list of the connections of the
- environment */
-};
-
-/* ODBC environment data structure */
-
-struct odbc_env_struct{
- UT_LIST_BASE_NODE_T(odbc_conn_t) conn_list;
- /* list of the connections of the
- environment */
-};
-
-/**************************************************************************
-Gets the nth parameter description struct for a statement. */
-UNIV_INLINE
-odbc_param_t*
-stat_get_nth_param(
-/*===============*/
- /* out: nth parameter */
- odbc_stat_t* stat, /* in: pointer to statement handle */
- ulint i) /* in: parameter index */
-{
- ut_ad(stat->n_params > i);
-
- return(stat->params + i);
-}
-
-/**************************************************************************
-Allocates an SQL environment. */
-
-RETCODE
-SQLAllocEnv(
-/*========*/
- /* out: SQL_SUCCESS */
- HENV* phenv) /* out: pointer to an environment handle */
-{
- odbc_env_t* env;
-
- if (!sync_initialized) {
- sync_init();
- mem_init(2000000);
- }
-
- env = mem_alloc(sizeof(odbc_env_t));
-
- UT_LIST_INIT(env->conn_list);
-
- *phenv = env;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Allocates an SQL connection. */
-
-RETCODE
-SQLAllocConnect(
-/*============*/
- /* out: SQL_SUCCESS */
- HENV henv, /* in: pointer to an environment handle */
- HDBC* phdbc) /* out: pointer to a connection handle */
-{
- odbc_conn_t* conn;
- odbc_env_t* env;
-
- ut_a(henv);
-
- env = henv;
- conn = mem_alloc(sizeof(odbc_conn_t));
-
- conn->connected = FALSE;
- conn->env = env;
-
- UT_LIST_INIT(conn->stat_list);
-
- UT_LIST_ADD_LAST(conn_list, env->conn_list, conn);
-
- *phdbc = conn;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Allocates an SQL statement. */
-
-RETCODE
-SQLAllocStmt(
-/*=========*/
- HDBC hdbc, /* in: SQL connection */
- HSTMT* phstmt) /* out: pointer to a statement handle */
-{
- odbc_conn_t* conn;
- odbc_stat_t* stat;
-
- ut_a(hdbc);
-
- conn = hdbc;
-
- stat = mem_alloc(sizeof(odbc_stat_t));
-
- stat->state = ODBC_STAT_INITIAL;
- stat->error_msg = NULL;
- stat->conn = conn;
-
- UT_LIST_ADD_LAST(stat_list, conn->stat_list, stat);
-
- *phstmt = stat;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Sends the message in datagram_buf to the server. */
-static
-void
-odbc_send_cli_msg(
-/*==============*/
- odbc_conn_t* conn, /* in: connection, does not have to be
- connected yet */
- ulint len) /* in: message length (excluding the standard
- header of size SESS_CLI_MSG_DATA) */
-{
- ulint ret;
- ulint fold;
- byte* msg;
-
- ut_a(len + SESS_CLI_MSG_DATA <= ODBC_DATAGRAM_SIZE);
-
- msg = conn->out_datagram_buf;
-
- mach_write_to_8(msg + SESS_CLI_MSG_NO, conn->out_msg_count);
-
- UT_DULINT_INC(conn->out_msg_count);
-
- fold = ut_fold_binary(msg + 4, len + SESS_CLI_MSG_DATA - 4);
-
- ut_ad(SESS_CLI_MSG_CHECKSUM == 0);
-
- mach_write_to_4(msg + SESS_CLI_MSG_CHECKSUM, fold);
-
- ret = com_sendto(conn->com_endpoint, msg, SESS_CLI_MSG_DATA + len,
- conn->server_name, conn->server_name_len);
- ut_a(ret == 0);
-}
-
-/**************************************************************************
-Receives a message in datagram_buf from the server. */
-static
-void
-odbc_recv_srv_msg(
-/*==============*/
- odbc_conn_t* conn, /* in: connection, does not have to be
- connected yet */
- ulint* len) /* out: received message length (excluding the
- standard header of size SESS_SRV_MSG_DATA) */
-{
- ulint total_len;
- ulint addr_len;
- ulint ret;
-
- ret = com_recvfrom(conn->com_endpoint, conn->in_datagram_buf,
- ODBC_DATAGRAM_SIZE, &total_len, (char*)conn->addr_buf,
- ODBC_ADDRESS_SIZE, &addr_len);
- ut_a(ret == 0);
- ut_a(total_len >= SESS_SRV_MSG_DATA);
-
- *len = total_len - SESS_SRV_MSG_DATA;
-}
-
-/**************************************************************************
-Connects to a database server process (establishes a connection and a
-session). */
-
-RETCODE
-SQLConnect(
-/*=======*/
- /* out: SQL_SUCCESS */
- HDBC hdbc, /* in: SQL connection handle */
- UCHAR* szDSN, /* in: data source name (server name) */
- SWORD cbDSN, /* in: data source name length */
- UCHAR* szUID, /* in: user name */
- SWORD cbUID, /* in: user name length */
- UCHAR* szAuthStr, /* in: password */
- SWORD cbAuthStr) /* in: password length */
-{
- com_endpoint_t* ep;
- odbc_conn_t* conn;
- ulint err;
- ulint size;
- byte* msg;
- ulint len;
- UCHAR catenated_name[100];
-
- ut_a(hdbc && szDSN);
-
- UT_NOT_USED(szUID);
- UT_NOT_USED(cbUID);
- UT_NOT_USED(szAuthStr);
- UT_NOT_USED(cbAuthStr);
-
- conn = hdbc;
-
- ut_a(!conn->connected);
-
- conn->server_name = mem_alloc(cbDSN);
- ut_memcpy(conn->server_name, szDSN, cbDSN);
-
- conn->server_name_len = cbDSN;
-
- ep = com_endpoint_create(COM_SHM);
-
- ut_a(ep);
-
- conn->com_endpoint = ep;
-
- conn->out_msg_count = ut_dulint_zero;
-
- size = ODBC_DATAGRAM_SIZE;
-
- err = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&size, 4);
- ut_a(err == 0);
-
- /* Make the data source name catenated to user name as the
- address of the communications endpoint */
-
- ut_a((ulint)cbDSN + (ulint)cbUID < 100);
-
- ut_memcpy(catenated_name, szDSN, (ulint)cbDSN);
- ut_memcpy(catenated_name + (ulint)cbDSN, szUID, (ulint)cbUID);
-
- err = com_bind(ep, (char*)catenated_name, (ulint)cbDSN
- + (ulint)cbUID);
- ut_a(err == 0);
-
- conn->in_datagram_buf = mem_alloc(ODBC_DATAGRAM_SIZE);
-
- msg = mem_alloc(ODBC_DATAGRAM_SIZE);
-
- conn->out_datagram_buf = msg;
- conn->addr_buf = mem_alloc(ODBC_ADDRESS_SIZE);
-
- /* Set the session id to dulint 0 as we are not yet connected */
-
- sess_cli_msg_set_sess(msg, ut_dulint_zero);
- sess_cli_msg_set_type(msg, SESS_CLI_CONNECT);
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, 0);
-
- odbc_recv_srv_msg(conn, &len);
-
- /*------------------------------------------*/
-
- ut_a(len == 0);
- ut_a(sess_srv_msg_get_type(conn->in_datagram_buf)
- == SESS_SRV_ACCEPT_CONNECT);
-
- conn->sess_id = mach_read_from_8(conn->in_datagram_buf
- + SESS_SRV_MSG_SESS_ID);
-
- /* Write the session id to out_datagram_buf: it will not be rewritten
- until the connection is closed, as the session id will stay the same */
-
- sess_cli_msg_set_sess(msg, conn->sess_id);
-
- /* We currently only send single part messages: the following will
- stay 0 during the connection */
-
- mach_write_to_4(msg + SESS_CLI_MSG_CONTINUE, 0);
- mach_write_to_4(msg + SESS_CLI_MSG_CONT_SIZE, 0);
-
- conn->connected = TRUE;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Stores an error message to a statement handle, so that it can be later
-queried with SQLError. */
-static
-void
-odbc_stat_store_error_msg(
-/*======================*/
- odbc_stat_t* stat, /* in: statement handle */
- byte* msg, /* in: error message sent by the server */
- ulint len) /* in: length of msg */
-{
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- }
-
- stat->error_msg_len = len;
-
- len += SESS_SRV_MSG_DATA;
-
- stat->error_msg = mem_alloc(len);
- ut_memcpy(stat->error_msg, msg, len);
-}
-
-/**************************************************************************
-Queries an error message. */
-
-RETCODE
-SQLError(
-/*=====*/
- /* out: SQL_SUCCESS or SQL_NO_DATA_FOUND */
- HENV henv, /* in: SQL_NULL_HENV */
- HDBC hdbc, /* in: SQL_NULL_HDBC */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlState, /* in/out: SQLSTATE as a null-terminated string,
- (currently, always == "S1000") */
- SDWORD* pfNativeError, /* out: native error code */
- UCHAR* szErrorMsg, /* in/out: buffer for an error message as a
- null-terminated string */
- SWORD cbErrorMsgMax, /* in: buffer size for szErrorMsg */
- SWORD* pcbErrorMsg) /* out: error message length */
-{
- odbc_stat_t* stat;
- ulint len;
-
- ut_a(henv == SQL_NULL_HENV);
- ut_a(hdbc == SQL_NULL_HDBC);
- ut_a(hstmt);
- ut_a(cbErrorMsgMax > 1);
-
- stat = hstmt;
-
- if (stat->error_msg == NULL) {
-
- return(SQL_NO_DATA_FOUND);
- }
-
- *pfNativeError = 0;
- ut_memcpy(szSqlState, (char *) "S1000", 6);
-
- len = (ulint)cbErrorMsgMax - 1;
-
- if (stat->error_msg_len < len) {
- len = stat->error_msg_len;
- }
-
- ut_memcpy(szErrorMsg, stat->error_msg + SESS_SRV_MSG_DATA, len);
-
- *(szErrorMsg + len) = '\0';
-
- *pcbErrorMsg = (SWORD)len;
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Makes the server to parse and optimize an SQL string. */
-
-RETCODE
-SQLPrepare(
-/*=======*/
- /* out: SQL_SUCCESS or SQL_ERROR */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlStr, /* in: SQL string */
- SDWORD cbSqlStr) /* in: SQL string length */
-{
- odbc_stat_t* stat;
- odbc_conn_t* conn;
- odbc_param_t* param;
- ulint len;
- byte* msg;
- ulint i;
-
- stat = hstmt;
- conn = stat->conn;
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- ut_memcpy(conn->out_datagram_buf + SESS_CLI_MSG_DATA, szSqlStr,
- 1 + (ulint)cbSqlStr);
-
- sess_cli_msg_set_type(conn->out_datagram_buf, SESS_CLI_PREPARE);
-
- /* The client message will be decoded in sess_receive_prepare */
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, 1 + (ulint)cbSqlStr);
-
- odbc_recv_srv_msg(conn, &len);
-
- /*------------------------------------------*/
-
- /* The server message was coded in sess_receive_prepare */
-
- ut_a(len >= 8);
-
- msg = conn->in_datagram_buf;
-
- if (sess_srv_msg_get_type(msg) != SESS_SRV_SUCCESS) {
-
- ut_a(sess_srv_msg_get_type(msg) == SESS_SRV_ERROR);
-
- odbc_stat_store_error_msg(stat, msg, len);
-
- return(SQL_ERROR);
- }
-
- stat->id = mach_read_from_4(msg + SESS_SRV_MSG_DATA);
-
- stat->n_params = mach_read_from_4(msg + SESS_SRV_MSG_DATA + 4);
-
- stat->n_params_bound = 0;
-
- ut_a(len == 8 + stat->n_params);
-
- if (stat->n_params > 0) {
-
- stat->params = mem_alloc(stat->n_params
- * sizeof(odbc_param_t));
- for (i = 0; i < stat->n_params; i++) {
- param = stat_get_nth_param(stat, i);
-
- param->is_input = mach_read_from_1(
- msg + SESS_SRV_MSG_DATA + 8 + i);
- /* Set buf to NULL so that we know when the parameter
- has been bound */
-
- param->buf = NULL;
- }
- }
-
- stat->state = ODBC_STAT_PREPARED;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Binds a parameter in a prepared statement. */
-
-RETCODE
-SQLBindParameter(
-/*=============*/
- /* out: SQL_SUCCESS */
- HSTMT hstmt, /* in: statement handle */
- UWORD ipar, /* in: parameter index, starting from 1 */
- SWORD fParamType, /* in: SQL_PARAM_INPUT or SQL_PARAM_OUTPUT */
- SWORD fCType, /* in: SQL_C_CHAR, ... */
- SWORD fSqlType, /* in: SQL_CHAR, ... */
- UDWORD cbColDef, /* in: precision: ignored */
- SWORD ibScale, /* in: scale: ignored */
- PTR rgbValue, /* in: pointer to a buffer for the data */
- SDWORD cbValueMax, /* in: buffer size */
- SDWORD* pcbValue) /* in: pointer to a buffer for the data
- length or SQL_NULL_DATA */
-{
- odbc_stat_t* stat;
- odbc_param_t* param;
-
- stat = hstmt;
-
- ut_a(stat->state != ODBC_STAT_INITIAL);
- ut_a(rgbValue);
- ut_a(ipar <= stat->n_params);
- ut_a(ipar > 0);
- ut_a(cbValueMax >= 0);
- ut_a(pcbValue);
-
- UT_NOT_USED(ibScale);
- UT_NOT_USED(fCType);
- UT_NOT_USED(cbColDef);
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- param = stat_get_nth_param(stat, ipar - 1);
-
- if (param->buf == NULL) {
- stat->n_params_bound++;
- }
-
- param->data_type = fSqlType;
-
- ut_a((fParamType != SQL_PARAM_INPUT) || param->is_input);
- ut_a((fParamType == SQL_PARAM_INPUT) || !param->is_input);
-
- param->buf = rgbValue;
- param->buf_len = cbValueMax;
- param->data_len = pcbValue;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Executes a prepared statement where all parameters have been bound. */
-
-RETCODE
-SQLExecute(
-/*=======*/
- /* out: SQL_SUCCESS or SQL_ERROR */
- HSTMT hstmt) /* in: statement handle */
-{
- odbc_stat_t* stat;
- odbc_conn_t* conn;
- odbc_param_t* param;
- lint len;
- ulint msg_len;
- byte* msg;
- byte* ptr;
- lint int_val;
- ulint i;
-
- stat = hstmt;
-
- ut_a(stat->state != ODBC_STAT_INITIAL);
- ut_a(stat->n_params == stat->n_params_bound);
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- conn = stat->conn;
- msg = conn->out_datagram_buf;
-
- sess_cli_msg_set_type(msg, SESS_CLI_EXECUTE);
-
- ptr = msg + SESS_CLI_MSG_DATA;
-
- mach_write_to_4(ptr, stat->id);
-
- ptr += 4;
-
- for (i = 0; i < stat->n_params; i++) {
-
- param = stat_get_nth_param(stat, i);
-
- if (param->is_input) {
- /* Copy its length and data to the message buffer */
-
- len = *(param->data_len);
-
- mach_write_to_4(ptr, (ulint)len);
-
- ptr += 4;
-
- if (len != SQL_NULL_DATA) {
- if (param->data_type == SQL_INTEGER) {
- ut_ad(len == 4);
- int_val = *((lint*)(param->buf));
-
- mach_write_to_4(ptr, (ulint)int_val);
- } else {
- ut_memcpy(ptr, param->buf, len);
- }
-
- ptr += len;
- }
- }
- }
-
- /* The client message will be decoded in sess_receive_command */
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, ptr - (msg + SESS_CLI_MSG_DATA));
-
- odbc_recv_srv_msg(conn, &msg_len);
-
- /*------------------------------------------*/
-
- /* The server message was coded in sess_command_completed_message */
-
- msg = conn->in_datagram_buf;
-
- if (sess_srv_msg_get_type(msg) != SESS_SRV_SUCCESS) {
-
- ut_a(sess_srv_msg_get_type(msg) == SESS_SRV_ERROR);
-
- odbc_stat_store_error_msg(stat, msg, msg_len);
-
- return(SQL_ERROR);
- }
-
- ptr = msg + SESS_SRV_MSG_DATA;
-
- for (i = 0; i < stat->n_params; i++) {
-
- param = stat_get_nth_param(stat, i);
-
- if (!param->is_input) {
- /* Copy its length and data from the message buffer */
-
- len = (lint)mach_read_from_4(ptr);
-
- ptr += 4;
-
- *(param->data_len) = len;
-
- if (len != SQL_NULL_DATA) {
- if (param->data_type == SQL_INTEGER) {
- ut_ad(len == 4);
-
- int_val = (lint)mach_read_from_4(ptr);
-
- *((lint*)(param->buf)) = int_val;
- } else {
- ut_memcpy(param->buf, ptr, (ulint)len);
- }
-
- ptr += len;
- }
- }
- }
-
- ut_ad(msg + SESS_SRV_MSG_DATA + msg_len == ptr);
-
- return(SQL_SUCCESS);
-}
diff --git a/innobase/os/os0proc.c b/innobase/os/os0proc.c
index a427c595bc0..85791c55348 100644
--- a/innobase/os/os0proc.c
+++ b/innobase/os/os0proc.c
@@ -515,83 +515,6 @@ os_mem_alloc_nocache(
#endif
}
-#ifdef notdefined
-/********************************************************************
-Creates a new process. */
-
-ibool
-os_process_create(
-/*==============*/
- char* name, /* in: name of the executable to start
- or its full path name */
- char* cmd, /* in: command line for the starting
- process, or NULL if no command line
- specified */
- os_process_t* proc, /* out: handle to the process */
- os_process_id_t* id) /* out: process id */
-
-{
- BOOL ret;
- PROCESS_INFORMATION pinfo;
- STARTUPINFO sinfo;
-
- /* The following assignments are default for the startupinfo
- structure */
- sinfo.cb = sizeof(STARTUPINFO);
- sinfo.lpReserved = NULL;
- sinfo.lpDesktop = NULL;
- sinfo.cbReserved2 = 0;
- sinfo.lpReserved = NULL;
-
- ret = CreateProcess(name,
- cmd,
- NULL, /* No security attributes */
- NULL, /* No thread security attrs */
- FALSE, /* Do not inherit handles */
- 0, /* No creation flags */
- NULL, /* No environment */
- NULL, /* Same current directory */
- &sinfo,
- &pinfo);
-
- *proc = pinfo.hProcess;
- *id = pinfo.dwProcessId;
-
- return(ret);
-}
-
-/**************************************************************************
-Exits a process. */
-
-void
-os_process_exit(
-/*============*/
- ulint code) /* in: exit code */
-{
- ExitProcess((UINT)code);
-}
-
-/**************************************************************************
-Gets a process exit code. */
-
-ibool
-os_process_get_exit_code(
-/*=====================*/
- /* out: TRUE if succeed, FALSE if fail */
- os_process_t proc, /* in: handle to the process */
- ulint* code) /* out: exit code */
-{
- DWORD ex_code;
- BOOL ret;
-
- ret = GetExitCodeProcess(proc, &ex_code);
-
- *code = (ulint)ex_code;
-
- return(ret);
-}
-#endif /* notdedfined */
-
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
diff --git a/innobase/os/os0trash.c b/innobase/os/os0trash.c
deleted file mode 100644
index e896ac9f083..00000000000
--- a/innobase/os/os0trash.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Stores the old console mode when echo is turned off */
-ulint os_old_console_mode;
-
-/********************************************************************
-Turns off echo from console input. */
-
-void
-os_console_echo_off(void)
-/*=====================*/
-{
- GetConsoleMode(stdio, &os_old_console_mode);
- SetConsoleMode(stdio, ENABLE_PROCESSED_INPUT);
-}
-
-/********************************************************************
-Turns on echo in console input. */
-
-void
-os_console_echo_on(void)
-/*====================*/
-{
- SetConsoleMode(stdio, &os_old_console_mode);
-}
-
-/********************************************************************
-Reads a character from the console. */
-
-char
-os_read_console(void)
-/*=================*/
-{
- char input_char;
- ulint n_chars;
-
- n_chars = 0;
-
- while (n_chars == 0) {
- ReadConsole(stdio, &input_char, 1, &n_chars, NULL);
- }
-
- return(input_char);
-}
-
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index 9c9e1f4156c..b7a85e79658 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -19,9 +19,6 @@ Created 2/2/1994 Heikki Tuuri
#include "btr0sea.h"
#include "buf0buf.h"
-/* A cached template page used in page_create */
-page_t* page_template = NULL;
-
/* THE INDEX PAGE
==============
@@ -321,20 +318,6 @@ page_create(
fil_page_set_type(page, FIL_PAGE_INDEX);
- /* If we have a page template, copy the page structure from there */
-
- if (page_template) {
- ut_memcpy(page + PAGE_HEADER,
- page_template + PAGE_HEADER, PAGE_HEADER_PRIV_END);
- ut_memcpy(page + PAGE_DATA,
- page_template + PAGE_DATA,
- PAGE_SUPREMUM_END - PAGE_DATA);
- ut_memcpy(page + UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START,
- page_template + UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START,
- PAGE_EMPTY_DIR_START - PAGE_DIR);
- return(frame);
- }
-
heap = mem_heap_create(200);
/* 3. CREATE THE INFIMUM AND SUPREMUM RECORDS */
@@ -409,17 +392,6 @@ page_create(
rec_set_next_offs(infimum_rec, (ulint)(supremum_rec - page));
rec_set_next_offs(supremum_rec, 0);
-#ifdef notdefined
- /* Disable the use of page_template: there is a race condition here:
- while one thread is creating page_template, another one can start
- using it before the memcpy completes! */
-
- if (page_template == NULL) {
- page_template = mem_alloc(UNIV_PAGE_SIZE);
-
- ut_memcpy(page_template, page, UNIV_PAGE_SIZE);
- }
-#endif
return(page);
}
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c
index e52afb0c9b1..40483988c12 100644
--- a/innobase/que/que0que.c
+++ b/innobase/que/que0que.c
@@ -73,37 +73,6 @@ void
que_thr_move_to_run_state(
/*======================*/
que_thr_t* thr); /* in: an query thread */
-/**************************************************************************
-Tries to parallelize query if it is not parallel enough yet. */
-static
-que_thr_t*
-que_try_parallelize(
-/*================*/
- /* out: next thread to execute */
- que_thr_t* thr); /* in: query thread */
-
-#ifdef notdefined
-/********************************************************************
-Adds info about the number of inserted rows etc. to the message to the
-client. */
-static
-void
-que_thr_add_update_info(
-/*====================*/
- que_thr_t* thr) /* in: query thread */
-{
- que_fork_t* graph;
-
- graph = thr->graph;
-
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_INSERTS,
- graph->n_inserts);
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_UPDATES,
- graph->n_updates);
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_DELETES,
- graph->n_deletes);
-}
-#endif
/***************************************************************************
Adds a query graph to the session's list of graphs. */
@@ -711,22 +680,6 @@ que_thr_handle_error(
/* Does nothing */
}
-/**************************************************************************
-Tries to parallelize query if it is not parallel enough yet. */
-static
-que_thr_t*
-que_try_parallelize(
-/*================*/
- /* out: next thread to execute */
- que_thr_t* thr) /* in: query thread */
-{
- ut_ad(thr);
-
- /* Does nothing yet */
-
- return(thr);
-}
-
/********************************************************************
Builds a command completed-message to the client. */
static
@@ -1331,85 +1284,6 @@ que_thr_step(
return(thr);
}
-/***********************************************************************
-Checks if there is a need for a query thread switch or stopping the current
-thread. */
-
-que_thr_t*
-que_thr_check_if_switch(
-/*====================*/
- que_thr_t* thr, /* in: current query thread */
- ulint* cumul_resource) /* in: amount of resources used
- by the current call of que_run_threads
- (resources used by the OS thread!) */
-{
- que_thr_t* next_thr;
- ibool stopped;
-
- if (que_thr_peek_stop(thr)) {
-
- mutex_enter(&kernel_mutex);
-
- stopped = que_thr_stop(thr);
-
- mutex_exit(&kernel_mutex);
-
- if (stopped) {
- /* If a signal is processed, we may get a new query
- thread next_thr to run */
-
- next_thr = NULL;
-
- que_thr_dec_refer_count(thr, &next_thr);
-
- if (next_thr == NULL) {
-
- return(NULL);
- }
-
- thr = next_thr;
- }
- }
-
- if (thr->resource > QUE_PARALLELIZE_LIMIT) {
-
- /* Try parallelization of the query thread */
- thr = que_try_parallelize(thr);
-
- thr->resource = 0;
- }
-
- (*cumul_resource)++;
-
- if (*cumul_resource > QUE_ROUND_ROBIN_LIMIT) {
-
- /* It is time to round-robin query threads in the
- server task queue */
-
- if (srv_get_thread_type() == SRV_COM) {
- /* This OS thread is a SRV_COM thread: we put
- the query thread to the task queue and return
- to allow the OS thread to receive more
- messages from clients */
-
- ut_ad(thr->is_active);
-
- srv_que_task_enqueue(thr);
-
- return(NULL);
- } else {
- /* Change the query thread if there is another
- in the server task queue */
-
- thr = srv_que_round_robin(thr);
- }
-
- *cumul_resource = 0;
- }
-
- return(thr);
-}
-
/**************************************************************************
Runs query threads. Note that the individual query thread which is run
within this function may change if, e.g., the OS thread executing this
@@ -1433,27 +1307,6 @@ que_run_threads(
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
cumul_resource = 0;
loop:
- if (loop_count >= QUE_MAX_LOOPS_WITHOUT_CHECK) {
-
-/* In MySQL this thread switch is never needed!
-
- loop_count = 0;
-
- next_thr = que_thr_check_if_switch(thr, &cumul_resource);
-
- if (next_thr != thr) {
- if (next_thr == NULL) {
-
- return;
- }
-
- loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
- }
-
- thr = next_thr;
-*/
- }
-
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
more than about 4 pages, checks must be made also within the query
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index b6f32c83b35..16d5c33cb35 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -58,7 +58,7 @@ cmp_debug_dtuple_rec_with_match(
This function is used to compare two data fields for which the data type
is such that we must use MySQL code to compare them. The prototype here
must be a copy of the the one in ha_innobase.cc! */
-
+extern
int
innobase_mysql_cmp(
/*===============*/
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index 5e84f43bcf0..5fef07683af 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -38,7 +38,7 @@ This prototype is copied from /mysql/sql/ha_innodb.cc.
Invalidates the MySQL query cache for the table.
NOTE that the exact prototype of this function has to be in
/innobase/row/row0ins.c! */
-
+extern
void
innobase_invalidate_query_cache(
/*============================*/
@@ -1349,58 +1349,6 @@ row_ins_check_foreign_constraints(
return(DB_SUCCESS);
}
-/*************************************************************************
-Reports a UNIQUE key error to dict_unique_err_buf so that SHOW INNODB
-STATUS can print it. */
-static
-void
-row_ins_unique_report_err(
-/*======================*/
- que_thr_t* thr, /* in: query thread */
- rec_t* rec, /* in: a record in the index */
- dtuple_t* entry, /* in: index entry to insert in the index */
- dict_index_t* index) /* in: index */
-{
- UT_NOT_USED(thr);
- UT_NOT_USED(rec);
- UT_NOT_USED(entry);
- UT_NOT_USED(index);
-
-#ifdef notdefined
- /* Disable reporting to test if the slowdown of REPLACE in 4.0.13 was
- caused by this! */
-
- char* buf = dict_unique_err_buf;
-
- /* The foreign err mutex protects also dict_unique_err_buf */
-
- mutex_enter(&dict_foreign_err_mutex);
-
- ut_sprintf_timestamp(buf);
- sprintf(buf + strlen(buf), " Transaction:\n");
- trx_print(buf + strlen(buf), thr_get_trx(thr));
-
- sprintf(buf + strlen(buf),
-"Unique key constraint fails for table %.500s.\n", index->table_name);
- sprintf(buf + strlen(buf),
-"Trying to add in index %.500s (%lu fields unique) tuple:\n", index->name,
- dict_index_get_n_unique(index));
-
- dtuple_sprintf(buf + strlen(buf), 1000, entry);
-
- sprintf(buf + strlen(buf),
-"\nBut there is already a record:\n");
-
- rec_sprintf(buf + strlen(buf), 1000, rec);
-
- sprintf(buf + strlen(buf), "\n");
-
- ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
-
- mutex_exit(&dict_foreign_err_mutex);
-#endif
-}
-
/*******************************************************************
Checks if a unique key violation to rec would occur at the index entry
insert. */
@@ -1531,8 +1479,6 @@ row_ins_scan_sec_index_for_duplicate(
if (cmp == 0) {
if (row_ins_dupl_error_with_rec(rec, entry, index)) {
- row_ins_unique_report_err(thr, rec, entry,
- index);
err = DB_DUPLICATE_KEY;
thr_get_trx(thr)->error_info = index;
@@ -1627,8 +1573,6 @@ row_ins_duplicate_error_in_clust(
if (row_ins_dupl_error_with_rec(rec, entry,
cursor->index)) {
trx->error_info = cursor->index;
- row_ins_unique_report_err(thr, rec, entry,
- cursor->index);
return(DB_DUPLICATE_KEY);
}
}
@@ -1651,9 +1595,6 @@ row_ins_duplicate_error_in_clust(
if (row_ins_dupl_error_with_rec(rec, entry,
cursor->index)) {
trx->error_info = cursor->index;
-
- row_ins_unique_report_err(thr, rec, entry,
- cursor->index);
return(DB_DUPLICATE_KEY);
}
}
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 476ab85f62e..626382398b7 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -1408,10 +1408,12 @@ row_create_table_for_mysql(
"UNIV_MEM_DEBUG defined in univ.i and the server must be\n"
"quiet because allocation from a mem heap is not protected\n"
"by any semaphore.\n");
-
+#ifdef UNIV_MEM_DEBUG
ut_a(mem_validate());
-
printf("Memory validated\n");
+#else /* UNIV_MEM_DEBUG */
+ puts("Memory NOT validated (recompile with UNIV_MEM_DEBUG)");
+#endif /* UNIV_MEM_DEBUG */
}
heap = mem_heap_create(512);
diff --git a/innobase/row/row0row.c b/innobase/row/row0row.c
index 6c0c6c04cd5..b5d676a936a 100644
--- a/innobase/row/row0row.c
+++ b/innobase/row/row0row.c
@@ -236,61 +236,6 @@ row_build(
return(row);
}
-#ifdef notdefined
-/***********************************************************************
-An inverse function to dict_row_build_index_entry. Builds a row from a
-record in a clustered index. */
-
-void
-row_build_to_tuple(
-/*===============*/
- dtuple_t* row, /* in/out: row built; see the NOTE below! */
- dict_index_t* index, /* in: clustered index */
- rec_t* rec) /* in: record in the clustered index;
- NOTE: the data fields in the row will point
- directly into this record, therefore,
- the buffer page of this record must be
- at least s-latched and the latch held
- as long as the row dtuple is used!
- NOTE 2: does not work with externally
- stored fields! */
-{
- dict_table_t* table;
- ulint n_fields;
- ulint i;
- dfield_t* dfield;
- byte* field;
- ulint len;
- ulint row_len;
- dict_col_t* col;
-
- ut_ad(index && rec);
- ut_ad(index->type & DICT_CLUSTERED);
-
- table = index->table;
- row_len = dict_table_get_n_cols(table);
-
- dtuple_set_info_bits(row, rec_get_info_bits(rec));
-
- n_fields = dict_index_get_n_fields(index);
-
- ut_ad(n_fields == rec_get_n_fields(rec));
-
- dict_table_copy_types(row, table);
-
- for (i = 0; i < n_fields; i++) {
-
- col = dict_field_get_col(dict_index_get_nth_field(index, i));
- dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
- field = rec_get_nth_field(rec, i, &len);
-
- dfield_set_data(dfield, field, len);
- }
-
- ut_ad(dtuple_check_typed(row));
-}
-#endif
-
/***********************************************************************
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap. */
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 88809ecbd09..e9ea4155e0d 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -741,249 +741,9 @@ srv_get_thread_type(void)
return(type);
}
-/***********************************************************************
-Increments by 1 the count of active threads of the type given
-and releases master thread if necessary. */
-static
-void
-srv_inc_thread_count(
-/*=================*/
- ulint type) /* in: type of the thread */
-{
- mutex_enter(&kernel_mutex);
-
- srv_activity_count++;
-
- srv_n_threads_active[type]++;
-
- if (srv_n_threads_active[SRV_MASTER] == 0) {
-
- srv_release_threads(SRV_MASTER, 1);
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Decrements by 1 the count of active threads of the type given. */
-static
-void
-srv_dec_thread_count(
-/*=================*/
- ulint type) /* in: type of the thread */
-
-{
- mutex_enter(&kernel_mutex);
-
- /* FIXME: the following assertion sometimes fails: */
-
- if (srv_n_threads_active[type] == 0) {
- printf("Error: thread type %lu\n", (ulong) type);
-
- ut_ad(0);
- }
-
- srv_n_threads_active[type]--;
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Calculates the number of allowed utility threads for a thread to decide if
-it has to suspend itself in the thread table. */
-static
-ulint
-srv_max_n_utilities(
-/*================*/
- /* out: maximum number of allowed utilities
- of the type given */
- ulint type) /* in: utility type */
-{
- ulint ret;
-
- if (srv_n_threads_active[SRV_COM] == 0) {
- if (srv_meter[type] > srv_meter_low_water[type]) {
- return(srv_n_threads[type] / 2);
- } else {
- return(0);
- }
- } else {
-
- if (srv_meter[type] < srv_meter_foreground[type]) {
- return(0);
- }
- ret = 1 + ((srv_n_threads[type]
- * (ulint)(srv_meter[type] - srv_meter_foreground[type]))
- / (ulint)(1000 - srv_meter_foreground[type]));
- if (ret > srv_n_threads[type]) {
- return(srv_n_threads[type]);
- } else {
- return(ret);
- }
- }
-}
-
-/***********************************************************************
-Increments the utility meter by the value given and releases utility
-threads if necessary. */
-
-void
-srv_increment_meter(
-/*================*/
- ulint type, /* in: utility type */
- ulint n) /* in: value to add to meter */
-{
- ulint m;
-
- mutex_enter(&kernel_mutex);
-
- srv_meter[type] += n;
-
- m = srv_max_n_utilities(type);
-
- if (m > srv_n_threads_active[type]) {
-
- srv_release_threads(type, m - srv_n_threads_active[type]);
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Releases max number of utility threads if no queries are active and
-the high-water mark for the utility is exceeded. */
-
-void
-srv_release_max_if_no_queries(void)
-/*===============================*/
-{
- ulint m;
- ulint type;
-
- mutex_enter(&kernel_mutex);
-
- if (srv_n_threads_active[SRV_COM] > 0) {
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- type = SRV_RECOVERY;
-
- m = srv_n_threads[type] / 2;
-
- if ((srv_meter[type] > srv_meter_high_water[type])
- && (srv_n_threads_active[type] < m)) {
-
- srv_release_threads(type, m - srv_n_threads_active[type]);
-
- printf("Releasing max background\n");
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-
-/*************************************************************************
-Creates the first communication endpoint for the server. This
-first call also initializes the com0com.* module. */
-
-void
-srv_communication_init(
-/*===================*/
- char* endpoint) /* in: server address */
-{
- ulint ret;
- ulint len;
-
- srv_sys->endpoint = com_endpoint_create(COM_SHM);
-
- ut_a(srv_sys->endpoint);
-
- len = ODBC_DATAGRAM_SIZE;
-
- ret = com_endpoint_set_option(srv_sys->endpoint,
- COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&len, sizeof(ulint));
- ut_a(ret == 0);
-
- ret = com_bind(srv_sys->endpoint, endpoint, ut_strlen(endpoint));
-
- ut_a(ret == 0);
-}
-
-/*************************************************************************
-Creates the utility threads. */
-
-void
-srv_create_utility_threads(void)
-/*============================*/
-{
-/* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- mutex_enter(&kernel_mutex);
-
- srv_n_threads[SRV_RECOVERY] = 1;
- srv_n_threads_active[SRV_RECOVERY] = 1;
-
- mutex_exit(&kernel_mutex);
-
- for (i = 0; i < 1; i++) {
- /* thread = os_thread_create(srv_recovery_thread, NULL, &thr_id); */
-
- /* ut_a(thread); */
- }
-
-/* thread = os_thread_create(srv_purge_thread, NULL, &thr_id);
-
- ut_a(thread); */
-}
-
-/*************************************************************************
-Creates the communication threads. */
-
-void
-srv_create_com_threads(void)
-/*========================*/
-{
- /* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- srv_n_threads[SRV_COM] = srv_n_com_threads;
-
- for (i = 0; i < srv_n_com_threads; i++) {
- /* thread = os_thread_create(srv_com_thread, NULL, &thr_id); */
- /* ut_a(thread); */
- }
-}
-
-/*************************************************************************
-Creates the worker threads. */
-
-void
-srv_create_worker_threads(void)
-/*===========================*/
-{
-/* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- srv_n_threads[SRV_WORKER] = srv_n_worker_threads;
- srv_n_threads_active[SRV_WORKER] = srv_n_worker_threads;
-
- for (i = 0; i < srv_n_worker_threads; i++) {
- /* thread = os_thread_create(srv_worker_thread, NULL, &thr_id); */
- /* ut_a(thread); */
- }
-}
-
-
/*************************************************************************
Initializes the server. */
-
+static
void
srv_init(void)
/*==========*/
@@ -1811,13 +1571,13 @@ srv_sprintf_innodb_monitor(
#ifdef UNIV_LINUX
buf += sprintf(buf,
- "Main thread process no. %lu, id %lu, state: %s\n",
+ "Main thread process no. %lu, id %lu, state: %.29s\n",
(ulong) srv_main_thread_process_no,
(ulong) srv_main_thread_id,
srv_main_thread_op_info);
#else
buf += sprintf(buf,
- "Main thread id %lu, state: %s\n",
+ "Main thread id %lu, state: %.29s\n",
(ulong) srv_main_thread_id,
srv_main_thread_op_info);
#endif
@@ -2090,13 +1850,6 @@ loop:
srv_refresh_innodb_monitor_stats();
}
-/* mem_print_new_info();
-
- if (cnt % 10 == 0) {
-
- mem_print_info();
- }
-*/
sync_array_print_long_waits();
/* Flush stdout and stderr so that a database user gets their output
@@ -2569,12 +2322,6 @@ flush_loop:
goto background_loop;
}
-/* mem_print_new_info();
- */
-
-#ifdef UNIV_SEARCH_PERF_STAT
-/* btr_search_print_info(); */
-#endif
/* There is no work for background operations either: suspend
master thread to wait for more server activity */
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index e671e95fad3..6335b857b09 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -903,80 +903,6 @@ skip_size_check:
return(DB_SUCCESS);
}
-#ifdef notdefined
-/*********************************************************************
-This thread is used to measure contention of latches. */
-static
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint pcount, kcount, s_scount, s_xcount, s_mcount, lcount;
-
- UT_NOT_USED(arg);
-
- fprintf(stderr, "Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
-
- pcount = 0;
- kcount = 0;
- s_scount = 0;
- s_xcount = 0;
- s_mcount = 0;
- lcount = 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 (buf_pool->mutex.lock_word) {
- pcount++;
- }
-
- if (log_sys->mutex.lock_word) {
- lcount++;
- }
-
- if (btr_search_latch.reader_count) {
- s_scount++;
- }
-
- if (btr_search_latch.writer != RW_LOCK_NOT_LOCKED) {
- s_xcount++;
- }
-
- if (btr_search_latch.mutex.lock_word) {
- s_mcount++;
- }
- }
-
- fprintf(stderr,
- "Mutex res. l %lu, p %lu, k %lu s x %lu s s %lu s mut %lu of %lu\n",
- lcount, pcount, kcount, s_xcount, s_scount, s_mcount, j);
-
-/* sync_print_wait_info(); */
-
- fprintf(stderr,
- "log i/o %lu n non sea %lu n succ %lu n h fail %lu\n",
- log_sys->n_log_ios, btr_cur_n_non_sea,
- btr_search_n_succ, btr_search_n_hash_fail);
- }
-
- return(0);
-}
-#endif
-
/********************************************************************
Starts InnoDB and creates a new database if database files
are not found and the user wants. Server parameters are
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index d5a6fff47bf..22e0975dd37 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -167,46 +167,6 @@ struct sync_level_struct{
ulint level; /* level of the latch in the latching order */
};
-
-#if defined(notdefined) && defined(__GNUC__) && defined(UNIV_INTEL_X86)
-
-ulint
-sync_gnuc_intelx86_test_and_set(
- /* out: old value of the lock word */
- ulint* lw) /* in: pointer to the lock word */
-{
- ulint res;
-
- /* In assembly we use the so-called AT & T syntax where
- the order of operands is inverted compared to the ordinary Intel
- syntax. The 'l' after the mnemonics denotes a 32-bit operation.
- The line after the code tells which values come out of the asm
- code, and the second line tells the input to the asm code. */
-
- asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" :
- "=eax" (res), "=m" (*lw) :
- "ecx" (lw));
- return(res);
-}
-
-void
-sync_gnuc_intelx86_reset(
- ulint* lw) /* in: pointer to the lock word */
-{
- /* In assembly we use the so-called AT & T syntax where
- the order of operands is inverted compared to the ordinary Intel
- syntax. The 'l' after the mnemonics denotes a 32-bit operation. */
-
- asm volatile("movl $0, %%eax; xchgl (%%ecx), %%eax" :
- "=m" (*lw) :
- "ecx" (lw) :
- "eax"); /* gcc does not seem to understand
- that our asm code resets eax: tell it
- explicitly that after the third ':' */
-}
-
-#endif
-
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
location (which must be appropriately aligned). The mutex is initialized
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index a0f500e51d7..e10f019ac13 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -41,47 +41,6 @@ trx_undof_page_add_undo_rec_log(
byte* log_ptr;
ulint len;
-#ifdef notdefined
- ulint i;
- byte* prev_rec_ptr;
- byte* ptr;
- ulint min_len;
-
- ut_ad(new_free >= old_free + 4);
-
- i = 0;
- ptr = undo_page + old_free + 2;
-
- if (old_free > mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
- + TRX_UNDO_PAGE_START)) {
- prev_rec_ptr = undo_page + mach_read_from_2(ptr - 4) + 2;
-
- min_len = ut_min(new_free - old_free - 4,
- (undo_page + old_free - 2) - prev_rec_ptr);
- for (;;) {
- if (i >= min_len) {
-
- break;
- } else if ((*ptr == *prev_rec_ptr)
- || ((*ptr == *prev_rec_ptr + 1)
- && (ptr + 1 == suffix))) {
- i++;
- ptr++;
- prev_rec_ptr++;
- } else {
- break;
- }
- }
- }
-
- mlog_write_initial_log_record(undo_page, MLOG_UNDO_INSERT, mtr);
-
- mlog_catenate_ulint(mtr, old_free, MLOG_2BYTES);
-
- mlog_catenate_ulint_compressed(mtr, i);
-
- mlog_catenate_string(mtr, ptr, new_free - old_free - 2 - i);
-#endif
log_ptr = mlog_open(mtr, 30 + MLOG_BUF_MARGIN);
if (log_ptr == NULL) {
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 47927976851..0197e5cc05f 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -650,29 +650,6 @@ trx_commit_off_kernel(
if (undo) {
mutex_enter(&kernel_mutex);
-#ifdef notdefined
- /* !!!!!!!!! There is a bug here: purge and rollback
- need the whole stack of old record versions even if no
- consistent read would need them!! This is because they
- decide on the basis of the old versions when we can
- remove delete marked secondary index records! */
-
- if (!undo->del_marks && (undo->size == 1)
- && (UT_LIST_GET_LEN(trx_sys->view_list) == 1)) {
-
- /* There is no need to save the update undo
- log: discard it; note that &mtr gets committed
- while we must hold the kernel mutex and
- therefore this optimization may add to the
- contention of the kernel mutex. */
-
- lsn = trx_undo_update_cleanup_by_discard(trx,
- &mtr);
- mutex_exit(&(rseg->mutex));
-
- goto shortcut;
- }
-#endif
trx->no = trx_sys_get_new_trx_no();
mutex_exit(&kernel_mutex);
diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c
index 6cd0ed62454..534fdf072f1 100644
--- a/innobase/ut/ut0dbg.c
+++ b/innobase/ut/ut0dbg.c
@@ -18,7 +18,6 @@ ibool ut_dbg_stop_threads = FALSE;
/* Null pointer used to generate memory trap */
ulint* ut_dbg_null_ptr = NULL;
-
const char* ut_dbg_msg_assert_fail =
"InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
const char* ut_dbg_msg_trap =
diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c
index a3c78dd9709..65229335a09 100644
--- a/innobase/ut/ut0mem.c
+++ b/innobase/ut/ut0mem.c
@@ -281,4 +281,4 @@ ut_str_contains(
}
return(FALSE);
-} \ No newline at end of file
+}
diff --git a/myisam/myisam_ftdump.c b/myisam/myisam_ftdump.c
index 47134af71d6..015604aa1ad 100644
--- a/myisam/myisam_ftdump.c
+++ b/myisam/myisam_ftdump.c
@@ -20,9 +20,9 @@
#include "ftdefs.h"
#include <my_getopt.h>
-static void get_options(int *argc,char **argv[]);
static void usage();
static void complain(int val);
+static my_bool get_one_option(int, const struct my_option *, char *);
static int count=0, stats=0, dump=0, lstats=0;
static my_bool verbose;
@@ -68,7 +68,8 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
- get_options(&argc, &argv);
+ if (error=handle_options(&argc, &argv, my_long_options, get_one_option))
+ exit(error);
if (count || dump)
verbose=0;
if (!count && !dump && !lstats && !query)
@@ -80,12 +81,21 @@ int main(int argc,char *argv[])
if (argc < 2)
usage();
+ {
+ char *end;
+ inx= strtoll(argv[1], &end, 10);
+ if (*end)
+ usage();
+ }
+
init_key_cache(dflt_key_cache,MI_KEY_BLOCK_LENGTH,USE_BUFFER_INIT, 0, 0);
if (!(info=mi_open(argv[0],2,HA_OPEN_ABORT_IF_LOCKED)))
+ {
+ error=my_errno;
goto err;
+ }
- inx=atoi(argv[1]);
*buf2=0;
aio->info=info;
@@ -96,6 +106,8 @@ int main(int argc,char *argv[])
goto err;
}
+ mi_lock_database(info, F_EXTRA_LCK);
+
if (query)
{
#if 0
@@ -112,7 +124,7 @@ int main(int argc,char *argv[])
printf("%d rows matched\n",result->ndocs);
for(i=0 ; i<result->ndocs ; i++)
- printf("%9qx %20.7f\n",result->doc[i].dpos,result->doc[i].weight);
+ printf("%9lx %20.7f\n",(ulong)result->doc[i].dpos,result->doc[i].weight);
ft_nlq_close_search(result);
#else
@@ -179,6 +191,7 @@ int main(int argc,char *argv[])
if (verbose && (total%HOW_OFTEN_TO_WRITE)==0)
printf("%10ld\r",total);
}
+ mi_lock_database(info, F_UNLCK);
if (stats)
{
@@ -252,15 +265,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
-static void get_options(int *argc, char **argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
- exit(ho_error);
-} /* get options */
-
-
static void usage()
{
printf("Use: ft_dump <table_name> <index_no>\n");
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index a61ce31b8ae..0ceb6cbfaed 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -373,6 +373,19 @@ where 0=1;
delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
+insert into `t3`values ( 1 ) ;
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Cannot delete or update a parent row: a foreign key constraint fails
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+Unknown table 't1' in where clause
+drop table t3,t2,t1;
create table t1 ( a int not null, b int not null) ;
alter table t1 add index i1(a);
delete from t1 where a > 2000000;
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index e52b373a4a6..4cb6218e0c4 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -309,7 +309,19 @@ delete t1, t2 from t2,t1
where t1.id1=t2.id2 and 0=1;
drop table t1,t2;
-
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) type = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) type = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) type = innodb;
+insert into `t3`values ( 1 ) ;
+--error 1217
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1217
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1109
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+drop table t3,t2,t1;
#
# Test for bug #1820.
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 037adc64d39..d4da77d0387 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -34,11 +34,13 @@ bin_SCRIPTS = @server_scripts@ \
mysql_tableinfo \
mysqld_multi \
make_win_src_distribution \
+ make_win_binary_distribution \
mysql_create_system_tables
EXTRA_SCRIPTS = make_binary_distribution.sh \
make_sharedlib_distribution.sh \
make_win_src_distribution.sh \
+ make_win_binary_distribution.sh \
msql2mysql.sh \
mysql_config.sh \
mysql_fix_privilege_tables.sh \
diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh
new file mode 100644
index 00000000000..e5893c1eb1e
--- /dev/null
+++ b/scripts/make_win_binary_distribution.sh
@@ -0,0 +1,178 @@
+#!/bin/sh
+
+#
+# Script to create a Windows binary package
+#
+# This is intended to be used under Cygwin, and will generate
+# an archive named in the form mysql<suffix>-<version>-noinstall.zip
+
+version=@VERSION@
+
+DEBUG=0
+SUFFIX=""
+DIRNAME=""
+EXTRA=""
+
+#
+# This script must run from MySQL top directory
+#
+
+if [ ! -f scripts/make_win_binary_distribution ]; then
+ echo "ERROR : You must run this script from the MySQL top-level directory"
+ exit 1
+fi
+
+#
+# Debug print of the status
+#
+
+print_debug()
+{
+ for statement
+ do
+ if [ "$DEBUG" = "1" ] ; then
+ echo $statement
+ fi
+ done
+}
+
+#
+# Usage of the script
+#
+
+show_usage()
+{
+ echo "MySQL utility script to create a Windows binary package"
+ echo ""
+ echo "This is intended to be used under Cygwin, and will generate"
+ echo "an archive named in the form mysql<suffix>-<version>-noinstall.zip"
+ echo "Takes the following arguments:"
+ echo ""
+ echo " --dirname Directory to use for copying files"
+ echo " --extra Directory to get extra files from"
+ echo " --suffix Name to append to 'mysql' for this binary"
+ echo " --help Show this help message"
+ exit 0
+}
+
+#
+# Parse the input arguments
+#
+
+parse_arguments() {
+ for arg do
+ case "$arg" in
+ --debug) DEBUG=1;;
+ --extra=*) EXTRA=`echo "$arg" | sed -e "s;--extra=;;"` ;;
+ --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
+ --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;;
+ --help) show_usage ;;
+ *)
+ echo "Unknown argument '$arg'"
+ exit 1
+ ;;
+ esac
+ done
+}
+
+parse_arguments "$@"
+
+if [ -z "$DIRNAME" ]; then
+ $DIRNAME="dist"
+fi
+
+print_debug "Making directories"
+mkdir $DIRNAME
+$DIRNAME="$DIRNAME/mysql-$version"
+mkdir $DIRNAME
+
+for dir in bin lib lib/opt lib/debug Embedded Embedded/DLL Embedded/DLL/debug Embedded/DLL/release Embedded/static Embedded/static/release examples examples/libmysqltest
+do
+ mkdir $DIRNAME/$dir
+done
+
+if [ $EXTRA ]; then
+ print_debug "Copying extra files"
+ cp -fr $EXTRA/* $DIRNAME
+fi
+
+# Dirs to be copied as-is
+for dir in data Docs include scripts share
+do
+ print_debug "Copying $dir to $DIRNAME/"
+ cp -fr $dir $DIRNAME
+done
+
+print_debug "Copying tests to $DIRNAME/examples/"
+cp -fr tests $DIRNAME/examples
+
+print_debug "Copying sql-bench to $DIRNAME/bench"
+mkdir $DIRNAME/bench
+cp -fr sql-bench/* $DIRNAME/bench
+
+# Files for bin
+for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll
+do
+ print_debug "Copying $i to $DIRNAME/bin"
+ cp $i $DIRNAME/bin
+done
+
+# Files for include
+for i in libmysql/libmysql.def libmysqld/libmysqld.def
+do
+ print_debug "Copying $i to $DIRNAME/include"
+ cp $i $DIRNAME/include
+done
+
+# Windows users are used to having dbug.h
+cp include/my_dbug.h $DIRNAME/include/dbug.h
+
+# Libraries found in lib_release and lib_debug
+for i in libmySQL.dll libmysql.lib zlib.lib mysqlclient.lib mysys.lib regex.lib strings.lib
+do
+ print_debug "Copying lib_release/$i to $DIRNAME/lib/opt"
+ cp lib_release/$i $DIRNAME/lib/opt
+ print_debug "Copying lib_debug/$i to $DIRNAME/lib/debug"
+ cp lib_debug/$i $DIRNAME/lib/debug
+done
+
+print_debug "Copying lib_release/mysys-max.lib to $DIRNAME/lib/opt"
+cp lib_release/mysys-max.lib $DIRNAME/lib/opt
+
+# Embedded server
+for i in libmysqld.dll libmysqld.lib libmysqld.exp
+do
+ print_debug "Copying lib_release/$i to $DIRNAME/Embedded/DLL/release"
+ cp lib_release/$i $DIRNAME/Embedded/DLL/release
+ print_debug "Copying lib_debug/$i to $DIRNAME/Embedded/DLL/debug"
+ cp lib_debug/$i $DIRNAME/Embedded/DLL/debug
+done
+
+# Static embedded
+print_debug "Copying lib_release/mysqlserver.lib to $DIRNAME/Embedded/static/release"
+cp lib_release/mysqlserver.lib $DIRNAME/Embedded/static/release
+
+# libmysqltest
+for i in mytest.c mytest.dsp mytest.dsw mytest.exe
+do
+ print_debug "Copying libmysqltest/release/$i to $DIRNAME/examples/libmysqltest"
+ cp libmysqltest/release/$i $DIRNAME/examples/libmysqltest
+done
+
+print_debug "Copying README.txt"
+cp README.txt $DIRNAME
+
+if [ -f MySQLEULA.txt ]; then
+ print_debug "Commercial version: copying MySQLEULA.txt"
+ cp MySQLEULA.txt $DIRNAME
+ rm $DIRNAME/Docs/COPYING
+else
+ print_debug "GPL version: copying COPYING"
+ cp Docs/COPYING $DIRNAME
+fi
+
+print_debug "Invoking zip to package the binary"
+zip -r mysql$SUFFIX-$version-win-noinstall.zip $DIRNAME
+
+print_debug "Deleting intermediate directory"
+rm -rf $DIRNAME
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 051f3fa9c14..aa7af1cb2c6 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -84,20 +84,25 @@ port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
client_libs='@CLIENT_LIBS@'
-# Create options, without end space
+# Create options
libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs"
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@"
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
-cflags="-I$pkgincludedir @CFLAGS@"
+cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
include="-I$pkgincludedir"
embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about
-
-cflags=`echo "$cflags " | sed -e 's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g' | sed -e 's; *\$;;'`
+for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
+ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
+ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*'
+do
+ cflags=`echo "$cflags"|sed -e "s/-$remove *//g"`
+done
+cflags=`echo "$cflags"|sed -e 's/ *\$//'`
usage () {
cat <<EOF
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 46dd4d7996e..fe7d881a863 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -370,7 +370,7 @@ bool multi_delete::send_data(List<Item> &values)
table->status|= STATUS_DELETED;
if (!(error=table->file->delete_row(table->record[0])))
deleted++;
- else if (!table_being_deleted->next)
+ else if (!table_being_deleted->next || table_being_deleted->table->file->has_transactions())
{
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
@@ -473,6 +473,10 @@ int multi_delete::do_deletes(bool from_send_error)
if ((local_error=table->file->delete_row(table->record[0])))
{
table->file->print_error(local_error,MYF(0));
+ if (transactional_tables)
+ {
+ DBUG_RETURN(local_error);
+ }
break;
}
deleted++;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c515924928c..4a098cc6fc0 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4801,6 +4801,7 @@ keyword:
| MASTER_LOG_POS_SYM {}
| MASTER_USER_SYM {}
| MASTER_PASSWORD_SYM {}
+ | MASTER_SERVER_ID_SYM {}
| MASTER_CONNECT_RETRY_SYM {}
| MASTER_SSL_SYM {}
| MASTER_SSL_CA_SYM {}