Commit 192bf819 authored by unknown's avatar unknown

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
parents 984750e1 522e83b6
......@@ -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
......
......@@ -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)
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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\
......
......@@ -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
......
......@@ -1499,75 +1499,6 @@ btr_search_update_hash_on_insert(
}
}
/************************************************************************
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. */
......
......@@ -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 */
......
......@@ -964,19 +964,6 @@ com_shm_recvfrom(
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 @@ com_shm_sendto(
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
}
This diff is collapsed.
......@@ -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 @@ dict_create_add_foreigns_to_dictionary(
"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 @@ dict_create_add_foreigns_to_dictionary(
+ (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 @@ dict_create_add_foreigns_to_dictionary(
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 @@ dict_create_add_foreigns_to_dictionary(
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 @@ dict_create_add_foreigns_to_dictionary(
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);
......
......@@ -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(
/*===============*/
......
......@@ -65,33 +65,6 @@ ha_create(
return(table);
}
/*****************************************************************
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
......
......@@ -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. */
......
......@@ -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
......
......@@ -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
......
......@@ -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
/*######################################################################*/
......
......@@ -16,15 +16,6 @@ Created 1/8/1996 Heikki Tuuri
#include "row0types.h"
#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. */
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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. */
......
......@@ -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
}
/*********************************************************************
......
......@@ -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. */
......
......@@ -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
......
......@@ -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. */
......
......@@ -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
......
......@@ -6,24 +6,6 @@ Comparison services for records
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. */
......
......@@ -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*
......
......@@ -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
......
......@@ -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
......
......@@ -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(
/*===============*/
......
......@@ -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. */
......
......@@ -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
......
......@@ -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(
/*============================*/
......
# 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 =
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
/* 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;
This diff is collapsed.
......@@ -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. */
......
/* 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);
}
......@@ -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);
}
......
......@@ -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
......
......@@ -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(
/*===============*/
......
......@@ -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);
}
}
......
......@@ -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);
......
......@@ -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. */
......
......@@ -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 @@ srv_error_monitor_thread(
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 @@ srv_master_thread(
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 */
......
......@@ -903,80 +903,6 @@ open_or_create_data_files(
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
......
......@@ -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
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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 =
......
......@@ -281,4 +281,4 @@ ut_str_contains(
}
return(FALSE);
}
\ No newline at end of file
}
......@@ -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");
......
......@@ -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;
......
......@@ -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.
......
......@@ -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 \
......
#!/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
......@@ -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
......
......@@ -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++;
......
......@@ -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 {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment