mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
merge with 3.23.42
config.guess: Auto merged config.sub: Auto merged ltconfig: Auto merged BitKeeper/deleted/.del-violite.c~d7b85be615595ace: Auto merged BitKeeper/deleted/.del-violite.c~984c09cffe14a11b: Auto merged client/Makefile.am: Auto merged include/errmsg.h: Auto merged include/global.h: Auto merged include/heap.h: Auto merged include/my_sys.h: Auto merged include/mysql_com.h: Auto merged isam/isamlog.c: Auto merged libmysql/libmysql.c: Auto merged merge/open.c: Auto merged myisam/ft_search.c: Auto merged myisam/ftdefs.h: Auto merged myisam/mi_test_all.sh: Auto merged myisam/myisamchk.c: Auto merged myisam/myisamlog.c: Auto merged myisam/myisampack.c: Auto merged myisam/sort.c: Auto merged myisammrg/myrg_open.c: Auto merged mysys/hash.c: Auto merged mysys/mf_casecnv.c: Auto merged mysys/mf_format.c: Auto merged mysys/my_lib.c: Auto merged mysys/tree.c: Auto merged sql-bench/bench-init.pl.sh: Auto merged sql/filesort.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/net_serv.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/t/bdb.test: Auto merged mysql-test/t/err000001.test: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/overflow.test: Auto merged mysql-test/t/show_check.test: Auto merged sql/sql_table.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged strings/ctype.c: Auto merged Docs/manual.texi: Change to 3.23 manual. (I will later add the changes for 4.0 to this copy) client/mysql.cc: merge client/mysqlbinlog.cc: merge client/mysqldump.c: merge client/mysqltest.c: merge client/thread_test.c: merge configure.in: merge include/my_pthread.h: merge include/mysqld_error.h: merge libmysql/net.c: merge myisam/mi_cache.c: merge myisam/mi_check.c: merge mysql-test/t/fulltext.test: merge mysys/mf_qsort.c: merge sql/lock.cc: merge sql/md5.c: merge sql/mini_client.cc: merge sql/share/czech/errmsg.txt: merge sql/share/danish/errmsg.txt: merge sql/share/dutch/errmsg.txt: merge sql/share/english/errmsg.txt: merge sql/share/estonian/errmsg.txt: merge sql/share/french/errmsg.txt: merge sql/share/german/errmsg.txt: merge sql/share/greek/errmsg.txt: merge sql/share/hungarian/errmsg.txt: merge sql/share/italian/errmsg.txt: merge sql/share/japanese/errmsg.txt: merge sql/share/korean/errmsg.txt: merge sql/share/norwegian-ny/errmsg.txt: merge sql/share/norwegian/errmsg.txt: merge sql/share/polish/errmsg.txt: merge sql/share/portuguese/errmsg.txt: merge sql/share/romanian/errmsg.txt: merge sql/share/russian/errmsg.txt: merge sql/share/slovak/errmsg.txt: merge sql/share/spanish/errmsg.txt: merge sql/share/swedish/errmsg.txt: merge sql/sql_load.cc: merge sql/sql_repl.cc: merge
This commit is contained in:
commit
ddee00a6ed
250 changed files with 45513 additions and 37812 deletions
19
BUILD/compile-solaris-sparc-fortre
Executable file
19
BUILD/compile-solaris-sparc-fortre
Executable file
|
@ -0,0 +1,19 @@
|
|||
#! /bin/sh
|
||||
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
aclocal && autoheader && aclocal && automake && autoconf
|
||||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
if [ -d gemini ]
|
||||
then
|
||||
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
fi
|
||||
|
||||
PATH=/opt/SUNWspro/bin/:$PATH
|
||||
CC=cc CFLAGS="-Xa -fast -xO4 -native -xstrconst -mt -D_FORTREC_" \
|
||||
CXX=CC CXXFLAGS="-noex -xO4 -mt" \
|
||||
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
|
||||
|
||||
gmake -j 4
|
|
@ -6,8 +6,12 @@ aclocal && autoheader && aclocal && automake && autoconf
|
|||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
|
||||
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug=full --with-berkeley-db --with-innodb
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-berkeley-db --with-innodb
|
||||
|
||||
gmake -j 4
|
||||
|
||||
cd sql ; rm mysqld ; make CXXLD="purify -best-effort g++" mysqld
|
||||
cd sql ; rm mysqld ;
|
||||
make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify
|
||||
make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify
|
||||
make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ use Getopt::Long;
|
|||
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
|
||||
$opt_dbd_options=$opt_perl_options=$opt_suffix="";
|
||||
$opt_tmp=$version_suffix="";
|
||||
$opt_help=$opt_Information=$opt_no_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
|
||||
$opt_help=$opt_Information=$opt_no_delete=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
|
||||
$opt_innodb=$opt_bdb=0;
|
||||
|
||||
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip") || usage();
|
||||
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip") || usage();
|
||||
|
||||
usage() if ($opt_help || $opt_Information);
|
||||
usage() if (!$opt_distribution);
|
||||
|
@ -68,17 +68,20 @@ delete $ENV{'MY_BASEDIR_VERSION'};
|
|||
$ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread;
|
||||
$ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build";
|
||||
$ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
|
||||
$slave_port=$mysql_tcp_port+16;
|
||||
|
||||
if (-x "$host/bin/mysqladmin")
|
||||
{
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P $mysql_tcp_port -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P $slave_port -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9306 -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9307 -h $host -s shutdown");
|
||||
}
|
||||
|
||||
if ($opt_stage == 0)
|
||||
{
|
||||
print "$host: Removing old distribution\n" if ($opt_debug);
|
||||
if (-x "$host/bin/mysqladmin")
|
||||
{
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P $mysql_tcp_port -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9306 -h $host -s shutdown");
|
||||
log_system("$host/bin/mysqladmin --no-defaults -u root -P 9307 -h $host -s shutdown");
|
||||
}
|
||||
if (!$opt_use_old_distribution)
|
||||
{
|
||||
system("mkdir $host") if (! -d $host);
|
||||
|
@ -86,7 +89,6 @@ if ($opt_stage == 0)
|
|||
rm_all(<$host/mysql-*>);
|
||||
system("mkdir $host/bin") if (! -d "$host/bin");
|
||||
}
|
||||
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
||||
rm_all("$host/test");
|
||||
system("mkdir $host/test") if (! -d "$host/test");
|
||||
system("mkdir Logs") if (! -d "Logs");
|
||||
|
@ -109,6 +111,7 @@ safe_cd($ver);
|
|||
if ($opt_stage <= 1)
|
||||
{
|
||||
$opt_config_options.=" --with-low-memory" if ($opt_with_low_memory);
|
||||
# Fix files if this is in another timezone than work.mysql.com
|
||||
unlink("config.cache");
|
||||
log_system("$make clean") if ($opt_use_old_distribution);
|
||||
if ($opt_static_server)
|
||||
|
@ -140,7 +143,7 @@ if ($opt_stage <= 1)
|
|||
|
||||
if ($opt_stage <= 2)
|
||||
{
|
||||
unlink($opt_distribution) if (!$opt_no_delete && !$opt_use_old_distribution);
|
||||
unlink($opt_distribution) if (!$opt_delete && !$opt_use_old_distribution);
|
||||
safe_system("$make");
|
||||
}
|
||||
|
||||
|
@ -157,7 +160,14 @@ if ($opt_stage <= 3)
|
|||
$flags.="--no-strip" if ($opt_no_strip);
|
||||
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
|
||||
safe_system("mv mysql*.tar.gz $pwd/$host");
|
||||
safe_system("cp client/mysqladmin $pwd/$host/bin");
|
||||
if (-f "client/.libs/mysqladmin")
|
||||
{
|
||||
safe_system("cp client/.libs/mysqladmin $pwd/$host/bin");
|
||||
}
|
||||
else
|
||||
{
|
||||
safe_system("cp client/mysqladmin $pwd/$host/bin");
|
||||
}
|
||||
safe_system("$make clean") if ($opt_with_small_disk);
|
||||
}
|
||||
|
||||
|
@ -184,13 +194,14 @@ $ENV{"LD_LIBRARY_PATH"}= "$testdir/lib:" . $ENV{"LD_LIBRARY_PATH"};
|
|||
|
||||
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
|
||||
{
|
||||
my ($slave_port);
|
||||
$slave_port=$mysql_tcp_port+16;
|
||||
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
|
||||
safe_cd("${test_dir}/mysql-test");
|
||||
check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --sleep=10", "tests were successful");
|
||||
}
|
||||
|
||||
if ($opt_stage <= 6 && !$opt_no_test)
|
||||
# Start the server if we are going to run any of the benchmarks
|
||||
|
||||
if (!$opt_no_test)
|
||||
{
|
||||
my $extra;
|
||||
safe_cd($test_dir);
|
||||
|
@ -207,10 +218,11 @@ if ($opt_stage <= 6 && !$opt_no_test)
|
|||
{
|
||||
$extra.=" --innodb_data_file_path=ibdata1:100M";
|
||||
}
|
||||
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-locking $extra >> $log 2>&1 &");
|
||||
safe_system("./bin/mysqld --no-defaults --basedir . --datadir ./data --skip-l\ocking $extra >> $log 2>&1 &");
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
|
||||
if ($opt_stage <= 7 && $opt_perl_files && !$opt_no_perl && !$opt_no_test)
|
||||
{
|
||||
safe_cd($test_dir);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
# and BSD makes
|
||||
|
||||
# If you know how to fix any of this more elegantly please mail
|
||||
# david@mysql.com
|
||||
# docs@mysql.com
|
||||
|
||||
TEXI2HTML_FLAGS = -iso -number
|
||||
DVIPS = dvips
|
||||
|
@ -93,6 +93,10 @@ nusphere.pdf: manual.texi
|
|||
rm -f manual-tmp.*
|
||||
touch $@
|
||||
|
||||
# Target to produce DocBook XML
|
||||
mysql.xml: manual.texi include.texi
|
||||
$(MAKEINFO) --force --no-ifinfo --docbook manual.texi
|
||||
|
||||
# The texi2dvi gives a lot of harmless errors. Just ignore them unless
|
||||
# you want to help with the typesetting part.
|
||||
# This is the European papersize version
|
||||
|
|
65629
Docs/manual.texi
65629
Docs/manual.texi
File diff suppressed because it is too large
Load diff
|
@ -291,6 +291,7 @@ __lock_init(dbenv, lt)
|
|||
sizeof(struct __db_lock), MUTEX_ALIGN, &lp)) != 0)
|
||||
goto mem_err;
|
||||
lp->status = DB_LSTAT_FREE;
|
||||
lp->gen=0;
|
||||
if ((ret = __db_shmutex_init(dbenv, &lp->mutex,
|
||||
R_OFFSET(<->reginfo, &lp->mutex) + DB_FCNTL_OFF_LOCK,
|
||||
MUTEX_SELF_BLOCK, <->reginfo,
|
||||
|
|
|
@ -40,20 +40,15 @@ mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
|
|||
mysqlbinlog_SOURCES = mysqlbinlog.cc
|
||||
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
|
||||
sql_src=log_event.h log_event.cc
|
||||
mysys_src=mysys_priv.h
|
||||
|
||||
# Fix for mit-threads
|
||||
DEFS = -DUNDEF_THREADS_HACK
|
||||
|
||||
link_sources:
|
||||
for f in $(sql_src) ; do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ ../sql/$$f $$f; \
|
||||
done; \
|
||||
for f in $(mysys_src); do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ ../mysys/$$f $$f; \
|
||||
done;
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(top_srcdir)/sql/$$f $(srcdir)/$$f; \
|
||||
done;
|
||||
|
||||
thread_test.o: thread_test.c
|
||||
$(COMPILE) -c @MT_INCLUDES@ $(INCLUDES) $<
|
||||
|
|
|
@ -80,7 +80,7 @@ extern "C" {
|
|||
|
||||
#undef bcmp // Fix problem with new readline
|
||||
#undef bzero
|
||||
#ifdef __WIN__
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
#include <conio.h>
|
||||
#else
|
||||
#include <readline/readline.h>
|
||||
|
@ -596,7 +596,7 @@ static int get_options(int argc, char **argv)
|
|||
|
||||
set_all_changeable_vars(changeable_vars);
|
||||
while ((c=getopt_long(argc,argv,
|
||||
"?ABCD:LfgGHXinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
|
||||
(char*) "?ABCD:LfgGHXinNoqrstTU::vVw::WEe:h:O:P:S:u:#::p::",
|
||||
long_options, &option_index)) != EOF)
|
||||
{
|
||||
switch(c) {
|
||||
|
@ -795,10 +795,20 @@ static int get_options(int argc, char **argv)
|
|||
return(0);
|
||||
}
|
||||
|
||||
#if defined(OS2)
|
||||
static char* readline( char* prompt)
|
||||
{
|
||||
#if defined(OS2)
|
||||
static char linebuffer[254];
|
||||
#endif
|
||||
puts( prompt);
|
||||
return gets( linebuffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int read_lines(bool execute_commands)
|
||||
{
|
||||
#ifdef __WIN__
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
char linebuffer[254];
|
||||
#endif
|
||||
char *line;
|
||||
|
@ -818,7 +828,7 @@ static int read_lines(bool execute_commands)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef __WIN__
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
if (opt_outfile && glob_buffer.is_empty())
|
||||
fflush(OUTFILE);
|
||||
tee_fputs(glob_buffer.is_empty() ? "mysql> " :
|
||||
|
@ -1513,7 +1523,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
|||
|
||||
static void init_pager()
|
||||
{
|
||||
#ifndef __WIN__
|
||||
#if !defined( __WIN__) && !defined( OS2)
|
||||
if (!opt_nopager)
|
||||
{
|
||||
if (!(PAGER= popen(pager, "w")))
|
||||
|
@ -1529,7 +1539,7 @@ static void init_pager()
|
|||
|
||||
static void end_pager()
|
||||
{
|
||||
#ifndef __WIN__
|
||||
#if !defined( __WIN__) && !defined( OS2)
|
||||
if (!opt_nopager)
|
||||
pclose(PAGER);
|
||||
#endif
|
||||
|
@ -2452,6 +2462,9 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
|
|||
|
||||
va_start(args, fmt);
|
||||
(void) vfprintf(file, fmt, args);
|
||||
#ifdef OS2
|
||||
fflush( file);
|
||||
#endif
|
||||
if (opt_outfile)
|
||||
(void) vfprintf(OUTFILE, fmt, args);
|
||||
va_end(args);
|
||||
|
@ -2461,6 +2474,9 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
|
|||
void tee_fputs(const char *s, FILE *file)
|
||||
{
|
||||
fputs(s, file);
|
||||
#ifdef OS2
|
||||
fflush( file);
|
||||
#endif
|
||||
if (opt_outfile)
|
||||
fputs(s, OUTFILE);
|
||||
}
|
||||
|
@ -2470,6 +2486,9 @@ void tee_puts(const char *s, FILE *file)
|
|||
{
|
||||
fputs(s, file);
|
||||
fputs("\n", file);
|
||||
#ifdef OS2
|
||||
fflush( file);
|
||||
#endif
|
||||
if (opt_outfile)
|
||||
{
|
||||
fputs(s, OUTFILE);
|
||||
|
@ -2480,11 +2499,14 @@ void tee_puts(const char *s, FILE *file)
|
|||
void tee_putc(int c, FILE *file)
|
||||
{
|
||||
putc(c, file);
|
||||
#ifdef OS2
|
||||
fflush( file);
|
||||
#endif
|
||||
if (opt_outfile)
|
||||
putc(c, OUTFILE);
|
||||
}
|
||||
|
||||
#ifdef __WIN__
|
||||
#if defined( __WIN__) || defined( OS2)
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/times.h>
|
||||
|
@ -2494,7 +2516,7 @@ void tee_putc(int c, FILE *file)
|
|||
|
||||
static ulong start_timer(void)
|
||||
{
|
||||
#ifdef __WIN__
|
||||
#if defined( __WIN__) || defined( OS2)
|
||||
return clock();
|
||||
#else
|
||||
struct tms tms_tmp;
|
||||
|
|
|
@ -132,7 +132,7 @@ static struct option long_options[] = {
|
|||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
CHANGEABLE_VAR changeable_vars[] = {
|
||||
static CHANGEABLE_VAR changeable_vars[] = {
|
||||
{ "connect_timeout", (long*) &opt_connect_timeout, 0, 0, 3600*12, 0, 1},
|
||||
{ "shutdown_timeout", (long*) &opt_shutdown_timeout, SHUTDOWN_DEF_TIMEOUT, 0,
|
||||
3600*12, 0, 1},
|
||||
|
@ -152,7 +152,8 @@ int main(int argc,char *argv[])
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
set_all_changeable_vars( changeable_vars );
|
||||
|
||||
while ((c=getopt_long(argc,argv,"h:i:p::u:#::P:sS:Ct:fq?vVw::WrEO:",
|
||||
while ((c=getopt_long(argc,argv,
|
||||
(char*) "h:i:p::u:#::P:sS:Ct:fq?vVw::WrEO:",
|
||||
long_options, &option_index)) != EOF)
|
||||
{
|
||||
switch(c) {
|
||||
|
@ -1121,14 +1122,15 @@ static void wait_pidfile(char *pidfile)
|
|||
uint count=0;
|
||||
|
||||
system_filename(buff,pidfile);
|
||||
while ((fd = open(buff, O_RDONLY)) >= 0 && count++ < opt_shutdown_timeout)
|
||||
while ((fd = my_open(buff, O_RDONLY, MYF(0))) >= 0 &&
|
||||
count++ < opt_shutdown_timeout)
|
||||
{
|
||||
close(fd);
|
||||
my_close(fd,MYF(0));
|
||||
sleep(1);
|
||||
}
|
||||
if (fd >= 0)
|
||||
{
|
||||
close(fd);
|
||||
my_close(fd,MYF(0));
|
||||
fprintf(stderr,
|
||||
"Warning; Aborted waiting on pid file: '%s' after %d seconds\n",
|
||||
buff, count-1);
|
||||
|
|
|
@ -21,9 +21,8 @@
|
|||
#include <m_string.h>
|
||||
#include <my_sys.h>
|
||||
#include <getopt.h>
|
||||
#include <my_pthread.h>
|
||||
#include <thr_alarm.h>
|
||||
#include <mysql.h>
|
||||
#include <time.h>
|
||||
#include "log_event.h"
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
|
||||
|
@ -113,7 +112,7 @@ static void die(const char* fmt, ...)
|
|||
|
||||
static void print_version()
|
||||
{
|
||||
printf("%s Ver 1.5 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
|
||||
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,11 +85,11 @@ static int first_error=0;
|
|||
extern ulong net_buffer_length;
|
||||
static DYNAMIC_STRING extended_row;
|
||||
#include "sslopt-vars.h"
|
||||
FILE *result_file;
|
||||
FILE *md_result_file;
|
||||
|
||||
enum options {OPT_FTB=256, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC, OPT_KEYWORDS,
|
||||
OPT_LOCKS, OPT_DROP, OPT_OPTIMIZE, OPT_DELAYED, OPT_TABLES,
|
||||
OPT_CHARSETS_DIR, OPT_DEFAULT_CHARSET};
|
||||
enum md_options {OPT_FTB=256, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC,
|
||||
OPT_KEYWORDS, OPT_LOCKS, OPT_DROP, OPT_OPTIMIZE, OPT_DELAYED,
|
||||
OPT_TABLES, MD_OPT_CHARSETS_DIR, MD_OPT_DEFAULT_CHARSET};
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
|
@ -98,12 +98,12 @@ static struct option long_options[] =
|
|||
{"add-drop-table", no_argument, 0, OPT_DROP},
|
||||
{"add-locks", no_argument, 0, OPT_LOCKS},
|
||||
{"allow-keywords", no_argument, 0, OPT_KEYWORDS},
|
||||
{"character-sets-dir",required_argument,0, OPT_CHARSETS_DIR},
|
||||
{"character-sets-dir",required_argument,0, MD_OPT_CHARSETS_DIR},
|
||||
{"complete-insert", no_argument, 0, 'c'},
|
||||
{"compress", no_argument, 0, 'C'},
|
||||
{"databases", no_argument, 0, 'B'},
|
||||
{"debug", optional_argument, 0, '#'},
|
||||
{"default-character-set", required_argument, 0, OPT_DEFAULT_CHARSET},
|
||||
{"default-character-set", required_argument, 0, MD_OPT_DEFAULT_CHARSET},
|
||||
{"delayed-insert", no_argument, 0, OPT_DELAYED},
|
||||
{"extended-insert", no_argument, 0, 'e'},
|
||||
{"fields-terminated-by", required_argument, 0, (int) OPT_FTB},
|
||||
|
@ -145,7 +145,7 @@ static struct option long_options[] =
|
|||
|
||||
static const char *load_default_groups[]= { "mysqldump","client",0 };
|
||||
|
||||
CHANGEABLE_VAR changeable_vars[] = {
|
||||
CHANGEABLE_VAR md_changeable_vars[] = {
|
||||
{ "max_allowed_packet", (long*) &max_allowed_packet,24*1024*1024,4096,
|
||||
24*1024L*1024L,MALLOC_OVERHEAD,1024},
|
||||
{ "net_buffer_length", (long*) &net_buffer_length,1024*1024L-1025,4096,
|
||||
|
@ -265,10 +265,10 @@ puts("\
|
|||
print_defaults("my",load_default_groups);
|
||||
|
||||
printf("\nPossible variables for option --set-variable (-O) are:\n");
|
||||
for (i=0 ; changeable_vars[i].name ; i++)
|
||||
for (i=0 ; md_changeable_vars[i].name ; i++)
|
||||
printf("%-20s current value: %lu\n",
|
||||
changeable_vars[i].name,
|
||||
(ulong) *changeable_vars[i].varptr);
|
||||
md_changeable_vars[i].name,
|
||||
(ulong) *md_changeable_vars[i].varptr);
|
||||
} /* usage */
|
||||
|
||||
|
||||
|
@ -290,9 +290,9 @@ static int get_options(int *argc,char ***argv)
|
|||
int c,option_index;
|
||||
my_bool tty_password=0;
|
||||
|
||||
result_file=stdout;
|
||||
md_result_file=stdout;
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
set_all_changeable_vars(changeable_vars);
|
||||
set_all_changeable_vars(md_changeable_vars);
|
||||
while ((c=getopt_long(*argc,*argv,
|
||||
"#::p::h:u:O:P:r:S:T:EBaAcCdefFlnqtvVw:?Ix",
|
||||
long_options, &option_index)) != EOF)
|
||||
|
@ -307,10 +307,10 @@ static int get_options(int *argc,char ***argv)
|
|||
case 'A':
|
||||
opt_alldbs=1;
|
||||
break;
|
||||
case OPT_DEFAULT_CHARSET:
|
||||
case MD_OPT_DEFAULT_CHARSET:
|
||||
default_charset= optarg;
|
||||
break;
|
||||
case OPT_CHARSETS_DIR:
|
||||
case MD_OPT_CHARSETS_DIR:
|
||||
charsets_dir= optarg;
|
||||
break;
|
||||
case 'f':
|
||||
|
@ -332,7 +332,7 @@ static int get_options(int *argc,char ***argv)
|
|||
break;
|
||||
#endif
|
||||
case 'O':
|
||||
if (set_changeable_var(optarg, changeable_vars))
|
||||
if (set_changeable_var(optarg, md_changeable_vars))
|
||||
{
|
||||
usage();
|
||||
return(1);
|
||||
|
@ -355,7 +355,7 @@ static int get_options(int *argc,char ***argv)
|
|||
opt_mysql_port= (unsigned int) atoi(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
if (!(result_file = my_fopen(optarg, O_WRONLY | O_BINARY,
|
||||
if (!(md_result_file = my_fopen(optarg, O_WRONLY | O_BINARY,
|
||||
MYF(MY_WME))))
|
||||
exit(1);
|
||||
break;
|
||||
|
@ -602,7 +602,7 @@ static uint getTableStructure(char *table, char* db)
|
|||
char *strpos, *table_name;
|
||||
const char *delayed;
|
||||
char name_buff[NAME_LEN+3],table_buff[NAME_LEN+3];
|
||||
FILE *sql_file = result_file;
|
||||
FILE *sql_file = md_result_file;
|
||||
DBUG_ENTER("getTableStructure");
|
||||
|
||||
delayed= opt_delayed ? " DELAYED " : "";
|
||||
|
@ -973,15 +973,14 @@ static void dumpTable(uint numFields, char *table)
|
|||
}
|
||||
else
|
||||
{
|
||||
fprintf(result_file,"\n#\n# Dumping data for table '%s'\n", table);
|
||||
fprintf(md_result_file,"\n#\n# Dumping data for table '%s'\n", table);
|
||||
sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff));
|
||||
if (where)
|
||||
{
|
||||
fprintf(result_file,"-- WHERE: %s\n",where);
|
||||
fprintf(md_result_file,"-- WHERE: %s\n",where);
|
||||
strxmov(strend(query), " WHERE ",where,NullS);
|
||||
}
|
||||
fputs("\n\n", result_file);
|
||||
|
||||
fputs("\n\n", md_result_file);
|
||||
if (mysql_query(sock, query))
|
||||
{
|
||||
DBerror(sock, "when retrieving data from server");
|
||||
|
@ -1007,7 +1006,7 @@ static void dumpTable(uint numFields, char *table)
|
|||
}
|
||||
|
||||
if (opt_lock)
|
||||
fprintf(result_file,"LOCK TABLES %s WRITE;\n",
|
||||
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n",
|
||||
quote_name(table,table_buff));
|
||||
|
||||
total_length=net_buffer_length; /* Force row break */
|
||||
|
@ -1021,7 +1020,7 @@ static void dumpTable(uint numFields, char *table)
|
|||
ulong *lengths=mysql_fetch_lengths(res);
|
||||
rownr++;
|
||||
if (!extended_insert)
|
||||
fputs(insert_pat,result_file);
|
||||
fputs(insert_pat,md_result_file);
|
||||
mysql_field_seek(res,0);
|
||||
|
||||
for (i = 0; i < mysql_num_fields(res); i++)
|
||||
|
@ -1075,17 +1074,17 @@ static void dumpTable(uint numFields, char *table)
|
|||
else
|
||||
{
|
||||
if (i)
|
||||
fputc(',',result_file);
|
||||
fputc(',',md_result_file);
|
||||
if (row[i])
|
||||
{
|
||||
if (!IS_NUM_FIELD(field))
|
||||
unescape(result_file, row[i], lengths[i]);
|
||||
unescape(md_result_file, row[i], lengths[i]);
|
||||
else
|
||||
fputs(row[i],result_file);
|
||||
fputs(row[i],md_result_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs("NULL",result_file);
|
||||
fputs("NULL",md_result_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1098,25 +1097,25 @@ static void dumpTable(uint numFields, char *table)
|
|||
if (total_length + row_length < net_buffer_length)
|
||||
{
|
||||
total_length += row_length;
|
||||
fputc(',',result_file); /* Always row break */
|
||||
fputs(extended_row.str,result_file);
|
||||
fputc(',',md_result_file); /* Always row break */
|
||||
fputs(extended_row.str,md_result_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (row_break)
|
||||
fputs(";\n", result_file);
|
||||
fputs(";\n", md_result_file);
|
||||
row_break=1; /* This is first row */
|
||||
fputs(insert_pat,result_file);
|
||||
fputs(extended_row.str,result_file);
|
||||
fputs(insert_pat,md_result_file);
|
||||
fputs(extended_row.str,md_result_file);
|
||||
total_length = row_length+init_length;
|
||||
}
|
||||
}
|
||||
else
|
||||
fputs(");\n", result_file);
|
||||
fputs(");\n", md_result_file);
|
||||
}
|
||||
if (extended_insert && row_break)
|
||||
fputs(";\n", result_file); /* If not empty table */
|
||||
fflush(result_file);
|
||||
fputs(";\n", md_result_file); /* If not empty table */
|
||||
fflush(md_result_file);
|
||||
if (mysql_errno(sock))
|
||||
{
|
||||
sprintf(query,"%s: Error %d: %s when dumping table '%s' at row: %ld\n",
|
||||
|
@ -1130,7 +1129,7 @@ static void dumpTable(uint numFields, char *table)
|
|||
return;
|
||||
}
|
||||
if (opt_lock)
|
||||
fputs("UNLOCK TABLES;\n", result_file);
|
||||
fputs("UNLOCK TABLES;\n", md_result_file);
|
||||
mysql_free_result(res);
|
||||
}
|
||||
} /* dumpTable */
|
||||
|
@ -1206,11 +1205,11 @@ static int init_dumping(char *database)
|
|||
{
|
||||
if (opt_databases || opt_alldbs)
|
||||
{
|
||||
fprintf(result_file,"\n#\n# Current Database: %s\n#\n", database);
|
||||
fprintf(md_result_file,"\n#\n# Current Database: %s\n#\n", database);
|
||||
if (!opt_create_db)
|
||||
fprintf(result_file,"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
|
||||
fprintf(md_result_file,"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
|
||||
database);
|
||||
fprintf(result_file,"\nUSE %s;\n", database);
|
||||
fprintf(md_result_file,"\nUSE %s;\n", database);
|
||||
}
|
||||
}
|
||||
if (extended_insert)
|
||||
|
@ -1224,6 +1223,7 @@ static int dump_all_tables_in_db(char *database)
|
|||
{
|
||||
char *table;
|
||||
uint numrows;
|
||||
char table_buff[NAME_LEN+3];
|
||||
|
||||
if (init_dumping(database))
|
||||
return 1;
|
||||
|
@ -1233,7 +1233,7 @@ static int dump_all_tables_in_db(char *database)
|
|||
init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
|
||||
for (numrows=0 ; (table = getTableName(1)) ; numrows++)
|
||||
{
|
||||
dynstr_append(&query, table);
|
||||
dynstr_append(&query, quote_name(table,table_buff));
|
||||
dynstr_append(&query, " READ /*!32311 LOCAL */,");
|
||||
}
|
||||
if (numrows && mysql_real_query(sock, query.str, query.length-1))
|
||||
|
@ -1263,6 +1263,7 @@ static int dump_all_tables_in_db(char *database)
|
|||
static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
{
|
||||
uint numrows;
|
||||
char table_buff[NAME_LEN+3];
|
||||
|
||||
if (init_dumping(db))
|
||||
return 1;
|
||||
|
@ -1274,7 +1275,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||
init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
|
||||
for (i=0 ; i < tables ; i++)
|
||||
{
|
||||
dynstr_append(&query, table_names[i]);
|
||||
dynstr_append(&query, quote_name(table_names[i],table_buff));
|
||||
dynstr_append(&query, " READ /*!32311 LOCAL */,");
|
||||
}
|
||||
if (mysql_real_query(sock, query.str, query.length-1))
|
||||
|
@ -1342,7 +1343,7 @@ int main(int argc, char **argv)
|
|||
if (dbConnect(current_host, current_user, opt_password))
|
||||
exit(EX_MYSQLERR);
|
||||
if (!path)
|
||||
write_heder(result_file, *argv);
|
||||
write_heder(md_result_file, *argv);
|
||||
|
||||
if (opt_first_slave)
|
||||
{
|
||||
|
@ -1378,9 +1379,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
dbDisconnect(current_host);
|
||||
fputs("\n", result_file);
|
||||
if (result_file != stdout)
|
||||
my_fclose(result_file, MYF(0));
|
||||
fputs("\n", md_result_file);
|
||||
if (md_result_file != stdout)
|
||||
my_fclose(md_result_file, MYF(0));
|
||||
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
||||
if (extended_insert)
|
||||
dynstr_free(&extended_row);
|
||||
|
|
|
@ -41,7 +41,7 @@ static char *field_escape(char *to,const char *from,uint length);
|
|||
static char *add_load_option(char *ptr,const char *object,
|
||||
const char *statement);
|
||||
|
||||
static my_bool verbose=0,lock_tables=0,ignore_errors=0,delete=0,
|
||||
static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0,
|
||||
replace=0,silent=0,ignore=0,opt_compress=0,opt_local_file=0;
|
||||
|
||||
static MYSQL mysql_connection;
|
||||
|
@ -54,8 +54,8 @@ static uint opt_mysql_port=0;
|
|||
static my_string opt_mysql_unix_port=0;
|
||||
#include "sslopt-vars.h"
|
||||
|
||||
enum options {OPT_FTB=256, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC,
|
||||
OPT_LOW_PRIORITY, OPT_CHARSETS_DIR, OPT_DEFAULT_CHARSET};
|
||||
enum mi_options {OPT_FTB=256, OPT_LTB, OPT_ENC, OPT_O_ENC, OPT_ESC,
|
||||
OPT_LOW_PRIORITY, OPT_CHARSETS_DIR, OPT_DEFAULT_CHARSET};
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
|
@ -173,7 +173,8 @@ static int get_options(int *argc, char ***argv)
|
|||
int c, option_index;
|
||||
my_bool tty_password=0;
|
||||
|
||||
while ((c=getopt_long(*argc,*argv,"#::p::c:h:u:P:S:CdfilLrsvV?IW",
|
||||
while ((c=getopt_long(*argc,*argv,
|
||||
(char*) "#::p::c:h:u:P:S:CdfilLrsvV?IW",
|
||||
long_options, &option_index)) != EOF)
|
||||
{
|
||||
switch(c) {
|
||||
|
@ -190,7 +191,7 @@ static int get_options(int *argc, char ***argv)
|
|||
charsets_dir= optarg;
|
||||
break;
|
||||
case 'd':
|
||||
delete= 1;
|
||||
opt_delete= 1;
|
||||
break;
|
||||
case 'f':
|
||||
ignore_errors= 1;
|
||||
|
@ -313,7 +314,7 @@ static int write_to_table(char *filename, MYSQL *sock)
|
|||
else
|
||||
my_load_path(hard_path, filename, NULL); /* filename includes the path */
|
||||
|
||||
if (delete)
|
||||
if (opt_delete)
|
||||
{
|
||||
if (verbose)
|
||||
fprintf(stdout, "Deleting the old data from table %s\n", tablename);
|
||||
|
|
|
@ -51,7 +51,11 @@
|
|||
#include <mysql.h>
|
||||
#include <mysql_version.h>
|
||||
#include <m_ctype.h>
|
||||
#include <my_config.h>
|
||||
#ifdef OS2
|
||||
#include <config-os2.h>
|
||||
#else
|
||||
#include <my_config.h>
|
||||
#endif
|
||||
#include <my_dir.h>
|
||||
#include <hash.h>
|
||||
#include <mysqld_error.h>
|
||||
|
@ -247,13 +251,12 @@ static int eval_result = 0;
|
|||
|
||||
/* Disable functions that only exist in MySQL 4.0 */
|
||||
#if MYSQL_VERSION_ID < 40000
|
||||
static void mysql_enable_rpl_parse(MYSQL* mysql) {}
|
||||
static void mysql_disable_rpl_parse(MYSQL* mysql) {}
|
||||
static int mysql_rpl_parse_enabled(MYSQL* mysql) { return 1; }
|
||||
static int mysql_rpl_probe(MYSQL *mysql) { return 1; }
|
||||
static void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
|
||||
static void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
|
||||
static int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; }
|
||||
static int mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
|
||||
#endif
|
||||
|
||||
|
||||
static void do_eval(DYNAMIC_STRING* query_eval, const char* query)
|
||||
{
|
||||
const char* p;
|
||||
|
@ -829,6 +832,17 @@ int do_sleep(struct st_query* q)
|
|||
if (!*p)
|
||||
die("Missing argument in sleep\n");
|
||||
t.tv_usec = 0;
|
||||
|
||||
#ifdef OS2
|
||||
|
||||
if (opt_sleep)
|
||||
DosSleep( opt_sleep * 1000);
|
||||
else
|
||||
DosSleep( atof( p) * 1000);
|
||||
|
||||
return 0;
|
||||
|
||||
#else
|
||||
if (opt_sleep)
|
||||
t.tv_sec = opt_sleep;
|
||||
else
|
||||
|
@ -858,6 +872,7 @@ int do_sleep(struct st_query* q)
|
|||
}
|
||||
t.tv_usec *= dec_mul;
|
||||
return select(0,0,0,0, &t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void get_file_name(char *filename, struct st_query* q)
|
||||
|
@ -1889,8 +1904,8 @@ static VAR* var_init(VAR* v, const char* name, int name_len, const char* val,
|
|||
|
||||
static void var_free(void* v)
|
||||
{
|
||||
my_free(((VAR*)v)->str_val, MYF(MY_WME));
|
||||
my_free(v, MYF(MY_WME));
|
||||
my_free(((VAR*) v)->str_val, MYF(MY_WME));
|
||||
my_free((char*) v, MYF(MY_WME));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2751,7 +2766,7 @@ uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
|||
{
|
||||
reg1 REPLACE *rep_pos;
|
||||
reg2 REPLACE_STRING *rep_str;
|
||||
my_string to,end,pos,new;
|
||||
my_string to,end,pos,new_str;
|
||||
|
||||
end=(to= *start) + *max_length-1;
|
||||
rep_pos=rep+1;
|
||||
|
@ -2763,10 +2778,10 @@ uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
|||
if (to == end)
|
||||
{
|
||||
(*max_length)+=8192;
|
||||
if (!(new=my_realloc(*start,*max_length,MYF(MY_WME))))
|
||||
if (!(new_str=my_realloc(*start,*max_length,MYF(MY_WME))))
|
||||
return (uint) -1;
|
||||
to=new+(to - *start);
|
||||
end=(*start=new)+ *max_length-1;
|
||||
to=new_str+(to - *start);
|
||||
end=(*start=new_str)+ *max_length-1;
|
||||
}
|
||||
*to++= *from++;
|
||||
}
|
||||
|
@ -2778,10 +2793,10 @@ uint replace_strings(REPLACE *rep, my_string *start,uint *max_length,
|
|||
if (to == end)
|
||||
{
|
||||
(*max_length)*=2;
|
||||
if (!(new=my_realloc(*start,*max_length,MYF(MY_WME))))
|
||||
if (!(new_str=my_realloc(*start,*max_length,MYF(MY_WME))))
|
||||
return (uint) -1;
|
||||
to=new+(to - *start);
|
||||
end=(*start=new)+ *max_length-1;
|
||||
to=new_str+(to - *start);
|
||||
end=(*start=new_str)+ *max_length-1;
|
||||
}
|
||||
*to++= *pos;
|
||||
}
|
||||
|
|
68
config.guess
vendored
68
config.guess
vendored
|
@ -790,7 +790,7 @@ EOF
|
|||
i?86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i?86:UNIX_SV:4.2MP:2.*)
|
||||
i*86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
|
@ -798,64 +798,24 @@ EOF
|
|||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i?86:UnixWare:5:7) # Unixware 7.0.0t (uname -v reports 7) has native threads
|
||||
# uname -m incorrectly reports CPU type (uname -m reports i386 always)
|
||||
# compiler supports following optimization flags:i386,i486,pentium,pentium_pro and blended
|
||||
# compiler does NOT support: i586,i686,Pentium,Pentium Pro,pentiumpro,pentium_II or Pentium II
|
||||
if /bin/uname machine 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname machine|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname machine|egrep 'Pentium' >/dev/null) && UNAME_MACHINE=pentium
|
||||
(/bin/uname machine|egrep 'Pentium Pro' >/dev/null) && UNAME_MACHINE=pentium_pro
|
||||
(/bin/uname machine|egrep 'Pentium II' >/dev/null) && UNAME_MACHINE=pentium_II
|
||||
echo ${UNAME_MACHINE}-pc-unixware7.0.0
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-unixware7.0.0
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:UnixWare:5:7.0.1) # Unixware 7.0.1 (uname -v reports 7.0.1) has POSIX threads
|
||||
# uname -m incorrectly reports CPU type (uname -m reports i386 always)
|
||||
# compiler supports following optimization flags:i386,i486,pentium,pentium_pro and blended
|
||||
# compiler does NOT support: i586,i686,Pentium,Pentium Pro,pentiumpro,pentium_II or Pentium II
|
||||
if /bin/uname machine 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname machine|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname machine|egrep 'Pentium' >/dev/null) && UNAME_MACHINE=pentium
|
||||
(/bin/uname machine|egrep 'Pentium Pro' >/dev/null) && UNAME_MACHINE=pentium_pro
|
||||
(/bin/uname machine|egrep 'Pentium II' >/dev/null) && UNAME_MACHINE=pentium_II
|
||||
echo ${UNAME_MACHINE}-pc-unixware7.0.1
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-unixware7.0.1
|
||||
fi
|
||||
exit 0 ;;
|
||||
# SysVr5/Unixware7
|
||||
i?86:*:5*:* | i?86:SYSTEM_V:5*:*)
|
||||
if uname -a | grep SCO >/dev/null 2>/dev/null ; then
|
||||
(/bin/uname -s|egrep UnixWare >/dev/null) && UNAME_VER=uw${UNAME_VERSION}
|
||||
if /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}${UNAME_VER}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
|
||||
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
|
||||
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
|
||||
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
|
||||
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i?86:*:5:7*)
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
|
||||
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
|
||||
i*86:*:5:[78]*)
|
||||
case `/bin/uname -X | grep "^Machine"` in
|
||||
*486*) UNAME_MACHINE=i486 ;;
|
||||
*Pentium) UNAME_MACHINE=i586 ;;
|
||||
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
|
||||
esac
|
||||
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
|
||||
|
||||
exit 0 ;;
|
||||
i?86:*:3.2:*)
|
||||
i*86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
|
|
198
config.sub
vendored
198
config.sub
vendored
|
@ -45,23 +45,66 @@
|
|||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
then
|
||||
echo Configuration name missing. 1>&2
|
||||
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
|
||||
echo "or $0 ALIAS" 1>&2
|
||||
echo where ALIAS is a recognized configuration type. 1>&2
|
||||
exit 1
|
||||
fi
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
# First pass through any local machine types.
|
||||
case $1 in
|
||||
*local*)
|
||||
echo $1
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
usage="\
|
||||
Usage: $0 [OPTION] CPU-MFR-OPSYS
|
||||
$0 [OPTION] ALIAS
|
||||
|
||||
Canonicalize a configuration name.
|
||||
|
||||
Operation modes:
|
||||
-h, --help print this help, then exit
|
||||
-t, --time-stamp print date of last modification, then exit
|
||||
-v, --version print version number, then exit
|
||||
|
||||
Report bugs and patches to <config-patches@gnu.org>."
|
||||
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
|
||||
help="
|
||||
Try \`$me --help' for more information."
|
||||
|
||||
# Parse command line
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
--time-stamp | --time* | -t )
|
||||
echo "$timestamp" ; exit 0 ;;
|
||||
--version | -v )
|
||||
echo "$version" ; exit 0 ;;
|
||||
--help | --h* | -h )
|
||||
echo "$usage"; exit 0 ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
- ) # Use stdin as input.
|
||||
break ;;
|
||||
-* )
|
||||
echo "$me: invalid option $1$help"
|
||||
exit 1 ;;
|
||||
|
||||
*local*)
|
||||
# First pass through any local machine types.
|
||||
echo $1
|
||||
exit 0;;
|
||||
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) echo "$me: missing argument$help" >&2
|
||||
exit 1;;
|
||||
1) ;;
|
||||
*) echo "$me: too many arguments$help" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
|
@ -168,27 +211,40 @@ esac
|
|||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
|
||||
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
|
||||
| pyramid | mn10200 | mn10300 | tron | a29k \
|
||||
| 580 | i960 | h8300 \
|
||||
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
|
||||
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
|
||||
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
|
||||
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
|
||||
| hppa64 \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
|
||||
| alphaev6[78] \
|
||||
| we32k | ns16k | clipper | i370 | sh | sh[34] \
|
||||
| powerpc | powerpcle \
|
||||
| 1750a | dsp16xx | pdp10 | pdp11 \
|
||||
| mips16 | mips64 | mipsel | mips64el \
|
||||
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
|
||||
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr5000 | miprs64vr5000el \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
|
||||
| thumb | d10v)
|
||||
| mips64vr5000 | mips64vr5000el | mcore | s390 | s390x \
|
||||
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
|
||||
| v850 | c4x \
|
||||
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
|
||||
| pj | pjl | h8500 | z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[34567]86)
|
||||
i*86 | x86_64)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
|
@ -197,23 +253,31 @@ case $basic_machine in
|
|||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
# FIXME: clean up the formatting here.
|
||||
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
|
||||
| xmp-* | ymp-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
|
||||
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
|
||||
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
|
||||
| hppa2.0n-* | hppa64-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
|
||||
| alphaev6[78]-* \
|
||||
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
|
||||
| clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
|
||||
| sparclite-* | pdp10-* | pdp11-* | sh-* | sh[34]-* | sh[34]eb-* \
|
||||
| powerpc-* | powerpcle-* | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
|
||||
| mips16-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-* | armv*-* | t3e-* \
|
||||
| mipstx39-* | mipstx39el-* | mcore-* \
|
||||
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
|
||||
| [cjt]90-* \
|
||||
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | ia64-* )
|
||||
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
|
||||
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
|
@ -431,22 +495,21 @@ case $basic_machine in
|
|||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[34567]86v32)
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[34567]86v4*)
|
||||
i*86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[34567]86v)
|
||||
i*86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[34567]86sol2)
|
||||
i*86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
|
@ -577,9 +640,16 @@ case $basic_machine in
|
|||
basic_machine=i960-intel
|
||||
os=-mon960
|
||||
;;
|
||||
nonstopux)
|
||||
basic_machine=mips-compaq
|
||||
os=-nonstopux
|
||||
;;
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
op50n-* | op60c-*)
|
||||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
|
@ -609,28 +679,28 @@ case $basic_machine in
|
|||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexen)
|
||||
pentium | p5 | k5 | k6 | nexgen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | 6x86)
|
||||
pentiumpro | p6 | 6x86 | athlon)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexen-*)
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-*)
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=rs6000-ibm
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
|
@ -645,6 +715,10 @@ case $basic_machine in
|
|||
ps2)
|
||||
basic_machine=i386-ibm
|
||||
;;
|
||||
pw32)
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rom68k)
|
||||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
|
@ -855,6 +929,9 @@ case $basic_machine in
|
|||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
|
@ -917,14 +994,29 @@ case $os in
|
|||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -openstep* | -oskit*)
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
case $basic_machine in
|
||||
x86-* | i*86-*)
|
||||
;;
|
||||
*)
|
||||
os=-nto$os
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
|
||||
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
|
||||
;;
|
||||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
|
@ -1225,3 +1317,11 @@ case $basic_machine in
|
|||
esac
|
||||
|
||||
echo $basic_machine$os
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "timestamp='"
|
||||
# time-stamp-format: "%:y-%02m-%02d"
|
||||
# time-stamp-end: "'"
|
||||
# End:
|
||||
|
|
68
configure.in
68
configure.in
|
@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
AC_INIT(sql/mysqld.cc)
|
||||
AC_CANONICAL_SYSTEM
|
||||
# The Docs Makefile.am parses this line!
|
||||
AM_INIT_AUTOMAKE(mysql, 4.0.0)
|
||||
AM_INIT_AUTOMAKE(mysql, 4.0.0-alpha)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
@ -264,7 +264,16 @@ case "$target_os" in
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
sysv5uw7*)
|
||||
sysv5UnixWare*)
|
||||
if test "$GCC" != "yes"; then
|
||||
# We are using built-in inline function
|
||||
CFLAGS="$CFLAGS -Kalloca"
|
||||
CXX="$CXX -DNO_CPLUSPLUS_ALLOCA"
|
||||
else
|
||||
CXX="$CXX -DNO_CPLUSPLUS_ALLOCA"
|
||||
fi
|
||||
;;
|
||||
sysv5OpenUNIX8*)
|
||||
if test "$GCC" != "yes"; then
|
||||
# We are using built-in inline function
|
||||
CFLAGS="$CFLAGS -Kalloca"
|
||||
|
@ -274,7 +283,6 @@ case "$target_os" in
|
|||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(CC)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(CXX)
|
||||
|
@ -1023,7 +1031,7 @@ fi
|
|||
if test "$with_named_thread" = "no"
|
||||
then
|
||||
AC_MSG_CHECKING("SCO UnixWare7 native threads")
|
||||
if expr "$SYSTEM_TYPE" : ".*unixware7*" > /dev/null
|
||||
if expr "$SYSTEM_TYPE" : ".*UnixWare*" > /dev/null
|
||||
then
|
||||
if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
|
||||
then
|
||||
|
@ -1053,6 +1061,45 @@ then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Hack for Caldera OpenUNIX8
|
||||
#
|
||||
if test "$with_named_thread" = "no"
|
||||
then
|
||||
AC_MSG_CHECKING("OpenUNIX8 native threads")
|
||||
if expr "$SYSTEM_TYPE" : ".*OpenUNIX*" > /dev/null
|
||||
then
|
||||
if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
|
||||
then
|
||||
MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
|
||||
with_named_thread="-Kthread -lsocket -lnsl"
|
||||
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
|
||||
then
|
||||
# AC_DEFINE(HAVE_OpenUNIX8_THREADS)
|
||||
AC_DEFINE(HAVE_UNIXWARE7_THREADS)
|
||||
else
|
||||
# AC_DEFINE(HAVE_OpenUNIX8_POSIX)
|
||||
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
|
||||
fi
|
||||
# We must have cc
|
||||
AC_MSG_CHECKING("for gcc")
|
||||
if expr "$CC" : ".*gcc.*"
|
||||
then
|
||||
{ echo "configure: error: On OpenUNIX8 and UnixWare7 MySQL must be compiled with cc. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
|
||||
else
|
||||
# CC="$CC -Kthread -DOpenUNIX8";
|
||||
# CXX="$CXX -Kthread -DOpenUNIX8";
|
||||
CC="$CC -Kthread -DUNIXWARE_7";
|
||||
CXX="$CXX -Kthread -DUNIXWARE_7";
|
||||
fi
|
||||
AC_MSG_RESULT("yes")
|
||||
else
|
||||
{ echo "configure: error: Can't find thread libs on Caldera OpenUNIX 8. See the Installation chapter in the Reference Manual." 1>&2; exit 1; };
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT("no")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Hack for Siemens UNIX
|
||||
if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no"
|
||||
then
|
||||
|
@ -1414,7 +1461,7 @@ AC_CHECK_FUNCS(alarm bmove \
|
|||
getrusage getpwuid getcwd getrlimit getwd index stpcpy locking longjmp \
|
||||
perror pread realpath readlink rename \
|
||||
socket strnlen madvise mkstemp \
|
||||
strtol strtoul strtoull snprintf tempnam thr_setconcurrency \
|
||||
strtol strtoul strtoll strtoull snprintf tempnam thr_setconcurrency \
|
||||
gethostbyaddr_r gethostbyname_r getpwnam \
|
||||
bfill bzero bcmp strstr strpbrk strerror \
|
||||
tell atod memcpy memmove \
|
||||
|
@ -1452,7 +1499,8 @@ then
|
|||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
fi
|
||||
AC_TRY_COMPILE(
|
||||
[#if !defined(SCO) && !defined(__osf__)
|
||||
[#undef inline
|
||||
#if !defined(SCO) && !defined(__osf__)
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
@ -1484,7 +1532,8 @@ then
|
|||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
fi
|
||||
AC_TRY_COMPILE(
|
||||
[#if !defined(SCO) && !defined(__osf__)
|
||||
[#undef inline
|
||||
#if !defined(SCO) && !defined(__osf__)
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
@ -1515,7 +1564,8 @@ then
|
|||
CXXFLAGS="$CXXFLAGS -Werror"
|
||||
fi
|
||||
AC_TRY_COMPILE(
|
||||
[#if !defined(SCO) && !defined(__osf__)
|
||||
[#undef inline
|
||||
#if !defined(SCO) && !defined(__osf__)
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
@ -1526,7 +1576,7 @@ AC_TRY_COMPILE(
|
|||
#include <netdb.h>],
|
||||
[int skr;
|
||||
|
||||
skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (hostent_data*) 0);],
|
||||
skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);],
|
||||
mysql_cv_gethostname_arg=hostent_data, mysql_cv_gethostname_arg=char))
|
||||
AC_LANG_RESTORE
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
|
|
181
dbug/dbug.c
181
dbug/dbug.c
|
@ -307,6 +307,7 @@ static char *static_strtok(char *s1,pchar chr);
|
|||
* Macros and defines for testing file accessibility under UNIX and MSDOS.
|
||||
*/
|
||||
|
||||
#undef EXISTS
|
||||
#if !defined(HAVE_ACCESS) || defined(MSDOS)
|
||||
#define EXISTS(pathname) (FALSE) /* Assume no existance */
|
||||
#define Writable(name) (TRUE)
|
||||
|
@ -489,8 +490,7 @@ static CODE_STATE static_code_state = { 0,0,"?func","?file",NULL,0,NULL,
|
|||
*
|
||||
*/
|
||||
|
||||
void _db_push_ (control)
|
||||
const char *control;
|
||||
void _db_push_ (const char *control)
|
||||
{
|
||||
reg1 char *scan;
|
||||
reg2 struct link *temp;
|
||||
|
@ -691,15 +691,14 @@ void _db_pop_ ()
|
|||
*
|
||||
*/
|
||||
|
||||
void _db_enter_ (_func_, _file_, _line_, _sfunc_, _sfile_, _slevel_,
|
||||
_sframep_)
|
||||
const char *_func_;
|
||||
const char *_file_;
|
||||
uint _line_;
|
||||
const char **_sfunc_;
|
||||
const char **_sfile_;
|
||||
uint *_slevel_;
|
||||
char ***_sframep_ __attribute__((unused));
|
||||
void _db_enter_ (
|
||||
const char *_func_,
|
||||
const char *_file_,
|
||||
uint _line_,
|
||||
const char **_sfunc_,
|
||||
const char **_sfile_,
|
||||
uint *_slevel_,
|
||||
char ***_sframep_ __attribute__((unused)))
|
||||
{
|
||||
reg1 CODE_STATE *state;
|
||||
|
||||
|
@ -777,11 +776,11 @@ char ***_sframep_ __attribute__((unused));
|
|||
*
|
||||
*/
|
||||
|
||||
void _db_return_ (_line_, _sfunc_, _sfile_, _slevel_)
|
||||
uint _line_;
|
||||
const char **_sfunc_;
|
||||
const char **_sfile_;
|
||||
uint *_slevel_;
|
||||
void _db_return_ (
|
||||
uint _line_,
|
||||
const char **_sfunc_,
|
||||
const char **_sfile_,
|
||||
uint *_slevel_)
|
||||
{
|
||||
CODE_STATE *state;
|
||||
|
||||
|
@ -851,9 +850,9 @@ uint *_slevel_;
|
|||
*
|
||||
*/
|
||||
|
||||
void _db_pargs_ (_line_, keyword)
|
||||
uint _line_;
|
||||
const char *keyword;
|
||||
void _db_pargs_ (
|
||||
uint _line_,
|
||||
const char *keyword)
|
||||
{
|
||||
CODE_STATE *state=code_state();
|
||||
state->u_line = _line_;
|
||||
|
@ -934,10 +933,11 @@ void _db_doprnt_ (const char *format,...)
|
|||
* Is used to examine corrputed memory or arrays.
|
||||
*/
|
||||
|
||||
void _db_dump_(_line_,keyword,memory,length)
|
||||
uint _line_,length;
|
||||
const char *keyword;
|
||||
const char *memory;
|
||||
void _db_dump_(
|
||||
uint _line_,
|
||||
const char *keyword,
|
||||
const char *memory,
|
||||
uint length)
|
||||
{
|
||||
int pos;
|
||||
char dbuff[90];
|
||||
|
@ -1004,11 +1004,11 @@ const char *memory;
|
|||
*
|
||||
*/
|
||||
|
||||
static struct link *ListParse (ctlp)
|
||||
char *ctlp;
|
||||
static struct link *ListParse (
|
||||
char *ctlp)
|
||||
{
|
||||
REGISTER char *start;
|
||||
REGISTER struct link *new;
|
||||
REGISTER struct link *new_malloc;
|
||||
REGISTER struct link *head;
|
||||
|
||||
head = NULL;
|
||||
|
@ -1020,10 +1020,10 @@ char *ctlp;
|
|||
if (*ctlp == ',') {
|
||||
*ctlp++ = EOS;
|
||||
}
|
||||
new = (struct link *) DbugMalloc (sizeof (struct link));
|
||||
new -> str = StrDup (start);
|
||||
new -> next_link = head;
|
||||
head = new;
|
||||
new_malloc = (struct link *) DbugMalloc (sizeof (struct link));
|
||||
new_malloc -> str = StrDup (start);
|
||||
new_malloc -> next_link = head;
|
||||
head = new_malloc;
|
||||
}
|
||||
return (head);
|
||||
}
|
||||
|
@ -1052,9 +1052,9 @@ char *ctlp;
|
|||
*
|
||||
*/
|
||||
|
||||
static BOOLEAN InList (linkp, cp)
|
||||
struct link *linkp;
|
||||
const char *cp;
|
||||
static BOOLEAN InList (
|
||||
struct link *linkp,
|
||||
const char *cp)
|
||||
{
|
||||
REGISTER struct link *scan;
|
||||
REGISTER BOOLEAN result;
|
||||
|
@ -1098,7 +1098,7 @@ const char *cp;
|
|||
|
||||
static void PushState ()
|
||||
{
|
||||
REGISTER struct state *new;
|
||||
REGISTER struct state *new_malloc;
|
||||
|
||||
if (!init_done)
|
||||
{
|
||||
|
@ -1106,19 +1106,19 @@ static void PushState ()
|
|||
init_done=TRUE;
|
||||
}
|
||||
(void) code_state(); /* Alloc memory */
|
||||
new = (struct state *) DbugMalloc (sizeof (struct state));
|
||||
new -> flags = 0;
|
||||
new -> delay = 0;
|
||||
new -> maxdepth = MAXDEPTH;
|
||||
new -> sub_level=0;
|
||||
new -> out_file = stderr;
|
||||
new -> prof_file = (FILE*) 0;
|
||||
new -> functions = NULL;
|
||||
new -> p_functions = NULL;
|
||||
new -> keywords = NULL;
|
||||
new -> processes = NULL;
|
||||
new -> next_state = stack;
|
||||
stack=new;
|
||||
new_malloc = (struct state *) DbugMalloc (sizeof (struct state));
|
||||
new_malloc -> flags = 0;
|
||||
new_malloc -> delay = 0;
|
||||
new_malloc -> maxdepth = MAXDEPTH;
|
||||
new_malloc -> sub_level=0;
|
||||
new_malloc -> out_file = stderr;
|
||||
new_malloc -> prof_file = (FILE*) 0;
|
||||
new_malloc -> functions = NULL;
|
||||
new_malloc -> p_functions = NULL;
|
||||
new_malloc -> keywords = NULL;
|
||||
new_malloc -> processes = NULL;
|
||||
new_malloc -> next_state = stack;
|
||||
stack=new_malloc;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1216,8 +1216,8 @@ static BOOLEAN DoProfile ()
|
|||
*
|
||||
*/
|
||||
|
||||
BOOLEAN _db_keyword_ (keyword)
|
||||
const char *keyword;
|
||||
BOOLEAN _db_keyword_ (
|
||||
const char *keyword)
|
||||
{
|
||||
REGISTER BOOLEAN result;
|
||||
CODE_STATE *state;
|
||||
|
@ -1256,8 +1256,8 @@ const char *keyword;
|
|||
*
|
||||
*/
|
||||
|
||||
static void Indent (indent)
|
||||
int indent;
|
||||
static void Indent (
|
||||
int indent)
|
||||
{
|
||||
REGISTER int count;
|
||||
|
||||
|
@ -1289,8 +1289,8 @@ int indent;
|
|||
*
|
||||
*/
|
||||
|
||||
static void FreeList (linkp)
|
||||
struct link *linkp;
|
||||
static void FreeList (
|
||||
struct link *linkp)
|
||||
{
|
||||
REGISTER struct link *old;
|
||||
|
||||
|
@ -1325,13 +1325,13 @@ struct link *linkp;
|
|||
*/
|
||||
|
||||
|
||||
static char *StrDup (str)
|
||||
const char *str;
|
||||
static char *StrDup (
|
||||
const char *str)
|
||||
{
|
||||
reg1 char *new;
|
||||
new = DbugMalloc ((int) strlen (str) + 1);
|
||||
(void) strcpy (new, str);
|
||||
return (new);
|
||||
reg1 char *new_malloc;
|
||||
new_malloc = DbugMalloc ((int) strlen (str) + 1);
|
||||
(void) strcpy (new_malloc, str);
|
||||
return (new_malloc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1354,8 +1354,8 @@ const char *str;
|
|||
*
|
||||
*/
|
||||
|
||||
static void DoPrefix (_line_)
|
||||
uint _line_;
|
||||
static void DoPrefix (
|
||||
uint _line_)
|
||||
{
|
||||
CODE_STATE *state;
|
||||
state=code_state();
|
||||
|
@ -1365,7 +1365,7 @@ uint _line_;
|
|||
#ifdef THREAD
|
||||
(void) fprintf (_db_fp_, "%-7s: ", my_thread_name());
|
||||
#else
|
||||
(void) fprintf (_db_fp_, "%5d: ", getpid ());
|
||||
(void) fprintf (_db_fp_, "%5d: ", (int) getpid ());
|
||||
#endif
|
||||
}
|
||||
if (stack -> flags & NUMBER_ON) {
|
||||
|
@ -1419,7 +1419,7 @@ static void DBUGOpenFile (const char *name,int append)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!Writable(name))
|
||||
if (!Writable((char*)name))
|
||||
{
|
||||
(void) fprintf (stderr, ERR_OPEN, _db_process_, name);
|
||||
perror ("");
|
||||
|
@ -1528,8 +1528,8 @@ static FILE *OpenProfile (const char *name)
|
|||
*
|
||||
*/
|
||||
|
||||
static void CloseFile (fp)
|
||||
FILE *fp;
|
||||
static void CloseFile (
|
||||
FILE *fp)
|
||||
{
|
||||
if (fp != stderr && fp != stdout) {
|
||||
if (fclose (fp) == EOF) {
|
||||
|
@ -1590,14 +1590,14 @@ static void DbugExit (const char *why)
|
|||
*
|
||||
*/
|
||||
|
||||
static char *DbugMalloc (size)
|
||||
int size;
|
||||
static char *DbugMalloc (
|
||||
int size)
|
||||
{
|
||||
register char *new;
|
||||
register char *new_malloc;
|
||||
|
||||
if (!(new = malloc ((unsigned int) size)))
|
||||
if (!(new_malloc = (char*) malloc ((unsigned int) size)))
|
||||
DbugExit ("out of memory");
|
||||
return (new);
|
||||
return (new_malloc);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1606,9 +1606,9 @@ int size;
|
|||
* separator (to allow directory-paths in dos).
|
||||
*/
|
||||
|
||||
static char *static_strtok (s1, separator)
|
||||
char *s1;
|
||||
pchar separator;
|
||||
static char *static_strtok (
|
||||
char *s1,
|
||||
pchar separator)
|
||||
{
|
||||
static char *end = NULL;
|
||||
reg1 char *rtnval,*cpy;
|
||||
|
@ -1692,8 +1692,8 @@ static char *BaseName (const char *pathname)
|
|||
|
||||
#ifndef Writable
|
||||
|
||||
static BOOLEAN Writable (pathname)
|
||||
char *pathname;
|
||||
static BOOLEAN Writable (
|
||||
char *pathname)
|
||||
{
|
||||
REGISTER BOOLEAN granted;
|
||||
REGISTER char *lastslash;
|
||||
|
@ -1746,8 +1746,8 @@ char *pathname;
|
|||
*/
|
||||
|
||||
#ifndef ChangeOwner
|
||||
static void ChangeOwner (pathname)
|
||||
char *pathname;
|
||||
static void ChangeOwner (
|
||||
char *pathname)
|
||||
{
|
||||
if (chown (pathname, getuid (), getgid ()) == -1)
|
||||
{
|
||||
|
@ -1847,8 +1847,8 @@ EXPORT void _db_longjmp_ ()
|
|||
#define HZ (50) /* Probably in some header somewhere */
|
||||
#endif
|
||||
|
||||
static int DelayArg (value)
|
||||
int value;
|
||||
static int DelayArg (
|
||||
int value)
|
||||
{
|
||||
uint delayarg = 0;
|
||||
|
||||
|
@ -1868,8 +1868,8 @@ int value;
|
|||
*/
|
||||
|
||||
#if ! defined(Delay) && ! defined(AMIGA)
|
||||
static int Delay (ticks)
|
||||
int ticks;
|
||||
static int Delay (
|
||||
int ticks)
|
||||
{
|
||||
return ticks;
|
||||
}
|
||||
|
@ -1969,12 +1969,13 @@ void _db_unlock_file()
|
|||
* own for whatever system that you have.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_GETRUSAGE
|
||||
#ifndef THREAD
|
||||
#if defined(HAVE_GETRUSAGE)
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
/* extern int getrusage(int, struct rusage *); */
|
||||
/* extern int getrusage(int, struct rusage *); */
|
||||
|
||||
/*
|
||||
* Returns the user time in milliseconds used by this process so
|
||||
|
@ -1989,15 +1990,13 @@ static unsigned long Clock ()
|
|||
return ((ru.ru_utime.tv_sec * 1000) + (ru.ru_utime.tv_usec / 1000));
|
||||
}
|
||||
|
||||
#else
|
||||
#if defined(MSDOS) || defined(__WIN__)
|
||||
#elif defined(MSDOS) || defined(__WIN__) || defined(OS2)
|
||||
|
||||
static ulong Clock()
|
||||
{
|
||||
return clock()*(1000/CLOCKS_PER_SEC);
|
||||
}
|
||||
#else
|
||||
#ifdef amiga
|
||||
#elif defined (amiga)
|
||||
|
||||
struct DateStamp { /* Yes, this is a hack, but doing it right */
|
||||
long ds_Days; /* is incredibly ugly without splitting this */
|
||||
|
@ -2030,19 +2029,13 @@ static unsigned long Clock ()
|
|||
}
|
||||
return (millisec);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#ifndef THREAD
|
||||
static unsigned long Clock ()
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
#endif /* amiga */
|
||||
#endif /* MSDOS || __WIN__ */
|
||||
#endif /* RUSAGE */
|
||||
|
||||
#endif /* THREADS */
|
||||
|
||||
#ifdef NO_VARARGS
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include <global.h>
|
||||
|
||||
int factorial (value)
|
||||
register int value;
|
||||
int factorial (
|
||||
register int value)
|
||||
{
|
||||
DBUG_ENTER ("factorial");
|
||||
DBUG_PRINT ("find", ("find %d factorial", value));
|
||||
|
|
|
@ -34,9 +34,9 @@ if (!(info->update & HA_STATE_AKTIV))\
|
|||
/* Find pos for record and update it in info->current_ptr */
|
||||
#define _hp_find_record(info,pos) (info)->current_ptr= _hp_find_block(&(info)->s->block,pos)
|
||||
|
||||
typedef struct st_hash_info
|
||||
typedef struct st_hp_hash_info
|
||||
{
|
||||
struct st_hash_info *next_key;
|
||||
struct st_hp_hash_info *next_key;
|
||||
byte *ptr_to_rec;
|
||||
} HASH_INFO;
|
||||
|
||||
|
|
822
include/config-os2.h
Normal file
822
include/config-os2.h
Normal file
|
@ -0,0 +1,822 @@
|
|||
/* Copyright (C) 2000 MySQL AB & Yuri Dario
|
||||
All the above parties has a full, independent copyright to
|
||||
the following code, including the right to use the code in
|
||||
any manner without any demands from the other parties.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/* Defines for OS2 to make it compatible for MySQL */
|
||||
|
||||
#ifndef __CONFIG_OS2_H__
|
||||
#define __CONFIG_OS2_H__
|
||||
|
||||
#include <os2.h>
|
||||
#include <math.h>
|
||||
#include <io.h>
|
||||
|
||||
/* Define to name of system eg solaris*/
|
||||
#define SYSTEM_TYPE "IBM OS/2 Warp"
|
||||
/* Define to machine type name eg sun10 */
|
||||
#define MACHINE_TYPE "i686"
|
||||
/* Name of package */
|
||||
#define PACKAGE "mysql"
|
||||
/* Version number of package */
|
||||
#define VERSION MYSQL_SERVER_VERSION
|
||||
/* Default socket */
|
||||
#define MYSQL_UNIX_ADDR "\\socket\\MySQL"
|
||||
|
||||
#define FN_LIBCHAR '\\'
|
||||
#define FN_ROOTDIR "\\"
|
||||
#define MY_NFILE 1024 /* This is only used to save filenames */
|
||||
|
||||
#define HAVE_ACCESS
|
||||
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#define _POSIX_PATH_MAX 255
|
||||
#define DWORD ULONG
|
||||
|
||||
#define O_SHARE 0x1000 /* Open file in sharing mode */
|
||||
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
|
||||
#define S_IROTH S_IREAD /* for my_lib */
|
||||
|
||||
#define O_NONBLOCK 0x10
|
||||
|
||||
#define NO_OPEN_3 /* For my_create() */
|
||||
#define SIGQUIT SIGTERM /* No SIGQUIT */
|
||||
#define SIGALRM 14 /* Alarm */
|
||||
|
||||
#define NO_FCNTL_NONBLOCK
|
||||
|
||||
#define EFBIG E2BIG
|
||||
//#define ENFILE EMFILE
|
||||
//#define ENAMETOOLONG (EOS2ERR+2)
|
||||
//#define ETIMEDOUT 145
|
||||
//#define EPIPE 146
|
||||
#define EROFS 147
|
||||
|
||||
#define sleep(A) DosSleep((A)*1000)
|
||||
#define closesocket(A) soclose(A)
|
||||
|
||||
#define F_OK 0
|
||||
#define W_OK 2
|
||||
|
||||
#define bzero(x,y) memset((x),'\0',(y))
|
||||
#define bcopy(x,y,z) memcpy((y),(x),(z))
|
||||
#define bcmp(x,y,z) memcmp((y),(x),(z))
|
||||
|
||||
#define F_RDLCK 4 /* Read lock. */
|
||||
#define F_WRLCK 2 /* Write lock. */
|
||||
#define F_UNLCK 0 /* Remove lock. */
|
||||
|
||||
#define S_IFMT 0xF000 /* Mask for file type */
|
||||
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
double _cdecl rint( double nr);
|
||||
|
||||
DWORD TlsAlloc( void);
|
||||
BOOL TlsFree( DWORD);
|
||||
PVOID TlsGetValue( DWORD);
|
||||
BOOL TlsSetValue( DWORD, PVOID);
|
||||
|
||||
/* support for > 2GB file size */
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define lseek(A,B,C) _lseek64( A, B, C)
|
||||
#define tell(A) _lseek64( A, 0, SEEK_CUR)
|
||||
|
||||
/* Some typedefs */
|
||||
typedef ulonglong os_off_t;
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
//#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
//#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#define HAVE_UTIME_NULL 1
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Version of .frm files */
|
||||
#define DOT_FRM_VERSION 6
|
||||
|
||||
/* READLINE: */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
|
||||
/* #undef GWINSZ_IN_SYS_IOCTL */
|
||||
|
||||
/* Do we have FIONREAD */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* atomic_add() from <asm/atomic.h> (Linux only) */
|
||||
/* #undef HAVE_ATOMIC_ADD */
|
||||
|
||||
/* atomic_sub() from <asm/atomic.h> (Linux only) */
|
||||
/* #undef HAVE_ATOMIC_SUB */
|
||||
|
||||
/* bool is not defined by all C++ compilators */
|
||||
#define HAVE_BOOL 1
|
||||
|
||||
/* Have berkeley db installed */
|
||||
//#define HAVE_BERKELEY_DB 1
|
||||
|
||||
/* DSB style signals ? */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* Can netinet be included */
|
||||
/* #undef HAVE_BROKEN_NETINET_INCLUDES */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* ZLIB and compress: */
|
||||
#define HAVE_COMPRESS 1
|
||||
|
||||
/* Define if we are using OSF1 DEC threads */
|
||||
/* #undef HAVE_DEC_THREADS */
|
||||
|
||||
/* Define if we are using OSF1 DEC threads on 3.2 */
|
||||
/* #undef HAVE_DEC_3_2_THREADS */
|
||||
|
||||
/* fp_except from ieeefp.h */
|
||||
/* #undef HAVE_FP_EXCEPT */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_GETPW_DECLS */
|
||||
|
||||
/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
|
||||
this with 6 arguments */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE */
|
||||
|
||||
/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */
|
||||
|
||||
/* Define if int8, int16 and int32 types exist */
|
||||
/* #undef HAVE_INT_8_16_32 */
|
||||
|
||||
/* Define if have -lwrap */
|
||||
/* #undef HAVE_LIBWRAP */
|
||||
|
||||
/* Define if we are using Xavier Leroy's LinuxThreads */
|
||||
/* #undef HAVE_LINUXTHREADS */
|
||||
|
||||
/* Do we use user level threads */
|
||||
/* #undef HAVE_mit_thread */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
|
||||
|
||||
/* READLINE: */
|
||||
#define HAVE_POSIX_SIGNALS 1
|
||||
|
||||
/* sigwait with one argument */
|
||||
/* #undef HAVE_NONPOSIX_SIGWAIT */
|
||||
|
||||
/* pthread_attr_setscope */
|
||||
#define HAVE_PTHREAD_ATTR_SETSCOPE 1
|
||||
|
||||
/* POSIX readdir_r */
|
||||
/* #undef HAVE_READDIR_R */
|
||||
|
||||
/* POSIX sigwait */
|
||||
/* #undef HAVE_SIGWAIT */
|
||||
|
||||
/* crypt */
|
||||
#define HAVE_CRYPT 1
|
||||
|
||||
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
|
||||
this with 8 arguments */
|
||||
/* #undef HAVE_SOLARIS_STYLE_GETHOST */
|
||||
|
||||
/* Timespec has a ts_sec instead of tv_sev */
|
||||
#define HAVE_TIMESPEC_TS_SEC 1
|
||||
|
||||
/* Have the tzname variable */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if the system files define uchar */
|
||||
/* #undef HAVE_UCHAR */
|
||||
|
||||
/* Define if the system files define uint */
|
||||
/* #undef HAVE_UINT */
|
||||
|
||||
/* Define if the system files define ulong */
|
||||
/* #undef HAVE_ULONG */
|
||||
|
||||
/* UNIXWARE7 threads are not posix */
|
||||
/* #undef HAVE_UNIXWARE7_THREADS */
|
||||
|
||||
/* new UNIXWARE7 threads that are not yet posix */
|
||||
/* #undef HAVE_UNIXWARE7_POSIX */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_USG_SIGHOLD */
|
||||
|
||||
/* Define if want -lwrap */
|
||||
/* #undef LIBWRAP */
|
||||
|
||||
/* mysql client protocoll version */
|
||||
#define PROTOCOL_VERSION 10
|
||||
|
||||
/* Define if qsort returns void */
|
||||
#define QSORT_TYPE_IS_VOID 1
|
||||
|
||||
/* Define as the return type of qsort (int or void). */
|
||||
#define RETQSORTTYPE void
|
||||
|
||||
/* Define as the base type of the last arg to accept */
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
|
||||
/* Last argument to get/setsockopt */
|
||||
/* #undef SOCKOPT_OPTLEN_TYPE */
|
||||
|
||||
/* #undef SPEED_T_IN_SYS_TYPES */
|
||||
/* #undef SPRINTF_RETURNS_PTR */
|
||||
#define SPRINTF_RETURNS_INT 1
|
||||
/* #undef SPRINTF_RETURNS_GARBAGE */
|
||||
|
||||
/* #undef STRUCT_DIRENT_HAS_D_FILENO */
|
||||
#define STRUCT_DIRENT_HAS_D_INO 1
|
||||
|
||||
/* Define if you want to have threaded code. This may be undef on client code */
|
||||
#define THREAD 1
|
||||
|
||||
/* Should be client be thread safe */
|
||||
/* #undef THREAD_SAFE_CLIENT */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef TIOCSTAT_IN_SYS_IOCTL */
|
||||
|
||||
/* Use multi-byte character routines */
|
||||
/* #undef USE_MB */
|
||||
/* #undef USE_MB_IDENT */
|
||||
|
||||
/* Use MySQL RAID */
|
||||
/* #undef USE_RAID */
|
||||
|
||||
/* Use strcoll() functions when comparing and sorting. */
|
||||
/* #undef USE_STRCOLL */
|
||||
|
||||
/* READLINE: */
|
||||
#define VOID_SIGHANDLER 1
|
||||
|
||||
/* The number of bytes in a char. */
|
||||
#define SIZEOF_CHAR 1
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The number of bytes in a long. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The number of bytes in a long long. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* Define if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the atod function. */
|
||||
/* #undef HAVE_ATOD */
|
||||
|
||||
/* Define if you have the bcmp function. */
|
||||
#define HAVE_BCMP 1
|
||||
|
||||
/* Define if you have the bfill function. */
|
||||
/* #undef HAVE_BFILL */
|
||||
|
||||
/* Define if you have the bmove function. */
|
||||
/* #undef HAVE_BMOVE */
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#define HAVE_BZERO 1
|
||||
|
||||
/* Define if you have the chsize function. */
|
||||
#define HAVE_CHSIZE 1
|
||||
|
||||
/* Define if you have the cuserid function. */
|
||||
//#define HAVE_CUSERID 1
|
||||
|
||||
/* Define if you have the dlerror function. */
|
||||
#define HAVE_DLERROR 1
|
||||
|
||||
/* Define if you have the dlopen function. */
|
||||
#define HAVE_DLOPEN 1
|
||||
|
||||
/* Define if you have the fchmod function. */
|
||||
/* #undef HAVE_FCHMOD */
|
||||
|
||||
/* Define if you have the fcntl function. */
|
||||
//#define HAVE_FCNTL 1
|
||||
|
||||
/* Define if you have the fconvert function. */
|
||||
/* #undef HAVE_FCONVERT */
|
||||
|
||||
/* Define if you have the finite function. */
|
||||
/* #undef HAVE_FINITE */
|
||||
|
||||
/* Define if you have the fpresetsticky function. */
|
||||
/* #undef HAVE_FPRESETSTICKY */
|
||||
|
||||
/* Define if you have the fpsetmask function. */
|
||||
/* #undef HAVE_FPSETMASK */
|
||||
|
||||
/* Define if you have the fseeko function. */
|
||||
/* #undef HAVE_FSEEKO */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
//#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the gethostbyaddr_r function. */
|
||||
/* #undef HAVE_GETHOSTBYADDR_R */
|
||||
|
||||
/* Define if you have the gethostbyname_r function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
//#define HAVE_GETPASS 1
|
||||
|
||||
/* Define if you have the getpassphrase function. */
|
||||
/* #undef HAVE_GETPASSPHRASE */
|
||||
|
||||
/* Define if you have the getpwnam function. */
|
||||
//#define HAVE_GETPWNAM 1
|
||||
|
||||
/* Define if you have the getpwuid function. */
|
||||
//#define HAVE_GETPWUID 1
|
||||
|
||||
/* Define if you have the getrlimit function. */
|
||||
/* #undef HAVE_GETRLIMIT */
|
||||
|
||||
/* Define if you have the getrusage function. */
|
||||
/* #undef HAVE_GETRUSAGE */
|
||||
|
||||
/* Define if you have the getwd function. */
|
||||
#define HAVE_GETWD 1
|
||||
|
||||
/* Define if you have the index function. */
|
||||
#define HAVE_INDEX 1
|
||||
|
||||
/* Define if you have the initgroups function. */
|
||||
/* #undef HAVE_INITGROUPS */
|
||||
|
||||
/* Define if you have the localtime_r function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define if you have the locking function. */
|
||||
/* #undef HAVE_LOCKING */
|
||||
|
||||
/* Define if you have the longjmp function. */
|
||||
#define HAVE_LONGJMP 1
|
||||
|
||||
/* Define if you have the lrand48 function. */
|
||||
/* #undef HAVE_LRAND48 */
|
||||
|
||||
/* Define if you have the lstat function. */
|
||||
/* #undef HAVE_LSTAT */
|
||||
|
||||
/* Define if you have the madvise function. */
|
||||
/* #undef HAVE_MADVISE */
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#define HAVE_MEMCPY 1
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
//#define HAVE_MKSTEMP 1
|
||||
|
||||
/* Define if you have the mlockall function. */
|
||||
/* #undef HAVE_MLOCKALL */
|
||||
|
||||
/* Define if you have the perror function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
/* #undef HAVE_POLL */
|
||||
|
||||
/* Define if you have the pread function. */
|
||||
/* #undef HAVE_PREAD */
|
||||
|
||||
/* Define if you have the pthread_attr_create function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_CREATE */
|
||||
|
||||
/* Define if you have the pthread_attr_setprio function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETPRIO 1
|
||||
|
||||
/* Define if you have the pthread_attr_setschedparam function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */
|
||||
|
||||
/* Define if you have the pthread_attr_setstacksize function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||
|
||||
/* Define if you have the pthread_condattr_create function. */
|
||||
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
|
||||
|
||||
/* Define if you have the pthread_getsequence_np function. */
|
||||
/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */
|
||||
|
||||
/* Define if you have the pthread_init function. */
|
||||
/* #undef HAVE_PTHREAD_INIT */
|
||||
|
||||
/* Define if you have the pthread_rwlock_rdlock function. */
|
||||
/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */
|
||||
|
||||
/* Define if you have the pthread_setprio function. */
|
||||
#define HAVE_PTHREAD_SETPRIO 1
|
||||
|
||||
/* Define if you have the pthread_setprio_np function. */
|
||||
/* #undef HAVE_PTHREAD_SETPRIO_NP */
|
||||
|
||||
/* Define if you have the pthread_setschedparam function. */
|
||||
/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
|
||||
|
||||
/* Define if you have the pthread_sigmask function. */
|
||||
#define HAVE_PTHREAD_SIGMASK 1
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#define HAVE_PUTENV 1
|
||||
|
||||
/* Define if you have the readlink function. */
|
||||
/* #undef HAVE_READLINK */
|
||||
|
||||
/* Define if you have the realpath function. */
|
||||
/* #undef HAVE_REALPATH */
|
||||
|
||||
/* Define if you have the rename function. */
|
||||
#define HAVE_RENAME 1
|
||||
|
||||
/* Define if you have the rint function. */
|
||||
#define HAVE_RINT 1
|
||||
|
||||
/* Define if you have the rwlock_init function. */
|
||||
/* #undef HAVE_RWLOCK_INIT */
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
/* #undef HAVE_SETENV */
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define if you have the setupterm function. */
|
||||
/* #undef HAVE_SETUPTERM */
|
||||
|
||||
/* Define if you have the sighold function. */
|
||||
/* #undef HAVE_SIGHOLD */
|
||||
|
||||
/* Define if you have the sigset function. */
|
||||
/* #undef HAVE_SIGSET */
|
||||
|
||||
/* Define if you have the sigthreadmask function. */
|
||||
/* #undef HAVE_SIGTHREADMASK */
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
//#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
/* #undef HAVE_STPCPY */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
|
||||
/* Define if you have the strcoll function. */
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strnlen function. */
|
||||
/* #undef HAVE_STRNLEN */
|
||||
|
||||
/* Define if you have the strpbrk function. */
|
||||
#define HAVE_STRPBRK 1
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define if you have the strtok_r function. */
|
||||
/* #undef HAVE_STRTOK_R */
|
||||
|
||||
/* Define if you have the strtol function. */
|
||||
#define HAVE_STRTOL 1
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#define HAVE_STRTOUL 1
|
||||
|
||||
/* Define if you have the strtoull function. */
|
||||
/* #undef HAVE_STRTOULL */
|
||||
|
||||
/* Define if you have the tcgetattr function. */
|
||||
#define HAVE_TCGETATTR 1
|
||||
|
||||
/* Define if you have the tell function. */
|
||||
#define HAVE_TELL 1
|
||||
|
||||
/* Define if you have the tempnam function. */
|
||||
#define HAVE_TEMPNAM 1
|
||||
|
||||
/* Define if you have the thr_setconcurrency function. */
|
||||
/* #undef HAVE_THR_SETCONCURRENCY */
|
||||
|
||||
/* Define if you have the vidattr function. */
|
||||
/* #undef HAVE_VIDATTR */
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
//#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define if you have the <asm/termbits.h> header file. */
|
||||
/* #undef HAVE_ASM_TERMBITS_H */
|
||||
|
||||
/* Define if you have the <crypt.h> header file. */
|
||||
#define HAVE_CRYPT_H 1
|
||||
|
||||
/* Define if you have the <curses.h> header file. */
|
||||
//#define HAVE_CURSES_H 1
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
//#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <float.h> header file. */
|
||||
#define HAVE_FLOAT_H 1
|
||||
|
||||
/* Define if you have the <floatingpoint.h> header file. */
|
||||
/* #undef HAVE_FLOATINGPOINT_H */
|
||||
|
||||
/* Define if you have the <grp.h> header file. */
|
||||
//#define HAVE_GRP_H 1
|
||||
|
||||
/* Define if you have the <ieeefp.h> header file. */
|
||||
/* #undef HAVE_IEEEFP_H */
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define if you have the <paths.h> header file. */
|
||||
/* #undef HAVE_PATHS_H */
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
//#define HAVE_PWD_H 1
|
||||
|
||||
/* Define if you have the <sched.h> header file. */
|
||||
/* #undef HAVE_SCHED_H */
|
||||
|
||||
/* Define if you have the <select.h> header file. */
|
||||
/* #undef HAVE_SELECT_H */
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
//#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define if you have the <synch.h> header file. */
|
||||
/* #undef HAVE_SYNCH_H */
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
//#define HAVE_SYS_DIR_H 1
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
//#define HAVE_SYS_FILE_H 1
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define if you have the <sys/mman.h> header file. */
|
||||
/* #undef HAVE_SYS_MMAN_H */
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/pte.h> header file. */
|
||||
/* #undef HAVE_SYS_PTE_H */
|
||||
|
||||
/* Define if you have the <sys/ptem.h> header file. */
|
||||
/* #undef HAVE_SYS_PTEM_H */
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define if you have the <sys/stream.h> header file. */
|
||||
/* #undef HAVE_SYS_STREAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have the <sys/un.h> header file. */
|
||||
#define HAVE_SYS_UN_H 1
|
||||
|
||||
/* Define if you have the <sys/utime.h> header file. */
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
|
||||
/* Define if you have the <sys/vadvise.h> header file. */
|
||||
/* #undef HAVE_SYS_VADVISE_H */
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
//#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you have the <term.h> header file. */
|
||||
/* #undef HAVE_TERM_H */
|
||||
|
||||
/* Define if you have the <termbits.h> header file. */
|
||||
/* #undef HAVE_TERMBITS_H */
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
//#define HAVE_TERMCAP_H 1
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
//#define HAVE_TERMIO_H 1
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
//#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define if you have the <varargs.h> header file. */
|
||||
#define HAVE_VARARGS_H 1
|
||||
|
||||
/* Define if you have the bind library (-lbind). */
|
||||
/* #undef HAVE_LIBBIND */
|
||||
|
||||
/* Define if you have the c_r library (-lc_r). */
|
||||
/* #undef HAVE_LIBC_R */
|
||||
|
||||
/* Define if you have the compat library (-lcompat). */
|
||||
/* #undef HAVE_LIBCOMPAT */
|
||||
|
||||
/* Define if you have the crypt library (-lcrypt). */
|
||||
#define HAVE_LIBCRYPT 1
|
||||
|
||||
/* Define if you have the dl library (-ldl). */
|
||||
#define HAVE_LIBDL 1
|
||||
|
||||
/* Define if you have the gen library (-lgen). */
|
||||
/* #undef HAVE_LIBGEN */
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
/* #undef HAVE_LIBNSL */
|
||||
|
||||
/* Define if you have the nsl_r library (-lnsl_r). */
|
||||
/* #undef HAVE_LIBNSL_R */
|
||||
|
||||
/* Define if you have the pthread library (-lpthread). */
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define to make fseeko etc. visible, on some hosts. */
|
||||
/* #undef _LARGEFILE_SOURCE */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
#endif // __CONFIG_OS2_H__
|
|
@ -287,7 +287,6 @@ inline double ulonglong2double(ulonglong value)
|
|||
#define FN_ROOTDIR "\\"
|
||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||
#define FN_LOWER_CASE TRUE /* Files are represented in lower case */
|
||||
#define MY_NFILE 1024
|
||||
|
||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||
|
|
|
@ -29,7 +29,11 @@ extern const char *client_errors[]; /* Error messages */
|
|||
|
||||
#define CR_MIN_ERROR 2000 /* For easier client code */
|
||||
#define CR_MAX_ERROR 2999
|
||||
#if defined(OS2) && defined( MYSQL_SERVER)
|
||||
#define CER(X) client_errors[(X)-CR_MIN_ERROR]
|
||||
#else
|
||||
#define ER(X) client_errors[(X)-CR_MIN_ERROR]
|
||||
#endif
|
||||
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
|
||||
|
||||
#define CR_UNKNOWN_ERROR 2000
|
||||
|
|
|
@ -43,14 +43,14 @@
|
|||
|
||||
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
|
||||
#include <config-win.h>
|
||||
#elif defined(OS2)
|
||||
#include <config-os2.h>
|
||||
#else
|
||||
#include <my_config.h>
|
||||
#endif
|
||||
#if defined(__cplusplus)
|
||||
#if defined(inline)
|
||||
#if defined(__cplusplus) && defined(inline)
|
||||
#undef inline /* fix configure problem */
|
||||
#endif
|
||||
#endif /* _cplusplus */
|
||||
#endif /* _WIN32... */
|
||||
|
||||
/* Fix problem with S_ISLNK() on Linux */
|
||||
#if defined(HAVE_LINUXTHREADS)
|
||||
|
@ -76,7 +76,7 @@
|
|||
#define __STDC_EXT__ 1 /* To get large file support on hpux */
|
||||
#endif
|
||||
|
||||
#if defined(THREAD) && !defined(__WIN__)
|
||||
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
|
||||
#endif
|
||||
|
@ -226,7 +226,9 @@
|
|||
#define POSIX_MISTAKE 1 /* regexp: Fix stupid spec error */
|
||||
#define USE_REGEX 1 /* We want the use the regex library */
|
||||
/* Do not define for ultra sparcs */
|
||||
#ifndef OS2
|
||||
#define USE_BMOVE512 1 /* Use this unless the system bmove is faster */
|
||||
#endif
|
||||
|
||||
/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
|
||||
#ifdef I_AM_PARANOID
|
||||
|
@ -477,7 +479,11 @@ extern double my_atof(const char*);
|
|||
#endif
|
||||
#undef remove /* Crashes MySQL on SCO 5.0.0 */
|
||||
#ifndef __WIN__
|
||||
#ifdef OS2
|
||||
#define closesocket(A) soclose(A)
|
||||
#else
|
||||
#define closesocket(A) close(A)
|
||||
#endif
|
||||
#ifndef ulonglong2double
|
||||
#define ulonglong2double(A) ((double) (A))
|
||||
#define my_off_t2double(A) ((double) (A))
|
||||
|
@ -566,9 +572,13 @@ typedef long my_ptrdiff_t;
|
|||
#ifndef NEAR
|
||||
#define NEAR /* Who needs segments ? */
|
||||
#define FAR /* On a good machine */
|
||||
#ifndef HUGE_PTR
|
||||
#define HUGE_PTR
|
||||
#endif
|
||||
#ifndef STDCALL
|
||||
#endif
|
||||
#if defined(__IBMC__) || defined(__IBMCPP__)
|
||||
#define STDCALL _System _Export
|
||||
#elif !defined( STDCALL)
|
||||
#define STDCALL
|
||||
#endif
|
||||
|
||||
|
@ -636,10 +646,25 @@ typedef ulonglong my_off_t;
|
|||
typedef unsigned long my_off_t;
|
||||
#endif
|
||||
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
|
||||
#ifndef __WIN__
|
||||
#if !defined(__WIN__) && !defined(OS2)
|
||||
typedef off_t os_off_t;
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
#define socket_errno WSAGetLastError()
|
||||
#define SOCKET_EINTR WSAEINTR
|
||||
#define SOCKET_EAGAIN WSAEINPROGRESS
|
||||
#elif defined(OS2)
|
||||
#define socket_errno sock_errno()
|
||||
#define closesocket(A) soclose(A)
|
||||
#else /* Unix */
|
||||
#define socket_errno errno
|
||||
#define closesocket(A) close(A)
|
||||
#define SOCKET_EINTR EINTR
|
||||
#define SOCKET_EAGAIN EAGAIN
|
||||
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
||||
#endif
|
||||
|
||||
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
|
||||
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
|
||||
typedef char *my_string; /* String of characters */
|
||||
|
|
|
@ -113,13 +113,13 @@ typedef struct st_heap_share
|
|||
LIST open_list;
|
||||
} HP_SHARE;
|
||||
|
||||
struct st_hash_info;
|
||||
struct st_hp_hash_info;
|
||||
|
||||
typedef struct st_heap_info
|
||||
{
|
||||
HP_SHARE *s;
|
||||
byte *current_ptr;
|
||||
struct st_hash_info *current_hash_ptr;
|
||||
struct st_hp_hash_info *current_hash_ptr;
|
||||
ulong current_record,next_block;
|
||||
int lastinx,errkey;
|
||||
int mode; /* Mode of file (READONLY..) */
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
# define bmove_allign(A,B,C) memcpy((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(OS2)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
@ -238,7 +238,7 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && !defined(OS2)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -25,13 +25,23 @@
|
|||
#define ETIME ETIMEDOUT /* For FreeBSD */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if defined(__WIN__) || defined(OS2)
|
||||
|
||||
#ifdef OS2
|
||||
typedef ULONG HANDLE;
|
||||
typedef ULONG DWORD;
|
||||
typedef int sigset_t;
|
||||
#endif
|
||||
|
||||
#if defined(__WIN__)
|
||||
|
||||
#ifdef OS2
|
||||
typedef HMTX pthread_mutex_t;
|
||||
#else
|
||||
typedef CRITICAL_SECTION pthread_mutex_t;
|
||||
#endif
|
||||
typedef HANDLE pthread_t;
|
||||
typedef struct thread_attr {
|
||||
DWORD dwStackSize ;
|
||||
|
@ -50,19 +60,30 @@ typedef struct st_pthread_link {
|
|||
|
||||
typedef struct {
|
||||
uint32 waiting;
|
||||
#ifdef OS2
|
||||
HEV semaphore;
|
||||
#else
|
||||
HANDLE semaphore;
|
||||
#endif
|
||||
} pthread_cond_t;
|
||||
|
||||
|
||||
#ifndef OS2
|
||||
struct timespec { /* For pthread_cond_timedwait() */
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef int pthread_mutexattr_t;
|
||||
#define win_pthread_self my_thread_var->pthread_self
|
||||
#ifdef OS2
|
||||
#define pthread_handler_decl(A,B) void * _Optlink A(void *B)
|
||||
typedef void * (_Optlink *pthread_handler)(void *);
|
||||
#else
|
||||
#define pthread_handler_decl(A,B) void * __cdecl A(void *B)
|
||||
typedef void * (__cdecl *pthread_handler)(void *);
|
||||
#endif
|
||||
|
||||
void win_pthread_init(void);
|
||||
int win_pthread_setspecific(void *A,void *B,uint length);
|
||||
|
@ -82,12 +103,14 @@ struct tm *localtime_r(const time_t *timep,struct tm *tmp);
|
|||
|
||||
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
|
||||
|
||||
#ifndef OS2
|
||||
#define ETIMEDOUT 145 /* Win32 doesn't have this */
|
||||
#define getpid() GetCurrentThreadId()
|
||||
#endif
|
||||
#define pthread_self() win_pthread_self
|
||||
#define HAVE_LOCALTIME_R
|
||||
#define _REENTRANT
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
#define _REENTRANT 1
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||
|
||||
#ifdef USE_TLS /* For LIBMYSQL.DLL */
|
||||
#undef SAFE_MUTEX /* This will cause conflicts */
|
||||
|
@ -109,13 +132,23 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
|
|||
#endif /* USE_TLS */
|
||||
|
||||
#define pthread_equal(A,B) ((A) == (B))
|
||||
#ifdef OS2
|
||||
int pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *);
|
||||
int pthread_mutex_lock (pthread_mutex_t *);
|
||||
int pthread_mutex_unlock (pthread_mutex_t *);
|
||||
int pthread_mutex_destroy (pthread_mutex_t *);
|
||||
#define my_pthread_setprio(A,B) DosSetPriority(PRTYS_THREAD,PRTYC_NOCHANGE, B, A)
|
||||
#define pthread_kill(A,B) raise(B)
|
||||
#else
|
||||
#define pthread_mutex_init(A,B) InitializeCriticalSection(A)
|
||||
#define pthread_mutex_lock(A) (EnterCriticalSection(A),0)
|
||||
#define pthread_mutex_unlock(A) LeaveCriticalSection(A)
|
||||
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
|
||||
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
|
||||
/* Dummy defines for easier code */
|
||||
#define pthread_kill(A,B) pthread_dummy(0)
|
||||
#endif /* OS2 */
|
||||
|
||||
/* Dummy defines for easier code */
|
||||
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
|
||||
#define my_pthread_attr_setprio(A,B) pthread_attr_setprio(A,B)
|
||||
#define pthread_attr_setscope(A,B)
|
||||
|
@ -315,12 +348,15 @@ extern void my_pthread_attr_setprio(pthread_attr_t *attr, int priority);
|
|||
#undef HAVE_GETHOSTBYADDR_R /* No definition */
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
|
||||
#if defined(OS2)
|
||||
#define my_pthread_getspecific(T,A) ((T) &(A))
|
||||
#define pthread_setspecific(A,B) win_pthread_setspecific(&(A),(B),sizeof(A))
|
||||
#elif !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
|
||||
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
|
||||
#else
|
||||
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
|
||||
void *my_pthread_getspecific_imp(pthread_key_t key);
|
||||
#endif
|
||||
#endif /* OS2 */
|
||||
|
||||
#ifndef HAVE_LOCALTIME_R
|
||||
struct tm *localtime_r(const time_t *clock, struct tm *res);
|
||||
|
@ -539,12 +575,14 @@ extern int pthread_dummy(int);
|
|||
struct st_my_thread_var
|
||||
{
|
||||
int thr_errno;
|
||||
pthread_cond_t suspend, *current_cond;
|
||||
pthread_mutex_t mutex, *current_mutex;
|
||||
pthread_cond_t suspend;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_mutex_t * volatile current_mutex;
|
||||
pthread_cond_t * volatile current_cond;
|
||||
pthread_t pthread_self;
|
||||
long id;
|
||||
int cmp_length;
|
||||
volatile int abort;
|
||||
int volatile abort;
|
||||
#ifndef DBUG_OFF
|
||||
gptr dbug;
|
||||
char name[THREAD_NAME_SIZE+1];
|
||||
|
@ -581,7 +619,7 @@ extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
|
|||
#endif /* HAVE_ATOMIC_ADD */
|
||||
#endif /* thread_safe_increment */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _my_ptread_h */
|
||||
|
|
|
@ -127,6 +127,7 @@ extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
|
|||
extern ulonglong safemalloc_mem_limit;
|
||||
#else
|
||||
#define my_checkmalloc() (0)
|
||||
#undef TERMINATE
|
||||
#define TERMINATE(A) {}
|
||||
#define QUICK_SAFEMALLOC
|
||||
#define NORMAL_SAFEMALLOC
|
||||
|
|
|
@ -235,10 +235,4 @@ void my_thread_end(void);
|
|||
|
||||
#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
|
||||
|
||||
#ifdef __WIN__
|
||||
#define socket_errno WSAGetLastError()
|
||||
#else
|
||||
#define socket_errno errno
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -212,11 +212,12 @@
|
|||
#define ER_CREATE_DB_WITH_READ_LOCK 1209
|
||||
#define ER_WRONG_ARGUMENTS 1210
|
||||
#define ER_NO_PERMISSION_TO_CREATE_USER 1211
|
||||
#define ER_CONNECT_TO_MASTER 1212
|
||||
#define ER_QUERY_ON_MASTER 1213
|
||||
#define ER_ERROR_WHEN_EXECUTING_COMMAND 1214
|
||||
#define ER_WRONG_USAGE 1215
|
||||
#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1216
|
||||
#define ER_CANT_UPDATE_WITH_READLOCK 1217
|
||||
#define ER_MIXING_NOT_ALLOWED 1218
|
||||
#define ER_ERROR_MESSAGES 219
|
||||
#define ER_UNION_TABLES_IN_DIFFERENT_DIR 1212
|
||||
#define ER_CONNECT_TO_MASTER 1213
|
||||
#define ER_QUERY_ON_MASTER 1214
|
||||
#define ER_ERROR_WHEN_EXECUTING_COMMAND 1215
|
||||
#define ER_WRONG_USAGE 1216
|
||||
#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1217
|
||||
#define ER_CANT_UPDATE_WITH_READLOCK 1218
|
||||
#define ER_MIXING_NOT_ALLOWED 1219
|
||||
#define ER_ERROR_MESSAGES 220
|
||||
|
|
|
@ -65,7 +65,7 @@ typedef struct st_thr_alarm_entry
|
|||
rf_SetTimer crono;
|
||||
} thr_alarm_entry;
|
||||
|
||||
#elif defined(__EMX__)
|
||||
#elif defined(__EMX__) || defined(OS2)
|
||||
|
||||
typedef struct st_thr_alarm_entry
|
||||
{
|
||||
|
|
|
@ -1738,8 +1738,8 @@ btr_node_ptr_delete(
|
|||
|
||||
btr_cur_position(UT_LIST_GET_FIRST(tree->tree_indexes), node_ptr,
|
||||
&cursor);
|
||||
compressed = btr_cur_pessimistic_delete(&err, TRUE, &cursor, mtr);
|
||||
|
||||
compressed = btr_cur_pessimistic_delete(&err, TRUE, &cursor, FALSE,
|
||||
mtr);
|
||||
ut_a(err == DB_SUCCESS);
|
||||
|
||||
if (!compressed) {
|
||||
|
|
|
@ -80,6 +80,9 @@ btr_rec_free_updated_extern_fields(
|
|||
X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
upd_t* update, /* in: update vector */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* mtr); /* in: mini-transaction handle which contains
|
||||
an X-latch to record page and to the tree */
|
||||
|
||||
|
@ -813,7 +816,7 @@ calculate_sizes_again:
|
|||
/* The record is so big that we have to store some fields
|
||||
externally on separate database pages */
|
||||
|
||||
big_rec_vec = dtuple_convert_big_rec(index, entry);
|
||||
big_rec_vec = dtuple_convert_big_rec(index, entry, NULL, 0);
|
||||
|
||||
if (big_rec_vec == NULL) {
|
||||
|
||||
|
@ -1021,7 +1024,7 @@ btr_cur_pessimistic_insert(
|
|||
/* The record is so big that we have to store some fields
|
||||
externally on separate database pages */
|
||||
|
||||
big_rec_vec = dtuple_convert_big_rec(index, entry);
|
||||
big_rec_vec = dtuple_convert_big_rec(index, entry, NULL, 0);
|
||||
|
||||
if (big_rec_vec == NULL) {
|
||||
|
||||
|
@ -1242,6 +1245,7 @@ btr_cur_update_in_place(
|
|||
rec_t* rec;
|
||||
dulint roll_ptr;
|
||||
trx_t* trx;
|
||||
ibool was_delete_marked;
|
||||
|
||||
/* Only clustered index records are updated using this function */
|
||||
ut_ad((cursor->index)->type & DICT_CLUSTERED);
|
||||
|
@ -1270,6 +1274,8 @@ btr_cur_update_in_place(
|
|||
|
||||
/* FIXME: in a mixed tree, all records may not have enough ordering
|
||||
fields for btr search: */
|
||||
|
||||
was_delete_marked = rec_get_deleted_flag(rec);
|
||||
|
||||
row_upd_rec_in_place(rec, update);
|
||||
|
||||
|
@ -1279,6 +1285,13 @@ btr_cur_update_in_place(
|
|||
|
||||
btr_cur_update_in_place_log(flags, rec, index, update, trx, roll_ptr,
|
||||
mtr);
|
||||
if (was_delete_marked && !rec_get_deleted_flag(rec)) {
|
||||
/* The new updated record owns its possible externally
|
||||
stored fields */
|
||||
|
||||
btr_cur_unmark_extern_fields(rec, mtr);
|
||||
}
|
||||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -1434,6 +1447,13 @@ btr_cur_optimistic_update(
|
|||
|
||||
ut_a(rec); /* <- We calculated above the insert would fit */
|
||||
|
||||
if (!rec_get_deleted_flag(rec)) {
|
||||
/* The new inserted record owns its possible externally
|
||||
stored fields */
|
||||
|
||||
btr_cur_unmark_extern_fields(rec, mtr);
|
||||
}
|
||||
|
||||
/* Restore the old explicit lock state on the record */
|
||||
|
||||
lock_rec_restore_from_page_infimum(rec, page);
|
||||
|
@ -1655,11 +1675,15 @@ btr_cur_pessimistic_update(
|
|||
if (flags & BTR_NO_UNDO_LOG_FLAG) {
|
||||
/* We are in a transaction rollback undoing a row
|
||||
update: we must free possible externally stored fields
|
||||
which got new values in the update */
|
||||
which got new values in the update, if they are not
|
||||
inherited values. They can be inherited if we have
|
||||
updated the primary key to another value, and then
|
||||
update it back again. */
|
||||
|
||||
ut_a(big_rec_vec == NULL);
|
||||
|
||||
btr_rec_free_updated_extern_fields(index, rec, update, mtr);
|
||||
btr_rec_free_updated_extern_fields(index, rec, update,
|
||||
TRUE, mtr);
|
||||
}
|
||||
|
||||
/* We have to set appropriate extern storage bits in the new
|
||||
|
@ -1676,8 +1700,8 @@ btr_cur_pessimistic_update(
|
|||
page_get_free_space_of_empty() / 2)
|
||||
|| (rec_get_converted_size(new_entry) >= REC_MAX_DATA_SIZE)) {
|
||||
|
||||
big_rec_vec = dtuple_convert_big_rec(index, new_entry);
|
||||
|
||||
big_rec_vec = dtuple_convert_big_rec(index, new_entry,
|
||||
ext_vect, n_ext_vect);
|
||||
if (big_rec_vec == NULL) {
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
@ -1694,6 +1718,13 @@ btr_cur_pessimistic_update(
|
|||
lock_rec_restore_from_page_infimum(rec, page);
|
||||
rec_set_field_extern_bits(rec, ext_vect, n_ext_vect, mtr);
|
||||
|
||||
if (!rec_get_deleted_flag(rec)) {
|
||||
/* The new inserted record owns its possible externally
|
||||
stored fields */
|
||||
|
||||
btr_cur_unmark_extern_fields(rec, mtr);
|
||||
}
|
||||
|
||||
btr_cur_compress_if_useful(cursor, mtr);
|
||||
|
||||
err = DB_SUCCESS;
|
||||
|
@ -1725,6 +1756,13 @@ btr_cur_pessimistic_update(
|
|||
|
||||
rec_set_field_extern_bits(rec, ext_vect, n_ext_vect, mtr);
|
||||
|
||||
if (!rec_get_deleted_flag(rec)) {
|
||||
/* The new inserted record owns its possible externally
|
||||
stored fields */
|
||||
|
||||
btr_cur_unmark_extern_fields(rec, mtr);
|
||||
}
|
||||
|
||||
lock_rec_restore_from_page_infimum(rec, page);
|
||||
|
||||
/* If necessary, restore also the correct lock state for a new,
|
||||
|
@ -2183,6 +2221,7 @@ btr_cur_pessimistic_delete(
|
|||
if compression does not occur, the cursor
|
||||
stays valid: it points to successor of
|
||||
deleted record on function exit */
|
||||
ibool in_rollback,/* in: TRUE if called in rollback */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
page_t* page;
|
||||
|
@ -2218,7 +2257,8 @@ btr_cur_pessimistic_delete(
|
|||
}
|
||||
|
||||
btr_rec_free_externally_stored_fields(cursor->index,
|
||||
btr_cur_get_rec(cursor), mtr);
|
||||
btr_cur_get_rec(cursor), in_rollback, mtr);
|
||||
|
||||
if ((page_get_n_recs(page) < 2)
|
||||
&& (dict_tree_get_page(btr_cur_get_tree(cursor))
|
||||
!= buf_frame_get_page_no(page))) {
|
||||
|
@ -2516,6 +2556,199 @@ btr_estimate_number_of_different_key_vals(
|
|||
|
||||
/*================== EXTERNAL STORAGE OF BIG FIELDS ===================*/
|
||||
|
||||
/***********************************************************************
|
||||
Sets the ownership bit of an externally stored field in a record. */
|
||||
static
|
||||
void
|
||||
btr_cur_set_ownership_of_extern_field(
|
||||
/*==================================*/
|
||||
rec_t* rec, /* in: clustered index record */
|
||||
ulint i, /* in: field number */
|
||||
ibool val, /* in: value to set */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
byte* data;
|
||||
ulint local_len;
|
||||
ulint byte_val;
|
||||
|
||||
data = rec_get_nth_field(rec, i, &local_len);
|
||||
|
||||
ut_a(local_len >= BTR_EXTERN_FIELD_REF_SIZE);
|
||||
|
||||
local_len -= BTR_EXTERN_FIELD_REF_SIZE;
|
||||
|
||||
byte_val = mach_read_from_1(data + local_len + BTR_EXTERN_LEN);
|
||||
|
||||
if (val) {
|
||||
byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG);
|
||||
} else {
|
||||
byte_val = byte_val | BTR_EXTERN_OWNER_FLAG;
|
||||
}
|
||||
|
||||
mlog_write_ulint(data + local_len + BTR_EXTERN_LEN, byte_val,
|
||||
MLOG_1BYTE, mtr);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Marks not updated extern fields as not-owned by this record. The ownership
|
||||
is transferred to the updated record which is inserted elsewhere in the
|
||||
index tree. In purge only the owner of externally stored field is allowed
|
||||
to free the field. */
|
||||
|
||||
void
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
/*=================================*/
|
||||
rec_t* rec, /* in: record in a clustered index */
|
||||
upd_t* update, /* in: update vector */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ibool is_updated;
|
||||
ulint n;
|
||||
ulint j;
|
||||
ulint i;
|
||||
|
||||
n = rec_get_n_fields(rec);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (rec_get_nth_field_extern_bit(rec, i)) {
|
||||
|
||||
/* Check it is not in updated fields */
|
||||
is_updated = FALSE;
|
||||
|
||||
if (update) {
|
||||
for (j = 0; j < upd_get_n_fields(update);
|
||||
j++) {
|
||||
if (upd_get_nth_field(update, j)
|
||||
->field_no == i) {
|
||||
is_updated = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_updated) {
|
||||
btr_cur_set_ownership_of_extern_field(rec, i,
|
||||
FALSE, mtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
The complement of the previous function: in an update entry may inherit
|
||||
some externally stored fields from a record. We must mark them as inherited
|
||||
in entry, so that they are not freed in a rollback. */
|
||||
|
||||
void
|
||||
btr_cur_mark_dtuple_inherited_extern(
|
||||
/*=================================*/
|
||||
dtuple_t* entry, /* in: updated entry to be inserted to
|
||||
clustered index */
|
||||
ulint* ext_vec, /* in: array of extern fields in the
|
||||
original record */
|
||||
ulint n_ext_vec, /* in: number of elements in ext_vec */
|
||||
upd_t* update) /* in: update vector */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
ulint byte_val;
|
||||
byte* data;
|
||||
ulint len;
|
||||
ibool is_updated;
|
||||
ulint j;
|
||||
ulint i;
|
||||
|
||||
if (ext_vec == NULL) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < n_ext_vec; i++) {
|
||||
|
||||
/* Check ext_vec[i] is in updated fields */
|
||||
is_updated = FALSE;
|
||||
|
||||
for (j = 0; j < upd_get_n_fields(update); j++) {
|
||||
if (upd_get_nth_field(update, j)->field_no
|
||||
== ext_vec[i]) {
|
||||
is_updated = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_updated) {
|
||||
dfield = dtuple_get_nth_field(entry, ext_vec[i]);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
len = dfield_get_len(dfield);
|
||||
|
||||
len -= BTR_EXTERN_FIELD_REF_SIZE;
|
||||
|
||||
byte_val = mach_read_from_1(data + len
|
||||
+ BTR_EXTERN_LEN);
|
||||
|
||||
byte_val = byte_val | BTR_EXTERN_INHERITED_FLAG;
|
||||
|
||||
mach_write_to_1(data + len + BTR_EXTERN_LEN, byte_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Marks all extern fields in a record as owned by the record. This function
|
||||
should be called if the delete mark of a record is removed: a not delete
|
||||
marked record always owns all its extern fields. */
|
||||
|
||||
void
|
||||
btr_cur_unmark_extern_fields(
|
||||
/*=========================*/
|
||||
rec_t* rec, /* in: record in a clustered index */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint n;
|
||||
ulint i;
|
||||
|
||||
n = rec_get_n_fields(rec);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (rec_get_nth_field_extern_bit(rec, i)) {
|
||||
|
||||
btr_cur_set_ownership_of_extern_field(rec, i,
|
||||
TRUE, mtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Marks all extern fields in a dtuple as owned by the record. */
|
||||
|
||||
void
|
||||
btr_cur_unmark_dtuple_extern_fields(
|
||||
/*================================*/
|
||||
dtuple_t* entry, /* in: clustered index entry */
|
||||
ulint* ext_vec, /* in: array of numbers of fields
|
||||
which have been stored externally */
|
||||
ulint n_ext_vec) /* in: number of elements in ext_vec */
|
||||
{
|
||||
dfield_t* dfield;
|
||||
ulint byte_val;
|
||||
byte* data;
|
||||
ulint len;
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < n_ext_vec; i++) {
|
||||
dfield = dtuple_get_nth_field(entry, ext_vec[i]);
|
||||
|
||||
data = dfield_get_data(dfield);
|
||||
len = dfield_get_len(dfield);
|
||||
|
||||
len -= BTR_EXTERN_FIELD_REF_SIZE;
|
||||
|
||||
byte_val = mach_read_from_1(data + len + BTR_EXTERN_LEN);
|
||||
|
||||
byte_val = byte_val & (~BTR_EXTERN_OWNER_FLAG);
|
||||
|
||||
mach_write_to_1(data + len + BTR_EXTERN_LEN, byte_val);
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
Stores the positions of the fields marked as extern storage in the update
|
||||
vector, and also those fields who are marked as extern storage in rec
|
||||
|
@ -2766,7 +2999,9 @@ btr_store_big_rec_extern_fields(
|
|||
|
||||
/***********************************************************************
|
||||
Frees the space in an externally stored field to the file space
|
||||
management. */
|
||||
management if the field in data is owned the externally stored field,
|
||||
in a rollback we may have the additional condition that the field must
|
||||
not be inherited. */
|
||||
|
||||
void
|
||||
btr_free_externally_stored_field(
|
||||
|
@ -2777,6 +3012,9 @@ btr_free_externally_stored_field(
|
|||
+ reference to the externally
|
||||
stored part */
|
||||
ulint local_len, /* in: length of data */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* local_mtr) /* in: mtr containing the latch to
|
||||
data an an X-latch to the index
|
||||
tree */
|
||||
|
@ -2828,6 +3066,26 @@ btr_free_externally_stored_field(
|
|||
return;
|
||||
}
|
||||
|
||||
if (mach_read_from_1(data + local_len + BTR_EXTERN_LEN)
|
||||
& BTR_EXTERN_OWNER_FLAG) {
|
||||
/* This field does not own the externally
|
||||
stored field: do not free! */
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (do_not_free_inherited
|
||||
&& mach_read_from_1(data + local_len + BTR_EXTERN_LEN)
|
||||
& BTR_EXTERN_INHERITED_FLAG) {
|
||||
/* Rollback and inherited field: do not free! */
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
page = buf_page_get(space_id, page_no, RW_X_LATCH, &mtr);
|
||||
|
||||
buf_page_dbg_add_level(page, SYNC_EXTERN_STORAGE);
|
||||
|
@ -2872,6 +3130,9 @@ btr_rec_free_externally_stored_fields(
|
|||
dict_index_t* index, /* in: index of the data, the index
|
||||
tree MUST be X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* mtr) /* in: mini-transaction handle which contains
|
||||
an X-latch to record page and to the index
|
||||
tree */
|
||||
|
@ -2896,7 +3157,8 @@ btr_rec_free_externally_stored_fields(
|
|||
if (rec_get_nth_field_extern_bit(rec, i)) {
|
||||
|
||||
data = rec_get_nth_field(rec, i, &len);
|
||||
btr_free_externally_stored_field(index, data, len, mtr);
|
||||
btr_free_externally_stored_field(index, data, len,
|
||||
do_not_free_inherited, mtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2912,6 +3174,9 @@ btr_rec_free_updated_extern_fields(
|
|||
X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
upd_t* update, /* in: update vector */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* mtr) /* in: mini-transaction handle which contains
|
||||
an X-latch to record page and to the tree */
|
||||
{
|
||||
|
@ -2938,7 +3203,8 @@ btr_rec_free_updated_extern_fields(
|
|||
if (rec_get_nth_field_extern_bit(rec, ufield->field_no)) {
|
||||
|
||||
data = rec_get_nth_field(rec, ufield->field_no, &len);
|
||||
btr_free_externally_stored_field(index, data, len, mtr);
|
||||
btr_free_externally_stored_field(index, data, len,
|
||||
do_not_free_inherited, mtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -769,6 +769,11 @@ btr_search_guess_on_hash(
|
|||
buf_page_make_young(page);
|
||||
}
|
||||
|
||||
/* Increment the page get statistics though we did not really
|
||||
fix the page: for user info only */
|
||||
|
||||
buf_pool->n_page_gets++;
|
||||
|
||||
return(TRUE);
|
||||
|
||||
/*-------------------------------------------*/
|
||||
|
|
|
@ -349,6 +349,10 @@ buf_pool_create(
|
|||
buf_pool->n_pages_written = 0;
|
||||
buf_pool->n_pages_created = 0;
|
||||
|
||||
buf_pool->n_page_gets = 0;
|
||||
buf_pool->n_page_gets_old = 0;
|
||||
buf_pool->n_pages_read_old = 0;
|
||||
|
||||
/* 2. Initialize flushing fields
|
||||
---------------------------- */
|
||||
UT_LIST_INIT(buf_pool->flush_list);
|
||||
|
@ -667,6 +671,7 @@ buf_page_get_gen(
|
|||
#ifndef UNIV_LOG_DEBUG
|
||||
ut_ad(!ibuf_inside() || ibuf_page(space, offset));
|
||||
#endif
|
||||
buf_pool->n_page_gets++;
|
||||
loop:
|
||||
mutex_enter_fast(&(buf_pool->mutex));
|
||||
|
||||
|
@ -846,6 +851,8 @@ buf_page_optimistic_get_func(
|
|||
ut_ad(mtr && guess);
|
||||
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
|
||||
|
||||
buf_pool->n_page_gets++;
|
||||
|
||||
block = buf_block_align(guess);
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
@ -976,6 +983,8 @@ buf_page_get_known_nowait(
|
|||
ut_ad(mtr);
|
||||
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
|
||||
|
||||
buf_pool->n_page_gets++;
|
||||
|
||||
block = buf_block_align(guess);
|
||||
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
@ -1643,6 +1652,18 @@ buf_print_io(void)
|
|||
printf("Pages read %lu, created %lu, written %lu\n",
|
||||
buf_pool->n_pages_read, buf_pool->n_pages_created,
|
||||
buf_pool->n_pages_written);
|
||||
|
||||
if (buf_pool->n_page_gets > buf_pool->n_page_gets_old) {
|
||||
printf("Buffer pool hit rate %lu / 1000\n",
|
||||
1000
|
||||
- ((1000 *
|
||||
(buf_pool->n_pages_read - buf_pool->n_pages_read_old))
|
||||
/ (buf_pool->n_page_gets - buf_pool->n_page_gets_old)));
|
||||
}
|
||||
|
||||
buf_pool->n_page_gets_old = buf_pool->n_page_gets;
|
||||
buf_pool->n_pages_read_old = buf_pool->n_pages_read;
|
||||
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Created 11/11/1995 Heikki Tuuri
|
|||
flushed along with the original page. */
|
||||
|
||||
#define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\
|
||||
buf_pool->curr_size / 16)
|
||||
buf_pool->curr_size / 16)
|
||||
|
||||
/**********************************************************************
|
||||
Validates the flush list. */
|
||||
|
|
|
@ -395,7 +395,12 @@ dtuple_convert_big_rec(
|
|||
the entry enough, i.e., if there are
|
||||
too many short fields in entry */
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* entry) /* in: index entry */
|
||||
dtuple_t* entry, /* in: index entry */
|
||||
ulint* ext_vec,/* in: array of externally stored fields,
|
||||
or NULL: if a field already is externally
|
||||
stored, then we cannot move it to the vector
|
||||
this function returns */
|
||||
ulint n_ext_vec)/* in: number of elements is ext_vec */
|
||||
{
|
||||
mem_heap_t* heap;
|
||||
big_rec_t* vector;
|
||||
|
@ -404,7 +409,9 @@ dtuple_convert_big_rec(
|
|||
ulint n_fields;
|
||||
ulint longest;
|
||||
ulint longest_i;
|
||||
ibool is_externally_stored;
|
||||
ulint i;
|
||||
ulint j;
|
||||
|
||||
size = rec_get_converted_size(entry);
|
||||
|
||||
|
@ -431,9 +438,23 @@ dtuple_convert_big_rec(
|
|||
for (i = dict_index_get_n_unique_in_tree(index);
|
||||
i < dtuple_get_n_fields(entry); i++) {
|
||||
|
||||
/* Skip over fields which already are externally
|
||||
stored */
|
||||
|
||||
is_externally_stored = FALSE;
|
||||
|
||||
if (ext_vec) {
|
||||
for (j = 0; j < n_ext_vec; j++) {
|
||||
if (ext_vec[j] == i) {
|
||||
is_externally_stored = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Skip over fields which are ordering in some index */
|
||||
|
||||
if (dict_field_get_col(
|
||||
if (!is_externally_stored &&
|
||||
dict_field_get_col(
|
||||
dict_index_get_nth_field(index, i))
|
||||
->ord_part == 0) {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ Created 10/25/1995 Heikki Tuuri
|
|||
#include "log0log.h"
|
||||
#include "log0recv.h"
|
||||
#include "fsp0fsp.h"
|
||||
#include "srv0srv.h"
|
||||
|
||||
/*
|
||||
IMPLEMENTATION OF THE LOW-LEVEL FILE SYSTEM
|
||||
|
@ -1152,6 +1153,7 @@ fil_aio_wait(
|
|||
ut_ad(fil_validate());
|
||||
|
||||
if (os_aio_use_native_aio) {
|
||||
srv_io_thread_op_info[segment] = "native aio handle";
|
||||
#ifdef WIN_ASYNC_IO
|
||||
ret = os_aio_windows_handle(segment, 0, &fil_node, &message,
|
||||
&type);
|
||||
|
@ -1161,12 +1163,16 @@ fil_aio_wait(
|
|||
ut_a(0);
|
||||
#endif
|
||||
} else {
|
||||
srv_io_thread_op_info[segment] = "simulated aio handle";
|
||||
|
||||
ret = os_aio_simulated_handle(segment, (void**) &fil_node,
|
||||
&message, &type);
|
||||
}
|
||||
|
||||
ut_a(ret);
|
||||
|
||||
|
||||
srv_io_thread_op_info[segment] = "complete io for fil node";
|
||||
|
||||
mutex_enter(&(system->mutex));
|
||||
|
||||
fil_node_complete_io(fil_node, fil_system, type);
|
||||
|
@ -1178,9 +1184,10 @@ fil_aio_wait(
|
|||
/* Do the i/o handling */
|
||||
|
||||
if (buf_pool_is_block(message)) {
|
||||
|
||||
srv_io_thread_op_info[segment] = "complete io for buf page";
|
||||
buf_page_io_complete(message);
|
||||
} else {
|
||||
srv_io_thread_op_info[segment] = "complete io for log";
|
||||
log_io_complete(message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2341,7 +2341,7 @@ ibuf_delete_rec(
|
|||
root = ibuf_tree_root_get(ibuf_data, space, mtr);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, TRUE, btr_pcur_get_btr_cur(pcur),
|
||||
mtr);
|
||||
FALSE, mtr);
|
||||
ut_a(err == DB_SUCCESS);
|
||||
|
||||
#ifdef UNIV_IBUF_DEBUG
|
||||
|
|
|
@ -353,6 +353,7 @@ btr_cur_pessimistic_delete(
|
|||
if compression does not occur, the cursor
|
||||
stays valid: it points to successor of
|
||||
deleted record on function exit */
|
||||
ibool in_rollback,/* in: TRUE if called in rollback */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***************************************************************
|
||||
Parses a redo log record of updating a record in-place. */
|
||||
|
@ -418,6 +419,52 @@ btr_estimate_number_of_different_key_vals(
|
|||
/* out: estimated number of key values */
|
||||
dict_index_t* index); /* in: index */
|
||||
/***********************************************************************
|
||||
Marks not updated extern fields as not-owned by this record. The ownership
|
||||
is transferred to the updated record which is inserted elsewhere in the
|
||||
index tree. In purge only the owner of externally stored field is allowed
|
||||
to free the field. */
|
||||
|
||||
void
|
||||
btr_cur_mark_extern_inherited_fields(
|
||||
/*=================================*/
|
||||
rec_t* rec, /* in: record in a clustered index */
|
||||
upd_t* update, /* in: update vector */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***********************************************************************
|
||||
The complement of the previous function: in an update entry may inherit
|
||||
some externally stored fields from a record. We must mark them as inherited
|
||||
in entry, so that they are not freed in a rollback. */
|
||||
|
||||
void
|
||||
btr_cur_mark_dtuple_inherited_extern(
|
||||
/*=================================*/
|
||||
dtuple_t* entry, /* in: updated entry to be inserted to
|
||||
clustered index */
|
||||
ulint* ext_vec, /* in: array of extern fields in the
|
||||
original record */
|
||||
ulint n_ext_vec, /* in: number of elements in ext_vec */
|
||||
upd_t* update); /* in: update vector */
|
||||
/***********************************************************************
|
||||
Marks all extern fields in a record as owned by the record. This function
|
||||
should be called if the delete mark of a record is removed: a not delete
|
||||
marked record always owns all its extern fields. */
|
||||
|
||||
void
|
||||
btr_cur_unmark_extern_fields(
|
||||
/*=========================*/
|
||||
rec_t* rec, /* in: record in a clustered index */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/***********************************************************************
|
||||
Marks all extern fields in a dtuple as owned by the record. */
|
||||
|
||||
void
|
||||
btr_cur_unmark_dtuple_extern_fields(
|
||||
/*================================*/
|
||||
dtuple_t* entry, /* in: clustered index entry */
|
||||
ulint* ext_vec, /* in: array of numbers of fields
|
||||
which have been stored externally */
|
||||
ulint n_ext_vec); /* in: number of elements in ext_vec */
|
||||
/***********************************************************************
|
||||
Stores the fields in big_rec_vec to the tablespace and puts pointers to
|
||||
them in rec. The fields are stored on pages allocated from leaf node
|
||||
file segment of the index tree. */
|
||||
|
@ -435,7 +482,9 @@ btr_store_big_rec_extern_fields(
|
|||
rec and to the tree */
|
||||
/***********************************************************************
|
||||
Frees the space in an externally stored field to the file space
|
||||
management. */
|
||||
management if the field in data is owned the externally stored field,
|
||||
in a rollback we may have the additional condition that the field must
|
||||
not be inherited. */
|
||||
|
||||
void
|
||||
btr_free_externally_stored_field(
|
||||
|
@ -446,6 +495,9 @@ btr_free_externally_stored_field(
|
|||
+ reference to the externally
|
||||
stored part */
|
||||
ulint local_len, /* in: length of data */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* local_mtr); /* in: mtr containing the latch to
|
||||
data an an X-latch to the index
|
||||
tree */
|
||||
|
@ -458,6 +510,9 @@ btr_rec_free_externally_stored_fields(
|
|||
dict_index_t* index, /* in: index of the data, the index
|
||||
tree MUST be X-latched */
|
||||
rec_t* rec, /* in: record */
|
||||
ibool do_not_free_inherited,/* in: TRUE if called in a
|
||||
rollback and we do not want to free
|
||||
inherited fields */
|
||||
mtr_t* mtr); /* in: mini-transaction handle which contains
|
||||
an X-latch to record page and to the index
|
||||
tree */
|
||||
|
@ -620,10 +675,21 @@ and sleep this many microseconds in between */
|
|||
on that page */
|
||||
#define BTR_EXTERN_LEN 12 /* 8 bytes containing the
|
||||
length of the externally
|
||||
stored part of the BLOB */
|
||||
stored part of the BLOB.
|
||||
The 2 highest bits are
|
||||
reserved to the flags below. */
|
||||
/*--------------------------------------*/
|
||||
#define BTR_EXTERN_FIELD_REF_SIZE 20
|
||||
|
||||
/* The highest bit of BTR_EXTERN_LEN (i.e., the highest bit of the byte
|
||||
at lowest address) is set to 1 if this field does not 'own' the externally
|
||||
stored field; only the owner field is allowed to free the field in purge!
|
||||
If the 2nd highest bit is 1 then it means that the externally stored field
|
||||
was inherited from an earlier version of the row. In rollback we are not
|
||||
allowed to free an inherited external field. */
|
||||
|
||||
#define BTR_EXTERN_OWNER_FLAG 128
|
||||
#define BTR_EXTERN_INHERITED_FLAG 64
|
||||
|
||||
extern ulint btr_cur_n_non_sea;
|
||||
|
||||
|
|
|
@ -771,6 +771,17 @@ struct buf_pool_struct{
|
|||
ulint n_pages_written;/* number write operations */
|
||||
ulint n_pages_created;/* number of pages created in the pool
|
||||
with no read */
|
||||
ulint n_page_gets; /* number of page gets performed;
|
||||
also successful seraches through
|
||||
the adaptive hash index are
|
||||
counted as page gets; this field
|
||||
is NOT protected by the buffer
|
||||
pool mutex */
|
||||
ulint n_page_gets_old;/* n_page_gets when buf_print was
|
||||
last time called: used to calculate
|
||||
hit rate */
|
||||
ulint n_pages_read_old;/* n_pages_read when buf_print was
|
||||
last time called */
|
||||
/* 2. Page flushing algorithm fields */
|
||||
|
||||
UT_LIST_BASE_NODE_T(buf_block_t) flush_list;
|
||||
|
|
|
@ -329,7 +329,12 @@ dtuple_convert_big_rec(
|
|||
the entry enough, i.e., if there are
|
||||
too many short fields in entry */
|
||||
dict_index_t* index, /* in: index */
|
||||
dtuple_t* entry); /* in: index entry */
|
||||
dtuple_t* entry, /* in: index entry */
|
||||
ulint* ext_vec,/* in: array of externally stored fields,
|
||||
or NULL: if a field already is externally
|
||||
stored, then we cannot move it to the vector
|
||||
this function returns */
|
||||
ulint n_ext_vec);/* in: number of elements is ext_vec */
|
||||
/******************************************************************
|
||||
Puts back to entry the data stored in vector. Note that to ensure the
|
||||
fields in entry can accommodate the data, vector must have been created
|
||||
|
|
|
@ -62,7 +62,15 @@ extern int srv_query_thread_priority;
|
|||
|
||||
/*-------------------------------------------*/
|
||||
|
||||
extern ulint srv_n_rows_inserted;
|
||||
extern ulint srv_n_rows_updated;
|
||||
extern ulint srv_n_rows_deleted;
|
||||
extern ulint srv_n_rows_read;
|
||||
|
||||
extern ibool srv_print_innodb_monitor;
|
||||
extern ibool srv_print_innodb_lock_monitor;
|
||||
extern ibool srv_print_innodb_tablespace_monitor;
|
||||
|
||||
extern ulint srv_n_spin_wait_rounds;
|
||||
extern ulint srv_spin_wait_delay;
|
||||
extern ibool srv_priority_boost;
|
||||
|
@ -105,13 +113,19 @@ extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
|
|||
it from dynamic memory to get it to the
|
||||
same DRAM page as other hotspot semaphores */
|
||||
#define kernel_mutex (*kernel_mutex_temp)
|
||||
|
||||
#define SRV_MAX_N_IO_THREADS 100
|
||||
|
||||
/* Array of English strings describing the current state of an
|
||||
i/o handler thread */
|
||||
extern char* srv_io_thread_op_info[];
|
||||
|
||||
typedef struct srv_sys_struct srv_sys_t;
|
||||
|
||||
/* The server system */
|
||||
extern srv_sys_t* srv_sys;
|
||||
|
||||
/* Alternatives for fiel flush option in Unix; see the InnoDB manual about
|
||||
/* Alternatives for the field flush option in Unix; see the InnoDB manual about
|
||||
what these mean */
|
||||
#define SRV_UNIX_FDATASYNC 1
|
||||
#define SRV_UNIX_O_DSYNC 2
|
||||
|
|
|
@ -315,6 +315,9 @@ struct trx_sys_struct{
|
|||
/* List of active and committed in
|
||||
memory transactions, sorted on trx id,
|
||||
biggest first */
|
||||
UT_LIST_BASE_NODE_T(trx_t) mysql_trx_list;
|
||||
/* List of transactions created
|
||||
for MySQL */
|
||||
UT_LIST_BASE_NODE_T(trx_rseg_t) rseg_list;
|
||||
/* List of rollback segment objects */
|
||||
trx_rseg_t* latest_rseg; /* Latest rollback segment in the
|
||||
|
|
|
@ -130,6 +130,14 @@ void
|
|||
trx_mark_sql_stat_end(
|
||||
/*==================*/
|
||||
trx_t* trx); /* in: trx handle */
|
||||
/**************************************************************************
|
||||
Marks the latest SQL statement ended but does not start a new transaction
|
||||
if the trx is not started. */
|
||||
|
||||
void
|
||||
trx_mark_sql_stat_end_do_not_start_new(
|
||||
/*===================================*/
|
||||
trx_t* trx); /* in: trx handle */
|
||||
/************************************************************************
|
||||
Assigns a read view for a consistent read query. All the consistent reads
|
||||
within the same transaction will get the same read view, which is created
|
||||
|
@ -236,6 +244,14 @@ trx_commit_step(
|
|||
/*============*/
|
||||
/* out: query thread to run next, or NULL */
|
||||
que_thr_t* thr); /* in: query thread */
|
||||
/**************************************************************************
|
||||
Prints info about a transaction to the standard output. The caller must
|
||||
own the kernel mutex. */
|
||||
|
||||
void
|
||||
trx_print(
|
||||
/*======*/
|
||||
trx_t* trx); /* in: transaction */
|
||||
|
||||
|
||||
/* Signal to a transaction */
|
||||
|
@ -270,6 +286,9 @@ rolling back after a database recovery */
|
|||
struct trx_struct{
|
||||
/* All the next fields are protected by the kernel mutex, except the
|
||||
undo logs which are protected by undo_mutex */
|
||||
char* op_info; /* English text describing the
|
||||
current operation, or an empty
|
||||
string */
|
||||
ulint type; /* TRX_USER, TRX_PURGE */
|
||||
ulint conc_state; /* state of the trx from the point
|
||||
of view of concurrency control:
|
||||
|
@ -284,6 +303,8 @@ struct trx_struct{
|
|||
table */
|
||||
dulint table_id; /* table id if the preceding field is
|
||||
TRUE */
|
||||
void* mysql_thd; /* MySQL thread handle corresponding
|
||||
to this trx, or NULL */
|
||||
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
|
||||
with this transaction object */
|
||||
ulint n_mysql_tables_in_use; /* number of Innobase tables
|
||||
|
@ -302,6 +323,9 @@ struct trx_struct{
|
|||
of a duplicate key error */
|
||||
UT_LIST_NODE_T(trx_t)
|
||||
trx_list; /* list of transactions */
|
||||
UT_LIST_NODE_T(trx_t)
|
||||
mysql_trx_list; /* list of transactions created for
|
||||
MySQL */
|
||||
/*------------------------------*/
|
||||
mutex_t undo_mutex; /* mutex protecting the fields in this
|
||||
section (down to undo_no_arr), EXCEPT
|
||||
|
|
|
@ -11,7 +11,9 @@ Created 1/20/1994 Heikki Tuuri
|
|||
|
||||
#include "univ.i"
|
||||
#include <time.h>
|
||||
#ifndef MYSQL_SERVER
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
typedef time_t ib_time_t;
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ Created 5/7/1996 Heikki Tuuri
|
|||
#endif
|
||||
|
||||
#include "usr0sess.h"
|
||||
#include "trx0purge.h"
|
||||
|
||||
/* When releasing transaction locks, this specifies how often we release
|
||||
the kernel mutex for a moment to give also others access to it */
|
||||
|
@ -3184,7 +3185,7 @@ lock_table_print(
|
|||
ut_ad(mutex_own(&kernel_mutex));
|
||||
ut_a(lock_get_type(lock) == LOCK_TABLE);
|
||||
|
||||
printf("\nTABLE LOCK table %s trx id %lu %lu",
|
||||
printf("TABLE LOCK table %s trx id %lu %lu",
|
||||
lock->un_member.tab_lock.table->name,
|
||||
(lock->trx)->id.high, (lock->trx)->id.low);
|
||||
|
||||
|
@ -3220,6 +3221,8 @@ lock_rec_print(
|
|||
ulint page_no;
|
||||
ulint i;
|
||||
ulint count = 0;
|
||||
ulint len;
|
||||
char buf[200];
|
||||
mtr_t mtr;
|
||||
|
||||
ut_ad(mutex_own(&kernel_mutex));
|
||||
|
@ -3228,7 +3231,7 @@ lock_rec_print(
|
|||
space = lock->un_member.rec_lock.space;
|
||||
page_no = lock->un_member.rec_lock.page_no;
|
||||
|
||||
printf("\nRECORD LOCKS space id %lu page no %lu n bits %lu",
|
||||
printf("RECORD LOCKS space id %lu page no %lu n bits %lu",
|
||||
space, page_no, lock_rec_get_n_bits(lock));
|
||||
|
||||
printf(" table %s index %s trx id %lu %lu",
|
||||
|
@ -3251,10 +3254,10 @@ lock_rec_print(
|
|||
printf(" waiting");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
printf("\n");
|
||||
|
||||
/* If the page is not in the buffer pool, we cannot load it
|
||||
because we have the kernel mutex and ibuf operations would
|
||||
break the latching order */
|
||||
|
@ -3280,12 +3283,14 @@ lock_rec_print(
|
|||
printf("Record lock, heap no %lu ", i);
|
||||
|
||||
if (page) {
|
||||
rec_print(page_find_rec_with_heap_no(page, i));
|
||||
len = rec_sprintf(buf, 190,
|
||||
page_find_rec_with_heap_no(page, i));
|
||||
buf[len] = '\0';
|
||||
printf("%s", buf);
|
||||
}
|
||||
|
||||
count++;
|
||||
|
||||
printf("\n");
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count >= 3) {
|
||||
|
@ -3342,12 +3347,32 @@ lock_print_info(void)
|
|||
ulint nth_lock = 0;
|
||||
ulint i;
|
||||
mtr_t mtr;
|
||||
|
||||
lock_mutex_enter_kernel();
|
||||
|
||||
printf("LOCK INFO:\n");
|
||||
printf("Number of locks in the record hash table %lu\n",
|
||||
printf(
|
||||
"Purge done for all trx's with n:o < %lu %lu, undo n:o < %lu %lu\n",
|
||||
ut_dulint_get_high(purge_sys->purge_trx_no),
|
||||
ut_dulint_get_low(purge_sys->purge_trx_no),
|
||||
ut_dulint_get_high(purge_sys->purge_undo_no),
|
||||
ut_dulint_get_low(purge_sys->purge_undo_no));
|
||||
|
||||
lock_mutex_enter_kernel();
|
||||
|
||||
printf("Total number of lock structs in row lock hash table %lu\n",
|
||||
lock_get_n_rec_locks());
|
||||
|
||||
/* First print info on non-active transactions */
|
||||
|
||||
trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
|
||||
|
||||
while (trx) {
|
||||
if (trx->conc_state == TRX_NOT_STARTED) {
|
||||
printf("---");
|
||||
trx_print(trx);
|
||||
}
|
||||
|
||||
trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
|
||||
}
|
||||
|
||||
loop:
|
||||
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
|
||||
|
||||
|
@ -3367,11 +3392,21 @@ loop:
|
|||
}
|
||||
|
||||
if (nth_lock == 0) {
|
||||
printf("\nLOCKS FOR TRANSACTION ID %lu %lu\n", trx->id.high,
|
||||
trx->id.low);
|
||||
printf("---");
|
||||
trx_print(trx);
|
||||
|
||||
if (trx->read_view) {
|
||||
printf(
|
||||
"Trx read view will not see trx with id >= %lu %lu, sees < %lu %lu\n",
|
||||
ut_dulint_get_high(trx->read_view->low_limit_id),
|
||||
ut_dulint_get_low(trx->read_view->low_limit_id),
|
||||
ut_dulint_get_high(trx->read_view->up_limit_id),
|
||||
ut_dulint_get_low(trx->read_view->up_limit_id));
|
||||
}
|
||||
|
||||
if (trx->que_state == TRX_QUE_LOCK_WAIT) {
|
||||
printf(
|
||||
"################# TRX IS WAITING FOR THE LOCK: ###\n");
|
||||
"------------------TRX IS WAITING FOR THE LOCK:\n");
|
||||
|
||||
if (lock_get_type(trx->wait_lock) == LOCK_REC) {
|
||||
lock_rec_print(trx->wait_lock);
|
||||
|
@ -3380,10 +3415,15 @@ loop:
|
|||
}
|
||||
|
||||
printf(
|
||||
"##################################################\n");
|
||||
"------------------\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!srv_print_innodb_lock_monitor) {
|
||||
nth_trx++;
|
||||
goto loop;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
|
||||
lock = UT_LIST_GET_FIRST(trx->trx_locks);
|
||||
|
@ -3431,9 +3471,9 @@ loop:
|
|||
|
||||
nth_lock++;
|
||||
|
||||
if (nth_lock >= 25) {
|
||||
if (nth_lock >= 10) {
|
||||
printf(
|
||||
"25 LOCKS PRINTED FOR THIS TRX: SUPPRESSING FURTHER PRINTS\n");
|
||||
"10 LOCKS PRINTED FOR THIS TRX: SUPPRESSING FURTHER PRINTS\n");
|
||||
|
||||
nth_trx++;
|
||||
nth_lock = 0;
|
||||
|
|
|
@ -1577,6 +1577,7 @@ os_aio_windows_handle(
|
|||
void** message2,
|
||||
ulint* type) /* out: OS_FILE_WRITE or ..._READ */
|
||||
{
|
||||
ulint orig_seg = segment;
|
||||
os_aio_array_t* array;
|
||||
os_aio_slot_t* slot;
|
||||
ulint n;
|
||||
|
@ -1602,10 +1603,14 @@ os_aio_windows_handle(
|
|||
n = array->n_slots / array->n_segments;
|
||||
|
||||
if (array == os_aio_sync_array) {
|
||||
srv_io_thread_op_info[orig_seg] = "wait windows aio for 1 page";
|
||||
|
||||
ut_ad(pos < array->n_slots);
|
||||
os_event_wait(array->events[pos]);
|
||||
i = pos;
|
||||
} else {
|
||||
srv_io_thread_op_info[orig_seg] =
|
||||
"wait windows aio for n pages";
|
||||
i = os_event_wait_multiple(n, (array->events) + segment * n);
|
||||
}
|
||||
|
||||
|
@ -1615,6 +1620,7 @@ os_aio_windows_handle(
|
|||
|
||||
ut_a(slot->reserved);
|
||||
|
||||
srv_io_thread_op_info[orig_seg] = "get windows aio return value";
|
||||
ret = GetOverlappedResult(slot->file, &(slot->control), &len, TRUE);
|
||||
|
||||
*message1 = slot->message1;
|
||||
|
@ -1887,6 +1893,8 @@ consecutive_loop:
|
|||
}
|
||||
}
|
||||
|
||||
srv_io_thread_op_info[global_segment] = "doing file i/o";
|
||||
|
||||
/* Do the i/o with ordinary, synchronous i/o functions: */
|
||||
if (slot->type == OS_FILE_WRITE) {
|
||||
ret = os_file_write(slot->name, slot->file, combined_buf,
|
||||
|
@ -1897,7 +1905,8 @@ consecutive_loop:
|
|||
}
|
||||
|
||||
ut_a(ret);
|
||||
|
||||
srv_io_thread_op_info[global_segment] = "file i/o done";
|
||||
|
||||
/* printf("aio: %lu consecutive %lu:th segment, first offs %lu blocks\n",
|
||||
n_consecutive, global_segment, slot->offset
|
||||
/ UNIV_PAGE_SIZE); */
|
||||
|
@ -1953,6 +1962,8 @@ wait_for_io:
|
|||
|
||||
os_mutex_exit(array->mutex);
|
||||
|
||||
srv_io_thread_op_info[global_segment] = "waiting for i/o request";
|
||||
|
||||
os_event_wait(os_aio_segment_wait_events[global_segment]);
|
||||
|
||||
goto restart;
|
||||
|
@ -2023,7 +2034,12 @@ os_aio_print(void)
|
|||
ulint n_reserved;
|
||||
ulint i;
|
||||
|
||||
printf("Pending normal aio reads:\n");
|
||||
for (i = 0; i < srv_n_file_io_threads; i++) {
|
||||
printf("I/O thread %lu state: %s\n", i,
|
||||
srv_io_thread_op_info[i]);
|
||||
}
|
||||
|
||||
printf("Pending normal aio reads: ");
|
||||
|
||||
array = os_aio_read_array;
|
||||
loop:
|
||||
|
@ -2041,21 +2057,21 @@ loop:
|
|||
|
||||
if (slot->reserved) {
|
||||
n_reserved++;
|
||||
printf("Reserved slot, messages %lx %lx\n",
|
||||
/* printf("Reserved slot, messages %lx %lx\n",
|
||||
(ulint)slot->message1,
|
||||
(ulint)slot->message2);
|
||||
ut_a(slot->len > 0);
|
||||
*/ ut_a(slot->len > 0);
|
||||
}
|
||||
}
|
||||
|
||||
ut_a(array->n_reserved == n_reserved);
|
||||
|
||||
printf("Total of %lu reserved aio slots\n", n_reserved);
|
||||
printf("%lu\n", n_reserved);
|
||||
|
||||
os_mutex_exit(array->mutex);
|
||||
|
||||
if (array == os_aio_read_array) {
|
||||
printf("Pending aio writes:\n");
|
||||
printf("Pending aio writes: ");
|
||||
|
||||
array = os_aio_write_array;
|
||||
|
||||
|
@ -2063,21 +2079,21 @@ loop:
|
|||
}
|
||||
|
||||
if (array == os_aio_write_array) {
|
||||
printf("Pending insert buffer aio reads:\n");
|
||||
printf("Pending insert buffer aio reads: ");
|
||||
array = os_aio_ibuf_array;
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
||||
if (array == os_aio_ibuf_array) {
|
||||
printf("Pending log writes or reads:\n");
|
||||
printf("Pending log writes or reads: ");
|
||||
array = os_aio_log_array;
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
||||
if (array == os_aio_log_array) {
|
||||
printf("Pending synchronous reads or writes:\n");
|
||||
printf("Pending synchronous reads or writes: ");
|
||||
array = os_aio_sync_array;
|
||||
|
||||
goto loop;
|
||||
|
|
|
@ -462,6 +462,8 @@ row_insert_for_mysql(
|
|||
ut_ad(trx);
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
|
||||
trx->op_info = "inserting";
|
||||
|
||||
if (node == NULL) {
|
||||
row_get_prebuilt_insert_row(prebuilt);
|
||||
node = prebuilt->ins_node;
|
||||
|
@ -499,6 +501,8 @@ run_again:
|
|||
goto run_again;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
@ -506,12 +510,15 @@ run_again:
|
|||
|
||||
prebuilt->table->stat_n_rows++;
|
||||
|
||||
srv_n_rows_inserted++;
|
||||
|
||||
if (prebuilt->table->stat_n_rows == 0) {
|
||||
/* Avoid wrap-over */
|
||||
prebuilt->table->stat_n_rows--;
|
||||
}
|
||||
|
||||
row_update_statistics_if_needed(prebuilt);
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
@ -627,6 +634,8 @@ row_update_for_mysql(
|
|||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
UT_NOT_USED(mysql_rec);
|
||||
|
||||
trx->op_info = "updating or deleting";
|
||||
|
||||
node = prebuilt->upd_node;
|
||||
|
||||
clust_index = dict_table_get_first_index(table);
|
||||
|
@ -700,6 +709,7 @@ run_again:
|
|||
|
||||
if (err == DB_RECORD_NOT_FOUND) {
|
||||
trx->error_state = DB_SUCCESS;
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
@ -710,6 +720,8 @@ run_again:
|
|||
goto run_again;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
@ -719,10 +731,16 @@ run_again:
|
|||
if (prebuilt->table->stat_n_rows > 0) {
|
||||
prebuilt->table->stat_n_rows--;
|
||||
}
|
||||
}
|
||||
|
||||
srv_n_rows_deleted++;
|
||||
} else {
|
||||
srv_n_rows_updated++;
|
||||
}
|
||||
|
||||
row_update_statistics_if_needed(prebuilt);
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
|
@ -798,6 +816,8 @@ row_create_table_for_mysql(
|
|||
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
|
||||
trx->op_info = "creating table";
|
||||
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
|
@ -825,16 +845,22 @@ row_create_table_for_mysql(
|
|||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
||||
|
||||
if (err == DB_OUT_OF_FILE_SPACE) {
|
||||
row_drop_table_for_mysql(table->name, trx, TRUE);
|
||||
row_drop_table_for_mysql(table->name, trx, TRUE);
|
||||
} else {
|
||||
assert(err == DB_DUPLICATE_KEY);
|
||||
fprintf(stderr,
|
||||
assert(err == DB_DUPLICATE_KEY);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: table %s already exists in InnoDB internal\n"
|
||||
"InnoDB: data dictionary. Have you deleted the .frm file\n"
|
||||
"InnoDB: and not used DROP TABLE? Have you used DROP DATABASE\n"
|
||||
"InnoDB: for InnoDB tables in MySQL version <= 3.23.39?\n"
|
||||
"InnoDB: for InnoDB tables in MySQL version <= 3.23.42?\n"
|
||||
"InnoDB: See the Restrictions section of the InnoDB manual.\n",
|
||||
table->name);
|
||||
fprintf(stderr,
|
||||
"InnoDB: You can drop the orphaned table inside InnoDB by\n"
|
||||
"InnoDB: creating an InnoDB table with the same name in another\n"
|
||||
"InnoDB: database and moving the .frm file to the current database.\n"
|
||||
"InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n"
|
||||
"InnoDB: succeed.\n");
|
||||
}
|
||||
|
||||
trx->error_state = DB_SUCCESS;
|
||||
|
@ -852,11 +878,32 @@ row_create_table_for_mysql(
|
|||
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||
"innodb_lock_monitor", keywordlen)) {
|
||||
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
srv_print_innodb_lock_monitor = TRUE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(table->name + namelen - keywordlen,
|
||||
"innodb_tablespace_monitor", keywordlen)) {
|
||||
|
||||
srv_print_innodb_tablespace_monitor = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
|
@ -879,6 +926,8 @@ row_create_index_for_mysql(
|
|||
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
|
||||
trx->op_info = "creating index";
|
||||
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
|
@ -915,6 +964,8 @@ row_create_index_for_mysql(
|
|||
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
|
@ -945,7 +996,9 @@ row_drop_table_for_mysql(
|
|||
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
ut_a(name != NULL);
|
||||
|
||||
|
||||
trx->op_info = "dropping table";
|
||||
|
||||
namelen = ut_strlen(name);
|
||||
keywordlen = ut_strlen("innodb_monitor");
|
||||
|
||||
|
@ -957,6 +1010,26 @@ row_drop_table_for_mysql(
|
|||
stop monitor prints */
|
||||
|
||||
srv_print_innodb_monitor = FALSE;
|
||||
srv_print_innodb_lock_monitor = FALSE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_lock_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||
"innodb_lock_monitor", keywordlen)) {
|
||||
|
||||
srv_print_innodb_monitor = FALSE;
|
||||
srv_print_innodb_lock_monitor = FALSE;
|
||||
}
|
||||
|
||||
keywordlen = ut_strlen("innodb_tablespace_monitor");
|
||||
|
||||
if (namelen >= keywordlen
|
||||
&& 0 == ut_memcmp(name + namelen - keywordlen,
|
||||
"innodb_tablespace_monitor", keywordlen)) {
|
||||
|
||||
srv_print_innodb_tablespace_monitor = FALSE;
|
||||
}
|
||||
|
||||
/* We use the private SQL parser of Innobase to generate the
|
||||
|
@ -1071,6 +1144,8 @@ funct_exit:
|
|||
|
||||
que_graph_free(graph);
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
|
@ -1099,6 +1174,8 @@ row_rename_table_for_mysql(
|
|||
ut_a(old_name != NULL);
|
||||
ut_a(new_name != NULL);
|
||||
|
||||
trx->op_info = "renaming table";
|
||||
|
||||
str1 =
|
||||
"PROCEDURE RENAME_TABLE_PROC () IS\n"
|
||||
"BEGIN\n"
|
||||
|
@ -1168,6 +1245,8 @@ funct_exit:
|
|||
|
||||
que_graph_free(graph);
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
|
@ -1279,6 +1358,8 @@ row_check_table_for_mysql(
|
|||
ulint n_rows;
|
||||
ulint n_rows_in_table;
|
||||
ulint ret = DB_SUCCESS;
|
||||
|
||||
prebuilt->trx->op_info = "checking table";
|
||||
|
||||
index = dict_table_get_first_index(table);
|
||||
|
||||
|
@ -1311,5 +1392,7 @@ row_check_table_for_mysql(
|
|||
index = dict_table_get_next_index(index);
|
||||
}
|
||||
|
||||
prebuilt->trx->op_info = "";
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ row_purge_remove_clust_if_poss_low(
|
|||
success = btr_cur_optimistic_delete(btr_cur, &mtr);
|
||||
} else {
|
||||
ut_ad(mode == BTR_MODIFY_TREE);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, &mtr);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, FALSE, &mtr);
|
||||
|
||||
if (err == DB_SUCCESS) {
|
||||
success = TRUE;
|
||||
|
@ -254,8 +254,8 @@ row_purge_remove_sec_if_poss_low(
|
|||
success = btr_cur_optimistic_delete(btr_cur, &mtr);
|
||||
} else {
|
||||
ut_ad(mode == BTR_MODIFY_TREE);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, &mtr);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
|
||||
FALSE, &mtr);
|
||||
if (err == DB_SUCCESS) {
|
||||
success = TRUE;
|
||||
} else if (err == DB_OUT_OF_FILE_SPACE) {
|
||||
|
@ -437,7 +437,7 @@ skip_secondaries:
|
|||
data_field_len = ufield->new_val.len;
|
||||
|
||||
btr_free_externally_stored_field(index, data_field,
|
||||
data_field_len, &mtr);
|
||||
data_field_len, FALSE, &mtr);
|
||||
mtr_commit(&mtr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2488,6 +2488,8 @@ row_search_for_mysql(
|
|||
printf("N tables locked %lu\n", trx->mysql_n_tables_locked);
|
||||
*/
|
||||
if (direction == 0) {
|
||||
trx->op_info = "starting index read";
|
||||
|
||||
prebuilt->n_rows_fetched = 0;
|
||||
prebuilt->n_fetch_cached = 0;
|
||||
prebuilt->fetch_cache_first = 0;
|
||||
|
@ -2497,6 +2499,8 @@ row_search_for_mysql(
|
|||
row_prebuild_sel_graph(prebuilt);
|
||||
}
|
||||
} else {
|
||||
trx->op_info = "fetching rows";
|
||||
|
||||
if (prebuilt->n_rows_fetched == 0) {
|
||||
prebuilt->fetch_direction = direction;
|
||||
}
|
||||
|
@ -2519,6 +2523,9 @@ row_search_for_mysql(
|
|||
|
||||
prebuilt->n_rows_fetched++;
|
||||
|
||||
srv_n_rows_read++;
|
||||
trx->op_info = "";
|
||||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
|
@ -2529,6 +2536,7 @@ row_search_for_mysql(
|
|||
cache, but the cache was not full at the time of the
|
||||
popping: no more rows can exist in the result set */
|
||||
|
||||
trx->op_info = "";
|
||||
return(DB_RECORD_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
@ -2560,6 +2568,7 @@ row_search_for_mysql(
|
|||
|
||||
/* printf("%s record not found 1\n", index->name); */
|
||||
|
||||
trx->op_info = "";
|
||||
return(DB_RECORD_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
@ -2599,6 +2608,9 @@ row_search_for_mysql(
|
|||
|
||||
/* printf("%s shortcut\n", index->name); */
|
||||
|
||||
srv_n_rows_read++;
|
||||
|
||||
trx->op_info = "";
|
||||
return(DB_SUCCESS);
|
||||
|
||||
} else if (shortcut == SEL_EXHAUSTED) {
|
||||
|
@ -2607,6 +2619,7 @@ row_search_for_mysql(
|
|||
|
||||
/* printf("%s record not found 2\n",
|
||||
index->name); */
|
||||
trx->op_info = "";
|
||||
return(DB_RECORD_NOT_FOUND);
|
||||
}
|
||||
|
||||
|
@ -2980,6 +2993,8 @@ lock_wait_or_error:
|
|||
|
||||
/* printf("Using index %s cnt %lu ret value %lu err\n", index->name,
|
||||
cnt, err); */
|
||||
trx->op_info = "";
|
||||
|
||||
return(err);
|
||||
|
||||
normal_return:
|
||||
|
@ -2995,5 +3010,11 @@ normal_return:
|
|||
|
||||
/* printf("Using index %s cnt %lu ret value %lu\n", index->name,
|
||||
cnt, err); */
|
||||
if (ret == DB_SUCCESS) {
|
||||
srv_n_rows_read++;
|
||||
}
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ retry:
|
|||
&(node->pcur), &mtr);
|
||||
ut_a(success);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, &mtr);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, TRUE, &mtr);
|
||||
|
||||
/* The delete operation may fail if we have little
|
||||
file space left: TODO: easiest to crash the database
|
||||
|
@ -174,7 +174,7 @@ row_undo_ins_remove_sec_low(
|
|||
} else {
|
||||
ut_ad(mode == BTR_MODIFY_TREE);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, &mtr);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, TRUE, &mtr);
|
||||
}
|
||||
|
||||
btr_pcur_close(&pcur);
|
||||
|
|
|
@ -179,7 +179,11 @@ row_undo_mod_remove_clust_low(
|
|||
} else {
|
||||
ut_ad(mode == BTR_MODIFY_TREE);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, mtr);
|
||||
/* Note that since this operation is analogous to purge,
|
||||
we can free also inherited externally stored fields:
|
||||
hence the last FALSE in the call below */
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, FALSE, mtr);
|
||||
|
||||
/* The delete operation may fail if we have little
|
||||
file space left: TODO: easiest to crash the database
|
||||
|
@ -356,7 +360,8 @@ row_undo_mod_del_mark_or_remove_sec_low(
|
|||
} else {
|
||||
ut_ad(mode == BTR_MODIFY_TREE);
|
||||
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur, &mtr);
|
||||
btr_cur_pessimistic_delete(&err, FALSE, btr_cur,
|
||||
TRUE, &mtr);
|
||||
|
||||
/* The delete operation may fail if we have little
|
||||
file space left: TODO: easiest to crash the database
|
||||
|
@ -423,22 +428,22 @@ row_undo_mod_del_unmark_sec(
|
|||
found = row_search_index_entry(index, entry, BTR_MODIFY_LEAF, &pcur,
|
||||
&mtr);
|
||||
if (!found) {
|
||||
err_buf = mem_alloc(1000);
|
||||
dtuple_sprintf(err_buf, 900, entry);
|
||||
err_buf = mem_alloc(1000);
|
||||
dtuple_sprintf(err_buf, 900, entry);
|
||||
|
||||
fprintf(stderr, "InnoDB: error in sec index entry del undo in\n"
|
||||
"InnoDB: index %s table %s\n", index->name,
|
||||
index->table->name);
|
||||
fprintf(stderr, "InnoDB: tuple %s\n", err_buf);
|
||||
fprintf(stderr, "InnoDB: error in sec index entry del undo in\n"
|
||||
"InnoDB: index %s table %s\n", index->name,
|
||||
index->table->name);
|
||||
fprintf(stderr, "InnoDB: tuple %s\n", err_buf);
|
||||
|
||||
rec_sprintf(err_buf, 900, btr_pcur_get_rec(&pcur));
|
||||
fprintf(stderr, "InnoDB: record %s\n", err_buf);
|
||||
rec_sprintf(err_buf, 900, btr_pcur_get_rec(&pcur));
|
||||
fprintf(stderr, "InnoDB: record %s\n", err_buf);
|
||||
|
||||
fprintf(stderr, "InnoDB: Make a detailed bug report and send it\n");
|
||||
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
|
||||
|
||||
mem_free(err_buf);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Make a detailed bug report and send it\n");
|
||||
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
|
||||
|
||||
mem_free(err_buf);
|
||||
} else {
|
||||
btr_cur = btr_pcur_get_btr_cur(&pcur);
|
||||
|
||||
|
|
|
@ -840,32 +840,31 @@ row_upd_sec_index_entry(
|
|||
rec = btr_cur_get_rec(btr_cur);
|
||||
|
||||
if (!found) {
|
||||
err_buf = mem_alloc(1000);
|
||||
dtuple_sprintf(err_buf, 900, entry);
|
||||
|
||||
err_buf = mem_alloc(1000);
|
||||
dtuple_sprintf(err_buf, 900, entry);
|
||||
fprintf(stderr, "InnoDB: error in sec index entry update in\n"
|
||||
"InnoDB: index %s table %s\n", index->name,
|
||||
index->table->name);
|
||||
fprintf(stderr, "InnoDB: tuple %s\n", err_buf);
|
||||
|
||||
fprintf(stderr, "InnoDB: error in sec index entry update in\n"
|
||||
"InnoDB: index %s table %s\n", index->name,
|
||||
index->table->name);
|
||||
fprintf(stderr, "InnoDB: tuple %s\n", err_buf);
|
||||
rec_sprintf(err_buf, 900, rec);
|
||||
fprintf(stderr, "InnoDB: record %s\n", err_buf);
|
||||
|
||||
rec_sprintf(err_buf, 900, rec);
|
||||
fprintf(stderr, "InnoDB: record %s\n", err_buf);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Make a detailed bug report and send it\n");
|
||||
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
|
||||
|
||||
fprintf(stderr, "InnoDB: Make a detailed bug report and send it\n");
|
||||
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
|
||||
|
||||
mem_free(err_buf);
|
||||
mem_free(err_buf);
|
||||
} else {
|
||||
/* Delete mark the old index record; it can already be
|
||||
delete marked if we return after a lock wait in
|
||||
row_ins_index_entry below */
|
||||
|
||||
/* Delete mark the old index record; it can already be
|
||||
delete marked if we return after a lock wait in
|
||||
row_ins_index_entry below */
|
||||
|
||||
if (!rec_get_deleted_flag(rec)) {
|
||||
err = btr_cur_del_mark_set_sec_rec(0, btr_cur, TRUE, thr,
|
||||
&mtr);
|
||||
}
|
||||
if (!rec_get_deleted_flag(rec)) {
|
||||
err = btr_cur_del_mark_set_sec_rec(0, btr_cur, TRUE,
|
||||
thr, &mtr);
|
||||
}
|
||||
}
|
||||
|
||||
btr_pcur_close(&pcur);
|
||||
|
@ -907,7 +906,7 @@ row_upd_sec_step(
|
|||
|| (node->state == UPD_NODE_UPDATE_SOME_SEC));
|
||||
ut_ad(!(node->index->type & DICT_CLUSTERED));
|
||||
|
||||
if ((node->state == UPD_NODE_UPDATE_ALL_SEC)
|
||||
if (node->state == UPD_NODE_UPDATE_ALL_SEC
|
||||
|| row_upd_changes_ord_field(node->row, node->index,
|
||||
node->update)) {
|
||||
err = row_upd_sec_index_entry(node, thr);
|
||||
|
@ -933,15 +932,13 @@ row_upd_clust_rec_by_insert(
|
|||
dict_index_t* index, /* in: clustered index of the record */
|
||||
que_thr_t* thr, /* in: query thread */
|
||||
mtr_t* mtr) /* in: mtr; gets committed here */
|
||||
{
|
||||
{
|
||||
mem_heap_t* heap;
|
||||
btr_pcur_t* pcur;
|
||||
btr_cur_t* btr_cur;
|
||||
trx_t* trx;
|
||||
dict_table_t* table;
|
||||
mem_heap_t* heap;
|
||||
dtuple_t* entry;
|
||||
ulint* ext_vec;
|
||||
ulint n_ext_vec;
|
||||
ulint err;
|
||||
|
||||
ut_ad(node);
|
||||
|
@ -961,17 +958,20 @@ row_upd_clust_rec_by_insert(
|
|||
|
||||
return(err);
|
||||
}
|
||||
/* Mark as not-owned the externally stored fields which the new
|
||||
row inherits from the delete marked record: purge should not
|
||||
free those externally stored fields even if the delete marked
|
||||
record is removed from the index tree, or updated. */
|
||||
|
||||
btr_cur_mark_extern_inherited_fields(btr_cur_get_rec(btr_cur),
|
||||
node->update, mtr);
|
||||
}
|
||||
|
||||
mtr_commit(mtr);
|
||||
|
||||
node->state = UPD_NODE_INSERT_CLUSTERED;
|
||||
|
||||
heap = mem_heap_create(1024);
|
||||
|
||||
ext_vec = mem_heap_alloc(heap,
|
||||
sizeof(ulint) * dtuple_get_n_fields(node->row));
|
||||
n_ext_vec = 0;
|
||||
heap = mem_heap_create(500);
|
||||
|
||||
entry = row_build_index_entry(node->row, index, heap);
|
||||
|
||||
|
@ -979,10 +979,23 @@ row_upd_clust_rec_by_insert(
|
|||
|
||||
row_upd_index_entry_sys_field(entry, index, DATA_TRX_ID, trx->id);
|
||||
|
||||
/* If we return from a lock wait, for example, we may have
|
||||
extern fields marked as not-owned in entry (marked if the
|
||||
if-branch above). We must unmark them. */
|
||||
|
||||
btr_cur_unmark_dtuple_extern_fields(entry, node->ext_vec,
|
||||
node->n_ext_vec);
|
||||
/* We must mark non-updated extern fields in entry as inherited,
|
||||
so that a possible rollback will not free them */
|
||||
|
||||
btr_cur_mark_dtuple_inherited_extern(entry, node->ext_vec,
|
||||
node->n_ext_vec,
|
||||
node->update);
|
||||
|
||||
err = row_ins_index_entry(index, entry, node->ext_vec,
|
||||
node->n_ext_vec, thr);
|
||||
mem_heap_free(heap);
|
||||
|
||||
mem_heap_free(heap);
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,14 @@ ibool srv_print_buf_io = FALSE;
|
|||
ibool srv_print_log_io = FALSE;
|
||||
ibool srv_print_latch_waits = FALSE;
|
||||
|
||||
ulint srv_n_rows_inserted = 0;
|
||||
ulint srv_n_rows_updated = 0;
|
||||
ulint srv_n_rows_deleted = 0;
|
||||
ulint srv_n_rows_read = 0;
|
||||
|
||||
ibool srv_print_innodb_monitor = FALSE;
|
||||
ibool srv_print_innodb_lock_monitor = FALSE;
|
||||
ibool srv_print_innodb_tablespace_monitor = FALSE;
|
||||
|
||||
/* The parameters below are obsolete: */
|
||||
|
||||
|
@ -137,6 +144,11 @@ ulint srv_test_n_reserved_rnds = ULINT_MAX;
|
|||
ulint srv_test_array_size = ULINT_MAX;
|
||||
ulint srv_test_n_mutexes = ULINT_MAX;
|
||||
|
||||
/* Array of English strings describing the current state of an
|
||||
i/o handler thread */
|
||||
|
||||
char* srv_io_thread_op_info[SRV_MAX_N_IO_THREADS];
|
||||
|
||||
/*
|
||||
IMPLEMENTATION OF THE SERVER MAIN PROGRAM
|
||||
=========================================
|
||||
|
@ -1926,23 +1938,25 @@ loop:
|
|||
}
|
||||
|
||||
background_loop:
|
||||
/* In this loop we run background operations while the server
|
||||
/* In this loop we run background operations when the server
|
||||
is quiet */
|
||||
|
||||
current_time = time(NULL);
|
||||
|
||||
if (srv_print_innodb_monitor
|
||||
&& difftime(current_time, last_monitor_time) > 8) {
|
||||
if (difftime(current_time, last_monitor_time) > 15) {
|
||||
|
||||
last_monitor_time = time(NULL);
|
||||
|
||||
if (srv_print_innodb_monitor) {
|
||||
|
||||
printf("================================\n");
|
||||
last_monitor_time = time(NULL);
|
||||
printf("=====================================\n");
|
||||
ut_print_timestamp(stdout);
|
||||
|
||||
printf(" INNODB MONITOR OUTPUT\n"
|
||||
"================================\n");
|
||||
printf("--------------------------\n"
|
||||
"LOCKS HELD BY TRANSACTIONS\n"
|
||||
"--------------------------\n");
|
||||
"=====================================\n");
|
||||
printf("------------\n"
|
||||
"TRANSACTIONS\n"
|
||||
"------------\n");
|
||||
lock_print_info();
|
||||
printf("-----------------------------------------------\n"
|
||||
"CURRENT SEMAPHORES RESERVED AND SEMAPHORE WAITS\n"
|
||||
|
@ -1955,11 +1969,40 @@ background_loop:
|
|||
"BUFFER POOL\n"
|
||||
"-----------\n");
|
||||
buf_print_io();
|
||||
printf("--------------\n"
|
||||
"ROW OPERATIONS\n"
|
||||
"--------------\n");
|
||||
printf(
|
||||
"Number of rows inserted %lu, updated %lu, deleted %lu, read %lu\n",
|
||||
srv_n_rows_inserted,
|
||||
srv_n_rows_updated,
|
||||
srv_n_rows_deleted,
|
||||
srv_n_rows_read);
|
||||
printf("Server activity counter %lu\n", srv_activity_count);
|
||||
printf("----------------------------\n"
|
||||
"END OF INNODB MONITOR OUTPUT\n"
|
||||
"============================\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (srv_print_innodb_tablespace_monitor) {
|
||||
|
||||
printf("================================================\n");
|
||||
|
||||
ut_print_timestamp(stdout);
|
||||
|
||||
printf(" INNODB TABLESPACE MONITOR OUTPUT\n"
|
||||
"================================================\n");
|
||||
|
||||
fsp_print(0);
|
||||
fprintf(stderr, "Validating tablespace\n");
|
||||
fsp_validate(0);
|
||||
fprintf(stderr, "Validation ok\n");
|
||||
printf("---------------------------------------\n"
|
||||
"END OF INNODB TABLESPACE MONITOR OUTPUT\n"
|
||||
"=======================================\n");
|
||||
}
|
||||
}
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
@ -2009,8 +2052,18 @@ background_loop:
|
|||
}
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
if (srv_print_innodb_monitor) {
|
||||
ut_print_timestamp(stdout);
|
||||
printf(" InnoDB (main thread) starts buffer pool flush\n");
|
||||
}
|
||||
|
||||
n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max);
|
||||
|
||||
if (srv_print_innodb_monitor) {
|
||||
ut_print_timestamp(stdout);
|
||||
printf(" InnoDB flushed %lu pages\n", n_pages_flushed);
|
||||
}
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
if (srv_activity_count != old_activity_count) {
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
@ -2038,12 +2091,7 @@ background_loop:
|
|||
|
||||
/* mem_print_new_info();
|
||||
*/
|
||||
/*
|
||||
fsp_print(0);
|
||||
fprintf(stderr, "Validating tablespace\n");
|
||||
fsp_validate(0);
|
||||
fprintf(stderr, "Validation ok\n");
|
||||
*/
|
||||
|
||||
#ifdef UNIV_SEARCH_PERF_STAT
|
||||
/* btr_search_print_info(); */
|
||||
#endif
|
||||
|
|
|
@ -67,8 +67,6 @@ os_file_t files[1000];
|
|||
mutex_t ios_mutex;
|
||||
ulint ios;
|
||||
|
||||
#define SRV_MAX_N_IO_THREADS 1000
|
||||
|
||||
ulint n[SRV_MAX_N_IO_THREADS + 5];
|
||||
os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 5];
|
||||
|
||||
|
@ -591,6 +589,11 @@ innobase_start_or_create_for_mysql(void)
|
|||
return((int) err);
|
||||
}
|
||||
|
||||
/* Restrict the maximum number of file i/o threads */
|
||||
if (srv_n_file_io_threads > SRV_MAX_N_IO_THREADS) {
|
||||
srv_n_file_io_threads = SRV_MAX_N_IO_THREADS;
|
||||
}
|
||||
|
||||
#if !(defined(WIN_ASYNC_IO) || defined(POSIX_ASYNC_IO))
|
||||
/* In simulated aio we currently have use only for 4 threads */
|
||||
|
||||
|
|
|
@ -438,22 +438,48 @@ sync_array_cell_print(
|
|||
/*==================*/
|
||||
sync_cell_t* cell) /* in: sync cell */
|
||||
{
|
||||
char* str = NULL;
|
||||
ulint type;
|
||||
mutex_t* mutex;
|
||||
rw_lock_t* rwlock;
|
||||
char* str = NULL;
|
||||
ulint type;
|
||||
|
||||
type = cell->request_type;
|
||||
|
||||
if (type == SYNC_MUTEX) {
|
||||
str = "MUTEX ENTER";
|
||||
} else if (type == RW_LOCK_EX) {
|
||||
str = "X-LOCK";
|
||||
} else if (type == RW_LOCK_SHARED) {
|
||||
str = "S-LOCK";
|
||||
mutex = (mutex_t*)cell->wait_object;
|
||||
|
||||
printf("Mutex created in file %s line %lu",
|
||||
mutex->cfile_name, mutex->cline);
|
||||
} else if (type == RW_LOCK_EX || type == RW_LOCK_SHARED) {
|
||||
|
||||
if (type == RW_LOCK_EX) {
|
||||
str = "X-LOCK";
|
||||
} else {
|
||||
str = "S_LOCK";
|
||||
}
|
||||
|
||||
rwlock = (rw_lock_t*)cell->wait_object;
|
||||
|
||||
printf("Rw-latch created in file %s line %lu",
|
||||
rwlock->cfile_name, rwlock->cline);
|
||||
if (rwlock->writer != RW_LOCK_NOT_LOCKED) {
|
||||
printf(" writer reserved with %lu", rwlock->writer);
|
||||
}
|
||||
|
||||
if (rwlock->writer == RW_LOCK_EX) {
|
||||
printf(" reserv. thread id %lu",
|
||||
(ulint)rwlock->writer_thread);
|
||||
}
|
||||
|
||||
if (rwlock->reader_count > 0) {
|
||||
printf(" readers %lu", rwlock->reader_count);
|
||||
}
|
||||
} else {
|
||||
ut_error;
|
||||
}
|
||||
|
||||
printf("%lx waited for by thread %lu op. %s file %s line %lu ",
|
||||
printf(" at addr %lx waited for by thread %lu op. %s file %s line %lu ",
|
||||
(ulint)cell->wait_object,
|
||||
(ulint)cell->thread,
|
||||
str, cell->file, cell->line);
|
||||
|
|
|
@ -98,6 +98,8 @@ trx_rollback_for_mysql(
|
|||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
trx->op_info = "rollback";
|
||||
|
||||
/* Tell Innobase server that there might be work for
|
||||
utility threads: */
|
||||
|
@ -111,6 +113,8 @@ trx_rollback_for_mysql(
|
|||
|
||||
srv_active_wake_master_thread();
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
@ -129,6 +133,8 @@ trx_rollback_last_sql_stat_for_mysql(
|
|||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
trx->op_info = "rollback of SQL statement";
|
||||
|
||||
/* Tell Innobase server that there might be work for
|
||||
utility threads: */
|
||||
|
@ -144,6 +150,8 @@ trx_rollback_last_sql_stat_for_mysql(
|
|||
|
||||
srv_active_wake_master_thread();
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(err);
|
||||
}
|
||||
|
||||
|
|
|
@ -510,7 +510,8 @@ trx_sys_init_at_db_start(void)
|
|||
MLOG_8BYTES, &mtr),
|
||||
TRX_SYS_TRX_ID_WRITE_MARGIN),
|
||||
2 * TRX_SYS_TRX_ID_WRITE_MARGIN);
|
||||
|
||||
|
||||
UT_LIST_INIT(trx_sys->mysql_trx_list);
|
||||
trx_lists_init_at_db_start();
|
||||
|
||||
if (UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
|
||||
|
|
|
@ -24,6 +24,12 @@ Created 3/26/1996 Heikki Tuuri
|
|||
#include "thr0loc.h"
|
||||
#include "btr0sea.h"
|
||||
|
||||
|
||||
/* Copy of the prototype for innobase_mysql_print_thd: this
|
||||
copy must be equal to the one in mysql/sql/ha_innobase.cc ! */
|
||||
void innobase_mysql_print_thd(void* thd);
|
||||
|
||||
|
||||
/* Dummy session used currently in MySQL interface */
|
||||
sess_t* trx_dummy_sess = NULL;
|
||||
|
||||
|
@ -58,11 +64,15 @@ trx_create(
|
|||
|
||||
trx = mem_alloc(sizeof(trx_t));
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
trx->type = TRX_USER;
|
||||
trx->conc_state = TRX_NOT_STARTED;
|
||||
|
||||
trx->dict_operation = FALSE;
|
||||
|
||||
trx->mysql_thd = NULL;
|
||||
|
||||
trx->n_mysql_tables_in_use = 0;
|
||||
trx->mysql_n_tables_locked = 0;
|
||||
|
||||
|
@ -129,6 +139,8 @@ trx_allocate_for_mysql(void)
|
|||
|
||||
trx_n_mysql_transactions++;
|
||||
|
||||
UT_LIST_ADD_FIRST(mysql_trx_list, trx_sys->mysql_trx_list, trx);
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
trx->mysql_thread_id = os_thread_get_curr_id();
|
||||
|
@ -144,11 +156,11 @@ trx_search_latch_release_if_reserved(
|
|||
/*=================================*/
|
||||
trx_t* trx) /* in: transaction */
|
||||
{
|
||||
if (trx->has_search_latch) {
|
||||
rw_lock_s_unlock(&btr_search_latch);
|
||||
if (trx->has_search_latch) {
|
||||
rw_lock_s_unlock(&btr_search_latch);
|
||||
|
||||
trx->has_search_latch = FALSE;
|
||||
}
|
||||
trx->has_search_latch = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -209,6 +221,8 @@ trx_free_for_mysql(
|
|||
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
UT_LIST_REMOVE(mysql_trx_list, trx_sys->mysql_trx_list, trx);
|
||||
|
||||
trx_free(trx);
|
||||
|
||||
ut_a(trx_n_mysql_transactions > 0);
|
||||
|
@ -641,7 +655,7 @@ shortcut:
|
|||
ut_ad(UT_LIST_GET_LEN(trx->wait_thrs) == 0);
|
||||
ut_ad(UT_LIST_GET_LEN(trx->trx_locks) == 0);
|
||||
|
||||
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
|
||||
UT_LIST_REMOVE(trx_list, trx_sys->trx_list, trx);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -1268,6 +1282,8 @@ trx_commit_for_mysql(
|
|||
sig to the transaction, we must here make sure that trx has been
|
||||
started. */
|
||||
|
||||
trx->op_info = "committing";
|
||||
|
||||
trx_start_if_not_started(trx);
|
||||
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
@ -1276,6 +1292,8 @@ trx_commit_for_mysql(
|
|||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
trx->op_info = "";
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -1295,3 +1313,78 @@ trx_mark_sql_stat_end(
|
|||
|
||||
mutex_exit(&kernel_mutex);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Marks the latest SQL statement ended but does not start a new transaction
|
||||
if the trx is not started. */
|
||||
|
||||
void
|
||||
trx_mark_sql_stat_end_do_not_start_new(
|
||||
/*===================================*/
|
||||
trx_t* trx) /* in: trx handle */
|
||||
{
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
trx->last_sql_stat_start.least_undo_no = trx->undo_no;
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Prints info about a transaction to the standard output. The caller must
|
||||
own the kernel mutex. */
|
||||
|
||||
void
|
||||
trx_print(
|
||||
/*======*/
|
||||
trx_t* trx) /* in: transaction */
|
||||
{
|
||||
printf("TRANSACTION %lu %lu, OS thread id %lu",
|
||||
ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id),
|
||||
(ulint)trx->mysql_thread_id);
|
||||
|
||||
if (ut_strlen(trx->op_info) > 0) {
|
||||
printf(" %s", trx->op_info);
|
||||
}
|
||||
|
||||
if (trx->type != TRX_USER) {
|
||||
printf(" purge trx");
|
||||
}
|
||||
|
||||
switch (trx->conc_state) {
|
||||
case TRX_NOT_STARTED: printf(", not started"); break;
|
||||
case TRX_ACTIVE: printf(", active"); break;
|
||||
case TRX_COMMITTED_IN_MEMORY: printf(", committed in memory");
|
||||
break;
|
||||
default: printf(" state %lu", trx->conc_state);
|
||||
}
|
||||
|
||||
switch (trx->que_state) {
|
||||
case TRX_QUE_RUNNING: printf(", runs or sleeps"); break;
|
||||
case TRX_QUE_LOCK_WAIT: printf(", lock wait"); break;
|
||||
case TRX_QUE_ROLLING_BACK: printf(", rolling back"); break;
|
||||
case TRX_QUE_COMMITTING: printf(", committing"); break;
|
||||
default: printf(" que state %lu", trx->que_state);
|
||||
}
|
||||
|
||||
if (0 < UT_LIST_GET_LEN(trx->trx_locks)) {
|
||||
printf(", has %lu lock struct(s)",
|
||||
UT_LIST_GET_LEN(trx->trx_locks));
|
||||
}
|
||||
|
||||
if (trx->has_search_latch) {
|
||||
printf(", holds adaptive hash latch");
|
||||
}
|
||||
|
||||
if (ut_dulint_cmp(trx->undo_no, ut_dulint_zero) != 0) {
|
||||
printf(", undo log entries %lu",
|
||||
ut_dulint_get_low(trx->undo_no));
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
if (trx->mysql_thd != NULL) {
|
||||
innobase_mysql_print_thd(trx->mysql_thd);
|
||||
}
|
||||
}
|
||||
|
|
103
isam/isamchk.c
103
isam/isamchk.c
|
@ -44,7 +44,7 @@ SET_STACK_SIZE(9000) /* Minimum stack size for program */
|
|||
#define T_SORT_RECORDS 4096
|
||||
#define T_SORT_INDEX 8192
|
||||
#define T_WAIT_FOREVER 16384
|
||||
#define T_REP_BY_SORT 32768
|
||||
#define T_REP_BY_SORT 32768L
|
||||
|
||||
|
||||
#define O_NEW_INDEX 1 /* Bits set in out_flag */
|
||||
|
@ -74,17 +74,17 @@ SET_STACK_SIZE(9000) /* Minimum stack size for program */
|
|||
#define UPDATE_STAT 2
|
||||
#define UPDATE_SORT 4
|
||||
|
||||
typedef struct st_sort_key_blocks { /* Used when sorting */
|
||||
typedef struct st_isam_sort_key_blocks { /* Used when sorting */
|
||||
uchar *buff,*end_pos;
|
||||
uchar lastkey[N_MAX_POSSIBLE_KEY_BUFF];
|
||||
uint last_length;
|
||||
int inited;
|
||||
} SORT_KEY_BLOCKS;
|
||||
} ISAM_SORT_KEY_BLOCKS;
|
||||
|
||||
typedef struct st_sort_info {
|
||||
typedef struct st_isam_sort_info {
|
||||
N_INFO *info;
|
||||
enum data_file_type new_data_file_type;
|
||||
SORT_KEY_BLOCKS *key_block,*key_block_end;
|
||||
ISAM_SORT_KEY_BLOCKS *key_block,*key_block_end;
|
||||
uint key,find_length;
|
||||
ulong pos,max_pos,filepos,start_recpos,filelength,dupp,max_records,unique,
|
||||
buff_length;
|
||||
|
@ -92,9 +92,9 @@ typedef struct st_sort_info {
|
|||
char *record,*buff;
|
||||
N_KEYDEF *keyinfo;
|
||||
N_KEYSEG *keyseg;
|
||||
} SORT_INFO;
|
||||
} ISAM_SORT_INFO;
|
||||
|
||||
enum options {OPT_CHARSETS_DIR=256};
|
||||
enum ic_options {OPT_CHARSETS_DIR_IC=256};
|
||||
|
||||
static ulong use_buffers=0,read_buffer_length=0,write_buffer_length=0,
|
||||
sort_buffer_length=0,sort_key_blocks=0,crc=0,unique_count=0;
|
||||
|
@ -120,7 +120,7 @@ static const char *type_names[]=
|
|||
|
||||
static char temp_filename[FN_REFLEN], *isam_file_name, *default_charset;
|
||||
static IO_CACHE read_cache;
|
||||
static SORT_INFO sort_info;
|
||||
static ISAM_SORT_INFO sort_info;
|
||||
static int tmpfile_createflag=O_RDWR | O_TRUNC | O_EXCL;
|
||||
|
||||
static const char *load_default_groups[]= { "isamchk",0 };
|
||||
|
@ -137,8 +137,8 @@ static int chk_del(N_INFO *info,uint testflag);
|
|||
static int check_k_link(N_INFO *info,uint nr);
|
||||
static int chk_size(N_INFO *info);
|
||||
static int chk_key(N_INFO *info);
|
||||
static int chk_index(N_INFO *info,N_KEYDEF *keyinfo,ulong page,uchar *buff,
|
||||
ulong *keys,uint level);
|
||||
static int chk_index(N_INFO *info, N_KEYDEF *keyinfo, ulong page, uchar *buff,
|
||||
ulong *keys, uint level);
|
||||
static uint isam_key_length(N_INFO *info,N_KEYDEF *keyinfo);
|
||||
static unsigned long calc_checksum(ulong count);
|
||||
static int chk_data_link(N_INFO *info,int extend);
|
||||
|
@ -171,12 +171,12 @@ static int sort_key_cmp(const void *not_used, const void *a,const void *b);
|
|||
static int sort_key_write(const void *a);
|
||||
static ulong get_record_for_key(N_INFO *info,N_KEYDEF *keyinfo,
|
||||
uchar *key);
|
||||
static int sort_insert_key(reg1 SORT_KEY_BLOCKS *key_block,uchar *key,
|
||||
static int sort_insert_key(reg1 ISAM_SORT_KEY_BLOCKS *key_block,uchar *key,
|
||||
ulong prev_block);
|
||||
static int sort_delete_record(void);
|
||||
static void usage(void);
|
||||
static int flush_pending_blocks(void);
|
||||
static SORT_KEY_BLOCKS *alloc_key_blocks(uint blocks,uint buffer_length);
|
||||
static ISAM_SORT_KEY_BLOCKS *alloc_key_blocks(uint blocks,uint buffer_length);
|
||||
static int test_if_almost_full(N_INFO *info);
|
||||
static int recreate_database(N_INFO **info,char *filename);
|
||||
static void save_integer(byte *pos,uint pack_length,ulong value);
|
||||
|
@ -186,9 +186,7 @@ static int update_state_info(N_INFO *info,uint update);
|
|||
|
||||
/* Main program */
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main( int argc, char **argv)
|
||||
{
|
||||
int error;
|
||||
MY_INIT(argv[0]);
|
||||
|
@ -255,7 +253,7 @@ static CHANGEABLE_VAR changeable_vars[] = {
|
|||
static struct option long_options[] =
|
||||
{
|
||||
{"analyze", no_argument, 0, 'a'},
|
||||
{"character-sets-dir", required_argument, 0, OPT_CHARSETS_DIR},
|
||||
{"character-sets-dir", required_argument, 0, OPT_CHARSETS_DIR_IC},
|
||||
#ifndef DBUG_OFF
|
||||
{"debug", required_argument, 0, '#'},
|
||||
#endif
|
||||
|
@ -284,7 +282,7 @@ static struct option long_options[] =
|
|||
|
||||
static void print_version(void)
|
||||
{
|
||||
printf("%s Ver 5.16 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
printf("%s Ver 5.17 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
MACHINE_TYPE);
|
||||
}
|
||||
|
||||
|
@ -598,7 +596,7 @@ static void get_options(register int *argc,register char ***argv)
|
|||
case 'C':
|
||||
default_charset=optarg;
|
||||
break;
|
||||
case OPT_CHARSETS_DIR:
|
||||
case OPT_CHARSETS_DIR_IC:
|
||||
charsets_dir = optarg;
|
||||
break;
|
||||
case 'b':
|
||||
|
@ -706,9 +704,7 @@ static void get_options(register int *argc,register char ***argv)
|
|||
|
||||
/* Check delete links */
|
||||
|
||||
static int chk_del(info,test_flag)
|
||||
reg1 N_INFO *info;
|
||||
uint test_flag;
|
||||
static int chk_del( reg1 N_INFO *info, uint test_flag)
|
||||
{
|
||||
reg2 ulong i;
|
||||
uint j,delete_link_length;
|
||||
|
@ -793,9 +789,7 @@ wrong:
|
|||
|
||||
/* Kontrollerar l{nkarna i nyckelfilen */
|
||||
|
||||
static int check_k_link(info,nr)
|
||||
register N_INFO *info;
|
||||
uint nr;
|
||||
static int check_k_link( register N_INFO *info, uint nr)
|
||||
{
|
||||
ulong next_link,records;
|
||||
DBUG_ENTER("check_k_link");
|
||||
|
@ -898,8 +892,7 @@ static int chk_size(register N_INFO *info)
|
|||
|
||||
/* Kontrollerar nycklarna */
|
||||
|
||||
static int chk_key(info)
|
||||
register N_INFO *info;
|
||||
static int chk_key( register N_INFO *info)
|
||||
{
|
||||
uint key;
|
||||
ulong keys,all_keydata,all_totaldata,key_totlength,length,
|
||||
|
@ -988,12 +981,8 @@ register N_INFO *info;
|
|||
|
||||
/* Check if index is ok */
|
||||
|
||||
static int chk_index(info,keyinfo,page,buff,keys,level)
|
||||
N_INFO *info;
|
||||
N_KEYDEF *keyinfo;
|
||||
ulong page,*keys;
|
||||
uchar *buff;
|
||||
uint level;
|
||||
static int chk_index(N_INFO *info, N_KEYDEF *keyinfo, ulong page, uchar *buff,
|
||||
ulong *keys,uint level)
|
||||
{
|
||||
int flag;
|
||||
uint used_length,comp_flag,nod_flag;
|
||||
|
@ -1129,9 +1118,7 @@ ulong count;
|
|||
|
||||
/* Calc length of key in normal isam */
|
||||
|
||||
static uint isam_key_length(info,keyinfo)
|
||||
N_INFO *info;
|
||||
reg1 N_KEYDEF *keyinfo;
|
||||
static uint isam_key_length( N_INFO *info, reg1 N_KEYDEF *keyinfo)
|
||||
{
|
||||
uint length;
|
||||
N_KEYSEG *keyseg;
|
||||
|
@ -2962,8 +2949,7 @@ static int sort_key_cmp(const void *not_used __attribute__((unused)),
|
|||
} /* sort_key_cmp */
|
||||
|
||||
|
||||
static int sort_key_write(a)
|
||||
const void *a;
|
||||
static int sort_key_write( const void *a)
|
||||
{
|
||||
int cmp=sort_info.key_block->inited ?
|
||||
_nisam_key_cmp(sort_info.keyseg,sort_info.key_block->lastkey,(uchar*) a,
|
||||
|
@ -2997,10 +2983,7 @@ const void *a;
|
|||
|
||||
/* get pointer to record from a key */
|
||||
|
||||
static ulong get_record_for_key(info,keyinfo,key)
|
||||
N_INFO *info;
|
||||
N_KEYDEF *keyinfo;
|
||||
uchar *key;
|
||||
static ulong get_record_for_key( N_INFO *info, N_KEYDEF *keyinfo, uchar *key)
|
||||
{
|
||||
return _nisam_dpos(info,0,key+_nisam_keylength(keyinfo,key));
|
||||
} /* get_record_for_key */
|
||||
|
@ -3008,10 +2991,8 @@ uchar *key;
|
|||
|
||||
/* Insert a key in sort-key-blocks */
|
||||
|
||||
static int sort_insert_key(key_block,key,prev_block)
|
||||
reg1 SORT_KEY_BLOCKS *key_block;
|
||||
uchar *key;
|
||||
ulong prev_block;
|
||||
static int sort_insert_key(reg1 ISAM_SORT_KEY_BLOCKS *key_block,
|
||||
uchar *key, ulong prev_block)
|
||||
{
|
||||
uint a_length,t_length,nod_flag;
|
||||
ulong filepos;
|
||||
|
@ -3140,7 +3121,7 @@ static int flush_pending_blocks()
|
|||
uint nod_flag,length;
|
||||
ulong filepos;
|
||||
N_INFO *info;
|
||||
SORT_KEY_BLOCKS *key_block;
|
||||
ISAM_SORT_KEY_BLOCKS *key_block;
|
||||
DBUG_ENTER("flush_pending_blocks");
|
||||
|
||||
filepos= NI_POS_ERROR; /* if empty file */
|
||||
|
@ -3169,16 +3150,15 @@ static int flush_pending_blocks()
|
|||
|
||||
/* alloc space and pointers for key_blocks */
|
||||
|
||||
static SORT_KEY_BLOCKS *alloc_key_blocks(blocks,buffer_length)
|
||||
uint blocks,buffer_length;
|
||||
static ISAM_SORT_KEY_BLOCKS *alloc_key_blocks(uint blocks, uint buffer_length)
|
||||
{
|
||||
reg1 uint i;
|
||||
SORT_KEY_BLOCKS *block;
|
||||
ISAM_SORT_KEY_BLOCKS *block;
|
||||
DBUG_ENTER("alloc_key_blocks");
|
||||
|
||||
if (!(block=(SORT_KEY_BLOCKS*) my_malloc((sizeof(SORT_KEY_BLOCKS)+
|
||||
buffer_length+IO_SIZE)*blocks,
|
||||
MYF(0))))
|
||||
if (!(block=(ISAM_SORT_KEY_BLOCKS*) my_malloc((sizeof(ISAM_SORT_KEY_BLOCKS)+
|
||||
buffer_length+IO_SIZE)*blocks,
|
||||
MYF(0))))
|
||||
{
|
||||
print_error("Not Enough memory for sort-key-blocks");
|
||||
return(0);
|
||||
|
@ -3253,8 +3233,7 @@ void print_error(const char *fmt,...)
|
|||
|
||||
/* Check if file is almost full */
|
||||
|
||||
static int test_if_almost_full(info)
|
||||
N_INFO *info;
|
||||
static int test_if_almost_full(N_INFO *info)
|
||||
{
|
||||
double diff= 0.9;
|
||||
if (info->s->base.options & HA_OPTION_COMPRESS_RECORD)
|
||||
|
@ -3274,9 +3253,7 @@ N_INFO *info;
|
|||
|
||||
/* Recreate table with bigger more alloced record-data */
|
||||
|
||||
static int recreate_database(org_info,filename)
|
||||
N_INFO **org_info;
|
||||
char *filename;
|
||||
static int recreate_database(N_INFO **org_info, char *filename)
|
||||
{
|
||||
int error;
|
||||
N_INFO info;
|
||||
|
@ -3369,10 +3346,7 @@ end:
|
|||
|
||||
/* Store long in 1,2,3 or 4 bytes */
|
||||
|
||||
static void save_integer(pos,pack_length,value)
|
||||
byte *pos;
|
||||
uint pack_length;
|
||||
ulong value;
|
||||
static void save_integer( byte *pos, uint pack_length, ulong value)
|
||||
{
|
||||
switch (pack_length) {
|
||||
case 4: int4store(pos,value); break;
|
||||
|
@ -3386,8 +3360,7 @@ ulong value;
|
|||
|
||||
/* write suffix to data file if neaded */
|
||||
|
||||
static int write_data_suffix(info)
|
||||
N_INFO *info;
|
||||
static int write_data_suffix( N_INFO *info)
|
||||
{
|
||||
if (info->s->base.options & HA_OPTION_COMPRESS_RECORD &&
|
||||
sort_info.fix_datafile)
|
||||
|
@ -3407,9 +3380,7 @@ N_INFO *info;
|
|||
|
||||
/* Update state and isamchk_time of indexfile */
|
||||
|
||||
static int update_state_info(info,update)
|
||||
N_INFO *info;
|
||||
uint update;
|
||||
static int update_state_info( N_INFO *info, uint update)
|
||||
{
|
||||
ISAM_SHARE *share=info->s;
|
||||
uint base_pos=uint2korr(info->s->state.header.base_pos);
|
||||
|
|
208
isam/isamlog.c
208
isam/isamlog.c
|
@ -1,15 +1,15 @@
|
|||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
|
||||
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 */
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
#define FILENAME(A) (A ? A->show_name : "Unknown")
|
||||
|
||||
struct file_info {
|
||||
struct isamlog_file_info {
|
||||
long process;
|
||||
int filenr,id;
|
||||
my_string name,show_name,record;
|
||||
|
@ -46,7 +46,7 @@ struct test_if_open_param {
|
|||
struct st_access_param
|
||||
{
|
||||
ulong min_accessed;
|
||||
struct file_info *found;
|
||||
struct isamlog_file_info *found;
|
||||
};
|
||||
|
||||
#define NO_FILEPOS (ulong) ~0L
|
||||
|
@ -56,21 +56,22 @@ static void get_options(int *argc,char ***argv);
|
|||
static int examine_log(my_string file_name,char **table_names);
|
||||
static int read_string(IO_CACHE *file,gptr *to,uint length);
|
||||
static int file_info_compare(void *a,void *b);
|
||||
static int test_if_open(struct file_info *key,element_count count,
|
||||
static int test_if_open(struct isamlog_file_info *key,element_count count,
|
||||
struct test_if_open_param *param);
|
||||
static void fix_blob_pointers(N_INFO *isam,byte *record);
|
||||
static uint set_maximum_open_files(uint);
|
||||
static int test_when_accessed(struct file_info *key,element_count count,
|
||||
static int test_when_accessed(struct isamlog_file_info *key,element_count count,
|
||||
struct st_access_param *access_param);
|
||||
static void file_info_free(struct file_info *info);
|
||||
static void file_info_free(struct isamlog_file_info *info);
|
||||
static int close_some_file(TREE *tree);
|
||||
static int reopen_closed_file(TREE *tree,struct file_info *file_info);
|
||||
static int find_record_with_key(struct file_info *file_info,byte *record);
|
||||
static int reopen_closed_file(TREE *tree,struct isamlog_file_info *file_info);
|
||||
static int find_record_with_key(struct isamlog_file_info *file_info,
|
||||
byte *record);
|
||||
static void printf_log(const char *str,...);
|
||||
static bool cmp_filename(struct file_info *file_info,my_string name);
|
||||
static bool cmp_filename(struct isamlog_file_info *file_info,my_string name);
|
||||
|
||||
static uint verbose=0,update=0,test_info=0,max_files=0,re_open_count=0,
|
||||
recover=0,prefix_remove=0;
|
||||
recover=0,prefix_remove=0,opt_processes=0;
|
||||
static my_string log_filename=0,filepath=0,write_filename=0,record_pos_file=0;
|
||||
static ulong com_count[10][3],number_of_commands=(ulong) ~0L,start_offset=0,
|
||||
record_pos= NO_FILEPOS,isamlog_filepos,isamlog_process;
|
||||
|
@ -78,9 +79,7 @@ static const char *command_name[]=
|
|||
{"open","write","update","delete","close","extra","lock","re-open",NullS};
|
||||
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int error,i,first;
|
||||
ulong total_count,total_error,total_recover;
|
||||
|
@ -92,11 +91,11 @@ char **argv;
|
|||
max_files=(set_maximum_open_files(min(max_files,8))-6)/2;
|
||||
|
||||
if (update)
|
||||
printf("Trying to %s isamfiles according to log '%s'\n",
|
||||
printf("Trying to %s ISAM files according to log '%s'\n",
|
||||
(recover ? "recover" : "update"),log_filename);
|
||||
error= examine_log(log_filename,argv);
|
||||
if (update && ! error)
|
||||
puts("isamfile:s updated successfully");
|
||||
puts("Tables updated successfully");
|
||||
total_count=total_error=total_recover=0;
|
||||
for (i=first=0 ; command_name[i] ; i++)
|
||||
{
|
||||
|
@ -128,17 +127,15 @@ char **argv;
|
|||
} /* main */
|
||||
|
||||
|
||||
static void get_options(argc,argv)
|
||||
register int *argc;
|
||||
register char ***argv;
|
||||
static void get_options(register int *argc, register char ***argv)
|
||||
{
|
||||
int help,version;
|
||||
const char *usage;
|
||||
char *pos, option;
|
||||
const char *pos,*usage;
|
||||
char option;
|
||||
|
||||
help=0;
|
||||
usage="Usage: %s [-?iruvIV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] \n";
|
||||
pos= (char*) "";
|
||||
usage="Usage: %s [-?iruvIPV] [-c #] [-f #] [-F filepath/] [-o #] [-R file recordpos] [-w write_file] [log-filename [table ...]] \n";
|
||||
pos= "";
|
||||
|
||||
while (--*argc > 0 && *(pos = *(++*argv)) == '-' ) {
|
||||
while (*++pos)
|
||||
|
@ -147,7 +144,7 @@ register char ***argv;
|
|||
switch((option=*pos)) {
|
||||
case '#':
|
||||
DBUG_PUSH (++pos);
|
||||
pos= (char*) " "; /* Skipp rest of arg */
|
||||
pos=" "; /* Skipp rest of arg */
|
||||
break;
|
||||
case 'c':
|
||||
if (! *++pos)
|
||||
|
@ -158,7 +155,7 @@ register char ***argv;
|
|||
pos= *(++*argv);
|
||||
}
|
||||
number_of_commands=(ulong) atol(pos);
|
||||
pos= (char*) " ";
|
||||
pos=" ";
|
||||
break;
|
||||
case 'u':
|
||||
update=1;
|
||||
|
@ -172,7 +169,7 @@ register char ***argv;
|
|||
pos= *(++*argv);
|
||||
}
|
||||
max_files=(uint) atoi(pos);
|
||||
pos= (char*) " ";
|
||||
pos=" ";
|
||||
break;
|
||||
case 'i':
|
||||
test_info=1;
|
||||
|
@ -186,7 +183,7 @@ register char ***argv;
|
|||
pos= *(++*argv);
|
||||
}
|
||||
start_offset=(ulong) atol(pos);
|
||||
pos= (char*) " ";
|
||||
pos=" ";
|
||||
break;
|
||||
case 'p':
|
||||
if (! *++pos)
|
||||
|
@ -202,6 +199,9 @@ register char ***argv;
|
|||
update=1;
|
||||
recover++;
|
||||
break;
|
||||
case 'P':
|
||||
opt_processes=1;
|
||||
break;
|
||||
case 'R':
|
||||
if (! *++pos)
|
||||
{
|
||||
|
@ -210,11 +210,11 @@ register char ***argv;
|
|||
else
|
||||
pos= *(++*argv);
|
||||
}
|
||||
record_pos_file=pos;
|
||||
record_pos_file=(char*) pos;
|
||||
if (!--*argc)
|
||||
goto err;
|
||||
record_pos=(ulong) atol(*(++*argv));
|
||||
pos= (char*) " ";
|
||||
pos= " ";
|
||||
break;
|
||||
case 'v':
|
||||
verbose++;
|
||||
|
@ -227,8 +227,8 @@ register char ***argv;
|
|||
else
|
||||
pos= *(++*argv);
|
||||
}
|
||||
write_filename=pos;
|
||||
pos= (char*) " ";
|
||||
write_filename=(char*) pos;
|
||||
pos=" ";
|
||||
break;
|
||||
case 'F':
|
||||
if (! *++pos)
|
||||
|
@ -238,20 +238,20 @@ register char ***argv;
|
|||
else
|
||||
pos= *(++*argv);
|
||||
}
|
||||
filepath=pos;
|
||||
pos= (char*) " ";
|
||||
filepath= (char*) pos;
|
||||
pos=" ";
|
||||
break;
|
||||
case 'V':
|
||||
version=1;
|
||||
/* Fall through */
|
||||
case 'I':
|
||||
case '?':
|
||||
printf("%s Ver 3.2 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
printf("%s Ver 3.3 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
MACHINE_TYPE);
|
||||
puts("TCX Datakonsult AB, by Monty, for your professional use\n");
|
||||
puts("By Monty, for your professional use\n");
|
||||
if (version)
|
||||
break;
|
||||
puts("Write info about whats in a nisam log file.");
|
||||
puts("Write info about whats in a ISAM log file.");
|
||||
printf("If no file name is given %s is used\n",log_filename);
|
||||
puts("");
|
||||
printf(usage,my_progname);
|
||||
|
@ -261,6 +261,7 @@ register char ***argv;
|
|||
puts(" -o \"offset\" -p # \"remove # components from path\"");
|
||||
puts(" -r \"recover\" -R \"file recordposition\"");
|
||||
puts(" -u \"update\" -v \"verbose\" -w \"write file\"");
|
||||
puts(" -P \"processes\"");
|
||||
puts("\nOne can give a second and a third '-v' for more verbose.");
|
||||
puts("Normaly one does a update (-u).");
|
||||
puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted.");
|
||||
|
@ -281,7 +282,7 @@ register char ***argv;
|
|||
}
|
||||
if (*argc >= 1)
|
||||
{
|
||||
log_filename=pos;
|
||||
log_filename=(char*) pos;
|
||||
(*argc)--;
|
||||
(*argv)++;
|
||||
}
|
||||
|
@ -308,7 +309,8 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
FILE *write_file;
|
||||
enum ha_extra_function extra_command;
|
||||
TREE tree;
|
||||
struct file_info file_info,*curr_file_info;
|
||||
struct isamlog_file_info file_info,*curr_file_info;
|
||||
char llbuff[22],llbuff2[22];
|
||||
DBUG_ENTER("examine_log");
|
||||
|
||||
if ((file=my_open(file_name,O_RDONLY,MYF(MY_WME))) < 0)
|
||||
|
@ -336,8 +338,11 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
isamlog_filepos=my_b_tell(&cache)-9L;
|
||||
file_info.filenr=uint2korr(head+1);
|
||||
isamlog_process=file_info.process=(long) uint4korr(head+3);
|
||||
if (!opt_processes)
|
||||
file_info.process=0;
|
||||
result=uint2korr(head+7);
|
||||
if ((curr_file_info=(struct file_info*) tree_search(&tree,&file_info)))
|
||||
if ((curr_file_info=(struct isamlog_file_info*)
|
||||
tree_search(&tree,&file_info)))
|
||||
{
|
||||
curr_file_info->accessed=access_time;
|
||||
if (update && curr_file_info->used && curr_file_info->closed)
|
||||
|
@ -352,7 +357,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
}
|
||||
command=(uint) head[0];
|
||||
if (command < sizeof(com_count)/sizeof(com_count[0][0])/3 &&
|
||||
(!curr_file_info || curr_file_info->used))
|
||||
(!table_names[0] || (curr_file_info && curr_file_info->used)))
|
||||
{
|
||||
com_count[command][0]++;
|
||||
if (result)
|
||||
|
@ -360,12 +365,15 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
}
|
||||
switch ((enum nisam_log_commands) command) {
|
||||
case LOG_OPEN:
|
||||
com_count[command][0]--; /* Must be counted explicite */
|
||||
if (result)
|
||||
com_count[command][1]--;
|
||||
if (!table_names[0])
|
||||
{
|
||||
com_count[command][0]--; /* Must be counted explicite */
|
||||
if (result)
|
||||
com_count[command][1]--;
|
||||
}
|
||||
|
||||
if (curr_file_info)
|
||||
printf("\nWarning: %s is opened twice with same process and filenumber\n",
|
||||
printf("\nWarning: %s is opened with same process and filenumber\nMaybe you should use the -P option ?\n",
|
||||
curr_file_info->show_name);
|
||||
if (my_b_read(&cache,(byte*) head,2))
|
||||
goto err;
|
||||
|
@ -376,11 +384,17 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
goto err;
|
||||
{
|
||||
uint i;
|
||||
char *pos=file_info.name,*to;
|
||||
char *pos,*to;
|
||||
|
||||
/* Fix if old DOS files to new format */
|
||||
for (pos=file_info.name; (pos=strchr(pos,'\\')) ; pos++)
|
||||
*pos= '/';
|
||||
|
||||
pos=file_info.name;
|
||||
for (i=0 ; i < prefix_remove ; i++)
|
||||
{
|
||||
char *next;
|
||||
if (!(next=strchr(pos,FN_LIBCHAR)))
|
||||
if (!(next=strchr(pos,'/')))
|
||||
break;
|
||||
pos=next+1;
|
||||
}
|
||||
|
@ -426,7 +440,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
files_open--;
|
||||
}
|
||||
if (!(file_info.isam= nisam_open(isam_file_name,O_RDWR,
|
||||
HA_OPEN_WAIT_IF_LOCKED)))
|
||||
HA_OPEN_WAIT_IF_LOCKED)))
|
||||
goto com_err;
|
||||
if (!(file_info.record=my_malloc(file_info.isam->s->base.reclength,
|
||||
MYF(MY_WME))))
|
||||
|
@ -438,7 +452,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
if (file_info.used)
|
||||
{
|
||||
if (verbose && !record_pos_file)
|
||||
printf_log("%s: open",file_info.show_name);
|
||||
printf_log("%s: open -> %d",file_info.show_name, file_info.filenr);
|
||||
com_count[command][0]++;
|
||||
if (result)
|
||||
com_count[command][1]++;
|
||||
|
@ -453,7 +467,6 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
{
|
||||
if (!curr_file_info->closed)
|
||||
files_open--;
|
||||
file_info_free(curr_file_info);
|
||||
VOID(tree_delete(&tree,(gptr) curr_file_info));
|
||||
}
|
||||
break;
|
||||
|
@ -464,14 +477,17 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
if (verbose && !record_pos_file &&
|
||||
(!table_names[0] || (curr_file_info && curr_file_info->used)))
|
||||
printf_log("%s: %s(%d) -> %d",FILENAME(curr_file_info),
|
||||
command_name[command], extra_command,result);
|
||||
command_name[command], (int) extra_command,result);
|
||||
if (update && curr_file_info && !curr_file_info->closed)
|
||||
{
|
||||
if (nisam_extra(curr_file_info->isam,extra_command) != (int) result)
|
||||
{
|
||||
fflush(stdout);
|
||||
VOID(fprintf(stderr,
|
||||
"Warning: error %d, expected %d on command %s at %lx\n",
|
||||
my_errno,result,command_name[command],isamlog_filepos));
|
||||
"Warning: error %d, expected %d on command %s at %s\n",
|
||||
my_errno,result,command_name[command],
|
||||
llstr(isamlog_filepos,llbuff)));
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -501,6 +517,9 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
goto com_err;
|
||||
if (ni_result)
|
||||
com_count[command][2]++; /* Mark error */
|
||||
if (verbose)
|
||||
printf_log("error: Got result %d from mi_delete instead of %d",
|
||||
ni_result, result);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -539,6 +558,8 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
result=0;
|
||||
goto com_err;
|
||||
}
|
||||
if (verbose)
|
||||
printf_log("error: Didn't find row to update with mi_rrnd");
|
||||
if (recover == 1 || result ||
|
||||
find_record_with_key(curr_file_info,buff))
|
||||
{
|
||||
|
@ -553,6 +574,9 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
{
|
||||
if (!recover)
|
||||
goto com_err;
|
||||
if (verbose)
|
||||
printf_log("error: Got result %d from mi_update instead of %d",
|
||||
ni_result, result);
|
||||
if (ni_result)
|
||||
com_count[command][2]++; /* Mark error */
|
||||
}
|
||||
|
@ -570,9 +594,10 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
}
|
||||
if (! recover && filepos != curr_file_info->isam->lastpos)
|
||||
{
|
||||
printf("Warning: Wrote at position: %ld, should have been %ld",
|
||||
curr_file_info->isam->lastpos,(long) filepos);
|
||||
goto com_err;
|
||||
printf("error: Wrote at position: %s, should have been %s",
|
||||
llstr(curr_file_info->isam->lastpos,llbuff),
|
||||
llstr(filepos,llbuff2));
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -597,6 +622,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
VOID(fprintf(stderr,
|
||||
"Error: found unknown command %d in logfile, aborted\n",
|
||||
command));
|
||||
fflush(stderr);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
@ -609,11 +635,16 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
fflush(stdout);
|
||||
VOID(fprintf(stderr,"Got error %d when reading from logfile\n",my_errno));
|
||||
fflush(stderr);
|
||||
goto end;
|
||||
com_err:
|
||||
VOID(fprintf(stderr,"Got error %d, expected %d on command %s at %lx\n",
|
||||
my_errno,result,command_name[command],isamlog_filepos));
|
||||
fflush(stdout);
|
||||
VOID(fprintf(stderr,"Got error %d, expected %d on command %s at %s\n",
|
||||
my_errno,result,command_name[command],
|
||||
llstr(isamlog_filepos,llbuff)));
|
||||
fflush(stderr);
|
||||
end:
|
||||
end_key_cache();
|
||||
delete_tree(&tree);
|
||||
|
@ -625,10 +656,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
}
|
||||
|
||||
|
||||
static int read_string(file,to,length)
|
||||
IO_CACHE *file;
|
||||
reg1 gptr *to;
|
||||
reg2 uint length;
|
||||
static int read_string(IO_CACHE *file, reg1 gptr *to, reg2 uint length)
|
||||
{
|
||||
DBUG_ENTER("read_string");
|
||||
|
||||
|
@ -647,24 +675,22 @@ reg2 uint length;
|
|||
} /* read_string */
|
||||
|
||||
|
||||
static int file_info_compare(a,b)
|
||||
void *a;
|
||||
void *b;
|
||||
static int file_info_compare(void *a, void *b)
|
||||
{
|
||||
long lint;
|
||||
|
||||
if ((lint=((struct file_info*) a)->process -
|
||||
((struct file_info*) b)->process))
|
||||
if ((lint=((struct isamlog_file_info*) a)->process -
|
||||
((struct isamlog_file_info*) b)->process))
|
||||
return lint < 0L ? -1 : 1;
|
||||
return ((struct file_info*) a)->filenr - ((struct file_info*) b)->filenr;
|
||||
return (((struct isamlog_file_info*) a)->filenr -
|
||||
((struct isamlog_file_info*) b)->filenr);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
||||
static int test_if_open (key,count,param)
|
||||
struct file_info *key;
|
||||
element_count count __attribute__((unused));
|
||||
struct test_if_open_param *param;
|
||||
static int test_if_open (struct isamlog_file_info *key,
|
||||
element_count count __attribute__((unused)),
|
||||
struct test_if_open_param *param)
|
||||
{
|
||||
if (!strcmp(key->name,param->name) && key->id > param->max_id)
|
||||
param->max_id=key->id;
|
||||
|
@ -672,9 +698,7 @@ struct test_if_open_param *param;
|
|||
}
|
||||
|
||||
|
||||
static void fix_blob_pointers(info,record)
|
||||
N_INFO *info;
|
||||
byte *record;
|
||||
static void fix_blob_pointers( N_INFO *info, byte *record)
|
||||
{
|
||||
byte *pos;
|
||||
N_BLOB *blob,*end;
|
||||
|
@ -689,8 +713,7 @@ byte *record;
|
|||
}
|
||||
}
|
||||
|
||||
static uint set_maximum_open_files(maximum_files)
|
||||
uint maximum_files;
|
||||
static uint set_maximum_open_files(uint maximum_files)
|
||||
{
|
||||
#if defined(HAVE_GETRUSAGE) && defined(RLIMIT_NOFILE)
|
||||
struct rlimit rlimit;
|
||||
|
@ -725,10 +748,9 @@ uint maximum_files;
|
|||
/* close the file with hasn't been accessed for the longest time */
|
||||
/* ARGSUSED */
|
||||
|
||||
static int test_when_accessed (key,count,access_param)
|
||||
struct file_info *key;
|
||||
element_count count __attribute__((unused));
|
||||
struct st_access_param *access_param;
|
||||
static int test_when_accessed (struct isamlog_file_info *key,
|
||||
element_count count __attribute__((unused)),
|
||||
struct st_access_param *access_param)
|
||||
{
|
||||
if (key->accessed < access_param->min_accessed && ! key->closed)
|
||||
{
|
||||
|
@ -739,9 +761,9 @@ struct st_access_param *access_param;
|
|||
}
|
||||
|
||||
|
||||
static void file_info_free(fileinfo)
|
||||
struct file_info *fileinfo;
|
||||
static void file_info_free(struct isamlog_file_info *fileinfo)
|
||||
{
|
||||
DBUG_ENTER("file_info_free");
|
||||
if (update)
|
||||
{
|
||||
if (!fileinfo->closed)
|
||||
|
@ -751,12 +773,12 @@ struct file_info *fileinfo;
|
|||
}
|
||||
my_free(fileinfo->name,MYF(0));
|
||||
my_free(fileinfo->show_name,MYF(0));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int close_some_file(tree)
|
||||
TREE *tree;
|
||||
static int close_some_file(TREE *tree)
|
||||
{
|
||||
struct st_access_param access_param;
|
||||
|
||||
|
@ -774,9 +796,7 @@ TREE *tree;
|
|||
}
|
||||
|
||||
|
||||
static int reopen_closed_file(tree,fileinfo)
|
||||
TREE *tree;
|
||||
struct file_info *fileinfo;
|
||||
static int reopen_closed_file(TREE *tree, struct isamlog_file_info *fileinfo)
|
||||
{
|
||||
char name[FN_REFLEN];
|
||||
if (close_some_file(tree))
|
||||
|
@ -794,9 +814,8 @@ struct file_info *fileinfo;
|
|||
|
||||
/* Try to find record with uniq key */
|
||||
|
||||
static int find_record_with_key(file_info,record)
|
||||
struct file_info *file_info;
|
||||
byte *record;
|
||||
static int find_record_with_key(struct isamlog_file_info *file_info,
|
||||
byte *record)
|
||||
{
|
||||
uint key;
|
||||
N_INFO *info=file_info->isam;
|
||||
|
@ -817,10 +836,11 @@ byte *record;
|
|||
|
||||
static void printf_log(const char *format,...)
|
||||
{
|
||||
char llbuff[21];
|
||||
va_list args;
|
||||
va_start(args,format);
|
||||
if (verbose > 2)
|
||||
printf("%9ld:",isamlog_filepos);
|
||||
printf("%9s:",llstr(isamlog_filepos,llbuff));
|
||||
if (verbose > 1)
|
||||
printf("%5ld ",isamlog_process); /* Write process number */
|
||||
(void) vprintf((char*) format,args);
|
||||
|
@ -829,9 +849,7 @@ static void printf_log(const char *format,...)
|
|||
}
|
||||
|
||||
|
||||
static bool cmp_filename(file_info,name)
|
||||
struct file_info *file_info;
|
||||
my_string name;
|
||||
static bool cmp_filename(struct isamlog_file_info *file_info,my_string name)
|
||||
{
|
||||
if (!file_info)
|
||||
return 1;
|
||||
|
|
|
@ -21,9 +21,7 @@ static void get_options(int argc, char *argv[]);
|
|||
static int rec_pointer_size=0,verbose=0,remove_ant=0,pack_keys=1,flags[50],
|
||||
packed_field=FIELD_SKIPP_PRESPACE;
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
N_INFO *file;
|
||||
int i,j,error,deleted,found;
|
||||
|
@ -145,9 +143,7 @@ err:
|
|||
/* l{ser optioner */
|
||||
/* OBS! intierar endast DEBUG - ingen debuggning h{r ! */
|
||||
|
||||
static void get_options(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
static void get_options(int argc, char *argv[])
|
||||
{
|
||||
char *pos;
|
||||
|
||||
|
|
59
isam/test2.c
59
isam/test2.c
|
@ -53,13 +53,11 @@ static char record[300],record2[300],key[100],key2[100],
|
|||
|
||||
/* Test program */
|
||||
|
||||
int main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
uint i;
|
||||
int j,n1,n2,n3,error,k;
|
||||
uint write_count,update,dupp_keys,delete,start,length,blob_pos,
|
||||
uint write_count,update,dupp_keys,opt_delete,start,length,blob_pos,
|
||||
reclength,ant;
|
||||
ulong lastpos,range_records,records;
|
||||
N_INFO *file;
|
||||
|
@ -138,7 +136,7 @@ char *argv[];
|
|||
else
|
||||
recinfo[6].base.type= FIELD_LAST;
|
||||
|
||||
write_count=update=dupp_keys=delete=0;
|
||||
write_count=update=dupp_keys=opt_delete=0;
|
||||
blob_buffer=0;
|
||||
|
||||
for (i=999 ; i>0 ; i--) key1[i]=0;
|
||||
|
@ -232,7 +230,7 @@ char *argv[];
|
|||
printf("error: %d; can't delete record: \"%s\"\n", my_errno,read_record);
|
||||
goto err;
|
||||
}
|
||||
delete++;
|
||||
opt_delete++;
|
||||
key1[atoi(read_record+keyinfo[0].seg[0].base.start)]--;
|
||||
key3[atoi(read_record+keyinfo[2].seg[0].base.start)]=0;
|
||||
}
|
||||
|
@ -346,9 +344,9 @@ char *argv[];
|
|||
}
|
||||
while (nisam_rnext(file,read_record3,0) == 0 && ant < write_count+10)
|
||||
ant++;
|
||||
if (ant != write_count - delete)
|
||||
if (ant != write_count - opt_delete)
|
||||
{
|
||||
printf("next: I found: %d records of %d\n",ant,write_count - delete);
|
||||
printf("next: I found: %d records of %d\n",ant,write_count - opt_delete);
|
||||
goto end;
|
||||
}
|
||||
if (nisam_rlast(file,read_record2,0) ||
|
||||
|
@ -362,7 +360,7 @@ char *argv[];
|
|||
ant=1;
|
||||
while (nisam_rprev(file,read_record3,0) == 0 && ant < write_count+10)
|
||||
ant++;
|
||||
if (ant != write_count - delete)
|
||||
if (ant != write_count - opt_delete)
|
||||
{
|
||||
printf("prev: I found: %d records of %d\n",ant,write_count);
|
||||
goto end;
|
||||
|
@ -414,7 +412,7 @@ char *argv[];
|
|||
if (nisam_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
|
||||
if (nisam_rnext(file,read_record3,0)) goto err;
|
||||
if (nisam_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
while (nisam_rnext(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -431,7 +429,7 @@ char *argv[];
|
|||
if (nisam_rprev(file,read_record3,0)) goto err;
|
||||
if (nisam_rprev(file,read_record3,0)) goto err;
|
||||
if (nisam_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
while (nisam_rprev(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -447,7 +445,7 @@ char *argv[];
|
|||
DBUG_PRINT("progpos",("first - delete - next -> last"));
|
||||
if (nisam_rkey(file,read_record3,0,key,0,HA_READ_KEY_EXACT)) goto err;
|
||||
if (nisam_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
if (nisam_rnext(file,read_record,0))
|
||||
goto err; /* Skall finnas poster */
|
||||
|
@ -463,7 +461,7 @@ char *argv[];
|
|||
DBUG_PRINT("progpos",("last - delete - prev -> first"));
|
||||
if (nisam_rprev(file,read_record3,0)) goto err;
|
||||
if (nisam_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=0;
|
||||
while (nisam_rprev(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -555,11 +553,11 @@ char *argv[];
|
|||
|
||||
printf("- nisam_info\n");
|
||||
nisam_info(file,&info,0);
|
||||
if (info.records != write_count-delete || info.deleted > delete + update
|
||||
if (info.records != write_count-opt_delete || info.deleted > opt_delete + update
|
||||
|| info.keys != keys)
|
||||
{
|
||||
puts("Wrong info from nisam_info");
|
||||
printf("Got: records: %ld delete: %ld i_keys: %d\n",
|
||||
printf("Got: records: %ld opt_delete: %ld i_keys: %d\n",
|
||||
info.records,info.deleted,info.keys);
|
||||
}
|
||||
if (verbose)
|
||||
|
@ -591,10 +589,10 @@ char *argv[];
|
|||
while ((error=nisam_rrnd(file,record,NI_POS_ERROR)) >= 0 &&
|
||||
ant < write_count + 10)
|
||||
ant+= error ? 0 : 1;
|
||||
if (ant != write_count-delete)
|
||||
if (ant != write_count-opt_delete)
|
||||
{
|
||||
printf("rrnd with cache: I can only find: %d records of %d\n",
|
||||
ant,write_count-delete);
|
||||
ant,write_count-opt_delete);
|
||||
goto end;
|
||||
}
|
||||
if (nisam_extra(file,HA_EXTRA_NO_CACHE))
|
||||
|
@ -648,14 +646,14 @@ char *argv[];
|
|||
printf("can't delete record: %s\n",read_record);
|
||||
goto err;
|
||||
}
|
||||
delete++;
|
||||
opt_delete++;
|
||||
}
|
||||
}
|
||||
if (my_errno != HA_ERR_END_OF_FILE && my_errno != HA_ERR_RECORD_DELETED)
|
||||
printf("error: %d from nisam_rrnd\n",my_errno);
|
||||
if (write_count != delete)
|
||||
if (write_count != opt_delete)
|
||||
{
|
||||
printf("Deleted only %d of %d records\n",write_count,delete);
|
||||
printf("Deleted only %d of %d records\n",write_count,opt_delete);
|
||||
goto err;
|
||||
}
|
||||
end:
|
||||
|
@ -663,7 +661,7 @@ end:
|
|||
goto err;
|
||||
nisam_panic(HA_PANIC_CLOSE); /* Should close log */
|
||||
printf("\nFollowing test have been made:\n");
|
||||
printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,delete);
|
||||
printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,opt_delete);
|
||||
if (rec_pointer_size)
|
||||
printf("Record pointer size: %d\n",rec_pointer_size);
|
||||
if (key_cacheing)
|
||||
|
@ -692,9 +690,7 @@ err:
|
|||
/* l{ser optioner */
|
||||
/* OBS! intierar endast DEBUG - ingen debuggning h{r ! */
|
||||
|
||||
static void get_options(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
static void get_options( int argc, char *argv[])
|
||||
{
|
||||
char *pos,*progname;
|
||||
DEBUGGER_OFF;
|
||||
|
@ -785,8 +781,7 @@ char *argv[];
|
|||
|
||||
/* Ge ett randomv{rde inom ett intervall 0 <=x <= n */
|
||||
|
||||
static uint rnd(max_value)
|
||||
uint max_value;
|
||||
static uint rnd( uint max_value)
|
||||
{
|
||||
return (uint) ((rand() & 32767)/32767.0*max_value);
|
||||
} /* rnd */
|
||||
|
@ -794,9 +789,7 @@ uint max_value;
|
|||
|
||||
/* G|r en record av skiftande length */
|
||||
|
||||
static void fix_length(rec,length)
|
||||
byte *rec;
|
||||
uint length;
|
||||
static void fix_length( byte *rec, uint length)
|
||||
{
|
||||
bmove(rec+STANDAR_LENGTH,
|
||||
"0123456789012345678901234567890123456789012345678901234567890",
|
||||
|
@ -807,8 +800,7 @@ uint length;
|
|||
|
||||
/* Put maybe a blob in record */
|
||||
|
||||
static void put_blob_in_record(blob_pos,blob_buffer)
|
||||
char *blob_pos,**blob_buffer;
|
||||
static void put_blob_in_record(char *blob_pos, char **blob_buffer)
|
||||
{
|
||||
ulong i,length;
|
||||
if (use_blob)
|
||||
|
@ -836,10 +828,7 @@ char *blob_pos,**blob_buffer;
|
|||
}
|
||||
|
||||
|
||||
static void copy_key(info,inx,rec,key_buff)
|
||||
N_INFO *info;
|
||||
uint inx;
|
||||
uchar *rec,*key_buff;
|
||||
static void copy_key( N_INFO *info, uint inx, uchar *rec, uchar *key_buff)
|
||||
{
|
||||
N_KEYSEG *keyseg;
|
||||
|
||||
|
|
|
@ -11,16 +11,16 @@ test2 -L -K -W -P
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
Write cacheing used
|
||||
Locking used
|
||||
|
@ -37,16 +37,16 @@ test2 -L -K -W -P -A
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
Write cacheing used
|
||||
Asyncron io with locking used
|
||||
|
@ -62,16 +62,16 @@ test2 -L -K -W -P -S -R1 -m500
|
|||
- Test read key-part
|
||||
- Read key (first) - next - delete - next -> last
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 484
|
||||
Update records: 48
|
||||
Same-key-read: 3
|
||||
Delete records: 484
|
||||
Write records: 475
|
||||
Update records: 44
|
||||
Same-key-read: 4
|
||||
Delete records: 475
|
||||
Record pointer size: 1
|
||||
Key cacheing used
|
||||
Write cacheing used
|
||||
|
@ -79,8 +79,31 @@ Locking used
|
|||
test2 -L -K -R1 -m2000 ; Should give error 135
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
Error: 135 in write at record: 1122
|
||||
got error: 135 when using NISAM-database
|
||||
- Delete
|
||||
- Update
|
||||
- Same key: first - next -> last - prev -> first
|
||||
- All keys: first - next -> last - prev -> first
|
||||
- Test if: Read first - next - prev - prev - next == first
|
||||
- Test if: Read last - prev - next - next - prev == last
|
||||
- Test read key-part
|
||||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Read first - delete - next -> last
|
||||
- Read last - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 1647
|
||||
Update records: 125
|
||||
Same-key-read: 8
|
||||
Delete records: 1647
|
||||
Record pointer size: 1
|
||||
Key cacheing used
|
||||
Locking used
|
||||
test2 -L -K -P -S -R3 -m50 -b1000000
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -92,9 +115,9 @@ test2 -L -K -P -S -R3 -m50 -b1000000
|
|||
- Test if: Read last - prev - next - next - prev == last
|
||||
- Test read key-part
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
|
@ -118,16 +141,16 @@ test2 -L -B
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 912
|
||||
Update records: 81
|
||||
Write records: 903
|
||||
Update records: 86
|
||||
Same-key-read: 5
|
||||
Delete records: 912
|
||||
Delete records: 903
|
||||
Locking used
|
||||
blobs used
|
||||
test2 -L -K -W -P -m50 -l
|
||||
|
@ -141,9 +164,9 @@ test2 -L -K -W -P -m50 -l
|
|||
- Test if: Read last - prev - next - next - prev == last
|
||||
- Test read key-part
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
|
@ -155,13 +178,13 @@ Key cacheing used
|
|||
Write cacheing used
|
||||
Locking used
|
||||
Commands Used count Errors Recover errors
|
||||
open 3 0 0
|
||||
write 150 0 0
|
||||
update 15 0 0
|
||||
delete 150 0 0
|
||||
close 3 0 0
|
||||
extra 18 0 0
|
||||
Total 339 0 0
|
||||
open 14 0 0
|
||||
write 700 0 0
|
||||
update 70 0 0
|
||||
delete 700 0 0
|
||||
close 14 0 0
|
||||
extra 84 0 0
|
||||
Total 1582 0 0
|
||||
test2 -L -K -W -P -m50 -l -b100
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -173,9 +196,9 @@ test2 -L -K -W -P -m50 -l -b100
|
|||
- Test if: Read last - prev - next - next - prev == last
|
||||
- Test read key-part
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
|
@ -187,13 +210,13 @@ Key cacheing used
|
|||
Write cacheing used
|
||||
Locking used
|
||||
Commands Used count Errors Recover errors
|
||||
open 4 0 0
|
||||
write 200 0 0
|
||||
update 20 0 0
|
||||
delete 200 0 0
|
||||
close 4 0 0
|
||||
extra 24 0 0
|
||||
Total 452 0 0
|
||||
open 15 0 0
|
||||
write 750 0 0
|
||||
update 75 0 0
|
||||
delete 750 0 0
|
||||
close 15 0 0
|
||||
extra 90 0 0
|
||||
Total 1695 0 0
|
||||
time test2
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -207,18 +230,16 @@ time test2
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
4.77user 6.81system 0:15.07elapsed 76%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
Delete records: 907
|
||||
time test2 -K
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -232,19 +253,17 @@ time test2 -K
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
6.09user 4.33system 0:11.66elapsed 89%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
time test2 -L
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -258,19 +277,17 @@ time test2 -L
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Locking used
|
||||
5.01user 5.20system 0:10.86elapsed 94%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
time test2 -L -K
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -284,20 +301,18 @@ time test2 -L -K
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
Locking used
|
||||
5.63user 0.97system 0:07.85elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
time test2 -L -K -W
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -311,21 +326,19 @@ time test2 -L -K -W
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
Write cacheing used
|
||||
Locking used
|
||||
5.28user 1.32system 0:08.86elapsed 74%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
time test2 -L -K -W -S
|
||||
- Creating isam-file
|
||||
- Writing key:s
|
||||
|
@ -339,18 +352,16 @@ time test2 -L -K -W -S
|
|||
- Read key (first) - next - delete - next -> last
|
||||
- Read last of key - prev - delete - prev -> first
|
||||
- Test if: Read rrnd - same
|
||||
- Test ni_records_in_range
|
||||
- ni_info
|
||||
- ni_extra(CACHE) + ni_rrnd.... + ni_extra(NO_CACHE)
|
||||
- Test nisam_records_in_range
|
||||
- nisam_info
|
||||
- nisam_extra(CACHE) + nisam_rrnd.... + nisam_extra(NO_CACHE)
|
||||
- Removing keys
|
||||
|
||||
Following test have been made:
|
||||
Write records: 915
|
||||
Update records: 82
|
||||
Write records: 907
|
||||
Update records: 87
|
||||
Same-key-read: 6
|
||||
Delete records: 915
|
||||
Delete records: 907
|
||||
Key cacheing used
|
||||
Write cacheing used
|
||||
Locking used
|
||||
5.32user 0.62system 0:06.13elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
|
||||
0inputs+0outputs (0major+0minor)pagefaults 0swaps
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <pwd.h>
|
||||
#endif /* HAVE_PWD_H */
|
||||
#else /* ! HAVE_GETPASS */
|
||||
#ifndef __WIN__
|
||||
#if !defined( __WIN__) && !defined(OS2)
|
||||
#include <sys/ioctl.h>
|
||||
#ifdef HAVE_TERMIOS_H /* For tty-password */
|
||||
#include <termios.h>
|
||||
|
@ -62,9 +62,8 @@
|
|||
#define getpass(A) getpassphrase(A)
|
||||
#endif
|
||||
|
||||
#ifdef __WIN__
|
||||
/* were just going to fake it here and get input from
|
||||
the keyboard */
|
||||
#if defined( __WIN__) || defined(OS2)
|
||||
/* were just going to fake it here and get input from the keyboard */
|
||||
|
||||
char *get_tty_password(char *opt_message)
|
||||
{
|
||||
|
|
|
@ -77,8 +77,7 @@ my_string mysql_unix_port=0;
|
|||
#include <errno.h>
|
||||
#define ERRNO errno
|
||||
#define SOCKET_ERROR -1
|
||||
#define closesocket(A) close(A)
|
||||
#endif
|
||||
#endif /* __WIN__ */
|
||||
|
||||
static void mysql_once_init(void);
|
||||
static MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields,
|
||||
|
@ -149,7 +148,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
|||
static int connect2(my_socket s, const struct sockaddr *name, uint namelen,
|
||||
uint timeout)
|
||||
{
|
||||
#if defined(__WIN__)
|
||||
#if defined(__WIN__) || defined(OS2)
|
||||
return connect(s, (struct sockaddr*) name, namelen);
|
||||
#else
|
||||
int flags, res, s_err;
|
||||
|
@ -510,7 +509,7 @@ struct passwd *getpwuid(uid_t);
|
|||
char* getlogin(void);
|
||||
#endif
|
||||
|
||||
#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__)
|
||||
#if !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__) && !defined(OS2)
|
||||
static void read_user_name(char *name)
|
||||
{
|
||||
DBUG_ENTER("read_user_name");
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef MYSQL_SERVER
|
||||
ulong max_allowed_packet=65536;
|
||||
|
@ -81,9 +80,15 @@ void sql_print_error(const char *format,...);
|
|||
#define RETRY_COUNT mysqld_net_retry_count
|
||||
extern ulong mysqld_net_retry_count;
|
||||
#else
|
||||
|
||||
#ifdef OS2 /* avoid name conflict */
|
||||
#define thr_alarm_t thr_alarm_t_net
|
||||
#define ALARM ALARM_net
|
||||
#endif
|
||||
|
||||
typedef my_bool thr_alarm_t;
|
||||
typedef my_bool ALARM;
|
||||
#define thr_alarm_init(A) (*A)=0
|
||||
#define thr_alarm_init(A) (*(A))=0
|
||||
#define thr_alarm_in_use(A) (*(A))
|
||||
#define thr_end_alarm(A)
|
||||
#define thr_alarm(A,B,C) local_thr_alarm((A),(B),(C))
|
||||
|
@ -134,7 +139,7 @@ int my_net_init(NET *net, Vio* vio)
|
|||
if (vio != 0) /* If real connection */
|
||||
{
|
||||
net->fd = vio_fd(vio); /* For perl DBI/DBD */
|
||||
#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__)
|
||||
#if defined(MYSQL_SERVER) && !defined(___WIN__) && !defined(__EMX__) && !defined(OS2)
|
||||
if (!(test_flags & TEST_BLOCKING))
|
||||
vio_blocking(vio, FALSE);
|
||||
#endif
|
||||
|
@ -336,7 +341,7 @@ net_real_write(NET *net,const char *packet,ulong len)
|
|||
int length;
|
||||
char *pos,*end;
|
||||
thr_alarm_t alarmed;
|
||||
#if !defined(__WIN__)
|
||||
#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2)
|
||||
ALARM alarm_buff;
|
||||
#endif
|
||||
uint retry_count=0;
|
||||
|
@ -394,7 +399,7 @@ net_real_write(NET *net,const char *packet,ulong len)
|
|||
if ((int) (length=vio_write(net->vio,pos,(int) (end-pos))) <= 0)
|
||||
{
|
||||
my_bool interrupted = vio_should_retry(net->vio);
|
||||
#if (!defined(__WIN__) && !defined(__EMX__))
|
||||
#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2))
|
||||
if ((interrupted || length==0) && !thr_alarm_in_use(&alarmed))
|
||||
{
|
||||
if (!thr_alarm(&alarmed,(uint) net_write_timeout,&alarm_buff))
|
||||
|
@ -491,8 +496,8 @@ static void my_net_skip_rest(NET *net, ulong remain, thr_alarm_t *alarmed)
|
|||
if ((int) (length=vio_read(net->vio,(char*) net->buff,remain)) <= 0L)
|
||||
{
|
||||
my_bool interrupted = vio_should_retry(net->vio);
|
||||
if (!thr_got_alarm(&alarmed) && interrupted)
|
||||
{ /* Probably in MIT threads */
|
||||
if (!thr_got_alarm(alarmed) && interrupted)
|
||||
{ /* Probably in MIT threads */
|
||||
if (retry_count++ < RETRY_COUNT)
|
||||
continue;
|
||||
}
|
||||
|
@ -519,7 +524,7 @@ my_real_read(NET *net, ulong *complen)
|
|||
uint i,retry_count=0;
|
||||
ulong len=packet_error;
|
||||
thr_alarm_t alarmed;
|
||||
#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER)
|
||||
#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
|
||||
ALARM alarm_buff;
|
||||
#endif
|
||||
my_bool net_blocking=vio_is_blocking(net->vio);
|
||||
|
@ -546,7 +551,7 @@ my_real_read(NET *net, ulong *complen)
|
|||
|
||||
DBUG_PRINT("info",("vio_read returned %d, errno: %d",
|
||||
length, vio_errno(net->vio)));
|
||||
#if (!defined(__WIN__) && !defined(__EMX__)) || defined(MYSQL_SERVER)
|
||||
#if (!defined(__WIN__) && !defined(__EMX__) && !defined(OS2)) || defined(MYSQL_SERVER)
|
||||
/*
|
||||
We got an error that there was no data on the socket. We now set up
|
||||
an alarm to not 'read forever', change the socket to non blocking
|
||||
|
|
25
ltconfig
25
ltconfig
|
@ -742,6 +742,12 @@ else
|
|||
wl='-Qoption ld '
|
||||
;;
|
||||
|
||||
sysv5UnixWare* | sysv5OpenUNIX*)
|
||||
pic_flag='-KPIC'
|
||||
link_static_flag='-Bstatic'
|
||||
wl='-Wl,'
|
||||
;;
|
||||
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
pic_flag='-KPIC'
|
||||
link_static_flag='-Bstatic'
|
||||
|
@ -1496,6 +1502,18 @@ else
|
|||
export_dynamic_flag_spec='-Bexport'
|
||||
;;
|
||||
|
||||
sysv5UnixWare* | sysv5OpenUNIX*)
|
||||
no_undefined_flag=' -z text'
|
||||
# $CC -shared without GNU ld will not create a library from C++
|
||||
# object files and a static libstdc++, better avoid it by now
|
||||
archive_cmds='$UW7_compile_command -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
|
||||
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
|
||||
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_shlibpath_var=no
|
||||
runpath_var='LD_RUN_PATH'
|
||||
;;
|
||||
|
||||
sysv5*)
|
||||
no_undefined_flag=' -z text'
|
||||
# $CC -shared without GNU ld will not create a library from C++
|
||||
|
@ -2097,6 +2115,13 @@ sunos4*)
|
|||
need_version=yes
|
||||
;;
|
||||
|
||||
sysv5UnixWare* | sysv5OpenUNIX*)
|
||||
version_type=linux
|
||||
soname_spec='${libname}${release}.so$major'
|
||||
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
|
||||
shlibpath_var=LD_LIBRARY_PATH
|
||||
;;
|
||||
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
version_type=linux
|
||||
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
|
||||
#include "mrgdef.h"
|
||||
|
||||
int mrg_lock_database(info,lock_type)
|
||||
MRG_INFO *info;
|
||||
int lock_type;
|
||||
int mrg_lock_database(MRG_INFO *info,int lock_type)
|
||||
{
|
||||
int error,new_error;
|
||||
MRG_TABLE *file;
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
|
||||
#include "mrgdef.h"
|
||||
|
||||
int mrg_close(info)
|
||||
register MRG_INFO *info;
|
||||
int mrg_close(register MRG_INFO *info)
|
||||
{
|
||||
int error=0,new_error;
|
||||
MRG_TABLE *file;
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
a NULL-pointer last
|
||||
*/
|
||||
|
||||
int mrg_create(name,table_names)
|
||||
const char *name,**table_names;
|
||||
int mrg_create(const char *name, const char**table_names)
|
||||
{
|
||||
int save_errno;
|
||||
uint errpos;
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#include "mrgdef.h"
|
||||
|
||||
int mrg_extra(info,function)
|
||||
MRG_INFO *info;
|
||||
enum ha_extra_function function;
|
||||
int mrg_extra(
|
||||
MRG_INFO *info,
|
||||
enum ha_extra_function function)
|
||||
{
|
||||
MRG_TABLE *file;
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
*/
|
||||
|
||||
|
||||
MRG_INFO *mrg_open(name,mode,handle_locking)
|
||||
const char *name;
|
||||
int mode;
|
||||
int handle_locking;
|
||||
MRG_INFO *mrg_open(
|
||||
const char *name,
|
||||
int mode,
|
||||
int handle_locking)
|
||||
{
|
||||
int save_errno,i,errpos;
|
||||
uint files,dir_length,length, options;
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
done for all single user files to get changes in database */
|
||||
|
||||
|
||||
int mrg_panic(flag)
|
||||
enum ha_panic_function flag;
|
||||
int mrg_panic(
|
||||
enum ha_panic_function flag)
|
||||
{
|
||||
int error=0;
|
||||
LIST *list_element,*next_open;
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
#include "mrgdef.h"
|
||||
|
||||
|
||||
int mrg_rsame(info,record,inx)
|
||||
MRG_INFO *info;
|
||||
byte *record;
|
||||
int inx; /* not used, should be 0 */
|
||||
int mrg_rsame(
|
||||
MRG_INFO *info,
|
||||
byte *record,
|
||||
int inx) /* not used, should be 0 */
|
||||
{
|
||||
if (inx)
|
||||
{
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include "mrgdef.h"
|
||||
|
||||
int mrg_update(info,oldrec,newrec)
|
||||
register MRG_INFO *info;
|
||||
const byte *oldrec,*newrec;
|
||||
int mrg_update(
|
||||
register MRG_INFO *info,
|
||||
const byte *oldrec, const byte *newrec)
|
||||
{
|
||||
if (!info->current_table)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include <getopt.h>
|
||||
|
||||
static void print_error(int exit_code, const char *fmt,...);
|
||||
static void get_options(int argc, char *argv[]);
|
||||
static int create_record(char *pos, FILE *file);
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@ -110,7 +112,7 @@ err:
|
|||
|
||||
}
|
||||
|
||||
void get_options(int argc,char *argv[])
|
||||
static void get_options(int argc,char *argv[])
|
||||
{
|
||||
int c;
|
||||
char *options=(char*) "Vh#:qSs:";
|
||||
|
@ -123,7 +125,7 @@ void get_options(int argc,char *argv[])
|
|||
{
|
||||
FILE *f; char s[HA_FT_MAXLEN]; int i=0,n=SWL_INIT;
|
||||
|
||||
if(!(stopwordlist=malloc(n*sizeof(char *))))
|
||||
if(!(stopwordlist=(const char**) malloc(n*sizeof(char *))))
|
||||
print_error(1,"malloc(%d)",n*sizeof(char *));
|
||||
if(!(f=fopen(optarg,"r")))
|
||||
print_error(1,"fopen(%s)",optarg);
|
||||
|
@ -165,7 +167,7 @@ void get_options(int argc,char *argv[])
|
|||
return;
|
||||
} /* get options */
|
||||
|
||||
int create_record(char *pos, FILE *file)
|
||||
static int create_record(char *pos, FILE *file)
|
||||
{ uint tmp; char *ptr;
|
||||
|
||||
bzero((char *)pos,MAX_REC_LENGTH);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
/* Copyright (C) 2000 MySQL AB & Sergei A. Golubchik
|
||||
|
||||
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
|
||||
|
@ -35,9 +35,6 @@ MI_COLUMNDEF recinfo[3];
|
|||
MI_KEYDEF keyinfo[2];
|
||||
MI_KEYSEG keyseg[10];
|
||||
|
||||
void get_options(int argc,char *argv[]);
|
||||
int create_record(char *, FILE *);
|
||||
|
||||
#define SWL_INIT 500
|
||||
#define SWL_PLUS 50
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ FT_DOCLIST *ft_init_search(void *info, uint keynr, byte *query,
|
|||
|
||||
int ft_read_next(FT_DOCLIST *handler, char *record)
|
||||
{
|
||||
MI_INFO *info=handler->info;
|
||||
MI_INFO *info= (MI_INFO *) handler->info;
|
||||
|
||||
if (++handler->curdoc >= handler->ndocs)
|
||||
{
|
||||
|
|
|
@ -30,8 +30,9 @@ static int create_flag=0,error=0;
|
|||
#define MAX_REC_LENGTH 300
|
||||
static char record[MAX_REC_LENGTH],read_record[MAX_REC_LENGTH];
|
||||
|
||||
void get_options(int argc,char *argv[]);
|
||||
static int run_test(const char *filename);
|
||||
static void get_options(int argc, char *argv[]);
|
||||
static void create_record(char *, int);
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@ -46,8 +47,6 @@ static MI_COLUMNDEF recinfo[3];
|
|||
static MI_KEYDEF keyinfo[2];
|
||||
static MI_KEYSEG keyseg[10];
|
||||
|
||||
void create_record(char *, int);
|
||||
|
||||
static int run_test(const char *filename)
|
||||
{
|
||||
MI_INFO *file;
|
||||
|
@ -235,7 +234,7 @@ void create_record(char *pos, int n)
|
|||
|
||||
/* Read options */
|
||||
|
||||
void get_options(int argc,char *argv[])
|
||||
static void get_options(int argc,char *argv[])
|
||||
{
|
||||
int c;
|
||||
const char *options="hVvsNSKFU#:";
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#define LWS_TF (count)
|
||||
#define LWS_BINARY (count>0)
|
||||
#define LWS_SQUARE (count*count)
|
||||
#define LWS_LOG (count?(log(count)+1):0)
|
||||
#define LWS_LOG (count?(log( (double) count)+1):0)
|
||||
/*--------------------------------------------------------------*/
|
||||
#define PRENORM_NONE (p->weight)
|
||||
#define PRENORM_MAX (p->weight/docstat.max)
|
||||
|
|
|
@ -76,7 +76,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
|
|||
DBUG_PRINT("error",
|
||||
("Error %d reading next-multi-part block (Got %d bytes)",
|
||||
my_errno, info->error));
|
||||
if (!my_errno)
|
||||
if (!my_errno || my_errno == -1)
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ int _mi_read_cache(IO_CACHE *info, byte *buff, my_off_t pos, uint length,
|
|||
DBUG_PRINT("error",
|
||||
("Error %d reading new block (Got %d bytes)",
|
||||
my_errno, (int) read_length));
|
||||
if (!my_errno)
|
||||
if (!my_errno || my_errno == -1)
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
|
|
@ -460,7 +460,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
|
|||
/* Check that there isn't a row with auto_increment = 0 in the table */
|
||||
mi_extra(info,HA_EXTRA_KEYREAD);
|
||||
bzero(info->lastkey,keyinfo->seg->length);
|
||||
if (!mi_rkey(info, info->rec_buff, key, info->lastkey,
|
||||
if (!mi_rkey(info, info->rec_buff, key, (const byte*) info->lastkey,
|
||||
keyinfo->seg->length, HA_READ_KEY_EXACT))
|
||||
{
|
||||
/* Don't count this as a real warning, as myisamchk can't correct it */
|
||||
|
@ -710,7 +710,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
puts("- check record links");
|
||||
}
|
||||
|
||||
if (!(record= (byte*) my_alloca(info->s->base.pack_reclength)))
|
||||
if (!(record= (byte*) my_malloc(info->s->base.pack_reclength,MYF(0))))
|
||||
{
|
||||
mi_check_print_error(param,"Not Enough memory");
|
||||
DBUG_RETURN(-1);
|
||||
|
@ -926,8 +926,9 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
if (block_info.rec_len < (uint) info->s->min_pack_length ||
|
||||
block_info.rec_len > (uint) info->s->max_pack_length)
|
||||
{
|
||||
mi_check_print_error(param,"Found block with wrong recordlength: %d at %s",
|
||||
block_info.rec_len, llstr(start_recpos,llbuff));
|
||||
mi_check_print_error(param,
|
||||
"Found block with wrong recordlength: %d at %s",
|
||||
block_info.rec_len, llstr(start_recpos,llbuff));
|
||||
got_error=1;
|
||||
break;
|
||||
}
|
||||
|
@ -936,7 +937,8 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
goto err;
|
||||
if (_mi_pack_rec_unpack(info,record,info->rec_buff,block_info.rec_len))
|
||||
{
|
||||
mi_check_print_error(param,"Found wrong record at %s", llstr(start_recpos,llbuff));
|
||||
mi_check_print_error(param,"Found wrong record at %s",
|
||||
llstr(start_recpos,llbuff));
|
||||
got_error=1;
|
||||
}
|
||||
if (static_row_size)
|
||||
|
@ -1084,12 +1086,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
printf("Lost space: %12s Linkdata: %10s\n",
|
||||
llstr(empty,llbuff),llstr(link_used,llbuff2));
|
||||
}
|
||||
my_afree((gptr) record);
|
||||
my_free((gptr) record,MYF(0));
|
||||
DBUG_RETURN (error);
|
||||
err:
|
||||
mi_check_print_error(param,"got error: %d when reading datafile",my_errno);
|
||||
mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff));
|
||||
err2:
|
||||
my_afree((gptr) record);
|
||||
my_free((gptr) record,MYF(0));
|
||||
param->retry_without_quick=1;
|
||||
DBUG_RETURN(1);
|
||||
} /* chk_data_link */
|
||||
|
@ -1111,6 +1113,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
|
|||
SORT_INFO *sort_info= ¶m->sort_info;
|
||||
DBUG_ENTER("mi_repair");
|
||||
|
||||
sort_info->buff=sort_info->record=0;
|
||||
start_records=info->state->records;
|
||||
new_header_length=(param->testflag & T_UNPACK) ? 0L :
|
||||
share->pack.header_length;
|
||||
|
@ -1199,7 +1202,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
|
|||
del=info->state->del;
|
||||
info->state->records=info->state->del=share->state.split=0;
|
||||
info->state->empty=0;
|
||||
if (sort_info->new_data_file_type != COMPRESSED_RECORD && !rep_quick)
|
||||
if (!rep_quick)
|
||||
share->state.checksum=0;
|
||||
info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
|
||||
for (i=0 ; i < info->s->base.keys ; i++)
|
||||
|
@ -1338,9 +1341,7 @@ err:
|
|||
}
|
||||
mi_mark_crashed_on_repair(info);
|
||||
}
|
||||
if (sort_info->record)
|
||||
my_free(sort_info->record,MYF(0));
|
||||
|
||||
my_free(sort_info->record,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(sort_info->buff,MYF(MY_ALLOW_ZERO_PTR));
|
||||
VOID(end_io_cache(¶m->read_cache));
|
||||
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
|
||||
|
@ -1874,8 +1875,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
|
|||
sort_param.sort_info=sort_info;
|
||||
|
||||
del=info->state->del;
|
||||
if (sort_info->new_data_file_type != COMPRESSED_RECORD &&
|
||||
! rep_quick)
|
||||
if (! rep_quick)
|
||||
share->state.checksum=0;
|
||||
|
||||
rec_per_key_part= param->rec_per_key_part;
|
||||
|
@ -2093,8 +2093,10 @@ static int sort_key_read(SORT_INFO *sort_info, void *key)
|
|||
"Found too many records; Can`t continue");
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
sort_info->real_key_length=info->s->rec_reflength+_mi_make_key(info,
|
||||
sort_info->key,key,sort_info->record,sort_info->filepos);
|
||||
sort_info->real_key_length=(info->s->rec_reflength+
|
||||
_mi_make_key(info, sort_info->key,
|
||||
(uchar*) key, sort_info->record,
|
||||
sort_info->filepos));
|
||||
DBUG_RETURN(sort_write_record(sort_info));
|
||||
} /* sort_key_read */
|
||||
|
||||
|
@ -2474,6 +2476,7 @@ static int sort_get_next_record(SORT_INFO *sort_info)
|
|||
llstr(sort_info->pos,llbuff));
|
||||
continue;
|
||||
}
|
||||
info->checksum=mi_checksum(info,sort_info->record);
|
||||
if (!sort_info->fix_datafile)
|
||||
sort_info->filepos=sort_info->pos;
|
||||
sort_info->max_pos=(sort_info->pos=block_info.filepos+
|
||||
|
@ -2552,6 +2555,7 @@ int sort_write_record(SORT_INFO *sort_info)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
sort_info->filepos+=block_length;
|
||||
info->s->state.checksum+=info->checksum;
|
||||
break;
|
||||
case COMPRESSED_RECORD:
|
||||
reclength=info->packed_length;
|
||||
|
@ -2564,6 +2568,7 @@ int sort_write_record(SORT_INFO *sort_info)
|
|||
mi_check_print_error(param,"%d when writing to datafile",my_errno);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
info->s->state.checksum+=info->checksum;
|
||||
sort_info->filepos+=reclength+length;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -962,7 +962,7 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
|
|||
b_type=_mi_pack_get_block_info(info,&block_info,info->dfile,filepos,
|
||||
info->rec_buff);
|
||||
if (b_type)
|
||||
goto err;
|
||||
goto err; /* Error code is already set */
|
||||
#ifndef DBUG_OFF
|
||||
if (block_info.rec_len > share->max_pack_length)
|
||||
{
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
|
||||
#include "myisam.h"
|
||||
#include <getopt.h>
|
||||
#include <m_ctype.h>
|
||||
|
||||
#include <m_string.h>
|
||||
|
||||
#define MAX_REC_LENGTH 1024
|
||||
|
||||
|
|
|
@ -59,11 +59,11 @@ static MI_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS];
|
|||
|
||||
/* Test program */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
uint i;
|
||||
int j,n1,n2,n3,error,k;
|
||||
uint write_count,update,dupp_keys,delete,start,length,blob_pos,
|
||||
uint write_count,update,dupp_keys,opt_delete,start,length,blob_pos,
|
||||
reclength,ant,found_parts;
|
||||
my_off_t lastpos;
|
||||
ha_rows range_records,records;
|
||||
|
@ -180,7 +180,7 @@ int main(int argc, char **argv)
|
|||
recinfo[6].null_pos=0;
|
||||
}
|
||||
|
||||
write_count=update=dupp_keys=delete=0;
|
||||
write_count=update=dupp_keys=opt_delete=0;
|
||||
blob_buffer=0;
|
||||
|
||||
for (i=1000 ; i>0 ; i--) key1[i]=0;
|
||||
|
@ -280,14 +280,14 @@ int main(int argc, char **argv)
|
|||
printf("can't find key1: \"%s\"\n",key);
|
||||
goto err;
|
||||
}
|
||||
if (delete == (uint) remove_count) /* While testing */
|
||||
if (opt_delete == (uint) remove_count) /* While testing */
|
||||
goto end;
|
||||
if (mi_delete(file,read_record))
|
||||
{
|
||||
printf("error: %d; can't delete record: \"%s\"\n", my_errno,read_record);
|
||||
goto err;
|
||||
}
|
||||
delete++;
|
||||
opt_delete++;
|
||||
key1[atoi(read_record+keyinfo[0].seg[0].start)]--;
|
||||
key3[atoi(read_record+keyinfo[2].seg[0].start)]=0;
|
||||
}
|
||||
|
@ -418,10 +418,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
while ((error=mi_rnext(file,read_record3,0)) == 0 && ant < write_count+10)
|
||||
ant++;
|
||||
if (ant != write_count - delete || error != HA_ERR_END_OF_FILE)
|
||||
if (ant != write_count - opt_delete || error != HA_ERR_END_OF_FILE)
|
||||
{
|
||||
printf("next: I found: %d records of %d (error: %d)\n",
|
||||
ant, write_count - delete, error);
|
||||
ant, write_count - opt_delete, error);
|
||||
goto end;
|
||||
}
|
||||
if (mi_rlast(file,read_record2,0) ||
|
||||
|
@ -435,7 +435,7 @@ int main(int argc, char **argv)
|
|||
ant=1;
|
||||
while (mi_rprev(file,read_record3,0) == 0 && ant < write_count+10)
|
||||
ant++;
|
||||
if (ant != write_count - delete)
|
||||
if (ant != write_count - opt_delete)
|
||||
{
|
||||
printf("prev: I found: %d records of %d\n",ant,write_count);
|
||||
goto end;
|
||||
|
@ -495,7 +495,7 @@ int main(int argc, char **argv)
|
|||
if (mi_rkey(file,read_record,0,key,0,HA_READ_KEY_EXACT)) goto err;
|
||||
if (mi_rnext(file,read_record3,0)) goto err;
|
||||
if (mi_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
while (mi_rnext(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -513,7 +513,7 @@ int main(int argc, char **argv)
|
|||
if (mi_rprev(file,read_record3,0)) goto err;
|
||||
if (mi_rprev(file,read_record3,0)) goto err;
|
||||
if (mi_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
while (mi_rprev(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -530,7 +530,7 @@ int main(int argc, char **argv)
|
|||
DBUG_PRINT("progpos",("first - delete - next -> last"));
|
||||
if (mi_rkey(file,read_record3,0,key,0,HA_READ_KEY_EXACT)) goto err;
|
||||
if (mi_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=1;
|
||||
if (mi_rnext(file,read_record,0))
|
||||
goto err; /* Skall finnas poster */
|
||||
|
@ -547,7 +547,7 @@ int main(int argc, char **argv)
|
|||
DBUG_PRINT("progpos",("last - delete - prev -> first"));
|
||||
if (mi_rprev(file,read_record3,0)) goto err;
|
||||
if (mi_delete(file,read_record3)) goto err;
|
||||
delete++;
|
||||
opt_delete++;
|
||||
ant=0;
|
||||
while (mi_rprev(file,read_record3,0) == 0 &&
|
||||
bcmp(read_record3+start,key,length) == 0) ant++;
|
||||
|
@ -641,7 +641,7 @@ int main(int argc, char **argv)
|
|||
if (!silent)
|
||||
printf("- mi_info\n");
|
||||
mi_status(file,&info,HA_STATUS_VARIABLE | HA_STATUS_CONST);
|
||||
if (info.records != write_count-delete || info.deleted > delete + update
|
||||
if (info.records != write_count-opt_delete || info.deleted > opt_delete + update
|
||||
|| info.keys != keys)
|
||||
{
|
||||
puts("Wrong info from mi_info");
|
||||
|
@ -678,10 +678,10 @@ int main(int argc, char **argv)
|
|||
while ((error=mi_rrnd(file,record,HA_OFFSET_ERROR)) != HA_ERR_END_OF_FILE &&
|
||||
ant < write_count + 10)
|
||||
ant+= error ? 0 : 1;
|
||||
if (ant != write_count-delete)
|
||||
if (ant != write_count-opt_delete)
|
||||
{
|
||||
printf("rrnd with cache: I can only find: %d records of %d\n",
|
||||
ant,write_count-delete);
|
||||
ant,write_count-opt_delete);
|
||||
goto end;
|
||||
}
|
||||
if (mi_extra(file,HA_EXTRA_NO_CACHE))
|
||||
|
@ -695,10 +695,10 @@ int main(int argc, char **argv)
|
|||
while ((error=mi_scan(file,record)) != HA_ERR_END_OF_FILE &&
|
||||
ant < write_count + 10)
|
||||
ant+= error ? 0 : 1;
|
||||
if (ant != write_count-delete)
|
||||
if (ant != write_count-opt_delete)
|
||||
{
|
||||
printf("scan with cache: I can only find: %d records of %d\n",
|
||||
ant,write_count-delete);
|
||||
ant,write_count-opt_delete);
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
@ -724,7 +724,7 @@ int main(int argc, char **argv)
|
|||
lastpos=info.recpos;
|
||||
if (error == 0)
|
||||
{
|
||||
if (delete == (uint) remove_count) /* While testing */
|
||||
if (opt_delete == (uint) remove_count) /* While testing */
|
||||
goto end;
|
||||
if (mi_rsame(file,read_record,-1))
|
||||
{
|
||||
|
@ -751,19 +751,19 @@ int main(int argc, char **argv)
|
|||
if (mi_delete(file,read_record))
|
||||
{
|
||||
printf("can't delete record: %6.6s, delete_count: %d\n",
|
||||
read_record, delete);
|
||||
read_record, opt_delete);
|
||||
goto err;
|
||||
}
|
||||
delete++;
|
||||
opt_delete++;
|
||||
}
|
||||
else
|
||||
found_parts++;
|
||||
}
|
||||
if (my_errno != HA_ERR_END_OF_FILE && my_errno != HA_ERR_RECORD_DELETED)
|
||||
printf("error: %d from mi_rrnd\n",my_errno);
|
||||
if (write_count != delete)
|
||||
if (write_count != opt_delete)
|
||||
{
|
||||
printf("Deleted only %d of %d records (%d parts)\n",delete,write_count,
|
||||
printf("Deleted only %d of %d records (%d parts)\n",opt_delete,write_count,
|
||||
found_parts);
|
||||
goto err;
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ end:
|
|||
if (!silent)
|
||||
{
|
||||
printf("\nFollowing test have been made:\n");
|
||||
printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,delete);
|
||||
printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,opt_delete);
|
||||
if (rec_pointer_size)
|
||||
printf("Record pointer size: %d\n",rec_pointer_size);
|
||||
if (key_cacheing)
|
||||
|
|
|
@ -39,7 +39,6 @@ static uint decode_bits;
|
|||
static char **default_argv;
|
||||
static const char *load_default_groups[]= { "myisamchk", 0 };
|
||||
static const char *set_charset_name;
|
||||
static uint8 set_charset_number;
|
||||
static CHARSET_INFO *set_charset;
|
||||
|
||||
static const char *type_names[]=
|
||||
|
@ -206,7 +205,7 @@ static struct option long_options[] =
|
|||
|
||||
static void print_version(void)
|
||||
{
|
||||
printf("%s Ver 1.49 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
printf("%s Ver 1.51 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
MACHINE_TYPE);
|
||||
}
|
||||
|
||||
|
@ -606,9 +605,10 @@ static int myisamchk(MI_CHECK *param, my_string filename)
|
|||
(((ulonglong) 1L << share->base.keys)-1)) ||
|
||||
test_if_almost_full(info) ||
|
||||
info->s->state.header.file_version[3] != myisam_file_magic[3] ||
|
||||
(set_charset && set_charset_number != share->state.header.language)))
|
||||
(set_charset && set_charset->number != share->state.header.language)))
|
||||
{
|
||||
check_param.language=set_charset_number;
|
||||
if (set_charset)
|
||||
check_param.language=set_charset->number;
|
||||
if (recreate_table(&check_param, &info,filename))
|
||||
{
|
||||
VOID(fprintf(stderr,
|
||||
|
@ -949,7 +949,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
|
|||
share->base.raid_chunks,
|
||||
share->base.raid_chunksize);
|
||||
}
|
||||
if (share->options & HA_OPTION_CHECKSUM)
|
||||
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
|
||||
printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff));
|
||||
;
|
||||
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#endif
|
||||
|
||||
#include "myisamdef.h"
|
||||
#include "my_tree.h"
|
||||
#include <my_tree.h>
|
||||
#include <stdarg.h>
|
||||
#ifdef HAVE_GETRUSAGE
|
||||
#include <sys/resource.h>
|
||||
|
@ -251,12 +251,12 @@ static void get_options(register int *argc, register char ***argv)
|
|||
/* Fall through */
|
||||
case 'I':
|
||||
case '?':
|
||||
printf("%s Ver 1.3 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE,
|
||||
MACHINE_TYPE);
|
||||
puts("By Monty, for your professional use\n");
|
||||
if (version)
|
||||
break;
|
||||
puts("Write info about whats in a myisam log file.");
|
||||
puts("Write info about whats in a MyISAM log file.");
|
||||
printf("If no file name is given %s is used\n",log_filename);
|
||||
puts("");
|
||||
printf(usage,my_progname);
|
||||
|
@ -266,7 +266,7 @@ static void get_options(register int *argc, register char ***argv)
|
|||
puts(" -o \"offset\" -p # \"remove # components from path\"");
|
||||
puts(" -r \"recover\" -R \"file recordposition\"");
|
||||
puts(" -u \"update\" -v \"verbose\" -w \"write file\"");
|
||||
puts(" -D \"myisam compileled with DBUG\" -P \"processes\"");
|
||||
puts(" -D \"myisam compiled with DBUG\" -P \"processes\"");
|
||||
puts("\nOne can give a second and a third '-v' for more verbose.");
|
||||
puts("Normaly one does a update (-u).");
|
||||
puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted.");
|
||||
|
@ -376,10 +376,8 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
}
|
||||
|
||||
if (curr_file_info)
|
||||
{
|
||||
printf("\nWarning: %s is opened with same process and filenumber\nMaybe you should use the -P option ?\n",
|
||||
curr_file_info->show_name);
|
||||
}
|
||||
if (my_b_read(&cache,(byte*) head,2))
|
||||
goto err;
|
||||
file_info.name=0;
|
||||
|
@ -490,8 +488,7 @@ static int examine_log(my_string file_name, char **table_names)
|
|||
command_name[command], (int) extra_command,result);
|
||||
if (update && curr_file_info && !curr_file_info->closed)
|
||||
{
|
||||
if (mi_extra(curr_file_info->isam,
|
||||
(int) extra_command) != (int) result)
|
||||
if (mi_extra(curr_file_info->isam, extra_command) != (int) result)
|
||||
{
|
||||
fflush(stdout);
|
||||
VOID(fprintf(stderr,
|
||||
|
|
|
@ -230,12 +230,12 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
}
|
||||
|
||||
enum options {OPT_CHARSETS_DIR=256};
|
||||
enum options {OPT_CHARSETS_DIR_MP=256};
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"backup", no_argument, 0, 'b'},
|
||||
{"character-sets-dir",required_argument,0, OPT_CHARSETS_DIR},
|
||||
{"character-sets-dir",required_argument,0, OPT_CHARSETS_DIR_MP},
|
||||
{"debug", optional_argument, 0, '#'},
|
||||
{"force", no_argument, 0, 'f'},
|
||||
{"join", required_argument, 0, 'j'},
|
||||
|
@ -252,7 +252,7 @@ static struct option long_options[] =
|
|||
|
||||
static void print_version(void)
|
||||
{
|
||||
printf("%s Ver 1.9 for %s on %s\n",my_progname,SYSTEM_TYPE,MACHINE_TYPE);
|
||||
printf("%s Ver 1.10 for %s on %s\n",my_progname,SYSTEM_TYPE,MACHINE_TYPE);
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
|
@ -335,7 +335,7 @@ static void get_options(int *argc,char ***argv)
|
|||
case '#':
|
||||
DBUG_PUSH(optarg ? optarg : "d:t:o");
|
||||
break;
|
||||
case OPT_CHARSETS_DIR:
|
||||
case OPT_CHARSETS_DIR_MP:
|
||||
charsets_dir = optarg;
|
||||
break;
|
||||
case 'V': print_version(); exit(0);
|
||||
|
@ -1169,7 +1169,7 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
|
|||
{
|
||||
uint i,found,bits_packed,first,last;
|
||||
my_off_t bytes_packed;
|
||||
HUFF_ELEMENT *a,*b,*new;
|
||||
HUFF_ELEMENT *a,*b,*new_huff_el;
|
||||
|
||||
first=last=0;
|
||||
if (huff_counts->tree_buff)
|
||||
|
@ -1249,23 +1249,23 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
|
|||
{
|
||||
if (huff_counts->counts[i])
|
||||
{
|
||||
new=huff_tree->element_buffer+(found++);
|
||||
new->count=huff_counts->counts[i];
|
||||
new->a.leaf.null=0;
|
||||
new->a.leaf.element_nr=i;
|
||||
queue.root[found]=(byte*) new;
|
||||
new_huff_el=huff_tree->element_buffer+(found++);
|
||||
new_huff_el->count=huff_counts->counts[i];
|
||||
new_huff_el->a.leaf.null=0;
|
||||
new_huff_el->a.leaf.element_nr=i;
|
||||
queue.root[found]=(byte*) new_huff_el;
|
||||
}
|
||||
}
|
||||
while (found < 2)
|
||||
{ /* Our huff_trees request at least 2 elements */
|
||||
new=huff_tree->element_buffer+(found++);
|
||||
new->count=0;
|
||||
new->a.leaf.null=0;
|
||||
new_huff_el=huff_tree->element_buffer+(found++);
|
||||
new_huff_el->count=0;
|
||||
new_huff_el->a.leaf.null=0;
|
||||
if (last)
|
||||
new->a.leaf.element_nr=huff_tree->min_chr=last-1;
|
||||
new_huff_el->a.leaf.element_nr=huff_tree->min_chr=last-1;
|
||||
else
|
||||
new->a.leaf.element_nr=huff_tree->max_chr=last+1;
|
||||
queue.root[found]=(byte*) new;
|
||||
new_huff_el->a.leaf.element_nr=huff_tree->max_chr=last+1;
|
||||
queue.root[found]=(byte*) new_huff_el;
|
||||
}
|
||||
}
|
||||
queue.elements=found;
|
||||
|
@ -1277,13 +1277,13 @@ static int make_huff_tree(HUFF_TREE *huff_tree, HUFF_COUNTS *huff_counts)
|
|||
{
|
||||
a=(HUFF_ELEMENT*) queue_remove(&queue,0);
|
||||
b=(HUFF_ELEMENT*) queue.root[1];
|
||||
new=huff_tree->element_buffer+found+i;
|
||||
new->count=a->count+b->count;
|
||||
bits_packed+=(uint) (new->count & 7);
|
||||
bytes_packed+=new->count/8;
|
||||
new->a.nod.left=a; /* lesser in left */
|
||||
new->a.nod.right=b;
|
||||
queue.root[1]=(byte*) new;
|
||||
new_huff_el=huff_tree->element_buffer+found+i;
|
||||
new_huff_el->count=a->count+b->count;
|
||||
bits_packed+=(uint) (new_huff_el->count & 7);
|
||||
bytes_packed+=new_huff_el->count/8;
|
||||
new_huff_el->a.nod.left=a; /* lesser in left */
|
||||
new_huff_el->a.nod.right=b;
|
||||
queue.root[1]=(byte*) new_huff_el;
|
||||
queue_replaced(&queue);
|
||||
}
|
||||
huff_tree->root=(HUFF_ELEMENT*) queue.root[1];
|
||||
|
@ -1306,14 +1306,14 @@ static int compare_tree(void* cmp_arg __attribute__((unused)),
|
|||
static int save_counts_in_queue(byte *key, element_count count,
|
||||
HUFF_TREE *tree)
|
||||
{
|
||||
HUFF_ELEMENT *new;
|
||||
HUFF_ELEMENT *new_huff_el;
|
||||
|
||||
new=tree->element_buffer+(tree->elements++);
|
||||
new->count=count;
|
||||
new->a.leaf.null=0;
|
||||
new->a.leaf.element_nr= (uint) (key- tree->counts->tree_buff) /
|
||||
new_huff_el=tree->element_buffer+(tree->elements++);
|
||||
new_huff_el->count=count;
|
||||
new_huff_el->a.leaf.null=0;
|
||||
new_huff_el->a.leaf.element_nr= (uint) (key- tree->counts->tree_buff) /
|
||||
tree->counts->field_length;
|
||||
queue.root[tree->elements]=(byte*) new;
|
||||
queue.root[tree->elements]=(byte*) new_huff_el;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1355,14 +1355,14 @@ static my_off_t calc_packed_length(HUFF_COUNTS *huff_counts,
|
|||
_downheap(&queue,i);
|
||||
for (i=0 ; i < found-1 ; i++)
|
||||
{
|
||||
HUFF_ELEMENT *a,*b,*new;
|
||||
HUFF_ELEMENT *a,*b,*new_huff_el;
|
||||
a=(HUFF_ELEMENT*) queue_remove(&queue,0);
|
||||
b=(HUFF_ELEMENT*) queue.root[1];
|
||||
new=element_buffer+i;
|
||||
new->count=a->count+b->count;
|
||||
bits_packed+=(uint) (new->count & 7);
|
||||
bytes_packed+=new->count/8;
|
||||
queue.root[1]=(byte*) new;
|
||||
new_huff_el=element_buffer+i;
|
||||
new_huff_el->count=a->count+b->count;
|
||||
bits_packed+=(uint) (new_huff_el->count & 7);
|
||||
bytes_packed+=new_huff_el->count/8;
|
||||
queue.root[1]=(byte*) new_huff_el;
|
||||
queue_replaced(&queue);
|
||||
}
|
||||
DBUG_RETURN(bytes_packed+(bits_packed+7)/8);
|
||||
|
@ -1673,7 +1673,7 @@ static int compress_isam_file(MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
|
|||
max_calc_length+=huff_counts[i].tree->height;
|
||||
else if (huff_counts[i].field_type == FIELD_BLOB ||
|
||||
huff_counts[i].field_type == FIELD_VARCHAR)
|
||||
max_calc_length=huff_counts[i].tree->height*huff_counts[i].max_length + huff_counts[i].length_bits +1;
|
||||
max_calc_length+=huff_counts[i].tree->height*huff_counts[i].max_length + huff_counts[i].length_bits +1;
|
||||
else
|
||||
max_calc_length+=
|
||||
(huff_counts[i].field_length - huff_counts[i].max_zero_fill)*
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
#include <queues.h>
|
||||
|
||||
/* static variabels */
|
||||
#undef MIN_SORT_MEMORY
|
||||
#undef MYF_RW
|
||||
#undef DISK_BUFFER_SIZE
|
||||
|
||||
#define MERGEBUFF 15
|
||||
#define MERGEBUFF2 31
|
||||
|
@ -36,10 +39,10 @@
|
|||
#define DISK_BUFFER_SIZE (IO_SIZE*16)
|
||||
|
||||
typedef struct st_buffpek {
|
||||
my_off_t file_pos; /* position to buffer */
|
||||
ha_rows count; /* keys in buffer */
|
||||
uchar *base,*key; /* Pekare inom sort_key - indexdel */
|
||||
uint mem_count; /* keys left in memory */
|
||||
my_off_t file_pos; /* Where we are in the sort file */
|
||||
ha_rows count; /* Number of rows in table */
|
||||
uchar *base,*key; /* Key pointers */
|
||||
uint mem_count; /* numbers of keys in memory */
|
||||
uint max_keys; /* Max keys in buffert */
|
||||
} BUFFPEK;
|
||||
|
||||
|
@ -419,7 +422,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
|
|||
sort_length));
|
||||
if (error == -1)
|
||||
goto err; /* purecov: inspected */
|
||||
queue_insert(&queue,(void*) buffpek);
|
||||
queue_insert(&queue,(char*) buffpek);
|
||||
}
|
||||
|
||||
while (queue.elements > 1)
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
#include "mymrgdef.h"
|
||||
|
||||
int myrg_delete(info,record)
|
||||
MYRG_INFO *info;
|
||||
const byte *record;
|
||||
int myrg_delete(
|
||||
MYRG_INFO *info,
|
||||
const byte *record)
|
||||
{
|
||||
if (!info->current_table)
|
||||
{
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
#include "mymrgdef.h"
|
||||
|
||||
int myrg_lock_database(info,lock_type)
|
||||
MYRG_INFO *info;
|
||||
int lock_type;
|
||||
int myrg_lock_database(
|
||||
MYRG_INFO *info,
|
||||
int lock_type)
|
||||
{
|
||||
int error,new_error;
|
||||
MYRG_TABLE *file;
|
||||
|
|
|
@ -30,10 +30,10 @@
|
|||
*/
|
||||
|
||||
|
||||
MYRG_INFO *myrg_open(name,mode,handle_locking)
|
||||
const char *name;
|
||||
int mode;
|
||||
int handle_locking;
|
||||
MYRG_INFO *myrg_open(
|
||||
const char *name,
|
||||
int mode,
|
||||
int handle_locking)
|
||||
{
|
||||
int save_errno,i,errpos;
|
||||
uint files,dir_length,length,options;
|
||||
|
@ -65,7 +65,6 @@ int handle_locking;
|
|||
end[-1]='\0';
|
||||
if (buff[0] && buff[0] != '#') /* Skipp empty lines and comments */
|
||||
{
|
||||
last_isam=isam;
|
||||
if (!test_if_hard_path(buff))
|
||||
{
|
||||
VOID(strmake(name_buff+dir_length,buff,
|
||||
|
@ -75,14 +74,14 @@ int handle_locking;
|
|||
if (!(isam=mi_open(buff,mode,test(handle_locking))))
|
||||
goto err;
|
||||
files++;
|
||||
last_isam=isam;
|
||||
if (info.reclength && info.reclength != isam->s->base.reclength)
|
||||
{
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
goto err;
|
||||
}
|
||||
info.reclength=isam->s->base.reclength;
|
||||
}
|
||||
last_isam=isam;
|
||||
if (info.reclength && info.reclength != isam->s->base.reclength)
|
||||
{
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
goto err;
|
||||
}
|
||||
info.reclength=isam->s->base.reclength;
|
||||
}
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO)+
|
||||
files*sizeof(MYRG_TABLE),
|
||||
|
|
|
@ -24,8 +24,7 @@
|
|||
done for all single user files to get changes in database */
|
||||
|
||||
|
||||
int myrg_panic(flag)
|
||||
enum ha_panic_function flag;
|
||||
int myrg_panic(enum ha_panic_function flag)
|
||||
{
|
||||
int error=0;
|
||||
LIST *list_element,*next_open;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,8 +6,8 @@ now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(no
|
|||
0 0 0
|
||||
from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0
|
||||
1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112
|
||||
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22")
|
||||
02:30:01 23001 54742
|
||||
sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21)
|
||||
02:30:01 23001 54742 00:04:57
|
||||
now()-curdate()*1000000-curtime()
|
||||
0
|
||||
strcmp(current_timestamp(),concat(current_date()," ",current_time()))
|
||||
|
|
|
@ -362,3 +362,9 @@ _userid
|
|||
marc@anyware.co.uk
|
||||
_userid
|
||||
marc@anyware.co.uk
|
||||
f1
|
||||
65
|
||||
379
|
||||
468
|
||||
469
|
||||
508
|
||||
|
|
|
@ -475,3 +475,7 @@ a
|
|||
1
|
||||
2
|
||||
4
|
||||
id name value uid
|
||||
1 one one value 101
|
||||
3 three three value 103
|
||||
6 two other value 102
|
||||
|
|
4
mysql-test/r/rpl_get_lock.result
Normal file
4
mysql-test/r/rpl_get_lock.result
Normal file
|
@ -0,0 +1,4 @@
|
|||
get_lock("lock",3)
|
||||
1
|
||||
n
|
||||
1
|
5
mysql-test/std_data/gemini.dat
Normal file
5
mysql-test/std_data/gemini.dat
Normal file
|
@ -0,0 +1,5 @@
|
|||
65,-1,1
|
||||
379,-1,1
|
||||
468,-1,1
|
||||
469,-1,1
|
||||
508,-1,1
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue