mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into teton.kitebird.com:/home/paul/mysql-4.1
This commit is contained in:
commit
9f1f82c42c
306 changed files with 8169 additions and 4337 deletions
|
@ -74,6 +74,7 @@ Docs/safe-mysql.xml
|
|||
Docs/tex.fmt
|
||||
Docs/texi2dvi.out
|
||||
INSTALL-SOURCE
|
||||
INSTALL-WIN-SOURCE
|
||||
Logs/*
|
||||
MIRRORS
|
||||
Makefile
|
||||
|
@ -436,6 +437,7 @@ linked_libmysqldex_sources
|
|||
linked_server_sources
|
||||
linked_tools_sources
|
||||
locked
|
||||
man/*.1
|
||||
mit-pthreads/config.flags
|
||||
mit-pthreads/include/bits
|
||||
mit-pthreads/include/pthread/machdep.h
|
||||
|
@ -458,6 +460,7 @@ myisam/mi_test2
|
|||
myisam/mi_test3
|
||||
myisam/mi_test_all
|
||||
myisam/myisam.log
|
||||
myisam/myisam_ftdump
|
||||
myisam/myisamchk
|
||||
myisam/myisamlog
|
||||
myisam/myisampack
|
||||
|
@ -640,4 +643,3 @@ vio/test-ssl
|
|||
vio/test-sslclient
|
||||
vio/test-sslserver
|
||||
vio/viotest-ssl
|
||||
INSTALL-WIN-SOURCE
|
||||
|
|
|
@ -37,6 +37,7 @@ EXTRA_DIST = FINISH.sh \
|
|||
compile-pentium-pgcc \
|
||||
compile-solaris-sparc \
|
||||
compile-solaris-sparc-debug \
|
||||
compile-irix-mips64-mipspro \
|
||||
compile-solaris-sparc-forte \
|
||||
compile-solaris-sparc-purify
|
||||
|
||||
|
|
84
BUILD/compile-irix-mips64-mipspro
Executable file
84
BUILD/compile-irix-mips64-mipspro
Executable file
|
@ -0,0 +1,84 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -f "sql/mysqld.cc" ]; then
|
||||
echo "You must run this script from the MySQL top-level directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cflags="-64 -mips4"
|
||||
|
||||
if [ "$#" != 0 ]; then
|
||||
case "$1" in
|
||||
--help)
|
||||
echo "Usage: $0 [options]"
|
||||
echo "Options:"
|
||||
echo "--help print this message"
|
||||
echo "-32 build 32-bit binary"
|
||||
echo "-64 build 64-bit binary [default]"
|
||||
exit 0
|
||||
;;
|
||||
-64)
|
||||
echo "Building 64-bit binary"
|
||||
;;
|
||||
-32)
|
||||
echo "Building 32-bit binary"
|
||||
cflags=""
|
||||
;;
|
||||
*)
|
||||
echo "$0: invalid option '$1'; use --help to show usage"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "Building 64-bit binary"
|
||||
fi
|
||||
|
||||
set -x
|
||||
make distclean
|
||||
aclocal
|
||||
autoheader
|
||||
libtoolize --automake --force
|
||||
automake --force --add-missing
|
||||
autoconf
|
||||
|
||||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
|
||||
# C options:
|
||||
# -apo - auto-parallize for multiprocessors (implies -mp)
|
||||
# -mp - generate multiprocessor code
|
||||
# These two common optimization options apparently use 'sproc' model of
|
||||
# threading, which is not compatible with PTHREADS: don't add them unless you
|
||||
# know what you're doing.
|
||||
#
|
||||
# -c99 - enable C features standardized in C99, such as long long,
|
||||
# strtoll, stroull etc.
|
||||
# This option is vital to compile MySQL.
|
||||
# -woff - turn off some warnings
|
||||
# -64 - generate 64 bit object (implies -mips4)
|
||||
# -mips4 - produce code for MIPS R10000, MIPS R12000 and further 64 bit
|
||||
# processors
|
||||
# -OPT:Olimit=0 - no limits exists to size of function for compiler to optimize
|
||||
# it
|
||||
nowarn="-woff 1064,1188,1460,1552,1681,1682,3303"
|
||||
cflags="$cflags $nowarn -O3 -c99 -OPT:Olimit=0"
|
||||
|
||||
# C++ only options:
|
||||
# -LANG:exceptions=OFF - don't generate exception handling code
|
||||
# MySQL doesn't use exceptions.
|
||||
# -LANG:std=OFF - don't link standard C++ library, such as
|
||||
# <iostream>, <complex>, etc.
|
||||
# -LANG:libc_in_namespace_std=OFF - libstdc functions can be
|
||||
# declared in namespace 'std', when included
|
||||
# into C++ code. Switch this feature off.
|
||||
# This option is vital to compile MySQL
|
||||
|
||||
cxxflags="$cflags -LANG:exceptions=OFF -LANG:std=OFF"
|
||||
cxxflags="$cxxflags -LANG:libc_in_namespace_std=OFF"
|
||||
|
||||
CC=cc CXX=CC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \
|
||||
./configure --prefix=/usr/local/mysql --disable-shared \
|
||||
--with-extra-charsets=complex --enable-thread-safe-client \
|
||||
--without-extra-tools --disable-dependency-tracking
|
||||
|
||||
make
|
|
@ -9,6 +9,6 @@ extra_configs="$pentium_configs"
|
|||
|
||||
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
|
||||
--with-embedded-server --enable-thread-safe-client \
|
||||
--with-openssl --with-vio"
|
||||
--with-openssl --with-vio --with-raid"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
|
|
@ -117,6 +117,7 @@ root@x3.internalnet
|
|||
salle@banica.(none)
|
||||
salle@geopard.(none)
|
||||
salle@geopard.online.bg
|
||||
salle@vafla.home
|
||||
salle@vafla.online.bg
|
||||
sasha@mysql.sashanet.com
|
||||
serg@build.mysql2.com
|
||||
|
|
|
@ -257,7 +257,7 @@ if (defined $opt_changelog)
|
|||
$msg= "Adding $target_dir/ChangeLog";
|
||||
$msg.= " (down to revision $opt_changelog)" if $opt_changelog ne "";
|
||||
&logger($msg);
|
||||
$command= "bk changes -v";
|
||||
$command= "bk changes -mv";
|
||||
$command.= " -r" if ($opt_changelog ne "" || $opt_revision);
|
||||
$command.= $opt_changelog if $opt_changelog ne "";
|
||||
$command.= ".." if ($opt_changelog ne "" && !$opt_revision);
|
||||
|
|
|
@ -282,7 +282,7 @@ if ($opt_stage <= 3)
|
|||
{
|
||||
my $flags= "";
|
||||
log_timestamp();
|
||||
log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz");
|
||||
log_system("rm -fr mysql-{3,4,5}* $pwd/$host/mysql*.t*gz");
|
||||
# No need to add the debug symbols, if the binaries are not stripped (saves space)
|
||||
unless ($opt_with_debug || $opt_no_strip)
|
||||
{
|
||||
|
@ -291,7 +291,7 @@ if ($opt_stage <= 3)
|
|||
|
||||
$flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug);
|
||||
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("mv mysql*.t*gz $pwd/$host");
|
||||
if (-f "client/.libs/mysqladmin")
|
||||
{
|
||||
safe_system("cp client/.libs/mysqladmin $pwd/$host/bin");
|
||||
|
@ -303,11 +303,8 @@ if ($opt_stage <= 3)
|
|||
safe_system("$make clean") if ($opt_with_small_disk);
|
||||
}
|
||||
|
||||
$tar_file=<$pwd/$host/*.tar.gz>;
|
||||
if (!defined($tar_file))
|
||||
{
|
||||
$tar_file=<$pwd/$host/*.tgz>;
|
||||
}
|
||||
$tar_file=<$pwd/$host/mysql*.t*gz>;
|
||||
abort ("Could not find tarball!") unless ($tar_file);
|
||||
|
||||
#
|
||||
# Unpack the binary distribution
|
||||
|
@ -320,7 +317,7 @@ if ($opt_stage <= 4 && !$opt_no_test)
|
|||
safe_system("gunzip < $tar_file | $tar xf -");
|
||||
}
|
||||
|
||||
$tar_file =~ /(mysql[^\/]*)\.tar/;
|
||||
$tar_file =~ /(mysql[^\/]*)\.(tar\.gz|tgz)/;
|
||||
$ver=$1;
|
||||
$test_dir="$pwd/$host/test/$ver";
|
||||
$ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
|
||||
|
|
|
@ -115,10 +115,12 @@ if (defined $opt_log)
|
|||
if (-x "/usr/bin/rpmbuild")
|
||||
{
|
||||
$RPM= "/usr/bin/rpmbuild";
|
||||
$RMSOURCE= "--rmsource --rmspec";
|
||||
}
|
||||
else
|
||||
{
|
||||
$RPM= "/bin/rpm";
|
||||
$RMSOURCE= "--rmspec";
|
||||
}
|
||||
|
||||
if ($RPM)
|
||||
|
@ -177,7 +179,7 @@ $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
|
|||
$command= "$RPM";
|
||||
$command.= " -v" if ($opt_verbose);
|
||||
$command.= " -ba";
|
||||
$command.= " --clean" if $opt_clean;
|
||||
$command.= " --clean $RMSOURCE" if $opt_clean;
|
||||
$command.= " $SPECDIR/";
|
||||
$command.= basename($SPECFILE);
|
||||
&logger("Building RPM.");
|
||||
|
@ -188,7 +190,7 @@ $command.= basename($SPECFILE);
|
|||
#
|
||||
$command= "mv";
|
||||
$command.= " -v " if ($opt_verbose);
|
||||
$command.= "$SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD";
|
||||
$command.= " $SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD";
|
||||
&logger("Moving source RPM to current dir.");
|
||||
&run_command($command, "Error moving source RPM!");
|
||||
|
||||
|
@ -198,19 +200,6 @@ $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
|
|||
&logger("Moving binary RPMs to current dir.");
|
||||
&run_command($command, "Error moving binary RPMs!");
|
||||
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
if ($opt_clean)
|
||||
{
|
||||
&logger("Removing spec file and source package");
|
||||
unless ($opt_dry_run)
|
||||
{
|
||||
unlink("$SPECDIR/" . basename($SPECFILE));
|
||||
unlink("$SOURCEDIR/$SOURCEFILE");
|
||||
}
|
||||
}
|
||||
|
||||
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
|
||||
exit 0;
|
||||
|
||||
|
|
82
Build-tools/Do-win-build
Executable file
82
Build-tools/Do-win-build
Executable file
|
@ -0,0 +1,82 @@
|
|||
#!/usr/bin/perl -w
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
$opt_help=0;
|
||||
$opt_tarball=$opt_builddir="";
|
||||
|
||||
GetOptions(
|
||||
"help",
|
||||
"tarball=s",
|
||||
"builddir=s",
|
||||
) || print_help();
|
||||
|
||||
print_help() if ($opt_help);
|
||||
|
||||
chomp($MSDEV=`which msdev`);
|
||||
|
||||
if (!$opt_builddir) {
|
||||
$opt_builddir = "/cygdrive/c/mysql-win-build";
|
||||
}
|
||||
|
||||
$opt_tarball =~ /(mysql[^\/]*)-win-src\.tar/;
|
||||
$mysqlver=$1;
|
||||
$basedir = "$opt_builddir/$mysqlver";
|
||||
|
||||
# Make sure build dir exists
|
||||
mkdir($opt_builddir);
|
||||
# Clean out any previous build
|
||||
system("rm -rf $basedir");
|
||||
mkdir($basedir);
|
||||
mkdir("$basedir/tarball");
|
||||
|
||||
system("cp $opt_tarball $basedir/tarball");
|
||||
|
||||
if (!chdir($basedir))
|
||||
{
|
||||
print "Do-win-build error: Could not change to $opt_builddir";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
mkdir("build");
|
||||
chdir("build");
|
||||
|
||||
system("tar -zxvf ../tarball/$mysqlver-win-src.tar.gz");
|
||||
|
||||
chdir($mysqlver);
|
||||
|
||||
system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
|
||||
|
||||
#
|
||||
# Print a help text message
|
||||
#
|
||||
sub print_help
|
||||
{
|
||||
print <<EOF;
|
||||
Usage: Do-compile-win [options] source-tarball
|
||||
|
||||
Unpacks a Windows source distribution on the local machine and
|
||||
compiles it using VC++ 6.0.
|
||||
|
||||
This script is intended for Cygwin Perl. You must have a working
|
||||
MSDEV.EXE in your path for compilation.
|
||||
|
||||
|
||||
Options:
|
||||
|
||||
--help
|
||||
Print this text.
|
||||
|
||||
--builddir=<dir>
|
||||
Set the Cygwin path to build under; the tarball will actually
|
||||
be moved to <builddir>/mysql-<version>/tarball and extracted under
|
||||
<builddir>/mysql-<version>/build.
|
||||
Default: /cygdrive/c/mysql-win-build
|
||||
|
||||
--tarball=<file>
|
||||
Windows source tarball to use for this build. Must be of the form
|
||||
mysql[com]-x.x.x-win-src.tar.gz (REQUIRED)
|
||||
|
||||
EOF
|
||||
exit 1;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2001-2003 MySQL AB
|
||||
/* Copyright (C) 2001-2004 MySQL 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
|
||||
|
@ -35,7 +35,6 @@ ulong bytes_sent = 0L, bytes_received = 0L;
|
|||
ulong mysqld_net_retry_count = 10L;
|
||||
uint test_flags = 0;
|
||||
static uint opt_protocol= 0;
|
||||
|
||||
static FILE *result_file;
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
|
@ -59,42 +58,62 @@ static short binlog_flags = 0;
|
|||
static MYSQL* mysql = NULL;
|
||||
static const char* dirname_for_local_load= 0;
|
||||
|
||||
static void dump_local_log_entries(const char* logname);
|
||||
static void dump_remote_log_entries(const char* logname);
|
||||
static void dump_log_entries(const char* logname);
|
||||
static void dump_remote_file(NET* net, const char* fname);
|
||||
static int dump_local_log_entries(const char* logname);
|
||||
static int dump_remote_log_entries(const char* logname);
|
||||
static int dump_log_entries(const char* logname);
|
||||
static int dump_remote_file(NET* net, const char* fname);
|
||||
static void die(const char* fmt, ...);
|
||||
static MYSQL* safe_connect();
|
||||
|
||||
|
||||
class Load_log_processor
|
||||
{
|
||||
char target_dir_name[MY_NFILE];
|
||||
int target_dir_name_len;
|
||||
DYNAMIC_ARRAY file_names;
|
||||
|
||||
const char *create_file(Create_file_log_event *ce);
|
||||
void append_to_file(const char* fname, int flags,
|
||||
gptr data, uint size)
|
||||
/*
|
||||
Looking for new uniquie filename that doesn't exist yet by
|
||||
adding postfix -%x
|
||||
|
||||
SYNOPSIS
|
||||
create_unique_file()
|
||||
|
||||
filename buffer for filename
|
||||
file_name_end tail of buffer that should be changed
|
||||
should point to a memory enough to printf("-%x",..)
|
||||
|
||||
RETURN VALUES
|
||||
values less than 0 - can't find new filename
|
||||
values great or equal 0 - created file with found filename
|
||||
*/
|
||||
File create_unique_file(char *filename, char *file_name_end)
|
||||
{
|
||||
File file;
|
||||
if (((file= my_open(fname,flags,MYF(MY_WME))) < 0) ||
|
||||
my_write(file,(byte*) data,size,MYF(MY_WME|MY_NABP)) ||
|
||||
my_close(file,MYF(MY_WME)))
|
||||
exit(1);
|
||||
File res;
|
||||
/* If we have to try more than 1000 times, something is seriously wrong */
|
||||
for (uint version= 0; version<1000; version++)
|
||||
{
|
||||
sprintf(file_name_end,"-%x",version);
|
||||
if ((res= my_create(filename,0,
|
||||
O_CREAT|O_EXCL|O_BINARY|O_WRONLY,MYF(0)))!=-1)
|
||||
return res;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public:
|
||||
Load_log_processor()
|
||||
{
|
||||
init_dynamic_array(&file_names,sizeof(Create_file_log_event*),
|
||||
100,100 CALLER_INFO);
|
||||
}
|
||||
|
||||
Load_log_processor() {}
|
||||
~Load_log_processor()
|
||||
{
|
||||
destroy();
|
||||
delete_dynamic(&file_names);
|
||||
}
|
||||
{
|
||||
destroy();
|
||||
delete_dynamic(&file_names);
|
||||
}
|
||||
|
||||
int init()
|
||||
{
|
||||
return init_dynamic_array(&file_names,sizeof(Create_file_log_event*),
|
||||
100,100 CALLER_INFO);
|
||||
}
|
||||
|
||||
void init_by_dir_name(const char *dir)
|
||||
{
|
||||
|
@ -131,83 +150,250 @@ public:
|
|||
*ptr= 0;
|
||||
return res;
|
||||
}
|
||||
void process(Create_file_log_event *ce)
|
||||
{
|
||||
const char *fname= create_file(ce);
|
||||
append_to_file(fname,O_CREAT|O_EXCL|O_BINARY|O_WRONLY,ce->block,
|
||||
ce->block_len);
|
||||
}
|
||||
void process(Append_block_log_event *ae)
|
||||
{
|
||||
Create_file_log_event* ce= (ae->file_id < file_names.elements) ?
|
||||
*((Create_file_log_event**)file_names.buffer + ae->file_id) : 0;
|
||||
|
||||
if (ce)
|
||||
append_to_file(ce->fname,O_APPEND|O_BINARY|O_WRONLY, ae->block,
|
||||
ae->block_len);
|
||||
else
|
||||
{
|
||||
/*
|
||||
There is no Create_file event (a bad binlog or a big
|
||||
--position). Assuming it's a big --position, we just do nothing and
|
||||
print a warning.
|
||||
*/
|
||||
fprintf(stderr,"Warning: ignoring Append_block as there is no \
|
||||
Create_file event for file_id: %u\n",ae->file_id);
|
||||
}
|
||||
}
|
||||
int process(Create_file_log_event *ce);
|
||||
int process(Append_block_log_event *ae);
|
||||
File prepare_new_file_for_old_format(Load_log_event *le, char *filename);
|
||||
int load_old_format_file(NET* net, const char *server_fname,
|
||||
uint server_fname_len, File file);
|
||||
};
|
||||
|
||||
|
||||
const char *Load_log_processor::create_file(Create_file_log_event *ce)
|
||||
|
||||
File Load_log_processor::prepare_new_file_for_old_format(Load_log_event *le,
|
||||
char *filename)
|
||||
{
|
||||
uint len;
|
||||
char *tail;
|
||||
File file;
|
||||
|
||||
fn_format(filename, le->fname, target_dir_name, "", 1);
|
||||
len= strlen(filename);
|
||||
tail= filename + len;
|
||||
|
||||
if ((file= create_unique_file(filename,tail)) < 0)
|
||||
{
|
||||
sql_print_error("Could not construct local filename %s",filename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
le->set_fname_outside_temp_buf(filename,len+strlen(tail));
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::load_old_format_file(NET* net, const char*server_fname,
|
||||
uint server_fname_len, File file)
|
||||
{
|
||||
char buf[FN_REFLEN+1];
|
||||
buf[0] = 0;
|
||||
memcpy(buf + 1, server_fname, server_fname_len + 1);
|
||||
if (my_net_write(net, buf, server_fname_len +2) || net_flush(net))
|
||||
{
|
||||
sql_print_error("Failed requesting the remote dump of %s", server_fname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
uint packet_len = my_net_read(net);
|
||||
if (packet_len == 0)
|
||||
{
|
||||
if (my_net_write(net, "", 0) || net_flush(net))
|
||||
{
|
||||
sql_print_error("Failed sending the ack packet");
|
||||
return -1;
|
||||
}
|
||||
/*
|
||||
we just need to send something, as the server will read but
|
||||
not examine the packet - this is because mysql_load() sends
|
||||
an OK when it is done
|
||||
*/
|
||||
break;
|
||||
}
|
||||
else if (packet_len == packet_error)
|
||||
{
|
||||
sql_print_error("Failed reading a packet during the dump of %s ",
|
||||
server_fname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (my_write(file, (byte*) net->read_pos, packet_len,MYF(MY_WME|MY_NABP)))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Create_file_log_event *ce)
|
||||
{
|
||||
const char *bname= ce->fname+dirname_length(ce->fname);
|
||||
uint blen= ce->fname_len - (bname-ce->fname);
|
||||
uint full_len= target_dir_name_len + blen + 9 + 9 + 1;
|
||||
uint version= 0;
|
||||
char *tmp, *ptr;
|
||||
int error= 0;
|
||||
char *fname, *ptr;
|
||||
File file;
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
|
||||
if (!(tmp= my_malloc(full_len,MYF(MY_WME))) ||
|
||||
set_dynamic(&file_names,(gptr)&ce,ce->file_id))
|
||||
if (set_dynamic(&file_names,(gptr)&ce,ce->file_id))
|
||||
{
|
||||
die("Could not construct local filename %s%s",target_dir_name,bname);
|
||||
return 0;
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name,bname);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (!(fname= my_malloc(full_len,MYF(MY_WME))))
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
memcpy(tmp, target_dir_name, target_dir_name_len);
|
||||
ptr= tmp+ target_dir_name_len;
|
||||
memcpy(fname, target_dir_name, target_dir_name_len);
|
||||
ptr= fname + target_dir_name_len;
|
||||
memcpy(ptr,bname,blen);
|
||||
ptr+= blen;
|
||||
ptr+= my_sprintf(ptr,(ptr,"-%x",ce->file_id));
|
||||
|
||||
/*
|
||||
Note that this code has a possible race condition if there was was
|
||||
many simultaneous clients running which tried to create files at the same
|
||||
time. Fortunately this should never be the case.
|
||||
|
||||
A better way to do this would be to use 'create_tmp_file() and avoid this
|
||||
race condition altogether on the expense of getting more cryptic file
|
||||
names.
|
||||
*/
|
||||
for (;;)
|
||||
if ((file= create_unique_file(fname,ptr)) < 0)
|
||||
{
|
||||
sprintf(ptr,"-%x",version);
|
||||
if (access(tmp,F_OK))
|
||||
break;
|
||||
/* If we have to try more than 1000 times, something is seriously wrong */
|
||||
if (version++ > 1000)
|
||||
{
|
||||
die("Could not construct local filename %s%s",target_dir_name,bname);
|
||||
return 0;
|
||||
}
|
||||
sql_print_error("Could not construct local filename %s%s",
|
||||
target_dir_name,bname);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
ce->set_fname_outside_temp_buf(tmp,strlen(tmp));
|
||||
return tmp;
|
||||
ce->set_fname_outside_temp_buf(fname,strlen(fname));
|
||||
|
||||
if (my_write(file,(byte*) ce->block,ce->block_len,MYF(MY_WME|MY_NABP)))
|
||||
error= -1;
|
||||
if (my_close(file, MYF(MY_WME)))
|
||||
error= -1;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
int Load_log_processor::process(Append_block_log_event *ae)
|
||||
{
|
||||
DBUG_ENTER("Load_log_processor::process");
|
||||
Create_file_log_event* ce= ((ae->file_id < file_names.elements) ?
|
||||
*((Create_file_log_event**)file_names.buffer +
|
||||
ae->file_id) :
|
||||
0);
|
||||
|
||||
if (ce)
|
||||
{
|
||||
File file;
|
||||
int error= 0;
|
||||
if (((file= my_open(ce->fname,
|
||||
O_APPEND|O_BINARY|O_WRONLY,MYF(MY_WME))) < 0))
|
||||
DBUG_RETURN(-1);
|
||||
if (my_write(file,(byte*)ae->block,ae->block_len,MYF(MY_WME|MY_NABP)))
|
||||
error= -1;
|
||||
if (my_close(file,MYF(MY_WME)))
|
||||
error= -1;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
/*
|
||||
There is no Create_file event (a bad binlog or a big
|
||||
--position). Assuming it's a big --position, we just do nothing and
|
||||
print a warning.
|
||||
*/
|
||||
fprintf(stderr,"Warning: ignoring Append_block as there is no \
|
||||
Create_file event for file_id: %u\n",ae->file_id);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
|
||||
Load_log_processor load_processor;
|
||||
|
||||
|
||||
int process_event(ulonglong *rec_count, char *last_db, Log_event *ev,
|
||||
my_off_t pos, int old_format)
|
||||
{
|
||||
char ll_buff[21];
|
||||
DBUG_ENTER("process_event");
|
||||
|
||||
if ((*rec_count) >= offset)
|
||||
{
|
||||
if (!short_form)
|
||||
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
|
||||
|
||||
switch (ev->get_type_code()) {
|
||||
case QUERY_EVENT:
|
||||
if (one_database)
|
||||
{
|
||||
const char * log_dbname = ((Query_log_event*)ev)->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
goto end;
|
||||
}
|
||||
ev->print(result_file, short_form, last_db);
|
||||
break;
|
||||
case CREATE_FILE_EVENT:
|
||||
{
|
||||
Create_file_log_event* ce= (Create_file_log_event*)ev;
|
||||
if (one_database)
|
||||
{
|
||||
/*
|
||||
We test if this event has to be ignored. If yes, we don't save
|
||||
this event; this will have the good side-effect of ignoring all
|
||||
related Append_block and Exec_load.
|
||||
Note that Load event from 3.23 is not tested.
|
||||
*/
|
||||
const char * log_dbname = ce->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
goto end; // Next event
|
||||
}
|
||||
/*
|
||||
We print the event, but with a leading '#': this is just to inform
|
||||
the user of the original command; the command we want to execute
|
||||
will be a derivation of this original command (we will change the
|
||||
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
|
||||
below.
|
||||
*/
|
||||
ce->print(result_file, short_form, last_db, TRUE);
|
||||
if (!old_format)
|
||||
{
|
||||
if (load_processor.process(ce))
|
||||
break; // Error
|
||||
ev= 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case APPEND_BLOCK_EVENT:
|
||||
ev->print(result_file, short_form, last_db);
|
||||
if (load_processor.process((Append_block_log_event*) ev))
|
||||
break; // Error
|
||||
break;
|
||||
case EXEC_LOAD_EVENT:
|
||||
{
|
||||
ev->print(result_file, short_form, last_db);
|
||||
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
|
||||
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
|
||||
/*
|
||||
if ce is 0, it probably means that we have not seen the Create_file
|
||||
event (a bad binlog, or most probably --position is after the
|
||||
Create_file event). Print a warning comment.
|
||||
*/
|
||||
if (ce)
|
||||
{
|
||||
ce->print(result_file, short_form, last_db, TRUE);
|
||||
my_free((char*)ce->fname,MYF(MY_WME));
|
||||
delete ce;
|
||||
}
|
||||
else
|
||||
fprintf(stderr,"Warning: ignoring Exec_load as there is no \
|
||||
Create_file event for file_id: %u\n",exv->file_id);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ev->print(result_file, short_form, last_db);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
(*rec_count)++;
|
||||
if (ev)
|
||||
delete ev;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
|
@ -247,7 +433,7 @@ static struct my_option my_long_options[] =
|
|||
(gptr*) &short_form, (gptr*) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"socket", 'S', "Socket file to use for connection.",
|
||||
(gptr*) &sock, (gptr*) &sock, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
(gptr*) &sock, (gptr*) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"user", 'u', "Connect to the remote server as username.",
|
||||
(gptr*) &user, (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
|
@ -274,6 +460,10 @@ void sql_print_error(const char *format,...)
|
|||
static void cleanup()
|
||||
{
|
||||
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) database, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) host, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) user, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free((char*) dirname_for_local_load, MYF(MY_ALLOW_ZERO_PTR));
|
||||
}
|
||||
|
||||
static void die(const char* fmt, ...)
|
||||
|
@ -285,12 +475,13 @@ static void die(const char* fmt, ...)
|
|||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
cleanup();
|
||||
my_end(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void print_version()
|
||||
{
|
||||
printf("%s Ver 2.5 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
|
||||
printf("%s Ver 3.0 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -309,37 +500,6 @@ the mysql command line client\n\n");
|
|||
my_print_variables(my_long_options);
|
||||
}
|
||||
|
||||
static void dump_remote_file(NET* net, const char* fname)
|
||||
{
|
||||
char buf[FN_REFLEN+1];
|
||||
uint len = (uint) strlen(fname);
|
||||
buf[0] = 0;
|
||||
memcpy(buf + 1, fname, len + 1);
|
||||
if(my_net_write(net, buf, len +2) || net_flush(net))
|
||||
die("Failed requesting the remote dump of %s", fname);
|
||||
for(;;)
|
||||
{
|
||||
uint packet_len = my_net_read(net);
|
||||
if(packet_len == 0)
|
||||
{
|
||||
if(my_net_write(net, "", 0) || net_flush(net))
|
||||
die("Failed sending the ack packet");
|
||||
|
||||
// we just need to send something, as the server will read but
|
||||
// not examine the packet - this is because mysql_load() sends an OK when it is done
|
||||
break;
|
||||
}
|
||||
else if(packet_len == packet_error)
|
||||
die("Failed reading a packet during the dump of %s ", fname);
|
||||
|
||||
if(!short_form)
|
||||
(void)my_fwrite(result_file, (byte*) net->read_pos, packet_len,MYF(0));
|
||||
}
|
||||
|
||||
fflush(result_file);
|
||||
}
|
||||
|
||||
|
||||
extern "C" my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
|
@ -425,14 +585,15 @@ static MYSQL* safe_connect()
|
|||
return local_mysql;
|
||||
}
|
||||
|
||||
static void dump_log_entries(const char* logname)
|
||||
|
||||
static int dump_log_entries(const char* logname)
|
||||
{
|
||||
if (remote_opt)
|
||||
dump_remote_log_entries(logname);
|
||||
else
|
||||
dump_local_log_entries(logname);
|
||||
return dump_remote_log_entries(logname);
|
||||
return dump_local_log_entries(logname);
|
||||
}
|
||||
|
||||
|
||||
static int check_master_version(MYSQL* mysql)
|
||||
{
|
||||
MYSQL_RES* res = 0;
|
||||
|
@ -481,13 +642,15 @@ static int check_master_version(MYSQL* mysql)
|
|||
}
|
||||
|
||||
|
||||
static void dump_remote_log_entries(const char* logname)
|
||||
static int dump_remote_log_entries(const char* logname)
|
||||
{
|
||||
char buf[128];
|
||||
char last_db[FN_REFLEN+1] = "";
|
||||
uint len;
|
||||
NET* net = &mysql->net;
|
||||
int old_format;
|
||||
DBUG_ENTER("dump_remote_log_entries");
|
||||
|
||||
old_format = check_master_version(mysql);
|
||||
|
||||
if (!position)
|
||||
|
@ -495,7 +658,7 @@ static void dump_remote_log_entries(const char* logname)
|
|||
if (position < BIN_LOG_HEADER_SIZE)
|
||||
{
|
||||
position = BIN_LOG_HEADER_SIZE;
|
||||
// warn the guity
|
||||
// warn the user
|
||||
sql_print_error("Warning: The position in the binary log can't be less than %d.\nStarting from position %d\n", BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE);
|
||||
}
|
||||
int4store(buf, position);
|
||||
|
@ -504,30 +667,76 @@ static void dump_remote_log_entries(const char* logname)
|
|||
int4store(buf + 6, 0);
|
||||
memcpy(buf + 10, logname,len);
|
||||
if (simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
|
||||
die("Error sending the log dump command");
|
||||
{
|
||||
fprintf(stderr,"Got fatal error sending the log dump command\n");
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
my_off_t old_off= 0;
|
||||
ulonglong rec_count= 0;
|
||||
char fname[FN_REFLEN+1];
|
||||
|
||||
for (;;)
|
||||
{
|
||||
const char *error;
|
||||
len = net_safe_read(mysql);
|
||||
if (len == packet_error)
|
||||
die("Error reading packet from server: %s", mysql_error(mysql));
|
||||
{
|
||||
fprintf(stderr, "Got error reading packet from server: %s\n",
|
||||
mysql_error(mysql));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (len < 8 && net->read_pos[0] == 254)
|
||||
break; // end of data
|
||||
DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n",
|
||||
len, net->read_pos[5]));
|
||||
Log_event *ev = Log_event::read_log_event((const char*) net->read_pos + 1 ,
|
||||
len - 1, &error, old_format);
|
||||
if (ev)
|
||||
if (!ev)
|
||||
{
|
||||
ev->print(result_file, short_form, last_db);
|
||||
if (ev->get_type_code() == LOAD_EVENT)
|
||||
dump_remote_file(net, ((Load_log_event*)ev)->fname);
|
||||
delete ev;
|
||||
fprintf(stderr, "Could not construct log event object\n");
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
Log_event_type type= ev->get_type_code();
|
||||
if (!old_format || ( type != LOAD_EVENT && type != CREATE_FILE_EVENT))
|
||||
{
|
||||
if (process_event(&rec_count,last_db,ev,old_off,old_format))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
else
|
||||
die("Could not construct log event object");
|
||||
{
|
||||
Load_log_event *le= (Load_log_event*)ev;
|
||||
const char *old_fname= le->fname;
|
||||
uint old_len= le->fname_len;
|
||||
File file;
|
||||
|
||||
if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
if (process_event(&rec_count,last_db,ev,old_off,old_format))
|
||||
{
|
||||
my_close(file,MYF(MY_WME));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
if (load_processor.load_old_format_file(net,old_fname,old_len,file))
|
||||
{
|
||||
my_close(file,MYF(MY_WME));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
my_close(file,MYF(MY_WME));
|
||||
}
|
||||
|
||||
/*
|
||||
Let's adjust offset for remote log as for local log to produce
|
||||
similar text..
|
||||
*/
|
||||
if (old_off)
|
||||
old_off+= len-1;
|
||||
else
|
||||
old_off= BIN_LOG_HEADER_SIZE;
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -536,6 +745,7 @@ static int check_header(IO_CACHE* file)
|
|||
byte header[BIN_LOG_HEADER_SIZE];
|
||||
byte buf[PROBE_HEADER_LEN];
|
||||
int old_format=0;
|
||||
DBUG_ENTER("check_header");
|
||||
|
||||
my_off_t pos = my_b_tell(file);
|
||||
my_b_seek(file, (my_off_t)0);
|
||||
|
@ -553,11 +763,11 @@ static int check_header(IO_CACHE* file)
|
|||
}
|
||||
}
|
||||
my_b_seek(file, pos);
|
||||
return old_format;
|
||||
DBUG_RETURN(old_format);
|
||||
}
|
||||
|
||||
|
||||
static void dump_local_log_entries(const char* logname)
|
||||
static int dump_local_log_entries(const char* logname)
|
||||
{
|
||||
File fd = -1;
|
||||
IO_CACHE cache,*file= &cache;
|
||||
|
@ -565,23 +775,27 @@ static void dump_local_log_entries(const char* logname)
|
|||
char last_db[FN_REFLEN+1];
|
||||
byte tmp_buff[BIN_LOG_HEADER_SIZE];
|
||||
bool old_format = 0;
|
||||
int error= 0;
|
||||
|
||||
last_db[0]=0;
|
||||
last_db[0]= 0;
|
||||
|
||||
if (logname && logname[0] != '-')
|
||||
{
|
||||
if ((fd = my_open(logname, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0)
|
||||
exit(1);
|
||||
return 1;
|
||||
if (init_io_cache(file, fd, 0, READ_CACHE, (my_off_t) position, 0,
|
||||
MYF(MY_WME | MY_NABP)))
|
||||
{
|
||||
my_close(fd, MYF(MY_WME));
|
||||
exit(1);
|
||||
}
|
||||
old_format = check_header(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (init_io_cache(file, fileno(result_file), 0, READ_CACHE, (my_off_t) 0,
|
||||
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
|
||||
exit(1);
|
||||
return 1;
|
||||
old_format = check_header(file);
|
||||
if (position)
|
||||
{
|
||||
|
@ -592,7 +806,10 @@ static void dump_local_log_entries(const char* logname)
|
|||
{
|
||||
tmp=min(length,sizeof(buff));
|
||||
if (my_b_read(file, buff, (uint) tmp))
|
||||
exit(1);
|
||||
{
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
file->pos_in_file=position;
|
||||
|
@ -600,7 +817,15 @@ static void dump_local_log_entries(const char* logname)
|
|||
}
|
||||
|
||||
if (!position)
|
||||
my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE); // Skip header
|
||||
{
|
||||
// Skip header
|
||||
if (my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE))
|
||||
{
|
||||
error= 1;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
char llbuff[21];
|
||||
|
@ -610,105 +835,38 @@ static void dump_local_log_entries(const char* logname)
|
|||
if (!ev)
|
||||
{
|
||||
if (file->error)
|
||||
die("\
|
||||
Could not read entry at offset %s : Error in log format or read error",
|
||||
llstr(old_off,llbuff));
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Could not read entry at offset %s:"
|
||||
"Error in log format or read error\n",
|
||||
llstr(old_off,llbuff));
|
||||
error= 1;
|
||||
}
|
||||
// file->error == 0 means EOF, that's OK, we break in this case
|
||||
break;
|
||||
}
|
||||
if (rec_count >= offset)
|
||||
if (process_event(&rec_count,last_db,ev,old_off,false))
|
||||
{
|
||||
if (!short_form)
|
||||
fprintf(result_file, "# at %s\n",llstr(old_off,llbuff));
|
||||
|
||||
switch (ev->get_type_code()) {
|
||||
case QUERY_EVENT:
|
||||
if (one_database)
|
||||
{
|
||||
const char * log_dbname = ((Query_log_event*)ev)->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
{
|
||||
rec_count++;
|
||||
delete ev;
|
||||
continue; // next
|
||||
}
|
||||
}
|
||||
ev->print(result_file, short_form, last_db);
|
||||
break;
|
||||
case CREATE_FILE_EVENT:
|
||||
{
|
||||
Create_file_log_event* ce= (Create_file_log_event*)ev;
|
||||
if (one_database)
|
||||
{
|
||||
/*
|
||||
We test if this event has to be ignored. If yes, we don't save this
|
||||
event; this will have the good side-effect of ignoring all related
|
||||
Append_block and Exec_load.
|
||||
Note that Load event from 3.23 is not tested.
|
||||
*/
|
||||
const char * log_dbname = ce->db;
|
||||
if ((log_dbname != NULL) && (strcmp(log_dbname, database)))
|
||||
{
|
||||
rec_count++;
|
||||
delete ev;
|
||||
continue; // next
|
||||
}
|
||||
}
|
||||
/*
|
||||
We print the event, but with a leading '#': this is just to inform
|
||||
the user of the original command; the command we want to execute
|
||||
will be a derivation of this original command (we will change the
|
||||
filename and use LOCAL), prepared in the 'case EXEC_LOAD_EVENT'
|
||||
below.
|
||||
*/
|
||||
ce->print(result_file, short_form, last_db, true);
|
||||
load_processor.process(ce);
|
||||
ev= 0;
|
||||
break;
|
||||
}
|
||||
case APPEND_BLOCK_EVENT:
|
||||
ev->print(result_file, short_form, last_db);
|
||||
load_processor.process((Append_block_log_event*)ev);
|
||||
break;
|
||||
case EXEC_LOAD_EVENT:
|
||||
{
|
||||
ev->print(result_file, short_form, last_db);
|
||||
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
|
||||
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
|
||||
/*
|
||||
if ce is 0, it probably means that we have not seen the Create_file
|
||||
event (a bad binlog, or most probably --position is after the
|
||||
Create_file event). Print a warning comment.
|
||||
*/
|
||||
if (ce)
|
||||
{
|
||||
ce->print(result_file, short_form, last_db,true);
|
||||
my_free((char*)ce->fname,MYF(MY_WME));
|
||||
delete ce;
|
||||
}
|
||||
else
|
||||
fprintf(stderr,"Warning: ignoring Exec_load as there is no \
|
||||
Create_file event for file_id: %u\n",exv->file_id);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ev->print(result_file, short_form, last_db);
|
||||
}
|
||||
error= 1;
|
||||
break;
|
||||
}
|
||||
rec_count++;
|
||||
if (ev)
|
||||
delete ev;
|
||||
}
|
||||
|
||||
end:
|
||||
if (fd >= 0)
|
||||
my_close(fd, MYF(MY_WME));
|
||||
end_io_cache(file);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
static char **defaults_argv;
|
||||
int exit_value;
|
||||
MY_INIT(argv[0]);
|
||||
DBUG_ENTER("main");
|
||||
DBUG_PROCESS(argv[0]);
|
||||
|
||||
parse_args(&argc, (char***)&argv);
|
||||
defaults_argv=argv;
|
||||
|
@ -717,7 +875,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
usage();
|
||||
free_defaults(defaults_argv);
|
||||
return -1;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (remote_opt)
|
||||
|
@ -732,13 +890,23 @@ int main(int argc, char** argv)
|
|||
dirname_for_local_load= my_tmpdir(&tmpdir);
|
||||
}
|
||||
|
||||
if (load_processor.init())
|
||||
exit(1);
|
||||
if (dirname_for_local_load)
|
||||
load_processor.init_by_dir_name(dirname_for_local_load);
|
||||
else
|
||||
load_processor.init_by_cur_dir();
|
||||
|
||||
exit_value= 0;
|
||||
while (--argc >= 0)
|
||||
dump_log_entries(*(argv++));
|
||||
{
|
||||
if (dump_log_entries(*(argv++)))
|
||||
{
|
||||
exit_value=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmpdir.list)
|
||||
free_tmpdir(&tmpdir);
|
||||
if (result_file != stdout)
|
||||
|
@ -748,7 +916,8 @@ int main(int argc, char** argv)
|
|||
cleanup();
|
||||
free_defaults(defaults_argv);
|
||||
my_end(0);
|
||||
return 0;
|
||||
exit(exit_value);
|
||||
DBUG_RETURN(exit_value); // Keep compilers happy
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -185,7 +185,10 @@ static struct my_option my_long_options[] =
|
|||
{"first-slave", 'x', "Locks all tables across all databases.",
|
||||
(gptr*) &opt_first_slave, (gptr*) &opt_first_slave, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"flush-logs", 'F', "Flush logs file in server before starting dump.",
|
||||
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
|
||||
"Note that if you dump many databases at once (using the option "
|
||||
"--databases= or --all-databases), the logs will be flushed for "
|
||||
"each database dumped.",
|
||||
(gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"force", 'f', "Continue even if we get an sql-error.",
|
||||
|
@ -1721,7 +1724,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||
if (opt_xml)
|
||||
fputs("</database>\n", md_result_file);
|
||||
if (lock_tables)
|
||||
mysql_query(sock,"UNLOCK_TABLES");
|
||||
mysql_query(sock,"UNLOCK TABLES");
|
||||
return 0;
|
||||
} /* dump_selected_tables */
|
||||
|
||||
|
|
|
@ -441,10 +441,10 @@ static void free_used_memory()
|
|||
my_free((gptr) (*q),MYF(0));
|
||||
}
|
||||
for (i=0; i < 10; i++)
|
||||
{
|
||||
if (var_reg[i].alloced_len)
|
||||
my_free(var_reg[i].str_val, MYF(MY_WME));
|
||||
}
|
||||
{
|
||||
if (var_reg[i].alloced_len)
|
||||
my_free(var_reg[i].str_val, MYF(MY_WME));
|
||||
}
|
||||
while (embedded_server_arg_count > 1)
|
||||
my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
|
||||
delete_dynamic(&q_lines);
|
||||
|
|
554
config.guess
vendored
554
config.guess
vendored
|
@ -1,9 +1,9 @@
|
|||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-08-21'
|
||||
timestamp='2003-07-02'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
@ -24,8 +24,9 @@ timestamp='2001-08-21'
|
|||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
|
@ -87,30 +88,42 @@ if test $# != 0; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
trap 'exit 1' 1 2 15
|
||||
|
||||
dummy=dummy-$$
|
||||
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
|
||||
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
|
||||
# compiler to aid in system detection is discouraged as it requires
|
||||
# temporary files to be created and, as you can see below, it is a
|
||||
# headache to deal with in a portable fashion.
|
||||
|
||||
# CC_FOR_BUILD -- compiler used by this script.
|
||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
||||
# use `HOST_CC' if defined, but it is deprecated.
|
||||
|
||||
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int dummy(){}" > $dummy.c ;
|
||||
for c in cc gcc c89 ; do
|
||||
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
|
||||
if test $? = 0 ; then
|
||||
# Portable tmp directory creation inspired by the Autoconf team.
|
||||
|
||||
set_cc_for_build='
|
||||
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
|
||||
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
||||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
dummy=$tmp/dummy ;
|
||||
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
case $CC_FOR_BUILD,$HOST_CC,$CC in
|
||||
,,) echo "int x;" > $dummy.c ;
|
||||
for c in cc gcc c89 c99 ; do
|
||||
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
|
||||
CC_FOR_BUILD="$c"; break ;
|
||||
fi ;
|
||||
done ;
|
||||
rm -f $dummy.c $dummy.o $dummy.rel ;
|
||||
if test x"$CC_FOR_BUILD" = x ; then
|
||||
CC_FOR_BUILD=no_compiler_found ;
|
||||
fi
|
||||
;;
|
||||
,,*) CC_FOR_BUILD=$CC ;;
|
||||
,*,*) CC_FOR_BUILD=$HOST_CC ;;
|
||||
esac'
|
||||
esac ;'
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 1994-08-24)
|
||||
|
@ -136,29 +149,30 @@ esac
|
|||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# Netbsd (nbsd) targets should (where applicable) match one or
|
||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
# compatibility and a consistent mechanism for selecting the
|
||||
# object file format.
|
||||
# Determine the machine/vendor (is the vendor relevant).
|
||||
case "${UNAME_MACHINE}" in
|
||||
amiga) machine=m68k-unknown ;;
|
||||
arm32) machine=arm-unknown ;;
|
||||
atari*) machine=m68k-atari ;;
|
||||
sun3*) machine=m68k-sun ;;
|
||||
mac68k) machine=m68k-apple ;;
|
||||
macppc) machine=powerpc-apple ;;
|
||||
hp3[0-9][05]) machine=m68k-hp ;;
|
||||
ibmrt|romp-ibm) machine=romp-ibm ;;
|
||||
*) machine=${UNAME_MACHINE}-unknown ;;
|
||||
#
|
||||
# Note: NetBSD doesn't particularly care about the vendor
|
||||
# portion of the name. We always set it to "unknown".
|
||||
sysctl="sysctl -n hw.machine_arch"
|
||||
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
|
||||
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
|
||||
case "${UNAME_MACHINE_ARCH}" in
|
||||
armeb) machine=armeb-unknown ;;
|
||||
arm*) machine=arm-unknown ;;
|
||||
sh3el) machine=shl-unknown ;;
|
||||
sh3eb) machine=sh-unknown ;;
|
||||
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
|
||||
esac
|
||||
# The Operating System including object format, if it has switched
|
||||
# to ELF recently, or will in the future.
|
||||
case "${UNAME_MACHINE}" in
|
||||
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
|
||||
case "${UNAME_MACHINE_ARCH}" in
|
||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
|
@ -175,75 +189,112 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
;;
|
||||
esac
|
||||
# The OS release
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
# Debian GNU/NetBSD machines have a different userland, and
|
||||
# thus, need a distinct triplet. However, they do not need
|
||||
# kernel version information, so it can be replaced with a
|
||||
# suitable tag, in the style of linux-gnu.
|
||||
case "${UNAME_VERSION}" in
|
||||
Debian*)
|
||||
release='-gnu'
|
||||
;;
|
||||
*)
|
||||
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
;;
|
||||
esac
|
||||
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
|
||||
# contains redundant information, the shorter form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvmeppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mipseb-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
||||
# covers most systems running today. This code pipes the CPU
|
||||
# types through head -n 1, so we only detect the type of CPU 0.
|
||||
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
|
||||
case "$ALPHA_CPU_TYPE" in
|
||||
"EV4 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV4.5 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"LCA4 (21066/21068)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV5 (21164)")
|
||||
UNAME_MACHINE="alphaev5" ;;
|
||||
"EV5.6 (21164A)")
|
||||
UNAME_MACHINE="alphaev56" ;;
|
||||
"EV5.6 (21164PC)")
|
||||
UNAME_MACHINE="alphapca56" ;;
|
||||
"EV5.7 (21164PC)")
|
||||
UNAME_MACHINE="alphapca57" ;;
|
||||
"EV6 (21264)")
|
||||
UNAME_MACHINE="alphaev6" ;;
|
||||
"EV6.7 (21264A)")
|
||||
UNAME_MACHINE="alphaev67" ;;
|
||||
"EV6.8CB (21264C)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8AL (21264B)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8CX (21264D)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.9A (21264/EV69A)")
|
||||
UNAME_MACHINE="alphaev69" ;;
|
||||
"EV7 (21364)")
|
||||
UNAME_MACHINE="alphaev7" ;;
|
||||
"EV7.9 (21364A)")
|
||||
UNAME_MACHINE="alphaev79" ;;
|
||||
esac
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
case `./$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
rm -f $dummy.s $dummy
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha*:OpenVMS:*:*)
|
||||
echo alpha-hp-vms
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
|
@ -256,29 +307,11 @@ EOF
|
|||
Amiga*:UNIX_System_V:4.0:*)
|
||||
echo m68k-unknown-sysv4
|
||||
exit 0;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:[Aa]miga[Oo][Ss]:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-amigaos
|
||||
exit 0 ;;
|
||||
arc64:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hkmips:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sgi:OpenBSD:*:*)
|
||||
echo mips-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
*:[Mm]orph[Oo][Ss]:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-morphos
|
||||
exit 0 ;;
|
||||
*:OS/390:*:*)
|
||||
echo i370-ibm-openedition
|
||||
|
@ -300,6 +333,13 @@ EOF
|
|||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
DRS?6000:unix:4.0:6*)
|
||||
echo sparc-icl-nx6
|
||||
exit 0 ;;
|
||||
DRS?6000:UNIX_SV:4.2*:7*)
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7 && exit 0 ;;
|
||||
esac ;;
|
||||
sun4H:SunOS:5.*:*)
|
||||
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
|
@ -328,7 +368,7 @@ EOF
|
|||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun*:*:4.2BSD:*)
|
||||
UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
|
||||
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
|
||||
case "`/bin/arch`" in
|
||||
sun3)
|
||||
|
@ -342,12 +382,6 @@ EOF
|
|||
aushp:SunOS:*:*)
|
||||
echo sparc-auspex-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sparc*:NetBSD:*)
|
||||
echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
# The situation for MiNT is a little confusing. The machine name
|
||||
# can be virtually everything (everything which is not
|
||||
# "atarist" or "atariste" at least should have a processor
|
||||
|
@ -374,18 +408,6 @@ EOF
|
|||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -402,6 +424,7 @@ EOF
|
|||
echo clipper-intergraph-clix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:*:UMIPS | mips:*:*:RISCos)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
|
@ -423,16 +446,20 @@ EOF
|
|||
exit (-1);
|
||||
}
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy \
|
||||
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c \
|
||||
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
|
||||
&& exit 0
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Motorola:PowerMAX_OS:*:*)
|
||||
echo powerpc-motorola-powermax
|
||||
exit 0 ;;
|
||||
Motorola:*:4.3:PL8-*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
|
||||
echo powerpc-harris-powermax
|
||||
exit 0 ;;
|
||||
Night_Hawk:Power_UNIX:*:*)
|
||||
echo powerpc-harris-powerunix
|
||||
exit 0 ;;
|
||||
|
@ -493,6 +520,7 @@ EOF
|
|||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
|
@ -504,9 +532,7 @@ EOF
|
|||
exit(0);
|
||||
}
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
|
@ -515,7 +541,7 @@ EOF
|
|||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:[45])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
|
@ -555,10 +581,8 @@ EOF
|
|||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/[678][0-9][0-9])
|
||||
case "${HPUX_REV}" in
|
||||
11.[0-9][0-9])
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
|
@ -567,12 +591,13 @@ EOF
|
|||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
|
||||
esac ;;
|
||||
esac
|
||||
fi ;;
|
||||
esac
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
fi
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
|
@ -605,12 +630,21 @@ EOF
|
|||
exit (0);
|
||||
}
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
|
||||
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
|
||||
rm -f $dummy.c $dummy
|
||||
fi ;;
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
fi ;;
|
||||
esac
|
||||
if [ ${HP_ARCH} = "hppa2.0w" ]
|
||||
then
|
||||
# avoid double evaluation of $set_cc_for_build
|
||||
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
HP_ARCH="hppa64"
|
||||
fi
|
||||
fi
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
ia64:HP-UX:*:*)
|
||||
|
@ -618,6 +652,7 @@ EOF
|
|||
echo ia64-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
|
@ -643,9 +678,7 @@ EOF
|
|||
exit (0);
|
||||
}
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
|
@ -673,9 +706,6 @@ EOF
|
|||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
hppa*:OpenBSD:*:*)
|
||||
echo hppa-unknown-openbsd
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
|
@ -694,9 +724,6 @@ EOF
|
|||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
|
@ -709,27 +736,21 @@ EOF
|
|||
CRAY*TS:*:*:*)
|
||||
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3D:*:*:*)
|
||||
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*T3E:*:*:*)
|
||||
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY*SV1:*:*:*)
|
||||
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
*:UNICOS/mp:*:*)
|
||||
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -739,11 +760,22 @@ EOF
|
|||
*:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
*:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
|
||||
# Determine whether the default compiler uses glibc.
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
# GNU/FreeBSD systems have a "k" prefix to indicate we are using
|
||||
# FreeBSD's kernel, but not the complete OS.
|
||||
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
||||
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
|
@ -754,11 +786,17 @@ EOF
|
|||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit 0 ;;
|
||||
x86:Interix*:[34]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit 0 ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit 0 ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
# UNAME_MACHINE based on the output of uname instead of i386?
|
||||
echo i386-pc-interix
|
||||
echo i586-pc-interix
|
||||
exit 0 ;;
|
||||
i*:UWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
|
@ -778,6 +816,9 @@ EOF
|
|||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux
|
||||
exit 0 ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
|
@ -785,19 +826,48 @@ EOF
|
|||
echo ${UNAME_MACHINE}-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
mips:Linux:*:*)
|
||||
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
|
||||
big) echo mips-${VENDOR}-linux && exit 0 ;;
|
||||
little) echo mipsel-${VENDOR}-linux && exit 0 ;;
|
||||
esac
|
||||
case `sed -n '/^system type/s/^.*: \([^ ]*\).*/\1/p' < /proc/cpuinfo` in
|
||||
SGI|sgi) echo mips-${VENDOR}-linux-gnu && exit 0 ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
|
||||
;;
|
||||
ppc:Linux:*:*|ppc64:Linux:*:*)
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
|
||||
test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
|
||||
;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
echo powerpc64-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
|
@ -810,7 +880,7 @@ EOF
|
|||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
|
||||
exit 0 ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
|
@ -827,6 +897,9 @@ EOF
|
|||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit 0 ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-${VENDOR}-linux
|
||||
exit 0 ;;
|
||||
|
@ -840,7 +913,8 @@ EOF
|
|||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
ld_supported_targets=`cd /; ld --help 2>&1 \
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
|
@ -852,7 +926,7 @@ EOF
|
|||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
|
||||
exit 0 ;;
|
||||
exit 0 ;;
|
||||
coff-i386)
|
||||
echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
|
||||
exit 0 ;;
|
||||
|
@ -863,33 +937,29 @@ EOF
|
|||
exit 0 ;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >$dummy.c <<EOF
|
||||
#include <features.h>
|
||||
#ifdef __cplusplus
|
||||
#include <stdio.h> /* for printf() prototype */
|
||||
int main (int argc, char *argv[]) {
|
||||
#else
|
||||
int main (argc, argv) int argc; char *argv[]; {
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-${VENDOR}-linux\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-${VENDOR}-linuxaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#ifdef __INTEL_COMPILER
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
|
||||
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
|
@ -906,6 +976,23 @@ EOF
|
|||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
exit 0 ;;
|
||||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
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
|
||||
|
@ -927,22 +1014,19 @@ EOF
|
|||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
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_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
|
||||
&& UNAME_MACHINE=i586
|
||||
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
|
||||
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
|
||||
&& UNAME_MACHINE=i686
|
||||
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-pc-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
i*86:*DOS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msdosdjgpp
|
||||
exit 0 ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
|
@ -966,9 +1050,15 @@ EOF
|
|||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
mc68k:UNIX:SYSTEM5:3.51m)
|
||||
echo m68k-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680?0:D-NIX:5.3:*)
|
||||
echo m68k-diab-dnix
|
||||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
|
@ -985,9 +1075,6 @@ EOF
|
|||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.*:*)
|
||||
echo sparc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -1059,6 +1146,9 @@ EOF
|
|||
SX-5:SUPER-UX:*:*)
|
||||
echo sx5-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
SX-6:SUPER-UX:*:*)
|
||||
echo sx6-nec-superux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
Power*:Rhapsody:*:*)
|
||||
echo powerpc-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -1066,18 +1156,24 @@ EOF
|
|||
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:Darwin:*:*)
|
||||
echo `uname -p`-apple-darwin${UNAME_RELEASE}
|
||||
case `uname -p` in
|
||||
*86) UNAME_PROCESSOR=i686 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
if test "${UNAME_MACHINE}" = "x86pc"; then
|
||||
UNAME_PROCESSOR=`uname -p`
|
||||
if test "$UNAME_PROCESSOR" = "x86"; then
|
||||
UNAME_PROCESSOR=i386
|
||||
UNAME_MACHINE=pc
|
||||
fi
|
||||
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
|
||||
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-[KW]:NONSTOP_KERNEL:*:*)
|
||||
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:NonStop-UX:*:*)
|
||||
|
@ -1100,11 +1196,6 @@ EOF
|
|||
fi
|
||||
echo ${UNAME_MACHINE}-unknown-plan9
|
||||
exit 0 ;;
|
||||
i*86:OS/2:*:*)
|
||||
# If we were able to find `uname', then EMX Unix compatibility
|
||||
# is probably installed.
|
||||
echo ${UNAME_MACHINE}-pc-os2-emx
|
||||
exit 0 ;;
|
||||
*:TOPS-10:*:*)
|
||||
echo pdp10-unknown-tops10
|
||||
exit 0 ;;
|
||||
|
@ -1123,14 +1214,15 @@ EOF
|
|||
*:ITS:*:*)
|
||||
echo pdp10-unknown-its
|
||||
exit 0 ;;
|
||||
i*86:XTS-300:*:STOP)
|
||||
echo ${UNAME_MACHINE}-unknown-stop
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
|
@ -1245,9 +1337,7 @@ main ()
|
|||
}
|
||||
EOF
|
||||
|
||||
eval $set_cc_for_build
|
||||
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
|
||||
rm -f $dummy.c $dummy
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
|
|
303
config.sub
vendored
303
config.sub
vendored
|
@ -1,9 +1,9 @@
|
|||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2001-08-13'
|
||||
timestamp='2003-07-04'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
|
@ -29,7 +29,8 @@ timestamp='2001-08-13'
|
|||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
|
@ -117,7 +118,7 @@ esac
|
|||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
|
||||
nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
|
@ -226,31 +227,44 @@ case $basic_machine in
|
|||
1750a | 580 \
|
||||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dsp16xx \
|
||||
| fr30 \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
|
||||
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
|
||||
| mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
| mips64vr | mips64vrel \
|
||||
| mips64orion | mips64orionel \
|
||||
| mips64vr4100 | mips64vr4100el \
|
||||
| mips64vr4300 | mips64vr4300el \
|
||||
| mips64vr5000 | mips64vr5000el \
|
||||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| msp430 \
|
||||
| ns16k | ns32k \
|
||||
| openrisc \
|
||||
| openrisc | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| s390 | s390x \
|
||||
| sh | sh[34] | sh[34]eb | shbe | shle \
|
||||
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| v850 \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale \
|
||||
| x86 | xscale | xstormy16 | xtensa \
|
||||
| z8k)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
|
@ -277,38 +291,55 @@ case $basic_machine in
|
|||
580-* \
|
||||
| a29k-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alphapca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armv*-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c54x-* \
|
||||
| clipper-* | cray2-* | cydra-* \
|
||||
| d10v-* | d30v-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fr30-* | fx80-* \
|
||||
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* \
|
||||
| m32r-* \
|
||||
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
|
||||
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \
|
||||
| mipsle-* | mipstx39-* | mipstx39el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
| mips64vr-* | mips64vrel-* \
|
||||
| mips64orion-* | mips64orionel-* \
|
||||
| mips64vr4100-* | mips64vr4100el-* \
|
||||
| mips64vr4300-* | mips64vr4300el-* \
|
||||
| mips64vr5000-* | mips64vr5000el-* \
|
||||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| msp430-* \
|
||||
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| s390-* | s390x-* \
|
||||
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
|
||||
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
|
||||
| v850-* | vax-* \
|
||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
| xtensa-* \
|
||||
| ymp-* \
|
||||
| z8k-*)
|
||||
;;
|
||||
|
@ -342,6 +373,9 @@ case $basic_machine in
|
|||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
|
@ -373,6 +407,10 @@ case $basic_machine in
|
|||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
convex-c1)
|
||||
basic_machine=c1-convex
|
||||
os=-bsd
|
||||
|
@ -393,16 +431,8 @@ case $basic_machine in
|
|||
basic_machine=c38-convex
|
||||
os=-bsd
|
||||
;;
|
||||
cray | ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cray2)
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[cjt]90)
|
||||
basic_machine=${basic_machine}-cray
|
||||
cray | j90)
|
||||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
|
@ -417,6 +447,14 @@ case $basic_machine in
|
|||
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
|
||||
basic_machine=mips-dec
|
||||
;;
|
||||
decsystem10* | dec10*)
|
||||
basic_machine=pdp10-dec
|
||||
os=-tops10
|
||||
;;
|
||||
decsystem20* | dec20*)
|
||||
basic_machine=pdp10-dec
|
||||
os=-tops20
|
||||
;;
|
||||
delta | 3300 | motorola-3300 | motorola-delta \
|
||||
| 3300-motorola | delta-motorola)
|
||||
basic_machine=m68k-motorola
|
||||
|
@ -597,12 +635,6 @@ case $basic_machine in
|
|||
basic_machine=m68k-atari
|
||||
os=-mint
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
|
@ -617,6 +649,10 @@ case $basic_machine in
|
|||
basic_machine=m68k-rom68k
|
||||
os=-coff
|
||||
;;
|
||||
morphos)
|
||||
basic_machine=powerpc-unknown
|
||||
os=-morphos
|
||||
;;
|
||||
msdos)
|
||||
basic_machine=i386-pc
|
||||
os=-msdos
|
||||
|
@ -689,6 +725,10 @@ case $basic_machine in
|
|||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
nv1)
|
||||
basic_machine=nv1-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
|
@ -696,6 +736,10 @@ case $basic_machine in
|
|||
basic_machine=hppa1.1-oki
|
||||
os=-proelf
|
||||
;;
|
||||
or32 | or32-*)
|
||||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
|
@ -718,51 +762,55 @@ case $basic_machine in
|
|||
pbb)
|
||||
basic_machine=m68k-tti
|
||||
;;
|
||||
pc532 | pc532-*)
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | k5 | k6 | nexgen)
|
||||
pentium | p5 | k5 | k6 | nexgen | viac3)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentiumpro | p6 | 6x86 | athlon)
|
||||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
|
||||
pentium4)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc64) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
;;
|
||||
;;
|
||||
ppcle-* | powerpclittle-*)
|
||||
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64) basic_machine=powerpc64-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
|
||||
basic_machine=powerpc64le-unknown
|
||||
;;
|
||||
;;
|
||||
ppc64le-* | powerpc64little-*)
|
||||
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
|
@ -783,10 +831,26 @@ case $basic_machine in
|
|||
rtpc | rtpc-*)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
s390 | s390-*)
|
||||
basic_machine=s390-ibm
|
||||
;;
|
||||
s390x | s390x-*)
|
||||
basic_machine=s390x-ibm
|
||||
;;
|
||||
sa29200)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
sb1)
|
||||
basic_machine=mipsisa64sb1-unknown
|
||||
;;
|
||||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
|
@ -794,7 +858,10 @@ case $basic_machine in
|
|||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sparclite-wrs)
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
;;
|
||||
|
@ -861,19 +928,35 @@ case $basic_machine in
|
|||
os=-dynix
|
||||
;;
|
||||
t3e)
|
||||
basic_machine=t3e-cray
|
||||
basic_machine=alphaev5-cray
|
||||
os=-unicos
|
||||
;;
|
||||
t90)
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
toad1)
|
||||
basic_machine=pdp10-xkl
|
||||
os=-tops20
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
|
@ -898,8 +981,8 @@ case $basic_machine in
|
|||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
|
@ -920,17 +1003,13 @@ case $basic_machine in
|
|||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
windows32)
|
||||
basic_machine=i386-pc
|
||||
os=-windows32-msvcrt
|
||||
;;
|
||||
xmp)
|
||||
basic_machine=xmp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
xps | xps100)
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
;;
|
||||
z8k-*-coff)
|
||||
basic_machine=z8k-unknown
|
||||
os=-sim
|
||||
|
@ -951,16 +1030,6 @@ case $basic_machine in
|
|||
op60c)
|
||||
basic_machine=hppa1.1-oki
|
||||
;;
|
||||
mips)
|
||||
case $os in
|
||||
linux*)
|
||||
basic_machine=mips-unknown
|
||||
;;
|
||||
*)
|
||||
basic_machine=mips-mips
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
;;
|
||||
|
@ -980,13 +1049,16 @@ case $basic_machine in
|
|||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb)
|
||||
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
cydra)
|
||||
basic_machine=cydra-cydrome
|
||||
;;
|
||||
orion)
|
||||
|
@ -1001,10 +1073,6 @@ case $basic_machine in
|
|||
pmac | pmac-mpw)
|
||||
basic_machine=powerpc-apple
|
||||
;;
|
||||
c4x*)
|
||||
basic_machine=c4x-none
|
||||
os=-coff
|
||||
;;
|
||||
*-unknown)
|
||||
# Make sure to match an already-canonicalized machine name.
|
||||
;;
|
||||
|
@ -1060,17 +1128,19 @@ case $os in
|
|||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
|
||||
| -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* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos*)
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
@ -1082,8 +1152,10 @@ case $os in
|
|||
;;
|
||||
esac
|
||||
;;
|
||||
-nto-qnx*)
|
||||
;;
|
||||
-nto*)
|
||||
os=-nto-qnx
|
||||
os=`echo $os | sed -e 's|nto|nto-qnx|'`
|
||||
;;
|
||||
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
|
||||
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
|
||||
|
@ -1119,14 +1191,20 @@ case $os in
|
|||
-acis*)
|
||||
os=-aos
|
||||
;;
|
||||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-nova*)
|
||||
os=-rtmk-nova
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
os=-nextstep2
|
||||
;;
|
||||
-nsk*)
|
||||
os=-nsk
|
||||
|
@ -1165,8 +1243,14 @@ case $os in
|
|||
-xenix)
|
||||
os=-xenix
|
||||
;;
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
|
@ -1199,10 +1283,14 @@ case $basic_machine in
|
|||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
;;
|
||||
pdp11-*)
|
||||
pdp11-*)
|
||||
os=-none
|
||||
;;
|
||||
*-dec | vax-*)
|
||||
|
@ -1229,6 +1317,9 @@ case $basic_machine in
|
|||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
*-tti) # must be before sparc entry or we get the wrong os.
|
||||
os=-sysv3
|
||||
;;
|
||||
|
@ -1292,19 +1383,19 @@ case $basic_machine in
|
|||
*-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
*-gould)
|
||||
*-gould)
|
||||
os=-sysv
|
||||
;;
|
||||
*-highlevel)
|
||||
*-highlevel)
|
||||
os=-bsd
|
||||
;;
|
||||
*-encore)
|
||||
os=-bsd
|
||||
;;
|
||||
*-sgi)
|
||||
*-sgi)
|
||||
os=-irix
|
||||
;;
|
||||
*-siemens)
|
||||
*-siemens)
|
||||
os=-sysv4
|
||||
;;
|
||||
*-masscomp)
|
||||
|
@ -1376,7 +1467,7 @@ case $basic_machine in
|
|||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxsim* | -vxworks*)
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
|
|
11
configure.in
11
configure.in
|
@ -192,6 +192,11 @@ AC_PROG_RANLIB
|
|||
#AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# Ensure that we have --preserve-dup-deps defines, otherwise we get link
|
||||
# problems of 'mysql' with CXX=g++
|
||||
LIBTOOL="$LIBTOOL --preserve-dup-deps"
|
||||
AC_SUBST(LIBTOOL)dnl
|
||||
|
||||
#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC
|
||||
|
||||
# AC_PROG_INSTALL
|
||||
|
@ -346,7 +351,7 @@ AC_SUBST(CXXFLAGS)
|
|||
AC_SUBST(LD)
|
||||
AC_SUBST(INSTALL_SCRIPT)
|
||||
|
||||
export CC CFLAGS LD LDFLAGS
|
||||
export CC CXX CFLAGS LD LDFLAGS AR
|
||||
|
||||
if test "$GXX" = "yes"
|
||||
then
|
||||
|
@ -1054,7 +1059,7 @@ case $SYSTEM_TYPE in
|
|||
echo "Using --with-named-thread=-lpthread"
|
||||
with_named_thread="-lpthread"
|
||||
fi
|
||||
CXXFLAGS="-D_BOOL"
|
||||
CXXFLAGS="$CXXFLAGS -D_BOOL"
|
||||
;;
|
||||
*aix4.3*)
|
||||
echo "Adding defines for AIX"
|
||||
|
@ -1833,7 +1838,7 @@ AC_CHECK_FUNCS(alarm bmove \
|
|||
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
|
||||
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
|
||||
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
|
||||
pthread_attr_getstacksize \
|
||||
pthread_attr_getstacksize pthread_key_delete \
|
||||
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
|
||||
fsync fdatasync fchmod getpass getpassphrase initgroups mlockall)
|
||||
|
||||
|
|
|
@ -47,13 +47,13 @@ ulong heap_position_old(HP_INFO *info)
|
|||
int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
|
||||
{
|
||||
DBUG_ENTER("heap_info");
|
||||
x->records = info->s->records;
|
||||
x->deleted = info->s->deleted;
|
||||
x->reclength = info->s->reclength;
|
||||
x->data_length = info->s->data_length;
|
||||
x->index_length= info->s->index_length;
|
||||
x->max_records = info->s->max_records;
|
||||
x->errkey = info->errkey;
|
||||
x->records = info->s->records;
|
||||
x->deleted = info->s->deleted;
|
||||
x->reclength = info->s->reclength;
|
||||
x->data_length = info->s->data_length;
|
||||
x->index_length = info->s->index_length;
|
||||
x->max_records = info->s->max_records;
|
||||
x->errkey = info->errkey;
|
||||
if (flag & HA_STATUS_AUTO)
|
||||
x->auto_increment= info->s->auto_increment + 1;
|
||||
DBUG_RETURN(0);
|
||||
|
|
|
@ -138,6 +138,7 @@ typedef struct st_heap_info
|
|||
TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
|
||||
TREE_ELEMENT **last_pos;
|
||||
uint lastkey_len;
|
||||
my_bool implicit_emptied;
|
||||
#ifdef THREAD
|
||||
THR_LOCK_DATA lock;
|
||||
#endif
|
||||
|
|
|
@ -111,7 +111,7 @@ typedef struct my_collation_handler_st
|
|||
uchar *, uint, const uchar *, uint);
|
||||
my_bool (*like_range)(struct charset_info_st *,
|
||||
const char *s, uint s_length,
|
||||
int w_prefix, int w_one, int w_many,
|
||||
pchar w_prefix, pchar w_one, pchar w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_len, uint *max_len);
|
||||
|
@ -144,7 +144,7 @@ typedef struct my_charset_handler_st
|
|||
int (*mbcharlen)(struct charset_info_st *, uint);
|
||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||
uint (*wellformedlen)(struct charset_info_st *,
|
||||
uint (*well_formed_len)(struct charset_info_st *,
|
||||
const char *b,const char *e, uint nchars);
|
||||
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
||||
|
||||
|
@ -300,7 +300,7 @@ void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
|
|||
|
||||
my_bool my_like_range_simple(CHARSET_INFO *cs,
|
||||
const char *ptr, uint ptr_length,
|
||||
int escape, int w_one, int w_many,
|
||||
pbool escape, pbool w_one, pbool w_many,
|
||||
uint res_length,
|
||||
char *min_str, char *max_str,
|
||||
uint *min_length, uint *max_length);
|
||||
|
@ -313,7 +313,7 @@ int my_wildcmp_8bit(CHARSET_INFO *,
|
|||
|
||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_wellformedlen_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
||||
|
||||
|
||||
|
@ -330,7 +330,7 @@ int my_wildcmp_mb(CHARSET_INFO *,
|
|||
int escape, int w_one, int w_many);
|
||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_wellformedlen_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||
uint my_instr_mb(struct charset_info_st *,
|
||||
const char *b, uint b_length,
|
||||
const char *s, uint s_length,
|
||||
|
@ -381,6 +381,7 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
|
|||
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
|
||||
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
||||
|
||||
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
||||
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
|
||||
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d)))
|
||||
|
|
|
@ -126,7 +126,7 @@ extern void bmove_align(gptr dst,const gptr src,uint len);
|
|||
#include <assert.h>
|
||||
#define memcpy_overlap(A,B,C) \
|
||||
DBUG_ASSERT((A) == (B) || ((A)+(C)) <= (B) || ((B)+(C)) <= (A)); \
|
||||
bmove((byte*) key,(byte*) from,(size_t) length);
|
||||
bmove((byte*) (A),(byte*) (B),(size_t) (C));
|
||||
#else
|
||||
#define memcpy_overlap(A,B,C) memcpy((A), (B), (C))
|
||||
#endif /* HAVE_purify */
|
||||
|
|
|
@ -293,7 +293,9 @@ C_MODE_END
|
|||
#ifndef CONFIG_SMP
|
||||
#define CONFIG_SMP
|
||||
#endif
|
||||
C_MODE_START
|
||||
#include <asm/atomic.h>
|
||||
C_MODE_END
|
||||
#endif
|
||||
#include <errno.h> /* Recommended by debian */
|
||||
/* We need the following to go around a problem with openssl on solaris */
|
||||
|
|
|
@ -392,6 +392,11 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
|
|||
#define pthread_condattr_destroy pthread_condattr_delete
|
||||
#endif
|
||||
|
||||
/* FSU THREADS */
|
||||
#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
|
||||
#define pthread_key_delete(A) pthread_dummy(0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
|
||||
#define pthread_cond_destroy(A) pthread_dummy(0)
|
||||
#define pthread_mutex_destroy(A) pthread_dummy(0)
|
||||
|
|
|
@ -730,6 +730,8 @@ extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
|
|||
extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
|
||||
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
|
||||
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
|
||||
extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
|
||||
uint prealloc_size);
|
||||
extern char *strdup_root(MEM_ROOT *root,const char *str);
|
||||
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
|
||||
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
|
||||
|
|
|
@ -93,7 +93,7 @@ typedef struct st_mi_isaminfo /* Struct from h_info */
|
|||
|
||||
typedef struct st_mi_create_info
|
||||
{
|
||||
char *index_file_name, *data_file_name; /* If using symlinks */
|
||||
const char *index_file_name, *data_file_name; /* If using symlinks */
|
||||
ha_rows max_rows;
|
||||
ha_rows reloc_rows;
|
||||
ulonglong auto_increment;
|
||||
|
|
|
@ -534,8 +534,8 @@ typedef struct st_mysql_stmt
|
|||
char *query; /* query buffer */
|
||||
MEM_ROOT mem_root; /* root allocations */
|
||||
my_ulonglong last_fetched_column; /* last fetched column */
|
||||
my_ulonglong affected_rows; /* copy of mysql->affected_rows
|
||||
after statement execution */
|
||||
/* copy of mysql->affected_rows after statement execution */
|
||||
my_ulonglong affected_rows;
|
||||
unsigned long stmt_id; /* Id for prepared statement */
|
||||
unsigned int last_errno; /* error code */
|
||||
unsigned int param_count; /* parameters count */
|
||||
|
|
|
@ -254,56 +254,57 @@
|
|||
#define ER_NOT_SUPPORTED_YET 1235
|
||||
#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
|
||||
#define ER_SLAVE_IGNORED_TABLE 1237
|
||||
#define ER_WRONG_FK_DEF 1238
|
||||
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1239
|
||||
#define ER_OPERAND_COLUMNS 1240
|
||||
#define ER_SUBQUERY_NO_1_ROW 1241
|
||||
#define ER_UNKNOWN_STMT_HANDLER 1242
|
||||
#define ER_CORRUPT_HELP_DB 1243
|
||||
#define ER_CYCLIC_REFERENCE 1244
|
||||
#define ER_AUTO_CONVERT 1245
|
||||
#define ER_ILLEGAL_REFERENCE 1246
|
||||
#define ER_DERIVED_MUST_HAVE_ALIAS 1247
|
||||
#define ER_SELECT_REDUCED 1248
|
||||
#define ER_TABLENAME_NOT_ALLOWED_HERE 1249
|
||||
#define ER_NOT_SUPPORTED_AUTH_MODE 1250
|
||||
#define ER_SPATIAL_CANT_HAVE_NULL 1251
|
||||
#define ER_COLLATION_CHARSET_MISMATCH 1252
|
||||
#define ER_SLAVE_WAS_RUNNING 1253
|
||||
#define ER_SLAVE_WAS_NOT_RUNNING 1254
|
||||
#define ER_TOO_BIG_FOR_UNCOMPRESS 1255
|
||||
#define ER_ZLIB_Z_MEM_ERROR 1256
|
||||
#define ER_ZLIB_Z_BUF_ERROR 1257
|
||||
#define ER_ZLIB_Z_DATA_ERROR 1258
|
||||
#define ER_CUT_VALUE_GROUP_CONCAT 1259
|
||||
#define ER_WARN_TOO_FEW_RECORDS 1260
|
||||
#define ER_WARN_TOO_MANY_RECORDS 1261
|
||||
#define ER_WARN_NULL_TO_NOTNULL 1262
|
||||
#define ER_WARN_DATA_OUT_OF_RANGE 1263
|
||||
#define ER_WARN_DATA_TRUNCATED 1264
|
||||
#define ER_WARN_USING_OTHER_HANDLER 1265
|
||||
#define ER_CANT_AGGREGATE_2COLLATIONS 1266
|
||||
#define ER_DROP_USER 1267
|
||||
#define ER_REVOKE_GRANTS 1268
|
||||
#define ER_CANT_AGGREGATE_3COLLATIONS 1269
|
||||
#define ER_CANT_AGGREGATE_NCOLLATIONS 1270
|
||||
#define ER_VARIABLE_IS_NOT_STRUCT 1271
|
||||
#define ER_UNKNOWN_COLLATION 1272
|
||||
#define ER_SLAVE_IGNORED_SSL_PARAMS 1273
|
||||
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1274
|
||||
#define ER_WARN_FIELD_RESOLVED 1275
|
||||
#define ER_BAD_SLAVE_UNTIL_COND 1276
|
||||
#define ER_MISSING_SKIP_SLAVE 1277
|
||||
#define ER_UNTIL_COND_IGNORED 1278
|
||||
#define ER_WRONG_NAME_FOR_INDEX 1279
|
||||
#define ER_WRONG_NAME_FOR_CATALOG 1280
|
||||
#define ER_WARN_QC_RESIZE 1281
|
||||
#define ER_BAD_FT_COLUMN 1282
|
||||
#define ER_UNKNOWN_KEY_CACHE 1283
|
||||
#define ER_WARN_HOSTNAME_WONT_WORK 1284
|
||||
#define ER_UNKNOWN_STORAGE_ENGINE 1285
|
||||
#define ER_WARN_DEPRECATED_SYNTAX 1286
|
||||
#define ER_NON_UPDATABLE_TABLE 1287
|
||||
#define ER_FEATURE_DISABLED 1288
|
||||
#define ER_SKIP_GRANT_TABLES 1289
|
||||
#define ER_ERROR_MESSAGES 290
|
||||
#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
|
||||
#define ER_WRONG_FK_DEF 1239
|
||||
#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
|
||||
#define ER_OPERAND_COLUMNS 1241
|
||||
#define ER_SUBQUERY_NO_1_ROW 1242
|
||||
#define ER_UNKNOWN_STMT_HANDLER 1243
|
||||
#define ER_CORRUPT_HELP_DB 1244
|
||||
#define ER_CYCLIC_REFERENCE 1245
|
||||
#define ER_AUTO_CONVERT 1246
|
||||
#define ER_ILLEGAL_REFERENCE 1247
|
||||
#define ER_DERIVED_MUST_HAVE_ALIAS 1248
|
||||
#define ER_SELECT_REDUCED 1249
|
||||
#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
|
||||
#define ER_NOT_SUPPORTED_AUTH_MODE 1251
|
||||
#define ER_SPATIAL_CANT_HAVE_NULL 1252
|
||||
#define ER_COLLATION_CHARSET_MISMATCH 1253
|
||||
#define ER_SLAVE_WAS_RUNNING 1254
|
||||
#define ER_SLAVE_WAS_NOT_RUNNING 1255
|
||||
#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
|
||||
#define ER_ZLIB_Z_MEM_ERROR 1257
|
||||
#define ER_ZLIB_Z_BUF_ERROR 1258
|
||||
#define ER_ZLIB_Z_DATA_ERROR 1259
|
||||
#define ER_CUT_VALUE_GROUP_CONCAT 1260
|
||||
#define ER_WARN_TOO_FEW_RECORDS 1261
|
||||
#define ER_WARN_TOO_MANY_RECORDS 1262
|
||||
#define ER_WARN_NULL_TO_NOTNULL 1263
|
||||
#define ER_WARN_DATA_OUT_OF_RANGE 1264
|
||||
#define ER_WARN_DATA_TRUNCATED 1265
|
||||
#define ER_WARN_USING_OTHER_HANDLER 1266
|
||||
#define ER_CANT_AGGREGATE_2COLLATIONS 1267
|
||||
#define ER_DROP_USER 1268
|
||||
#define ER_REVOKE_GRANTS 1269
|
||||
#define ER_CANT_AGGREGATE_3COLLATIONS 1270
|
||||
#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
|
||||
#define ER_VARIABLE_IS_NOT_STRUCT 1272
|
||||
#define ER_UNKNOWN_COLLATION 1273
|
||||
#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
|
||||
#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
|
||||
#define ER_WARN_FIELD_RESOLVED 1276
|
||||
#define ER_BAD_SLAVE_UNTIL_COND 1277
|
||||
#define ER_MISSING_SKIP_SLAVE 1278
|
||||
#define ER_UNTIL_COND_IGNORED 1279
|
||||
#define ER_WRONG_NAME_FOR_INDEX 1280
|
||||
#define ER_WRONG_NAME_FOR_CATALOG 1281
|
||||
#define ER_WARN_QC_RESIZE 1282
|
||||
#define ER_BAD_FT_COLUMN 1283
|
||||
#define ER_UNKNOWN_KEY_CACHE 1284
|
||||
#define ER_WARN_HOSTNAME_WONT_WORK 1285
|
||||
#define ER_UNKNOWN_STORAGE_ENGINE 1286
|
||||
#define ER_WARN_DEPRECATED_SYNTAX 1287
|
||||
#define ER_NON_UPDATABLE_TABLE 1288
|
||||
#define ER_FEATURE_DISABLED 1289
|
||||
#define ER_SKIP_GRANT_TABLES 1290
|
||||
#define ER_ERROR_MESSAGES 291
|
||||
|
|
|
@ -2709,7 +2709,7 @@ btr_estimate_number_of_different_key_vals(
|
|||
ulint n_cols;
|
||||
ulint matched_fields;
|
||||
ulint matched_bytes;
|
||||
ulint* n_diff;
|
||||
ib_longlong* n_diff;
|
||||
ulint not_empty_flag = 0;
|
||||
ulint total_external_size = 0;
|
||||
ulint i;
|
||||
|
@ -2781,7 +2781,8 @@ btr_estimate_number_of_different_key_vals(
|
|||
|
||||
for (j = 0; j <= n_cols; j++) {
|
||||
index->stat_n_diff_key_vals[j] =
|
||||
(n_diff[j] * index->stat_n_leaf_pages
|
||||
(n_diff[j]
|
||||
* (ib_longlong)index->stat_n_leaf_pages
|
||||
+ BTR_KEY_VAL_ESTIMATE_N_PAGES - 1
|
||||
+ total_external_size
|
||||
+ not_empty_flag)
|
||||
|
|
|
@ -299,7 +299,7 @@ buf_LRU_get_free_block(void)
|
|||
buf_block_t* block = NULL;
|
||||
ibool freed;
|
||||
ulint n_iterations = 1;
|
||||
ibool mon_value_was = 0; /* remove bug */
|
||||
ibool mon_value_was = FALSE;
|
||||
ibool started_monitor = FALSE;
|
||||
loop:
|
||||
mutex_enter(&(buf_pool->mutex));
|
||||
|
@ -318,12 +318,14 @@ loop:
|
|||
|
||||
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
|
||||
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
|
||||
if (!srv_print_innodb_monitor) {
|
||||
|
||||
/* Over 80 % of the buffer pool is occupied by lock heaps
|
||||
or the adaptive hash index. This may be a memory leak! */
|
||||
/* Over 80 % of the buffer pool is occupied by lock
|
||||
heaps or the adaptive hash index. This may be a memory
|
||||
leak! */
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: WARNING: over 4 / 5 of the buffer pool is occupied by\n"
|
||||
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
|
||||
"InnoDB: transactions do not set too many row locks.\n"
|
||||
|
@ -333,8 +335,9 @@ loop:
|
|||
"InnoDB: lock heap and hash index sizes.\n",
|
||||
(ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
|
||||
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
|
||||
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) {
|
||||
|
||||
|
@ -423,6 +426,7 @@ loop:
|
|||
mon_value_was = srv_print_innodb_monitor;
|
||||
started_monitor = TRUE;
|
||||
srv_print_innodb_monitor = TRUE;
|
||||
os_event_set(srv_lock_timeout_thread_event);
|
||||
}
|
||||
|
||||
/* No free block was found: try to flush the LRU list */
|
||||
|
|
|
@ -1210,23 +1210,36 @@ dict_create_or_check_foreign_constraint_tables(void)
|
|||
}
|
||||
|
||||
/************************************************************************
|
||||
Adds foreign key definitions to data dictionary tables in the database. */
|
||||
Adds foreign key definitions to data dictionary tables in the database. We
|
||||
look at table->foreign_list, and also generate names to constraints that were
|
||||
not named by the user. A generated constraint has a name of the format
|
||||
databasename/tablename_ibfk_<number>, where the numbers start from 1, and are
|
||||
given locally for this table, that is, the number is not global, as in the
|
||||
old format constraints < 4.0.18 it used to be. */
|
||||
|
||||
ulint
|
||||
dict_create_add_foreigns_to_dictionary(
|
||||
/*===================================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
ulint start_id,/* in: if we are actually doing ALTER TABLE
|
||||
ADD CONSTRAINT, we want to generate constraint
|
||||
numbers which are bigger than in the table so
|
||||
far; we number the constraints from
|
||||
start_id + 1 up; start_id should be set to 0 if
|
||||
we are creating a new table, or if the table
|
||||
so far has no constraints for which the name
|
||||
was generated here */
|
||||
dict_table_t* table, /* in: table */
|
||||
trx_t* trx) /* in: transaction */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
que_thr_t* thr;
|
||||
que_t* graph;
|
||||
dulint id;
|
||||
ulint number = start_id + 1;
|
||||
ulint len;
|
||||
ulint error;
|
||||
char* ebuf = dict_foreign_err_buf;
|
||||
ulint i;
|
||||
char buf2[50];
|
||||
char buf[10000];
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
@ -1254,18 +1267,18 @@ loop:
|
|||
"PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n"
|
||||
"BEGIN\n");
|
||||
|
||||
/* We allocate the new id from the sequence of table id's */
|
||||
id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
|
||||
if (foreign->id == NULL) {
|
||||
/* Generate a new constraint id */
|
||||
foreign->id = mem_heap_alloc(foreign->heap,
|
||||
ut_strlen(table->name)
|
||||
+ 20);
|
||||
sprintf(foreign->id, "%s_ibfk_%lu", table->name, (ulong) number);
|
||||
number++;
|
||||
}
|
||||
|
||||
sprintf(buf2, "%lu_%lu", (ulong) ut_dulint_get_high(id),
|
||||
(ulong) ut_dulint_get_low(id));
|
||||
foreign->id = mem_heap_alloc(foreign->heap, ut_strlen(buf2) + 1);
|
||||
ut_memcpy(foreign->id, buf2, ut_strlen(buf2) + 1);
|
||||
|
||||
len += sprintf(buf + len,
|
||||
"INSERT INTO SYS_FOREIGN VALUES('%lu_%lu', '%s', '%s', %lu);\n",
|
||||
(ulong) ut_dulint_get_high(id),
|
||||
(ulong) ut_dulint_get_low(id),
|
||||
"INSERT INTO SYS_FOREIGN VALUES('%s', '%s', '%s', %lu);\n",
|
||||
foreign->id,
|
||||
table->name,
|
||||
foreign->referenced_table_name,
|
||||
(ulong) (foreign->n_fields
|
||||
|
@ -1274,9 +1287,8 @@ loop:
|
|||
for (i = 0; i < foreign->n_fields; i++) {
|
||||
|
||||
len += sprintf(buf + len,
|
||||
"INSERT INTO SYS_FOREIGN_COLS VALUES('%lu_%lu', %lu, '%s', '%s');\n",
|
||||
(ulong) ut_dulint_get_high(id),
|
||||
(ulong) ut_dulint_get_low(id),
|
||||
"INSERT INTO SYS_FOREIGN_COLS VALUES('%s', %lu, '%s', '%s');\n",
|
||||
foreign->id,
|
||||
(ulong) i,
|
||||
foreign->foreign_col_names[i],
|
||||
foreign->referenced_col_names[i]);
|
||||
|
@ -1301,29 +1313,30 @@ loop:
|
|||
|
||||
que_graph_free(graph);
|
||||
|
||||
if (error == DB_DUPLICATE_KEY) {
|
||||
mutex_enter(&dict_foreign_err_mutex);
|
||||
ut_sprintf_timestamp(dict_foreign_err_buf);
|
||||
sprintf(ebuf + strlen(ebuf),
|
||||
" Error in foreign key constraint creation for table %.500s.\n"
|
||||
"A foreign key constraint of name %.500s\n"
|
||||
"already exists (note that internally InnoDB adds 'databasename/'\n"
|
||||
"in front of the user-defined constraint name).\n", table->name, foreign->id);
|
||||
|
||||
ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN);
|
||||
|
||||
mutex_exit(&dict_foreign_err_mutex);
|
||||
|
||||
return(error);
|
||||
}
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Foreign key constraint creation failed:\n"
|
||||
"InnoDB: internal error number %lu\n", (ulong) error);
|
||||
|
||||
if (error == DB_DUPLICATE_KEY) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Duplicate key error in system table %s index %s\n",
|
||||
((dict_index_t*)trx->error_info)->table_name,
|
||||
((dict_index_t*)trx->error_info)->name);
|
||||
|
||||
fprintf(stderr, "%s\n", buf);
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: Maybe the internal data dictionary of InnoDB is\n"
|
||||
"InnoDB: out-of-sync from the .frm files of your tables.\n"
|
||||
"InnoDB: See section 15.1 Troubleshooting data dictionary operations\n"
|
||||
"InnoDB: at http://www.innodb.com/ibman.html\n");
|
||||
}
|
||||
|
||||
mutex_enter(&dict_foreign_err_mutex);
|
||||
ut_sprintf_timestamp(buf);
|
||||
sprintf(buf + strlen(buf),
|
||||
ut_sprintf_timestamp(ebuf);
|
||||
sprintf(ebuf + strlen(ebuf),
|
||||
" Internal error in foreign key constraint creation for table %.500s.\n"
|
||||
"See the MySQL .err log in the datadir for more information.\n", table->name);
|
||||
mutex_exit(&dict_foreign_err_mutex);
|
||||
|
|
|
@ -52,7 +52,7 @@ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
|
|||
hash table fixed size in bytes */
|
||||
#define DICT_POOL_PER_VARYING 4 /* buffer pool max size per data
|
||||
dictionary varying size in bytes */
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Adds a column to the data dictionary hash table. */
|
||||
static
|
||||
|
@ -236,6 +236,29 @@ dict_remove_db_name(
|
|||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Get the database name length in a table name. */
|
||||
|
||||
ulint
|
||||
dict_get_db_name_len(
|
||||
/*=================*/
|
||||
/* out: database name length */
|
||||
char* name) /* in: table name in the form dbname '/' tablename */
|
||||
{
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i < 100000 ; i++) {
|
||||
if (name[i] == '/') {
|
||||
|
||||
return(i);
|
||||
}
|
||||
}
|
||||
|
||||
ut_a(0);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Reserves the dictionary system mutex for MySQL. */
|
||||
|
@ -870,6 +893,7 @@ dict_table_rename_in_cache(
|
|||
ulint fold;
|
||||
ulint old_size;
|
||||
char* name_buf;
|
||||
char* old_name;
|
||||
ibool success;
|
||||
ulint i;
|
||||
|
||||
|
@ -916,6 +940,9 @@ dict_table_rename_in_cache(
|
|||
/* Remove table from the hash tables of tables */
|
||||
HASH_DELETE(dict_table_t, name_hash, dict_sys->table_hash,
|
||||
ut_fold_string(table->name), table);
|
||||
old_name = mem_heap_alloc(table->heap, ut_strlen(table->name) + 1);
|
||||
|
||||
ut_strcpy(old_name, table->name);
|
||||
|
||||
name_buf = mem_heap_alloc(table->heap, ut_strlen(new_name) + 1);
|
||||
|
||||
|
@ -972,7 +999,9 @@ dict_table_rename_in_cache(
|
|||
return(TRUE);
|
||||
}
|
||||
|
||||
/* Update the table name fields in foreign constraints */
|
||||
/* Update the table name fields in foreign constraints, and update also
|
||||
the constraint id of new format >= 4.0.18 constraints. Note that at
|
||||
this point we have already changed table->name to the new name. */
|
||||
|
||||
foreign = UT_LIST_GET_FIRST(table->foreign_list);
|
||||
|
||||
|
@ -981,14 +1010,68 @@ dict_table_rename_in_cache(
|
|||
ut_strlen(table->name)) {
|
||||
/* Allocate a longer name buffer;
|
||||
TODO: store buf len to save memory */
|
||||
|
||||
foreign->foreign_table_name = mem_heap_alloc(
|
||||
foreign->heap,
|
||||
ut_strlen(table->name) + 1);
|
||||
}
|
||||
|
||||
ut_memcpy(foreign->foreign_table_name, table->name,
|
||||
ut_strlen(table->name) + 1);
|
||||
foreign->foreign_table_name[ut_strlen(table->name)] = '\0';
|
||||
sprintf(foreign->foreign_table_name, "%s", table->name);
|
||||
|
||||
if (ut_str_contains(foreign->id, '/')) {
|
||||
ulint db_len;
|
||||
char old_id[2000];
|
||||
|
||||
/* This is a >= 4.0.18 format id */
|
||||
|
||||
ut_a(ut_strlen(foreign->id) < 1999);
|
||||
|
||||
ut_strcpy(old_id, foreign->id);
|
||||
|
||||
if (ut_strlen(foreign->id) > ut_strlen(old_name)
|
||||
+ ut_strlen("_ibfk_")
|
||||
&& 0 == ut_memcmp(foreign->id, old_name,
|
||||
ut_strlen(old_name))
|
||||
&& 0 == ut_memcmp(
|
||||
foreign->id + ut_strlen(old_name),
|
||||
(char*)"_ibfk_", ut_strlen("_ibfk_"))) {
|
||||
|
||||
/* This is a generated >= 4.0.18 format id */
|
||||
|
||||
if (ut_strlen(table->name)
|
||||
> ut_strlen(old_name)) {
|
||||
foreign->id = mem_heap_alloc(
|
||||
foreign->heap,
|
||||
ut_strlen(table->name)
|
||||
+ ut_strlen(old_id) + 1);
|
||||
}
|
||||
|
||||
/* Replace the prefix 'databasename/tablename'
|
||||
with the new names */
|
||||
sprintf(foreign->id, "%s%s", table->name,
|
||||
old_id + ut_strlen(old_name));
|
||||
} else {
|
||||
/* This is a >= 4.0.18 format id where the user
|
||||
gave the id name */
|
||||
db_len = dict_get_db_name_len(table->name) + 1;
|
||||
|
||||
if (dict_get_db_name_len(table->name)
|
||||
> dict_get_db_name_len(foreign->id)) {
|
||||
|
||||
foreign->id = mem_heap_alloc(
|
||||
foreign->heap,
|
||||
db_len + ut_strlen(old_id) + 1);
|
||||
}
|
||||
|
||||
/* Replace the database prefix in id with the
|
||||
one from table->name */
|
||||
|
||||
ut_memcpy(foreign->id, table->name, db_len);
|
||||
|
||||
sprintf(foreign->id + db_len, "%s",
|
||||
dict_remove_db_name(old_id));
|
||||
}
|
||||
}
|
||||
|
||||
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
|
||||
}
|
||||
|
@ -1000,14 +1083,13 @@ dict_table_rename_in_cache(
|
|||
ut_strlen(table->name)) {
|
||||
/* Allocate a longer name buffer;
|
||||
TODO: store buf len to save memory */
|
||||
|
||||
foreign->referenced_table_name = mem_heap_alloc(
|
||||
foreign->heap,
|
||||
ut_strlen(table->name) + 1);
|
||||
}
|
||||
|
||||
ut_memcpy(foreign->referenced_table_name, table->name,
|
||||
ut_strlen(table->name) + 1);
|
||||
foreign->referenced_table_name[ut_strlen(table->name)] = '\0';
|
||||
sprintf(foreign->referenced_table_name, "%s", table->name);
|
||||
|
||||
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
|
||||
}
|
||||
|
@ -1804,6 +1886,24 @@ dict_index_build_internal_non_clust(
|
|||
|
||||
/*====================== FOREIGN KEY PROCESSING ========================*/
|
||||
|
||||
/*************************************************************************
|
||||
Checks if a table is referenced by foreign keys. */
|
||||
|
||||
ibool
|
||||
dict_table_referenced_by_foreign_key(
|
||||
/*=================================*/
|
||||
/* out: TRUE if table is referenced by a
|
||||
foreign key */
|
||||
dict_table_t* table) /* in: InnoDB table */
|
||||
{
|
||||
if (UT_LIST_GET_LEN(table->referenced_list) > 0) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Frees a foreign key struct. */
|
||||
static
|
||||
|
@ -2083,7 +2183,7 @@ static
|
|||
char*
|
||||
dict_scan_to(
|
||||
/*=========*/
|
||||
|
||||
/* out: scanned up to this */
|
||||
char* ptr, /* in: scan from */
|
||||
const char *string) /* in: look for this */
|
||||
{
|
||||
|
@ -2149,6 +2249,68 @@ dict_accept(
|
|||
return(ptr + ut_strlen(string));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Scans an id. For the lexical definition of an 'id', see the code below.
|
||||
Strips backquotes or double quotes from around the id. */
|
||||
static
|
||||
char*
|
||||
dict_scan_id(
|
||||
/*=========*/
|
||||
/* out: scanned to */
|
||||
char* ptr, /* in: scanned to */
|
||||
char** start, /* out: start of the id; NULL if no id was
|
||||
scannable */
|
||||
ulint* len, /* out: length of the id */
|
||||
ibool accept_also_dot)/* in: TRUE if also a dot can appear in a
|
||||
non-quoted id; in a quoted id it can appear
|
||||
always */
|
||||
{
|
||||
char quote = '\0';
|
||||
|
||||
*start = NULL;
|
||||
|
||||
while (isspace(*ptr)) {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
if (*ptr == '`' || *ptr == '"') {
|
||||
quote = *ptr++;
|
||||
}
|
||||
|
||||
*start = ptr;
|
||||
|
||||
if (quote) {
|
||||
while (*ptr != quote && *ptr != '\0') {
|
||||
ptr++;
|
||||
}
|
||||
} else {
|
||||
while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
|
||||
&& (accept_also_dot || *ptr != '.')
|
||||
&& *ptr != ',' && *ptr != '\0') {
|
||||
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
*len = (ulint) (ptr - *start);
|
||||
|
||||
if (quote) {
|
||||
if (*ptr == quote) {
|
||||
ptr++;
|
||||
} else {
|
||||
/* Syntax error */
|
||||
*start = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Tries to scan a column name. */
|
||||
static
|
||||
|
@ -2165,46 +2327,29 @@ dict_scan_col(
|
|||
ulint* column_name_len)/* out: column name length */
|
||||
{
|
||||
dict_col_t* col;
|
||||
char* old_ptr;
|
||||
ulint i;
|
||||
|
||||
*success = FALSE;
|
||||
|
||||
while (isspace(*ptr)) {
|
||||
ptr++;
|
||||
ptr = dict_scan_id(ptr, column_name, column_name_len, TRUE);
|
||||
|
||||
if (column_name == NULL) {
|
||||
|
||||
return(ptr); /* Syntax error */
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
if (*ptr == '`') {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
old_ptr = ptr;
|
||||
|
||||
while (!isspace(*ptr) && *ptr != ',' && *ptr != ')' && *ptr != '`'
|
||||
&& *ptr != '\0') {
|
||||
|
||||
ptr++;
|
||||
}
|
||||
|
||||
*column_name_len = (ulint)(ptr - old_ptr);
|
||||
|
||||
if (table == NULL) {
|
||||
*success = TRUE;
|
||||
*column = NULL;
|
||||
*column_name = old_ptr;
|
||||
} else {
|
||||
for (i = 0; i < dict_table_get_n_cols(table); i++) {
|
||||
|
||||
col = dict_table_get_nth_col(table, i);
|
||||
|
||||
if (ut_strlen(col->name) == (ulint)(ptr - old_ptr)
|
||||
&& 0 == ut_cmp_in_lower_case(col->name, old_ptr,
|
||||
(ulint)(ptr - old_ptr))) {
|
||||
if (ut_strlen(col->name) == *column_name_len
|
||||
&& 0 == ut_cmp_in_lower_case(col->name,
|
||||
*column_name,
|
||||
*column_name_len)) {
|
||||
/* Found */
|
||||
|
||||
*success = TRUE;
|
||||
|
@ -2216,10 +2361,6 @@ dict_scan_col(
|
|||
}
|
||||
}
|
||||
|
||||
if (*ptr == '`') {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
|
@ -2238,144 +2379,112 @@ dict_scan_table_name(
|
|||
the referenced table name; must be at least
|
||||
2500 bytes */
|
||||
{
|
||||
char* dot_ptr = NULL;
|
||||
char* old_ptr;
|
||||
char* database_name = NULL;
|
||||
ulint database_name_len = 999999999; /* init to a dummy value to
|
||||
suppress a compiler warning */
|
||||
char* table_name = NULL;
|
||||
ulint table_name_len;
|
||||
char* scanned_id;
|
||||
ulint scanned_id_len;
|
||||
ulint i;
|
||||
|
||||
*success = FALSE;
|
||||
*table = NULL;
|
||||
|
||||
while (isspace(*ptr)) {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
if (*ptr == '`') {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
old_ptr = ptr;
|
||||
|
||||
while (!isspace(*ptr) && *ptr != '(' && *ptr != '`' && *ptr != '\0') {
|
||||
if (*ptr == '.') {
|
||||
dot_ptr = ptr;
|
||||
ptr = dict_scan_id(ptr, &scanned_id, &scanned_id_len, FALSE);
|
||||
|
||||
if (scanned_id == NULL) {
|
||||
|
||||
return(ptr); /* Syntax error */
|
||||
}
|
||||
|
||||
if (*ptr == '.') {
|
||||
/* We scanned the database name; scan also the table name */
|
||||
|
||||
ptr++;
|
||||
|
||||
database_name = scanned_id;
|
||||
database_name_len = scanned_id_len;
|
||||
|
||||
ptr = dict_scan_id(ptr, &table_name, &table_name_len, FALSE);
|
||||
|
||||
if (table_name == NULL) {
|
||||
|
||||
return(ptr); /* Syntax error */
|
||||
}
|
||||
} else {
|
||||
/* To be able to read table dumps made with InnoDB-4.0.17 or
|
||||
earlier, we must allow the dot separator between the database
|
||||
name and the table name also to appear within a quoted
|
||||
identifier! InnoDB used to print a constraint as:
|
||||
... REFERENCES `databasename.tablename` ...
|
||||
starting from 4.0.18 it is
|
||||
... REFERENCES `databasename`.`tablename` ... */
|
||||
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (ptr - old_ptr > 2000) {
|
||||
return(old_ptr);
|
||||
}
|
||||
|
||||
if (dot_ptr == NULL) {
|
||||
/* Copy the database name from 'name' to the start */
|
||||
for (i = 0;; i++) {
|
||||
second_table_name[i] = name[i];
|
||||
if (name[i] == '/') {
|
||||
i++;
|
||||
break;
|
||||
for (i = 0; i < scanned_id_len; i++) {
|
||||
if (scanned_id[i] == '.') {
|
||||
database_name = scanned_id;
|
||||
database_name_len = i;
|
||||
|
||||
scanned_id = scanned_id + i + 1;
|
||||
scanned_id_len -= i + 1;
|
||||
}
|
||||
}
|
||||
#ifdef __WIN__
|
||||
ut_cpy_in_lower_case(second_table_name + i, old_ptr,
|
||||
ptr - old_ptr);
|
||||
#else
|
||||
if (srv_lower_case_table_names) {
|
||||
ut_cpy_in_lower_case(second_table_name + i, old_ptr,
|
||||
ptr - old_ptr);
|
||||
} else {
|
||||
ut_memcpy(second_table_name + i, old_ptr,
|
||||
ptr - old_ptr);
|
||||
}
|
||||
#endif
|
||||
second_table_name[i + (ptr - old_ptr)] = '\0';
|
||||
} else {
|
||||
#ifdef __WIN__
|
||||
ut_cpy_in_lower_case(second_table_name, old_ptr,
|
||||
ptr - old_ptr);
|
||||
#else
|
||||
if (srv_lower_case_table_names) {
|
||||
ut_cpy_in_lower_case(second_table_name, old_ptr,
|
||||
ptr - old_ptr);
|
||||
} else {
|
||||
ut_memcpy(second_table_name, old_ptr, ptr - old_ptr);
|
||||
}
|
||||
#endif
|
||||
second_table_name[dot_ptr - old_ptr] = '/';
|
||||
second_table_name[ptr - old_ptr] = '\0';
|
||||
|
||||
table_name = scanned_id;
|
||||
table_name_len = scanned_id_len;
|
||||
}
|
||||
|
||||
if (database_name == NULL) {
|
||||
/* Use the database name of the foreign key table */
|
||||
|
||||
database_name = name;
|
||||
|
||||
database_name_len = dict_get_db_name_len(name);
|
||||
}
|
||||
|
||||
if (table_name_len + database_name_len > 2000) {
|
||||
|
||||
return(ptr); /* Too long name */
|
||||
}
|
||||
|
||||
#ifdef __WIN__
|
||||
ut_cpy_in_lower_case(second_table_name, database_name,
|
||||
database_name_len);
|
||||
#else
|
||||
if (srv_lower_case_table_names) {
|
||||
ut_cpy_in_lower_case(second_table_name, database_name,
|
||||
database_name_len);
|
||||
} else {
|
||||
ut_memcpy(second_table_name, database_name,
|
||||
database_name_len);
|
||||
}
|
||||
#endif
|
||||
second_table_name[database_name_len] = '/';
|
||||
|
||||
#ifdef __WIN__
|
||||
ut_cpy_in_lower_case(second_table_name + database_name_len + 1,
|
||||
table_name, table_name_len);
|
||||
#else
|
||||
if (srv_lower_case_table_names) {
|
||||
ut_cpy_in_lower_case(second_table_name + database_name_len + 1,
|
||||
table_name, table_name_len);
|
||||
} else {
|
||||
ut_memcpy(second_table_name + database_name_len + 1,
|
||||
table_name, table_name_len);
|
||||
}
|
||||
#endif
|
||||
second_table_name[database_name_len + 1 + table_name_len] = '\0';
|
||||
|
||||
*success = TRUE;
|
||||
|
||||
*table = dict_table_get_low(second_table_name);
|
||||
|
||||
if (*ptr == '`') {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Scans an id. For the lexical definition of an 'id', see the code below.
|
||||
Strips backquotes from around the id. */
|
||||
static
|
||||
char*
|
||||
dict_scan_id(
|
||||
/*=========*/
|
||||
/* out: scanned to */
|
||||
char* ptr, /* in: scanned to */
|
||||
char** start, /* out: start of the id; NULL if no id was
|
||||
scannable */
|
||||
ulint* len) /* out: length of the id */
|
||||
{
|
||||
ibool scanned_backquote = FALSE;
|
||||
|
||||
*start = NULL;
|
||||
|
||||
while (isspace(*ptr)) {
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
if (*ptr == '`') {
|
||||
scanned_backquote = TRUE;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
*start = ptr;
|
||||
|
||||
while (!isspace(*ptr) && *ptr != ',' && *ptr != '(' && *ptr != ')'
|
||||
&& *ptr != '\0' && *ptr != '`') {
|
||||
|
||||
ptr++;
|
||||
}
|
||||
|
||||
*len = (ulint) (ptr - *start);
|
||||
|
||||
if (scanned_backquote) {
|
||||
if (*ptr == '`') {
|
||||
ptr++;
|
||||
} else {
|
||||
/* Syntax error */
|
||||
*start = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Skips one id. */
|
||||
Skips one id. The id is allowed to contain also '.'. */
|
||||
static
|
||||
char*
|
||||
dict_skip_word(
|
||||
|
@ -2390,7 +2499,7 @@ dict_skip_word(
|
|||
|
||||
*success = FALSE;
|
||||
|
||||
ptr = dict_scan_id(ptr, &start, &len);
|
||||
ptr = dict_scan_id(ptr, &start, &len, TRUE);
|
||||
|
||||
if (start) {
|
||||
*success = TRUE;
|
||||
|
@ -2505,6 +2614,52 @@ scan_more:
|
|||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Finds the highest <number> for foreign key constraints of the table. Looks
|
||||
only at the >= 4.0.18-format id's, which are of the form
|
||||
databasename/tablename_ibfk_<number>. */
|
||||
static
|
||||
ulint
|
||||
dict_table_get_highest_foreign_id(
|
||||
/*==============================*/
|
||||
/* out: highest number, 0 if table has no new
|
||||
format foreign key constraints */
|
||||
dict_table_t* table) /* in: table in the dictionary memory cache */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
char* endp;
|
||||
ulint biggest_id = 0;
|
||||
ulint id;
|
||||
|
||||
ut_a(table);
|
||||
|
||||
foreign = UT_LIST_GET_FIRST(table->foreign_list);
|
||||
|
||||
while (foreign) {
|
||||
if (ut_strlen(foreign->id) > ut_strlen("_ibfk_")
|
||||
+ ut_strlen(table->name)
|
||||
&& 0 == ut_memcmp(foreign->id, table->name,
|
||||
ut_strlen(table->name))
|
||||
&& 0 == ut_memcmp(foreign->id + ut_strlen(table->name),
|
||||
(char*)"_ibfk_", ut_strlen("_ibfk_"))) {
|
||||
/* It is of the >= 4.0.18 format */
|
||||
|
||||
id = strtoul(foreign->id + ut_strlen(table->name)
|
||||
+ ut_strlen("_ibfk_"),
|
||||
&endp, 10);
|
||||
ut_a(id != biggest_id);
|
||||
|
||||
if (id > biggest_id) {
|
||||
biggest_id = id;
|
||||
}
|
||||
}
|
||||
|
||||
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
|
||||
}
|
||||
|
||||
return(biggest_id);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Reports a simple foreign key create clause syntax error. */
|
||||
static
|
||||
|
@ -2547,19 +2702,26 @@ dict_create_foreign_constraints_low(
|
|||
FOREIGN KEY (a, b) REFERENCES table2(c, d),
|
||||
table2 can be written also with the database
|
||||
name before it: test.table2; the default
|
||||
database id the database of parameter name */
|
||||
database is the database of parameter name */
|
||||
char* name) /* in: table full name in the normalized form
|
||||
database_name/table_name */
|
||||
{
|
||||
dict_table_t* table;
|
||||
dict_table_t* referenced_table;
|
||||
dict_table_t* table_to_alter;
|
||||
ulint highest_id_so_far = 0;
|
||||
dict_index_t* index;
|
||||
dict_foreign_t* foreign;
|
||||
char* ptr = sql_string;
|
||||
char* start_of_latest_foreign = sql_string;
|
||||
char* buf = dict_foreign_err_buf;
|
||||
char* constraint_name; /* this is NOT a null-
|
||||
terminated string */
|
||||
ulint constraint_name_len;
|
||||
ibool success;
|
||||
ulint error;
|
||||
char* ptr1;
|
||||
char* ptr2;
|
||||
ulint i;
|
||||
ulint j;
|
||||
ibool is_on_delete;
|
||||
|
@ -2586,16 +2748,89 @@ dict_create_foreign_constraints_low(
|
|||
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
/* First check if we are actually doing an ALTER TABLE, and in that
|
||||
case look for the table being altered */
|
||||
|
||||
ptr = dict_accept(ptr, (char*) "ALTER", &success);
|
||||
|
||||
if (!success) {
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
||||
ptr = dict_accept(ptr, (char*) "TABLE", &success);
|
||||
|
||||
if (!success) {
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
||||
/* We are doing an ALTER TABLE: scan the table name we are altering;
|
||||
in the call below we use the buffer 'referenced_table_name' as a dummy
|
||||
buffer */
|
||||
|
||||
ptr = dict_scan_table_name(ptr, &table_to_alter, name,
|
||||
&success, referenced_table_name);
|
||||
if (!success) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: could not find the table being ALTERED in:\n%s\n", sql_string);
|
||||
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
/* Starting from 4.0.18 and 4.1.2, we generate foreign key id's in the
|
||||
format databasename/tablename_ibfk_<number>, where <number> is local
|
||||
to the table; look for the highest <number> for table_to_alter, so
|
||||
that we can assign to new constraints higher numbers. */
|
||||
|
||||
/* If we are altering a temporary table, the table name after ALTER
|
||||
TABLE does not correspond to the internal table name, and
|
||||
table_to_alter is NULL. TODO: should we fix this somehow? */
|
||||
|
||||
if (table_to_alter == NULL) {
|
||||
highest_id_so_far = 0;
|
||||
} else {
|
||||
highest_id_so_far = dict_table_get_highest_foreign_id(
|
||||
table_to_alter);
|
||||
}
|
||||
|
||||
/* Scan for foreign key declarations in a loop */
|
||||
loop:
|
||||
ptr = dict_scan_to(ptr, (char *) "FOREIGN");
|
||||
/* Scan either to "CONSTRAINT" or "FOREIGN", whichever is closer */
|
||||
|
||||
ptr1 = dict_scan_to(ptr, (char *) "CONSTRAINT");
|
||||
ptr2 = dict_scan_to(ptr, (char *) "FOREIGN");
|
||||
|
||||
constraint_name = NULL;
|
||||
|
||||
if (ptr1 < ptr2) {
|
||||
/* The user has specified a constraint name. Pick it so
|
||||
that we can store 'databasename/constraintname' as the id of
|
||||
the id of the constraint to system tables. */
|
||||
ptr = ptr1;
|
||||
|
||||
ptr = dict_accept(ptr, (char *) "CONSTRAINT", &success);
|
||||
|
||||
ut_a(success);
|
||||
|
||||
if (!isspace(*ptr)) {
|
||||
goto loop;
|
||||
}
|
||||
|
||||
ptr = dict_scan_id(ptr, &constraint_name, &constraint_name_len,
|
||||
FALSE);
|
||||
} else {
|
||||
ptr = ptr2;
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
|
||||
/**********************************************************/
|
||||
/* The following call adds the foreign key constraints
|
||||
to the data dictionary system tables on disk */
|
||||
|
||||
error = dict_create_add_foreigns_to_dictionary(table, trx);
|
||||
|
||||
error = dict_create_add_foreigns_to_dictionary(
|
||||
highest_id_so_far, table, trx);
|
||||
return(error);
|
||||
}
|
||||
|
||||
|
@ -2703,6 +2938,28 @@ col_loop1:
|
|||
|
||||
foreign = dict_mem_foreign_create();
|
||||
|
||||
if (constraint_name) {
|
||||
ulint db_len;
|
||||
|
||||
/* Catenate 'databasename/' to the constraint name specified
|
||||
by the user: we conceive the constraint as belonging to the
|
||||
same MySQL 'database' as the table itself. We store the name
|
||||
to foreign->id. */
|
||||
|
||||
db_len = dict_get_db_name_len(table->name);
|
||||
|
||||
foreign->id = mem_heap_alloc(foreign->heap,
|
||||
db_len + 1 + constraint_name_len + 1);
|
||||
|
||||
ut_memcpy(foreign->id, table->name, db_len);
|
||||
|
||||
foreign->id[db_len] = '/';
|
||||
|
||||
ut_memcpy(foreign->id + db_len + 1, constraint_name,
|
||||
constraint_name_len);
|
||||
foreign->id[db_len + 1 + constraint_name_len] = '\0';
|
||||
}
|
||||
|
||||
foreign->foreign_table = table;
|
||||
foreign->foreign_table_name = table->name;
|
||||
foreign->foreign_index = index;
|
||||
|
@ -3004,7 +3261,7 @@ dict_create_foreign_constraints(
|
|||
FOREIGN KEY (a, b) REFERENCES table2(c, d),
|
||||
table2 can be written also with the database
|
||||
name before it: test.table2; the default
|
||||
database id the database of parameter name */
|
||||
database is the database of parameter name */
|
||||
char* name) /* in: table full name in the normalized form
|
||||
database_name/table_name */
|
||||
{
|
||||
|
@ -3088,7 +3345,7 @@ loop:
|
|||
goto syntax_error;
|
||||
}
|
||||
|
||||
ptr = dict_scan_id(ptr, &start, &len);
|
||||
ptr = dict_scan_id(ptr, &start, &len, TRUE);
|
||||
|
||||
if (start == NULL) {
|
||||
|
||||
|
@ -3106,8 +3363,10 @@ loop:
|
|||
foreign = UT_LIST_GET_FIRST(table->foreign_list);
|
||||
|
||||
while (foreign != NULL) {
|
||||
if (0 == ut_strcmp(foreign->id, id)) {
|
||||
|
||||
if (0 == ut_strcmp(foreign->id, id)
|
||||
|| (ut_str_contains(foreign->id, '/')
|
||||
&& 0 == ut_strcmp(id,
|
||||
dict_remove_db_name(foreign->id)))) {
|
||||
/* Found */
|
||||
break;
|
||||
}
|
||||
|
@ -3120,8 +3379,8 @@ loop:
|
|||
ut_sprintf_timestamp(buf);
|
||||
sprintf(buf + strlen(buf),
|
||||
" Error in dropping of a foreign key constraint of table %.500s,\n"
|
||||
"just before:\n%s\n in SQL command\n%s\nCannot find a constraint with the\n"
|
||||
"given id %s.\n", table->name, ptr, str, id);
|
||||
"in SQL command\n%s\nCannot find a constraint with the\n"
|
||||
"given id %s.\n", table->name, str, id);
|
||||
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
|
||||
mutex_exit(&dict_foreign_err_mutex);
|
||||
|
||||
|
@ -3937,10 +4196,20 @@ dict_print_info_on_foreign_key_in_create_format(
|
|||
char* buf) /* in: buffer of at least 5000 bytes */
|
||||
{
|
||||
char* buf2 = buf;
|
||||
char* stripped_id;
|
||||
ulint cpy_len;
|
||||
ulint i;
|
||||
|
||||
if (ut_str_contains(foreign->id, '/')) {
|
||||
/* Strip the preceding database name from the constraint id */
|
||||
stripped_id = foreign->id + 1
|
||||
+ dict_get_db_name_len(foreign->id);
|
||||
} else {
|
||||
stripped_id = foreign->id;
|
||||
}
|
||||
|
||||
buf2 += sprintf(buf2, ",\n CONSTRAINT `%s` FOREIGN KEY (",
|
||||
foreign->id);
|
||||
stripped_id);
|
||||
for (i = 0; i < foreign->n_fields; i++) {
|
||||
if ((ulint)(buf2 - buf) >= 4000) {
|
||||
|
||||
|
@ -3956,24 +4225,31 @@ dict_print_info_on_foreign_key_in_create_format(
|
|||
|
||||
if (dict_tables_have_same_db(foreign->foreign_table_name,
|
||||
foreign->referenced_table_name)) {
|
||||
/* Do not print the database name of the referenced
|
||||
table */
|
||||
/* Do not print the database name of the referenced table */
|
||||
buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
|
||||
dict_remove_db_name(
|
||||
foreign->referenced_table_name));
|
||||
} else {
|
||||
buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
|
||||
foreign->referenced_table_name);
|
||||
/* Change the '/' in the table name to '.' */
|
||||
buf2 += sprintf(buf2, ") REFERENCES `");
|
||||
|
||||
/* Look for the '/' in the table name */
|
||||
|
||||
for (i = ut_strlen(buf); i > 0; i--) {
|
||||
if (buf[i] == '/') {
|
||||
|
||||
buf[i] = '.';
|
||||
|
||||
break;
|
||||
}
|
||||
i = 0;
|
||||
while (foreign->referenced_table_name[i] != '/') {
|
||||
i++;
|
||||
}
|
||||
|
||||
cpy_len = i;
|
||||
|
||||
if (cpy_len > 500) {
|
||||
cpy_len = 500;
|
||||
}
|
||||
|
||||
memcpy(buf2, foreign->referenced_table_name, cpy_len);
|
||||
buf2 += cpy_len;
|
||||
|
||||
buf2 += sprintf(buf2, "`.`%.500s` (",
|
||||
foreign->referenced_table_name + i + 1);
|
||||
}
|
||||
|
||||
for (i = 0; i < foreign->n_fields; i++) {
|
||||
|
|
|
@ -262,6 +262,14 @@ dtuple_set_types_binary(
|
|||
/*====================*/
|
||||
dtuple_t* tuple, /* in: data tuple */
|
||||
ulint n); /* in: number of fields to set */
|
||||
/**************************************************************************
|
||||
Checks if a dtuple contains an SQL null value. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtuple_contains_null(
|
||||
/*=================*/
|
||||
/* out: TRUE if some field is SQL null */
|
||||
dtuple_t* tuple); /* in: dtuple */
|
||||
/**************************************************************
|
||||
Checks that a data field is typed. Asserts an error if not. */
|
||||
|
||||
|
|
|
@ -406,3 +406,28 @@ data_write_sql_null(
|
|||
data[j] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Checks if a dtuple contains an SQL null value. */
|
||||
UNIV_INLINE
|
||||
ibool
|
||||
dtuple_contains_null(
|
||||
/*=================*/
|
||||
/* out: TRUE if some field is SQL null */
|
||||
dtuple_t* tuple) /* in: dtuple */
|
||||
{
|
||||
ulint n;
|
||||
ulint i;
|
||||
|
||||
n = dtuple_get_n_fields(tuple);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (dfield_get_len(dtuple_get_nth_field(tuple, i))
|
||||
== UNIV_SQL_NULL) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
||||
|
|
|
@ -81,12 +81,25 @@ dict_create_or_check_foreign_constraint_tables(void);
|
|||
/*================================================*/
|
||||
/* out: DB_SUCCESS or error code */
|
||||
/************************************************************************
|
||||
Adds foreign key definitions to data dictionary tables in the database. */
|
||||
Adds foreign key definitions to data dictionary tables in the database. We
|
||||
look at table->foreign_list, and also generate names to constraints that were
|
||||
not named by the user. A generated constraint has a name of the format
|
||||
databasename/tablename_ibfk_<number>, where the numbers start from 1, and are
|
||||
given locally for this table, that is, the number is not global, as in the
|
||||
old format constraints < 4.0.18 it used to be. */
|
||||
|
||||
ulint
|
||||
dict_create_add_foreigns_to_dictionary(
|
||||
/*===================================*/
|
||||
/* out: error code or DB_SUCCESS */
|
||||
ulint start_id,/* in: if we are actually doing ALTER TABLE
|
||||
ADD CONSTRAINT, we want to generate constraint
|
||||
numbers which are bigger than in the table so
|
||||
far; we number the constraints from
|
||||
start_id + 1 up; start_id should be set to 0 if
|
||||
we are creating a new table, or if the table
|
||||
so far has no constraints for which the name
|
||||
was generated here */
|
||||
dict_table_t* table, /* in: table */
|
||||
trx_t* trx); /* in: transaction */
|
||||
|
||||
|
|
|
@ -26,6 +26,14 @@ Created 1/8/1996 Heikki Tuuri
|
|||
#include "ut0byte.h"
|
||||
#include "trx0types.h"
|
||||
|
||||
/************************************************************************
|
||||
Get the database name length in a table name. */
|
||||
|
||||
ulint
|
||||
dict_get_db_name_len(
|
||||
/*=================*/
|
||||
/* out: database name length */
|
||||
char* name); /* in: table name in the form dbname '/' tablename */
|
||||
/*************************************************************************
|
||||
Accepts a specified string. Comparisons are case-insensitive. */
|
||||
|
||||
|
@ -217,6 +225,15 @@ dict_foreign_add_to_cache(
|
|||
/* out: DB_SUCCESS or error code */
|
||||
dict_foreign_t* foreign); /* in, own: foreign key constraint */
|
||||
/*************************************************************************
|
||||
Checks if a table is referenced by foreign keys. */
|
||||
|
||||
ibool
|
||||
dict_table_referenced_by_foreign_key(
|
||||
/*=================================*/
|
||||
/* out: TRUE if table is referenced by a
|
||||
foreign key */
|
||||
dict_table_t* table); /* in: InnoDB table */
|
||||
/*************************************************************************
|
||||
Scans a table create SQL string and adds to the data dictionary
|
||||
the foreign key constraints declared in the string. This function
|
||||
should be called after the indexes for a table have been created.
|
||||
|
|
|
@ -95,10 +95,17 @@ ut_str_catenate(
|
|||
/* out, own: catenated null-terminated string */
|
||||
char* str1, /* in: null-terminated string */
|
||||
char* str2); /* in: null-terminated string */
|
||||
/**************************************************************************
|
||||
Checks if a null-terminated string contains a certain character. */
|
||||
|
||||
ibool
|
||||
ut_str_contains(
|
||||
/*============*/
|
||||
char* str, /* in: null-terminated string */
|
||||
char c); /* in: character */
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "ut0mem.ic"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -655,7 +655,18 @@ failure:
|
|||
|
||||
if (!success) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: log file group too small for innodb_thread_concurrency\n");
|
||||
"InnoDB: Error: ib_logfiles are too small for innodb_thread_concurrency %lu.\n"
|
||||
"InnoDB: The combined size of ib_logfiles should be bigger than\n"
|
||||
"InnoDB: 200 kB * innodb_thread_concurrency.\n"
|
||||
"InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n"
|
||||
"InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n"
|
||||
"InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n"
|
||||
"InnoDB: section 5 of http://www.innodb.com/ibman.php",
|
||||
(ulong)srv_thread_concurrency);
|
||||
fprintf(stderr,
|
||||
"InnoDB: Cannot continue operation. Calling exit(1).\n");
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return(success);
|
||||
|
|
|
@ -682,14 +682,6 @@ row_ins_foreign_check_on_constraint(
|
|||
(DICT_FOREIGN_ON_DELETE_CASCADE
|
||||
| DICT_FOREIGN_ON_DELETE_SET_NULL))) {
|
||||
|
||||
/* No action is defined: return a foreign key error if
|
||||
NO ACTION is not specified */
|
||||
|
||||
if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) {
|
||||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
row_ins_foreign_report_err((char*)"Trying to delete",
|
||||
thr, foreign,
|
||||
btr_pcur_get_rec(pcur), entry);
|
||||
|
@ -703,14 +695,6 @@ row_ins_foreign_check_on_constraint(
|
|||
|
||||
/* This is an UPDATE */
|
||||
|
||||
/* No action is defined: return a foreign key error if
|
||||
NO ACTION is not specified */
|
||||
|
||||
if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) {
|
||||
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
row_ins_foreign_report_err((char*)"Trying to update",
|
||||
thr, foreign,
|
||||
btr_pcur_get_rec(pcur), entry);
|
||||
|
|
|
@ -2085,6 +2085,7 @@ row_drop_table_for_mysql(
|
|||
char* name, /* in: table name */
|
||||
trx_t* trx) /* in: transaction handle */
|
||||
{
|
||||
dict_foreign_t* foreign;
|
||||
dict_table_t* table;
|
||||
ulint space_id;
|
||||
que_thr_t* thr;
|
||||
|
@ -2282,6 +2283,38 @@ row_drop_table_for_mysql(
|
|||
goto funct_exit;
|
||||
}
|
||||
|
||||
/* Check if the table is referenced by foreign key constraints from
|
||||
some other table (not the table itself) */
|
||||
|
||||
foreign = UT_LIST_GET_FIRST(table->referenced_list);
|
||||
|
||||
while (foreign && foreign->foreign_table == table) {
|
||||
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
|
||||
}
|
||||
|
||||
if (foreign && trx->check_foreigns) {
|
||||
char* buf = dict_foreign_err_buf;
|
||||
|
||||
/* We only allow dropping a referenced table if
|
||||
FOREIGN_KEY_CHECKS is set to 0 */
|
||||
|
||||
err = DB_CANNOT_DROP_CONSTRAINT;
|
||||
|
||||
mutex_enter(&dict_foreign_err_mutex);
|
||||
ut_sprintf_timestamp(buf);
|
||||
|
||||
sprintf(buf + strlen(buf),
|
||||
" Cannot drop table %.500s\n", name);
|
||||
sprintf(buf + strlen(buf),
|
||||
"because it is referenced by %.500s\n", foreign->foreign_table_name);
|
||||
|
||||
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
|
||||
|
||||
mutex_exit(&dict_foreign_err_mutex);
|
||||
|
||||
goto funct_exit;
|
||||
}
|
||||
|
||||
if (table->n_mysql_handles_opened > 0) {
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
|
@ -2469,7 +2502,7 @@ row_is_mysql_tmp_table_name(
|
|||
{
|
||||
ulint i;
|
||||
|
||||
for (i = 0; i <= ut_strlen(name) - 5; i++) {
|
||||
for (i = 0; i + 5 <= ut_strlen(name); i++) {
|
||||
if (ut_memcmp(name + i, (char*)"/#sql", 5) == 0) {
|
||||
|
||||
return(TRUE);
|
||||
|
@ -2505,6 +2538,7 @@ row_rename_table_for_mysql(
|
|||
ulint keywordlen;
|
||||
ulint len;
|
||||
ulint i;
|
||||
char* db_name;
|
||||
ibool success;
|
||||
char buf[2 * OS_FILE_MAX_PATH];
|
||||
|
||||
|
@ -2593,6 +2627,15 @@ row_rename_table_for_mysql(
|
|||
"PROCEDURE RENAME_TABLE_PROC () IS\n"
|
||||
"new_table_name CHAR;\n"
|
||||
"old_table_name CHAR;\n"
|
||||
"gen_constr_prefix CHAR;\n"
|
||||
"new_db_name CHAR;\n"
|
||||
"foreign_id CHAR;\n"
|
||||
"new_foreign_id CHAR;\n"
|
||||
"old_db_name_len INT;\n"
|
||||
"old_t_name_len INT;\n"
|
||||
"new_db_name_len INT;\n"
|
||||
"id_len INT;\n"
|
||||
"found INT;\n"
|
||||
"BEGIN\n"
|
||||
"new_table_name :='";
|
||||
|
||||
|
@ -2619,32 +2662,94 @@ row_rename_table_for_mysql(
|
|||
}
|
||||
|
||||
str3 = mem_heap_alloc(heap,
|
||||
1000 + 500 * n_constraints_to_drop);
|
||||
1000 + 1000 * n_constraints_to_drop);
|
||||
*str3 = '\0';
|
||||
sprintf(str3,
|
||||
"';\n"
|
||||
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
|
||||
"WHERE NAME = old_table_name;\n");
|
||||
|
||||
db_name = mem_heap_alloc(heap, 1 + dict_get_db_name_len(
|
||||
old_name));
|
||||
ut_memcpy(db_name, old_name, dict_get_db_name_len(old_name));
|
||||
db_name[dict_get_db_name_len(old_name)] = '\0';
|
||||
|
||||
/* Internally, old format < 4.0.18 constraints have as the
|
||||
constraint id <number>_<number>, while new format constraints
|
||||
have <databasename>/<constraintname>. */
|
||||
|
||||
for (i = 0; i < n_constraints_to_drop; i++) {
|
||||
|
||||
sprintf(str3 + strlen(str3),
|
||||
"DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s';\n"
|
||||
"DELETE FROM SYS_FOREIGN WHERE ID = '%s';\n",
|
||||
"DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s/%s';\n"
|
||||
"DELETE FROM SYS_FOREIGN WHERE ID = '%s/%s';\n",
|
||||
db_name, constraints_to_drop[i],
|
||||
db_name, constraints_to_drop[i]);
|
||||
|
||||
if (!ut_str_contains(constraints_to_drop[i], '/')) {
|
||||
/* If this happens to be an old format
|
||||
constraint, let us delete it. Since all new
|
||||
format constraints contain '/', it does no
|
||||
harm to run these DELETEs anyway. */
|
||||
|
||||
sprintf(str3 + strlen(str3),
|
||||
"DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s';\n"
|
||||
"DELETE FROM SYS_FOREIGN WHERE ID = '%s';\n",
|
||||
constraints_to_drop[i],
|
||||
constraints_to_drop[i]);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(str3 + strlen(str3),
|
||||
"END;\n");
|
||||
|
||||
ut_a(strlen(str3) < 1000 + 500 * n_constraints_to_drop);
|
||||
ut_a(strlen(str3) < 1000 + 1000 * n_constraints_to_drop);
|
||||
} else {
|
||||
str3 = (char*)
|
||||
"';\n"
|
||||
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
|
||||
"WHERE NAME = old_table_name;\n"
|
||||
"UPDATE SYS_FOREIGN SET FOR_NAME = new_table_name\n"
|
||||
"WHERE FOR_NAME = old_table_name;\n"
|
||||
"found := 1;\n"
|
||||
"old_db_name_len := INSTR(old_table_name, '/') - 1;\n"
|
||||
"new_db_name_len := INSTR(new_table_name, '/') - 1;\n"
|
||||
"new_db_name := SUBSTR(new_table_name, 0, new_db_name_len);\n"
|
||||
"old_t_name_len := LENGTH(old_table_name);\n"
|
||||
"gen_constr_prefix := CONCAT(old_table_name, '_ibfk_');\n"
|
||||
"WHILE found = 1 LOOP\n"
|
||||
" SELECT ID INTO foreign_id\n"
|
||||
" FROM SYS_FOREIGN\n"
|
||||
" WHERE FOR_NAME = old_table_name;\n"
|
||||
" IF (SQL % NOTFOUND) THEN\n"
|
||||
" found := 0;\n"
|
||||
" ELSE\n"
|
||||
" UPDATE SYS_FOREIGN\n"
|
||||
" SET FOR_NAME = new_table_name\n"
|
||||
" WHERE ID = foreign_id;\n"
|
||||
" id_len := LENGTH(foreign_id);\n"
|
||||
" IF (INSTR(foreign_id, '/') > 0) THEN\n"
|
||||
" IF (INSTR(foreign_id,\n"
|
||||
" gen_constr_prefix) > 0)\n"
|
||||
" THEN\n"
|
||||
" new_foreign_id :=\n"
|
||||
" CONCAT(new_table_name,\n"
|
||||
" SUBSTR(foreign_id, old_t_name_len,\n"
|
||||
" id_len - old_t_name_len));\n"
|
||||
" ELSE\n"
|
||||
" new_foreign_id :=\n"
|
||||
" CONCAT(new_db_name,\n"
|
||||
" SUBSTR(foreign_id,\n"
|
||||
" old_db_name_len,\n"
|
||||
" id_len - old_db_name_len));\n"
|
||||
" END IF;\n"
|
||||
" UPDATE SYS_FOREIGN\n"
|
||||
" SET ID = new_foreign_id\n"
|
||||
" WHERE ID = foreign_id;\n"
|
||||
" UPDATE SYS_FOREIGN_COLS\n"
|
||||
" SET ID = new_foreign_id\n"
|
||||
" WHERE ID = foreign_id;\n"
|
||||
" END IF;\n"
|
||||
" END IF;\n"
|
||||
"END LOOP;\n"
|
||||
"UPDATE SYS_FOREIGN SET REF_NAME = new_table_name\n"
|
||||
"WHERE REF_NAME = old_table_name;\n"
|
||||
"END;\n";
|
||||
|
|
|
@ -2886,7 +2886,16 @@ row_search_for_mysql(
|
|||
if (match_mode == ROW_SEL_EXACT
|
||||
&& index->type & DICT_UNIQUE
|
||||
&& dtuple_get_n_fields(search_tuple)
|
||||
== dict_index_get_n_unique(index)) {
|
||||
== dict_index_get_n_unique(index)
|
||||
&& (index->type & DICT_CLUSTERED
|
||||
|| !dtuple_contains_null(search_tuple))) {
|
||||
|
||||
/* Note above that a UNIQUE secondary index can contain many
|
||||
rows with the same key value if one of the columns is the SQL
|
||||
null. A clustered index under MySQL can never contain null
|
||||
columns because we demand that all the columns in primary key
|
||||
are non-null. */
|
||||
|
||||
unique_search = TRUE;
|
||||
|
||||
/* Even if the condition is unique, MySQL seems to try to
|
||||
|
|
|
@ -159,7 +159,7 @@ struct sync_thread_struct{
|
|||
};
|
||||
|
||||
/* Number of slots reserved for each OS thread in the sync level array */
|
||||
#define SYNC_THREAD_N_LEVELS 7000
|
||||
#define SYNC_THREAD_N_LEVELS 10000
|
||||
|
||||
struct sync_level_struct{
|
||||
void* latch; /* pointer to a mutex or an rw-lock; NULL means that
|
||||
|
|
|
@ -45,6 +45,43 @@ or there was no master log position info inside InnoDB. */
|
|||
char trx_sys_mysql_master_log_name[TRX_SYS_MYSQL_LOG_NAME_LEN];
|
||||
ib_longlong trx_sys_mysql_master_log_pos = -1;
|
||||
|
||||
/* Do NOT merge this to the 4.1 code base! */
|
||||
ibool trx_sys_downgrading_from_4_1_1 = FALSE;
|
||||
|
||||
/********************************************************************
|
||||
Do NOT merge this to the 4.1 code base!
|
||||
Marks the trx sys header when we have successfully downgraded from the >= 4.1.1
|
||||
multiple tablespace format back to the 4.0 format. */
|
||||
|
||||
void
|
||||
trx_sys_mark_downgraded_from_4_1_1(void)
|
||||
/*====================================*/
|
||||
{
|
||||
page_t* page;
|
||||
byte* doublewrite;
|
||||
mtr_t mtr;
|
||||
|
||||
/* Let us mark to the trx_sys header that the downgrade has been
|
||||
done. */
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
page = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
|
||||
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
|
||||
|
||||
doublewrite = page + TRX_SYS_DOUBLEWRITE;
|
||||
|
||||
mlog_write_ulint(doublewrite + TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED,
|
||||
TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N + 1,
|
||||
MLOG_4BYTES, &mtr);
|
||||
mtr_commit(&mtr);
|
||||
|
||||
/* Flush the modified pages to disk and make a checkpoint */
|
||||
log_make_checkpoint_at(ut_dulint_max, TRUE);
|
||||
|
||||
trx_sys_downgrading_from_4_1_1 = FALSE;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
Determines if a page number is located inside the doublewrite buffer. */
|
||||
|
||||
|
@ -187,7 +224,7 @@ start_again:
|
|||
just read in some numbers */
|
||||
|
||||
trx_doublewrite_init(doublewrite);
|
||||
|
||||
|
||||
mtr_commit(&mtr);
|
||||
} else {
|
||||
fprintf(stderr,
|
||||
|
@ -351,6 +388,31 @@ trx_sys_doublewrite_init_or_restore_pages(
|
|||
== TRX_SYS_DOUBLEWRITE_MAGIC_N) {
|
||||
/* The doublewrite buffer has been created */
|
||||
|
||||
/* Do NOT merge to the 4.1 code base! */
|
||||
if (mach_read_from_4(doublewrite
|
||||
+ TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED)
|
||||
== TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N) {
|
||||
|
||||
fprintf(stderr,
|
||||
"InnoDB: You are downgrading from the multiple tablespace format of\n"
|
||||
"InnoDB: >= MySQL-4.1.1 back to the old format of MySQL-4.0.\n"
|
||||
"InnoDB:\n"
|
||||
"InnoDB: MAKE SURE that the mysqld server is idle, and purge and the insert\n"
|
||||
"InnoDB: buffer merge have run to completion under >= 4.1.1 before trying to\n"
|
||||
"InnoDB: downgrade! You can determine this by looking at SHOW INNODB STATUS:\n"
|
||||
"InnoDB: if the Main thread is 'waiting for server activity' and SHOW\n"
|
||||
"InnoDB: PROCESSLIST shows that you have ended all other connections\n"
|
||||
"InnoDB: to mysqld, then purge and the insert buffer merge have been\n"
|
||||
"InnoDB: completed.\n"
|
||||
"InnoDB: If you have already created tables in >= 4.1.1, then those\n"
|
||||
"InnoDB: tables cannot be used under 4.0.\n"
|
||||
"InnoDB: NOTE THAT this downgrade procedure has not been properly tested!\n"
|
||||
"InnoDB: The safe way to downgrade is to dump all InnoDB tables and recreate\n"
|
||||
"InnoDB: the whole tablespace.\n");
|
||||
|
||||
trx_sys_downgrading_from_4_1_1 = TRUE;
|
||||
}
|
||||
|
||||
trx_doublewrite_init(doublewrite);
|
||||
|
||||
block1 = trx_doublewrite->block1;
|
||||
|
|
|
@ -258,3 +258,27 @@ ut_str_catenate(
|
|||
|
||||
return(str);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Checks if a null-terminated string contains a certain character. */
|
||||
|
||||
ibool
|
||||
ut_str_contains(
|
||||
/*============*/
|
||||
char* str, /* in: null-terminated string */
|
||||
char c) /* in: character */
|
||||
{
|
||||
ulint len;
|
||||
ulint i;
|
||||
|
||||
len = ut_strlen(str);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (str[i] == c) {
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return(FALSE);
|
||||
}
|
|
@ -2997,7 +2997,7 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
if((*mysql->methods->unbuffered_fetch)(mysql, ( char **)&row))
|
||||
if ((*mysql->methods->unbuffered_fetch)(mysql, (char**) &row))
|
||||
{
|
||||
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
|
||||
mysql->net.sqlstate);
|
||||
|
|
|
@ -28,8 +28,8 @@ EXPORTS
|
|||
my_print_variables
|
||||
my_realloc
|
||||
my_strdup
|
||||
my_thread_end
|
||||
my_thread_init
|
||||
mysql_thread_end
|
||||
mysql_thread_init
|
||||
myodbc_remove_escape
|
||||
mysql_affected_rows
|
||||
mysql_autocommit
|
||||
|
|
|
@ -189,8 +189,9 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
|
|||
thd->data= 0;
|
||||
}
|
||||
if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
|
||||
(const char*)&stmt->stmt_id,sizeof(stmt->stmt_id),1)
|
||||
|| emb_mysql_read_query_result(stmt->mysql))
|
||||
(const char*)&stmt->stmt_id,sizeof(stmt->stmt_id),
|
||||
1) ||
|
||||
emb_mysql_read_query_result(stmt->mysql))
|
||||
{
|
||||
NET *net= &stmt->mysql->net;
|
||||
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
|
||||
|
@ -251,8 +252,8 @@ int emb_next_result(MYSQL *mysql)
|
|||
DBUG_ENTER("emb_next_result");
|
||||
|
||||
if (emb_advanced_command(mysql, COM_QUERY,0,0,
|
||||
thd->query_rest.ptr(),thd->query_rest.length(),1)
|
||||
|| emb_mysql_read_query_result(mysql))
|
||||
thd->query_rest.ptr(),thd->query_rest.length(),1) ||
|
||||
emb_mysql_read_query_result(mysql))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
DBUG_RETURN(0); /* No more results */
|
||||
|
|
|
@ -21,7 +21,26 @@ man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \
|
|||
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
|
||||
perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
EXTRA_DIST = mysql.1.in isamchk.1.in isamlog.1.in mysql_zap.1.in \
|
||||
mysqlaccess.1.in mysqladmin.1.in mysqld.1.in mysqld_multi.1.in \
|
||||
mysqldump.1.in mysqlshow.1.in perror.1.in replace.1.in \
|
||||
mysqld_safe.1.in mysql_fix_privilege_tables.1.in
|
||||
|
||||
CLEANFILES = $(man_MANS)
|
||||
|
||||
SUFFIXES = .in
|
||||
|
||||
.in:
|
||||
@RM@ -f $@ $@-t
|
||||
@SED@ \
|
||||
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
||||
-e 's!@''sysconfdir''@!@sysconfdir@!' \
|
||||
-e 's!@''bindir''@!$(bindir)!g' \
|
||||
-e 's!@''libexecdir''@!$(libexecdir)!g' \
|
||||
-e 's!@''localstatedir''@!$(localstatedir)!g' \
|
||||
-e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
|
||||
$< > $@-t
|
||||
@MV@ $@-t $@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH isamchk 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH isamchk 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
.BR isamchk
|
||||
\- Description, check and repair of ISAM tables.
|
||||
|
@ -114,24 +114,29 @@ Print version and exit.
|
|||
.BR \-w | \-\-wait
|
||||
Wait if table is locked.
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH isamlog 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH isamlog 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
isamlog - Write info about whats in a nisam log file.
|
||||
.SH USAGE
|
||||
|
@ -71,27 +71,31 @@ If one gives table names as arguments only these tables will be updated
|
|||
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
|
||||
.SH AUTHOR
|
||||
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,6 +1,8 @@
|
|||
.TH mysql 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysql 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysql \- text-based client for mysqld, a SQL-based relational database daemon
|
||||
.SH USAGE
|
||||
mysql [OPTIONS] [Database]
|
||||
.SH SYNOPSIS
|
||||
.B mysql
|
||||
.RB [ \-B | \-\-batch ]
|
||||
|
@ -105,16 +107,19 @@ version number and exit.
|
|||
Wait and retry if the database server connection is down.
|
||||
.SH FILES
|
||||
.TP 2.2i
|
||||
.I /depot/bin/mysql
|
||||
executable
|
||||
.I @sysconfdir@/my.cnf
|
||||
MySQL configuration file
|
||||
.TP
|
||||
.I /depot/bin/mysqld
|
||||
executable
|
||||
.I @bindir@/mysql
|
||||
Client executable
|
||||
.TP
|
||||
.I /depot/bin/mysqld_safe
|
||||
.I @libexecdir@/mysqld
|
||||
Server executable
|
||||
.TP
|
||||
.I @bindir@/mysqld_safe
|
||||
executable shell script for starting mysqld safely
|
||||
.TP
|
||||
.I /site/var/mysql/data
|
||||
.I @localstatedir@
|
||||
location of database files
|
||||
.SH EXAMPLE
|
||||
You can also read a backup dump file back into MySQL with:
|
||||
|
@ -124,24 +129,29 @@ You can also read a backup dump file back into MySQL with:
|
|||
.BR <
|
||||
backup-file.sql
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 6.3, distribution 3.20.20
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 6.3, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/)
|
||||
This software comes with no warranty.
|
||||
Manual page by R. P. C. Rodgers,
|
||||
Lister Hill National Center for Biomedical Communication,
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysql 1 "17 March 2003" "MySQL 4.0" "MySQL database"
|
||||
.TH mysql 1 "17 March 2003" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
|
||||
.SH SYNOPSIS
|
||||
|
@ -14,7 +14,25 @@ If you get 'Access denied' errors, run the script again
|
|||
and give the MySQL root user password as an argument.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
mysql (1), mysqld (1)
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
This manpage was written by Christian Hammers <ch@debian.org>.
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
.TH zap 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.SH NAME
|
||||
zap - a perl script used to kill processes
|
||||
.SH USAGE
|
||||
/usr/bin/mysql_zap [-signal] [-?Ift] pattern
|
||||
.SH SYNOPSIS
|
||||
.B zap
|
||||
.RB [ \-I | \-? ]
|
||||
.RB [ \-f ]
|
||||
.RB [ \-t ]
|
||||
.SH DESCRIPTION
|
||||
.TP
|
||||
.BR zap
|
||||
supports by executing
|
||||
.TP
|
||||
.BR \-I | \-?
|
||||
info
|
||||
.TP
|
||||
.BR \-f
|
||||
force
|
||||
.TP
|
||||
.BR \-t
|
||||
test
|
||||
.SH NOTE
|
||||
If
|
||||
.BR -f
|
||||
isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
|
||||
.BR -t
|
||||
is given the processes is only shown on stdout.
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
|
||||
.\" end of man page
|
52
man/mysql_zap.1.in
Normal file
52
man/mysql_zap.1.in
Normal file
|
@ -0,0 +1,52 @@
|
|||
.TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
zap - a perl script used to kill processes
|
||||
.SH USAGE
|
||||
/usr/bin/mysql_zap [-signal] [-?Ift] pattern
|
||||
.SH SYNOPSIS
|
||||
.B zap
|
||||
.RB [ \-I | \-? ]
|
||||
.RB [ \-f ]
|
||||
.RB [ \-t ]
|
||||
.SH DESCRIPTION
|
||||
.TP
|
||||
.BR zap
|
||||
supports by executing
|
||||
.TP
|
||||
.BR \-I | \-?
|
||||
info
|
||||
.TP
|
||||
.BR \-f
|
||||
force
|
||||
.TP
|
||||
.BR \-t
|
||||
test
|
||||
.SH NOTE
|
||||
If
|
||||
.BR -f
|
||||
isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
|
||||
.BR -t
|
||||
is given the processes is only shown on stdout.
|
||||
.SH "SEE ALSO"
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
|
||||
.\" end of man page
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysqlaccess 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
.BR mysqlaccess
|
||||
\- Create new users to mysql.
|
||||
|
@ -95,24 +95,29 @@ If no host is given, `localhost' is assumed
|
|||
Wildcards (*,?,%,_) are allowed for host, user and db, but be sure
|
||||
to escape them from your shell!! (i.e., type \\* or '*')
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysqladmin 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqladmin 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
|
||||
.SH OPTION SYNOPSIS
|
||||
|
@ -178,31 +178,32 @@ Prints variables available
|
|||
.BR version
|
||||
Get version info from server
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
|
||||
system developer (http://www.mercurmedia.com)
|
||||
.\" end of man page
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
.TH mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
.BR mysqld
|
||||
\- Starts the MySQL server demon
|
||||
mysqld \- The MySQL server demon
|
||||
.SH USAGE
|
||||
mysqld [OPTIONS]
|
||||
.SH SYNOPSIS
|
||||
|
@ -204,24 +203,29 @@ Output version information and exit.
|
|||
|
||||
.SH NOTE
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysqld_multi 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqld_multi 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
|
||||
.SH USAGE
|
||||
|
@ -58,27 +58,31 @@ Please see the mysql manual for more detailed information on this.
|
|||
|
||||
|
||||
.SH "SEE ALSO"
|
||||
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
|
||||
.SH AUTHOR
|
||||
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH safe_mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH safe_mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysqld_safe \- start the mysqld daemon on Unix.
|
||||
.SH SYNOPSIS
|
||||
|
@ -60,22 +60,27 @@ Set the timezone (the TZ) variable to the value of this parameter.
|
|||
.SH NOTE
|
||||
Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file.
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com).
|
||||
This software comes with no warranty.
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysqldump 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
|
||||
|
||||
|
@ -247,24 +247,29 @@ If all the databases are wanted, one can use:
|
|||
mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql
|
||||
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH mysqlshow 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH mysqlshow 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
.BR mysqlshow
|
||||
\- Shows the structure of a mysql database (databases,tables and columns)
|
||||
|
@ -67,24 +67,29 @@ If no column is given then all matching columns and columntypes in table
|
|||
are shown
|
||||
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH perror 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH perror 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
perror \- describes a system or MySQL error code.
|
||||
.SH SYNOPSIS
|
||||
|
@ -27,24 +27,29 @@ shell> perror 64 79
|
|||
Error code 64: Machine is not on the network
|
||||
Error code 79: Can not access a needed shared library
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
replace(1)
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
|
|
@ -1,4 +1,4 @@
|
|||
.TH replace 1 "19 December 2000" "MySQL 4.0" "MySQL database"
|
||||
.TH replace 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
|
||||
.SH NAME
|
||||
.TP
|
||||
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
|
||||
|
@ -41,24 +41,29 @@ this command swaps a and b in the given files:
|
|||
.TP
|
||||
shell> replace a b b a -- file1 file2 ...
|
||||
.SH "SEE ALSO"
|
||||
isamchk (1),
|
||||
isamlog (1),
|
||||
mysqlaccess (1),
|
||||
mysqladmin (1),
|
||||
mysqlbug (1),
|
||||
mysqld (1),
|
||||
mysqldump (1),
|
||||
mysqlshow (1),
|
||||
msql2mysql (1),
|
||||
perror (1),
|
||||
replace (1),
|
||||
mysqld_safe (1),
|
||||
which1 (1),
|
||||
zap (1),
|
||||
isamchk(1),
|
||||
isamlog(1),
|
||||
mysql(1),
|
||||
mysqlaccess(1),
|
||||
mysqladmin(1),
|
||||
mysqld(1),
|
||||
mysqld_multi(1),
|
||||
mysqld_safe(1),
|
||||
mysqldump(1),
|
||||
mysql_fix_privilege_tables(1),
|
||||
mysqlshow(1),
|
||||
mysql_zap(1),
|
||||
perror(1),
|
||||
.P
|
||||
For more information please refer to the MySQL reference
|
||||
manual, which may already be installed locally and which
|
||||
is also available online at http://www.mysql.com/doc/en/
|
||||
.SH BUGS
|
||||
Please refer to http://bugs.mysql.com/ to report bugs.
|
||||
.SH AUTHOR
|
||||
Ver 1.0, distribution 3.23.29a
|
||||
Michael (Monty) Widenius (monty@tcx.se),
|
||||
TCX Datakonsult AB (http://www.tcx.se).
|
||||
Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
|
||||
Michael (Monty) Widenius (monty@mysql.com),
|
||||
MySQL AB (http://www.mysql.com/).
|
||||
This software comes with no warranty.
|
||||
Manual page by L. (Kill-9) Pedersen
|
||||
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
|
|
@ -21,18 +21,18 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
|
|||
LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a ../mysys/libmysys.a \
|
||||
../dbug/libdbug.a ../strings/libmystrings.a
|
||||
pkglib_LIBRARIES = libmyisam.a
|
||||
bin_PROGRAMS = myisamchk myisamlog myisampack
|
||||
bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
|
||||
myisamchk_DEPENDENCIES= $(LIBRARIES)
|
||||
myisamlog_DEPENDENCIES= $(LIBRARIES)
|
||||
myisampack_DEPENDENCIES=$(LIBRARIES)
|
||||
noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test ft_dump #ft_test1 ft_eval
|
||||
noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
|
||||
noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h fulltext.h ftdefs.h ft_test1.h ft_eval.h
|
||||
mi_test1_DEPENDENCIES= $(LIBRARIES)
|
||||
mi_test2_DEPENDENCIES= $(LIBRARIES)
|
||||
mi_test3_DEPENDENCIES= $(LIBRARIES)
|
||||
#ft_test1_DEPENDENCIES= $(LIBRARIES)
|
||||
#ft_eval_DEPENDENCIES= $(LIBRARIES)
|
||||
ft_dump_DEPENDENCIES= $(LIBRARIES)
|
||||
myisam_ftdump_DEPENDENCIES= $(LIBRARIES)
|
||||
rt_test_DEPENDENCIES= $(LIBRARIES)
|
||||
sp_test_DEPENDENCIES= $(LIBRARIES)
|
||||
libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
|
||||
|
|
|
@ -947,7 +947,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
info->checksum=mi_checksum(info,record);
|
||||
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
|
||||
{
|
||||
if (_mi_rec_check(info,record, info->rec_buff))
|
||||
if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len))
|
||||
{
|
||||
mi_check_print_error(param,"Found wrong packed record at %s",
|
||||
llstr(start_recpos,llbuff));
|
||||
|
@ -2389,6 +2389,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
|
|||
|
||||
sort_param[i].record= (((char *)(sort_param+share->base.keys))+
|
||||
(share->base.pack_reclength * i));
|
||||
if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
|
||||
{
|
||||
mi_check_print_error(param,"Not enough memory!");
|
||||
goto err;
|
||||
}
|
||||
|
||||
sort_param[i].key_length=share->rec_reflength;
|
||||
for (keyseg=sort_param[i].seg; keyseg->type != HA_KEYTYPE_END;
|
||||
|
@ -2966,7 +2971,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
|
|||
info->checksum=mi_checksum(info,sort_param->record);
|
||||
if ((param->testflag & (T_EXTEND | T_REP)) || searching)
|
||||
{
|
||||
if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff))
|
||||
if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff,
|
||||
sort_param->find_length))
|
||||
{
|
||||
mi_check_print_info(param,"Found wrong packed record at %s",
|
||||
llstr(sort_param->start_recpos,llbuff));
|
||||
|
|
|
@ -14,7 +14,15 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Functions to handle space-packed-records and blobs */
|
||||
/*
|
||||
Functions to handle space-packed-records and blobs
|
||||
|
||||
A row may be stored in one or more linked blocks.
|
||||
The block size is between MI_MIN_BLOCK_LENGTH and MI_MAX_BLOCK_LENGTH.
|
||||
Each block is aligned on MI_DYN_ALIGN_SIZE.
|
||||
The reson for the max block size is to not have too many different types
|
||||
of blocks. For the differnet block types, look at _mi_get_block_info()
|
||||
*/
|
||||
|
||||
#include "myisamdef.h"
|
||||
#include <assert.h>
|
||||
|
@ -148,7 +156,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
|
|||
} while (reclength);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
err:
|
||||
err:
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
@ -264,6 +272,48 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Add a backward link to delete block
|
||||
|
||||
SYNOPSIS
|
||||
update_backward_delete_link()
|
||||
info MyISAM handler
|
||||
delete_block Position to delete block to update.
|
||||
If this is 'HA_OFFSET_ERROR', nothing will be done
|
||||
filepos Position to block that 'delete_block' should point to
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 error. In this case my_error is set.
|
||||
*/
|
||||
|
||||
static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
|
||||
my_off_t filepos)
|
||||
{
|
||||
MI_BLOCK_INFO block_info;
|
||||
DBUG_ENTER("update_backward_delete_link");
|
||||
|
||||
if (delete_block != HA_OFFSET_ERROR)
|
||||
{
|
||||
block_info.second_read=0;
|
||||
if (_mi_get_block_info(&block_info,info->dfile,delete_block)
|
||||
& BLOCK_DELETED)
|
||||
{
|
||||
char buff[8];
|
||||
mi_sizestore(buff,filepos);
|
||||
if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
|
||||
DBUG_RETURN(1); /* Error on write */
|
||||
}
|
||||
else
|
||||
{
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
DBUG_RETURN(1); /* Wrong delete link */
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Delete datarecord from database */
|
||||
/* info->rec_cache.seek_not_done is updated in cmp_record */
|
||||
|
||||
|
@ -272,29 +322,12 @@ static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
|
|||
{
|
||||
uint length,b_type;
|
||||
MI_BLOCK_INFO block_info,del_block;
|
||||
int error=0;
|
||||
int error;
|
||||
my_bool remove_next_block;
|
||||
DBUG_ENTER("delete_dynamic_record");
|
||||
|
||||
/* First add a link from the last block to the new one */
|
||||
if (info->s->state.dellink != HA_OFFSET_ERROR)
|
||||
{
|
||||
block_info.second_read=0;
|
||||
if (_mi_get_block_info(&block_info,info->dfile,info->s->state.dellink)
|
||||
& BLOCK_DELETED)
|
||||
{
|
||||
char buff[8];
|
||||
mi_sizestore(buff,filepos);
|
||||
if (my_pwrite(info->dfile,buff,8,info->s->state.dellink+12,
|
||||
MYF(MY_NABP)))
|
||||
error=1; /* Error on write */
|
||||
}
|
||||
else
|
||||
{
|
||||
error=1; /* Wrong delete link */
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
}
|
||||
}
|
||||
error= update_backward_delete_link(info, info->s->state.dellink, filepos);
|
||||
|
||||
block_info.second_read=second_read;
|
||||
do
|
||||
|
@ -518,21 +551,11 @@ int _mi_write_part_record(MI_INFO *info,
|
|||
*reclength-=(length-head_length);
|
||||
*flag=6;
|
||||
|
||||
if (del_length && next_delete_block != HA_OFFSET_ERROR)
|
||||
if (del_length)
|
||||
{
|
||||
/* link the next delete block to this */
|
||||
MI_BLOCK_INFO del_block;
|
||||
del_block.second_read=0;
|
||||
if (!(_mi_get_block_info(&del_block,info->dfile,next_delete_block)
|
||||
& BLOCK_DELETED))
|
||||
{
|
||||
my_errno=HA_ERR_WRONG_IN_RECORD;
|
||||
goto err;
|
||||
}
|
||||
mi_sizestore(del_block.header+12,info->s->state.dellink);
|
||||
if (my_pwrite(info->dfile,(char*) del_block.header+12,8,
|
||||
next_delete_block+12,
|
||||
MYF(MY_NABP)))
|
||||
if (update_backward_delete_link(info, next_delete_block,
|
||||
info->s->state.dellink))
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@ -574,6 +597,8 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
|
|||
{
|
||||
uint tmp=MY_ALIGN(reclength - length + 3 +
|
||||
test(reclength >= 65520L),MI_DYN_ALIGN_SIZE);
|
||||
/* Don't create a block bigger than MI_MAX_BLOCK_LENGTH */
|
||||
tmp= min(length+tmp, MI_MAX_BLOCK_LENGTH)-length;
|
||||
/* Check if we can extend this block */
|
||||
if (block_info.filepos + block_info.block_len ==
|
||||
info->state->data_file_length &&
|
||||
|
@ -588,9 +613,15 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
|
|||
info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK;
|
||||
length+=tmp;
|
||||
}
|
||||
else
|
||||
else if (length < MI_MAX_BLOCK_LENGTH - MI_MIN_BLOCK_LENGTH)
|
||||
{
|
||||
/* Check if next block is a deleted block */
|
||||
/*
|
||||
Check if next block is a deleted block
|
||||
Above we have MI_MIN_BLOCK_LENGTH to avoid the problem where
|
||||
the next block is so small it can't be splited which could
|
||||
casue problems
|
||||
*/
|
||||
|
||||
MI_BLOCK_INFO del_block;
|
||||
del_block.second_read=0;
|
||||
if (_mi_get_block_info(&del_block,info->dfile,
|
||||
|
@ -601,7 +632,35 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
|
|||
DBUG_PRINT("info",("Extending current block"));
|
||||
if (unlink_deleted_block(info,&del_block))
|
||||
goto err;
|
||||
length+=del_block.block_len;
|
||||
if ((length+=del_block.block_len) > MI_MAX_BLOCK_LENGTH)
|
||||
{
|
||||
/*
|
||||
New block was too big, link overflow part back to
|
||||
delete list
|
||||
*/
|
||||
my_off_t next_pos;
|
||||
ulong rest_length= length-MI_MAX_BLOCK_LENGTH;
|
||||
set_if_bigger(rest_length, MI_MIN_BLOCK_LENGTH);
|
||||
next_pos= del_block.filepos+ del_block.block_len - rest_length;
|
||||
|
||||
if (update_backward_delete_link(info, info->s->state.dellink,
|
||||
next_pos))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
/* create delete link for data that didn't fit into the page */
|
||||
del_block.header[0]=0;
|
||||
mi_int3store(del_block.header+1, rest_length);
|
||||
mi_sizestore(del_block.header+4,info->s->state.dellink);
|
||||
bfill(del_block.header+12,8,255);
|
||||
if (my_pwrite(info->dfile,(byte*) del_block.header,20, next_pos,
|
||||
MYF(MY_NABP)))
|
||||
DBUG_RETURN(1);
|
||||
info->s->state.dellink= next_pos;
|
||||
info->s->state.split++;
|
||||
info->state->del++;
|
||||
info->state->empty+= rest_length;
|
||||
length-= rest_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -615,7 +674,10 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
|
|||
&record,&reclength,&flag))
|
||||
goto err;
|
||||
if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR)
|
||||
{
|
||||
/* Start writing data on deleted blocks */
|
||||
filepos=info->s->state.dellink;
|
||||
}
|
||||
}
|
||||
|
||||
if (block_info.next_filepos != HA_OFFSET_ERROR)
|
||||
|
@ -744,7 +806,8 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
|
|||
Returns 0 if record is ok.
|
||||
*/
|
||||
|
||||
my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
|
||||
my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
|
||||
ulong packed_length)
|
||||
{
|
||||
uint length,new_length,flag,bit,i;
|
||||
char *pos,*end,*packpos,*to;
|
||||
|
@ -836,8 +899,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
|
|||
to+=length;
|
||||
}
|
||||
}
|
||||
if (info->packed_length != (uint) (to - rec_buff)
|
||||
+ test(info->s->calc_checksum) ||
|
||||
if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
|
||||
(bit != 1 && (flag & ~(bit - 1))))
|
||||
goto err;
|
||||
if (info->s->calc_checksum)
|
||||
|
@ -850,7 +912,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
|
|||
}
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
err:
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
@ -966,8 +1028,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
|
|||
if (info->s->calc_checksum)
|
||||
from++;
|
||||
if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1))))
|
||||
DBUG_RETURN((info->packed_length=found_length));
|
||||
err:
|
||||
DBUG_RETURN(found_length);
|
||||
err:
|
||||
my_errno=HA_ERR_RECORD_DELETED;
|
||||
DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx",
|
||||
to,to_end,from,from_end));
|
||||
|
@ -1210,7 +1272,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
|
|||
}
|
||||
}
|
||||
my_errno=0;
|
||||
err:
|
||||
err:
|
||||
if (buffer != info->rec_buff)
|
||||
my_afree((gptr) buffer);
|
||||
DBUG_RETURN(my_errno);
|
||||
|
|
|
@ -249,6 +249,8 @@ struct st_myisam_info {
|
|||
my_off_t last_search_keypage; /* Last keypage when searching */
|
||||
my_off_t dupp_key_pos;
|
||||
ha_checksum checksum;
|
||||
/* QQ: the folloing two xxx_length fields should be removed,
|
||||
as they are not compatible with parallel repair */
|
||||
ulong packed_length,blob_length; /* Length of found, packed record */
|
||||
int dfile; /* The datafile */
|
||||
uint opt_flag; /* Optim. for space/speed */
|
||||
|
@ -577,7 +579,8 @@ extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
|
|||
|
||||
extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
|
||||
ulong reclength);
|
||||
extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos);
|
||||
extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos,
|
||||
ulong reclength);
|
||||
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
|
||||
my_off_t next_filepos,byte **record,
|
||||
ulong *reclength,int *flag);
|
||||
|
|
|
@ -183,7 +183,8 @@ MY_LOG_DIR="$MYSQL_TEST_DIR/var/log"
|
|||
# Set LD_LIBRARY_PATH if we are using shared libraries
|
||||
#
|
||||
LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH
|
||||
DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
|
||||
|
||||
MASTER_RUNNING=0
|
||||
MASTER_MYPORT=9306
|
||||
|
|
|
@ -412,6 +412,27 @@ t1 0 PRIMARY 1 Host A NULL NULL NULL BTREE
|
|||
t1 0 PRIMARY 2 User A 0 NULL NULL BTREE
|
||||
t1 1 Host 1 Host A NULL NULL NULL BTREE disabled
|
||||
DROP TABLE t1;
|
||||
create table t1 (name char(15));
|
||||
insert into t1 (name) values ("current");
|
||||
create database mysqltest;
|
||||
create table mysqltest.t1 (name char(15));
|
||||
insert into mysqltest.t1 (name) values ("mysqltest");
|
||||
select * from t1;
|
||||
name
|
||||
current
|
||||
select * from mysqltest.t1;
|
||||
name
|
||||
mysqltest
|
||||
alter table t1 rename mysqltest.t1;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
select * from t1;
|
||||
name
|
||||
current
|
||||
select * from mysqltest.t1;
|
||||
name
|
||||
mysqltest
|
||||
drop table t1;
|
||||
drop database mysqltest;
|
||||
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
|
||||
ALTER TABLE t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
|
|
@ -162,7 +162,7 @@ last_insert_id()
|
|||
255
|
||||
insert into t1 set i = null;
|
||||
Warnings:
|
||||
Warning 1263 Data truncated, out of range for column 'i' at row 1
|
||||
Warning 1264 Data truncated, out of range for column 'i' at row 1
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
255
|
||||
|
@ -213,7 +213,7 @@ a b
|
|||
delete from t1 where a=0;
|
||||
update t1 set a=NULL where b=6;
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
||||
update t1 set a=300 where b=7;
|
||||
SET SQL_MODE='';
|
||||
insert into t1(a,b)values(NULL,8);
|
||||
|
@ -255,7 +255,7 @@ a b
|
|||
delete from t1 where a=0;
|
||||
update t1 set a=NULL where b=13;
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 9
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 9
|
||||
update t1 set a=500 where b=14;
|
||||
select * from t1 order by b;
|
||||
a b
|
||||
|
|
|
@ -1156,3 +1156,28 @@ create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, pri
|
|||
insert into t2 select * from t1;
|
||||
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
|
||||
drop table t1,t2;
|
||||
create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
|
||||
insert into t1 values ('a',1),('A',2);
|
||||
explain select a from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
|
||||
select a from t1;
|
||||
a
|
||||
a
|
||||
A
|
||||
explain select b from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL b 4 NULL 2 Using index
|
||||
select b from t1;
|
||||
b
|
||||
1
|
||||
2
|
||||
alter table t1 modify a char(10) binary;
|
||||
explain select a from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL a 11 NULL 2 Using index
|
||||
select a from t1;
|
||||
a
|
||||
A
|
||||
a
|
||||
drop table t1;
|
||||
|
|
|
@ -59,10 +59,8 @@ concat("-",a,"-",b,"-")
|
|||
-hello-hello-
|
||||
select concat("-",a,"-",b,"-") from t1 where b="hello ";
|
||||
concat("-",a,"-",b,"-")
|
||||
-hello-hello-
|
||||
select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
|
||||
concat("-",a,"-",b,"-")
|
||||
-hello-hello-
|
||||
alter table t1 modify b tinytext not null, drop key b, add key (b(100));
|
||||
select concat("-",a,"-",b,"-") from t1 where b="hello ";
|
||||
concat("-",a,"-",b,"-")
|
||||
|
|
|
@ -11,7 +11,7 @@ create table t1 (b char(0) not null);
|
|||
create table if not exists t1 (b char(0) not null);
|
||||
insert into t1 values (""),(null);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
select * from t1;
|
||||
b
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ t1 CREATE TABLE `t1` (
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'c1' at row 1
|
||||
Warning 1264 Data truncated for column 'c2' at row 1
|
||||
Warning 1264 Data truncated for column 'c3' at row 1
|
||||
Warning 1265 Data truncated for column 'c1' at row 1
|
||||
Warning 1265 Data truncated for column 'c2' at row 1
|
||||
Warning 1265 Data truncated for column 'c3' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1 c2 c3
|
||||
aaaa aaaa aaaa
|
||||
|
|
|
@ -111,3 +111,28 @@ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
|
|||
SELECT hex(convert(@uF USING tis620));
|
||||
hex(convert(@uF USING tis620))
|
||||
F0F1F2F3F4F5F6F7F8F9FAFBFFFFFFFF
|
||||
SET NAMES tis620;
|
||||
CREATE TABLE t1 (
|
||||
recid int(11) NOT NULL auto_increment,
|
||||
dyninfo text,
|
||||
PRIMARY KEY (recid)
|
||||
) ENGINE=MyISAM;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`recid` int(11) NOT NULL auto_increment,
|
||||
`dyninfo` text,
|
||||
PRIMARY KEY (`recid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=tis620
|
||||
INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n');
|
||||
INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n');
|
||||
SELECT DISTINCT
|
||||
(IF( LOCATE( 'year=\"', dyninfo ) = 1,
|
||||
SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1),
|
||||
IF( LOCATE( '\nyear=\"', dyninfo ),
|
||||
SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7,
|
||||
LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year
|
||||
FROM t1
|
||||
HAVING year != '' ORDER BY year;
|
||||
year
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -83,7 +83,7 @@ set names koi8r;
|
|||
create table t1 (s1 char(1) character set utf8);
|
||||
insert into t1 values (_koi8r'ÁÂ');
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
|
||||
s1 hex(s1) char_length(s1) octet_length(s1)
|
||||
Á D0B0 1 2
|
||||
|
@ -91,19 +91,19 @@ drop table t1;
|
|||
create table t1 (s1 tinytext character set utf8);
|
||||
insert into t1 select repeat('a',300);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('Ñ',300);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('aÑ',300);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('Ña',300);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('ÑÑ',300);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select hex(s1) from t1;
|
||||
hex(s1)
|
||||
616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
|
||||
|
@ -122,19 +122,19 @@ drop table t1;
|
|||
create table t1 (s1 text character set utf8);
|
||||
insert into t1 select repeat('a',66000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('Ñ',66000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('aÑ',66000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('Ña',66000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
insert into t1 select repeat('ÑÑ',66000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select length(s1),char_length(s1) from t1;
|
||||
length(s1) char_length(s1)
|
||||
65535 65535
|
||||
|
@ -146,7 +146,7 @@ drop table t1;
|
|||
create table t1 (s1 char(10) character set utf8);
|
||||
insert into t1 values (0x41FF);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select hex(s1) from t1;
|
||||
hex(s1)
|
||||
41
|
||||
|
@ -154,7 +154,7 @@ drop table t1;
|
|||
create table t1 (s1 varchar(10) character set utf8);
|
||||
insert into t1 values (0x41FF);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select hex(s1) from t1;
|
||||
hex(s1)
|
||||
41
|
||||
|
@ -162,7 +162,7 @@ drop table t1;
|
|||
create table t1 (s1 text character set utf8);
|
||||
insert into t1 values (0x41FF);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 's1' at row 1
|
||||
Warning 1265 Data truncated for column 's1' at row 1
|
||||
select hex(s1) from t1;
|
||||
hex(s1)
|
||||
41
|
||||
|
|
|
@ -93,8 +93,8 @@ a b
|
|||
2 12
|
||||
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
|
||||
Warnings:
|
||||
Error 1241 Subquery returns more than 1 row
|
||||
Error 1241 Subquery returns more than 1 row
|
||||
Error 1242 Subquery returns more than 1 row
|
||||
Error 1242 Subquery returns more than 1 row
|
||||
select * from t11;
|
||||
a b
|
||||
0 10
|
||||
|
@ -113,8 +113,8 @@ a b
|
|||
2 12
|
||||
delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
|
||||
Warnings:
|
||||
Error 1241 Subquery returns more than 1 row
|
||||
Error 1241 Subquery returns more than 1 row
|
||||
Error 1242 Subquery returns more than 1 row
|
||||
Error 1242 Subquery returns more than 1 row
|
||||
select * from t11;
|
||||
a b
|
||||
0 10
|
||||
|
|
|
@ -5,6 +5,10 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
|
|||
('Only MyISAM tables','support collections'),
|
||||
('Function MATCH ... AGAINST()','is used to do a search'),
|
||||
('Full-text search in MySQL', 'implements vector space model');
|
||||
SHOW INDEX FROM t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A NULL NULL NULL YES FULLTEXT
|
||||
t1 1 a 2 b A NULL NULL NULL YES FULLTEXT
|
||||
select * from t1 where MATCH(a,b) AGAINST ("collections");
|
||||
a b
|
||||
Only MyISAM tables support collections
|
||||
|
@ -213,7 +217,7 @@ id
|
|||
show keys from t2;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t2 1 tig 1 ticket A NULL NULL NULL YES BTREE
|
||||
t2 1 tix 1 inhalt A NULL 1 NULL YES FULLTEXT
|
||||
t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
|
|
@ -65,6 +65,6 @@ NULL
|
|||
50000
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1258 ZLIB: Input data was corrupted for zlib
|
||||
Error 1255 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
|
||||
Error 1259 ZLIB: Input data was corrupted for zlib
|
||||
Error 1256 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
|
||||
drop table t1;
|
||||
|
|
|
@ -163,10 +163,10 @@ grp group_concat(c)
|
|||
4
|
||||
5 NULL
|
||||
Warnings:
|
||||
Warning 1259 1 line(s) was(were) cut by group_concat()
|
||||
Warning 1260 1 line(s) was(were) cut by group_concat()
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 1259 1 line(s) was(were) cut by group_concat()
|
||||
Warning 1260 1 line(s) was(were) cut by group_concat()
|
||||
set group_concat_max_len = 1024;
|
||||
select group_concat(sum(a)) from t1 group by grp;
|
||||
ERROR HY000: Invalid use of group function
|
||||
|
|
|
@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
explain
|
||||
select min(a1) from t1 where a1 between a3 and 'KKK';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 14 Using where
|
||||
explain
|
||||
select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
|
|
|
@ -37,6 +37,15 @@ select * from t1 where a like "%abc\d%";
|
|||
a
|
||||
abcd
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10), key(a));
|
||||
insert into t1 values ('a'), ('a\\b');
|
||||
select * from t1 where a like 'a\\%' escape '#';
|
||||
a
|
||||
a\b
|
||||
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
|
||||
a
|
||||
a\b
|
||||
drop table t1;
|
||||
SET NAMES koi8r;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
|
||||
INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á');
|
||||
|
|
|
@ -101,6 +101,24 @@ Note 1003 select high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,c
|
|||
select degrees(pi()),radians(360);
|
||||
degrees(pi()) radians(360)
|
||||
180 6.2831853071796
|
||||
SELECT ACOS(1.0);
|
||||
ACOS(1.0)
|
||||
0.000000
|
||||
SELECT ASIN(1.0);
|
||||
ASIN(1.0)
|
||||
1.570796
|
||||
SELECT ACOS(0.2*5.0);
|
||||
ACOS(0.2*5.0)
|
||||
0.000000
|
||||
SELECT ACOS(0.5*2.0);
|
||||
ACOS(0.5*2.0)
|
||||
0.000000
|
||||
SELECT ASIN(0.8+0.2);
|
||||
ASIN(0.8+0.2)
|
||||
1.570796
|
||||
SELECT ASIN(1.2-0.2);
|
||||
ASIN(1.2-0.2)
|
||||
1.570796
|
||||
explain extended select degrees(pi()),radians(360);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
|
|
|
@ -268,6 +268,34 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
|
|||
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
wid int(10) unsigned NOT NULL auto_increment,
|
||||
data_podp date default NULL,
|
||||
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
|
||||
PRIMARY KEY(wid),
|
||||
);
|
||||
INSERT INTO t1 VALUES (8,NULL,'real');
|
||||
INSERT INTO t1 VALUES (9,NULL,'nowy');
|
||||
SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
|
||||
elt(status_wnio,data_podp)
|
||||
NULL
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (title text) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
|
||||
INSERT INTO t1 VALUES ('House passes the CAREERS bill');
|
||||
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
|
||||
CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
|
||||
NULL
|
||||
</a>..........................
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (i int, j int);
|
||||
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
|
||||
i ELT(j, '345', '34')
|
||||
1 345
|
||||
2 34
|
||||
DROP TABLE t1;
|
||||
select 1=_latin1'1';
|
||||
1=_latin1'1'
|
||||
1
|
||||
|
@ -514,7 +542,7 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
|
|||
replace(_latin2'abcd',_latin2'b',_latin2'B')
|
||||
;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'format(130,10)' at row 1
|
||||
Warning 1265 Data truncated for column 'format(130,10)' at row 1
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -576,27 +604,6 @@ select * from t7
|
|||
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
|
||||
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat'
|
||||
drop table t7;
|
||||
CREATE TABLE t1 (
|
||||
wid int(10) unsigned NOT NULL auto_increment,
|
||||
data_podp date default NULL,
|
||||
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
|
||||
PRIMARY KEY(wid),
|
||||
);
|
||||
INSERT INTO t1 VALUES (8,NULL,'real');
|
||||
INSERT INTO t1 VALUES (9,NULL,'nowy');
|
||||
SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
|
||||
elt(status_wnio,data_podp)
|
||||
NULL
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (title text) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
|
||||
INSERT INTO t1 VALUES ('House passes the CAREERS bill');
|
||||
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
|
||||
CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
|
||||
NULL
|
||||
</a>..........................
|
||||
DROP TABLE t1;
|
||||
select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
|
||||
substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2) substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2)
|
||||
1abcd;2abcd 3abcd;4abcd
|
||||
|
|
|
@ -175,3 +175,21 @@ ERROR 42S22: Unknown column 'W' in 'field list'
|
|||
handler t1 read a=(a);
|
||||
ERROR HY000: Wrong arguments to HANDLER ... READ
|
||||
drop table t1;
|
||||
create table t1 (a char(5));
|
||||
insert into t1 values ("Ok");
|
||||
handler t1 open as t;
|
||||
handler t read first;
|
||||
a
|
||||
Ok
|
||||
use mysql;
|
||||
handler t read first;
|
||||
a
|
||||
Ok
|
||||
handler t close;
|
||||
handler test.t1 open as t;
|
||||
handler t read first;
|
||||
a
|
||||
Ok
|
||||
handler t close;
|
||||
use test;
|
||||
drop table t1;
|
||||
|
|
|
@ -1084,11 +1084,7 @@ select * from t1;
|
|||
id
|
||||
select * from t2;
|
||||
id t1_id
|
||||
drop table t1,t2;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
Note 1051 Unknown table 't2'
|
||||
drop table t2,t1;
|
||||
CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
|
||||
CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
|
@ -1333,13 +1329,16 @@ a
|
|||
3
|
||||
4
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
|
||||
drop table t2,t1;
|
||||
CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
|
||||
(stamp))ENGINE=InnoDB;
|
||||
insert into t1 values (1),(2),(3);
|
||||
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'stamp' at row 3
|
||||
Warning 1265 Data truncated for column 'stamp' at row 3
|
||||
SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
|
||||
'20020204120000' GROUP BY col1;
|
||||
col1
|
||||
|
@ -1414,3 +1413,17 @@ test.t2 968604391
|
|||
test.t3 968604391
|
||||
test.t4 NULL
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
|
||||
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
|
||||
select name2 from t1 union all select name from t1 union all select id from t1;
|
||||
name2
|
||||
fff
|
||||
sss
|
||||
ttt
|
||||
first
|
||||
second
|
||||
third
|
||||
1
|
||||
2
|
||||
3
|
||||
drop table t1;
|
||||
|
|
|
@ -63,7 +63,7 @@ insert into t1 values(NULL);
|
|||
ERROR 23000: Column 'id' cannot be null
|
||||
insert into t1 values (1), (NULL), (2);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'id' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id' at row 2
|
||||
select * from t1;
|
||||
id
|
||||
1
|
||||
|
|
|
@ -595,3 +595,37 @@ CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNE
|
|||
INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
|
||||
INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1(
|
||||
Month date NOT NULL,
|
||||
Type tinyint(3) unsigned NOT NULL auto_increment,
|
||||
Field int(10) unsigned NOT NULL,
|
||||
Count int(10) unsigned NOT NULL,
|
||||
UNIQUE KEY Month (Month,Type,Field)
|
||||
);
|
||||
insert into t1 Values
|
||||
(20030901, 1, 1, 100),
|
||||
(20030901, 1, 2, 100),
|
||||
(20030901, 2, 1, 100),
|
||||
(20030901, 2, 2, 100),
|
||||
(20030901, 3, 1, 100);
|
||||
select * from t1;
|
||||
Month Type Field Count
|
||||
2003-09-01 1 1 100
|
||||
2003-09-01 1 2 100
|
||||
2003-09-01 2 1 100
|
||||
2003-09-01 2 2 100
|
||||
2003-09-01 3 1 100
|
||||
Select null, Field, Count From t1 Where Month=20030901 and Type=2;
|
||||
NULL Field Count
|
||||
NULL 1 100
|
||||
NULL 2 100
|
||||
create table t2(No int not null, Field int not null, Count int not null);
|
||||
insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2;
|
||||
Warnings:
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'No' at row 2
|
||||
select * from t2;
|
||||
No Field Count
|
||||
0 1 100
|
||||
0 2 100
|
||||
drop table t1, t2;
|
||||
|
|
|
@ -34,10 +34,10 @@ INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
|
|||
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
|
||||
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','','');
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'transityes' at row 1
|
||||
Warning 1264 Data truncated for column 'shopsyes' at row 1
|
||||
Warning 1264 Data truncated for column 'schoolsyes' at row 1
|
||||
Warning 1264 Data truncated for column 'petsyes' at row 1
|
||||
Warning 1265 Data truncated for column 'transityes' at row 1
|
||||
Warning 1265 Data truncated for column 'shopsyes' at row 1
|
||||
Warning 1265 Data truncated for column 'schoolsyes' at row 1
|
||||
Warning 1265 Data truncated for column 'petsyes' at row 1
|
||||
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
|
||||
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
|
||||
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
|
||||
|
@ -156,8 +156,8 @@ CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
|
|||
UNIQUE (c,i));
|
||||
INSERT INTO t1 (c) VALUES (NULL),(NULL);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
||||
SELECT * FROM t1;
|
||||
c i
|
||||
1
|
||||
|
|
|
@ -2,12 +2,12 @@ drop table if exists t1;
|
|||
create table t1 (a date, b date, c date not null, d date);
|
||||
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'a' at row 1
|
||||
Warning 1264 Data truncated for column 'c' at row 1
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
Warning 1264 Data truncated for column 'a' at row 2
|
||||
Warning 1264 Data truncated for column 'b' at row 2
|
||||
Warning 1264 Data truncated for column 'd' at row 2
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
Warning 1265 Data truncated for column 'd' at row 1
|
||||
Warning 1265 Data truncated for column 'a' at row 2
|
||||
Warning 1265 Data truncated for column 'b' at row 2
|
||||
Warning 1265 Data truncated for column 'd' at row 2
|
||||
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
|
||||
SELECT * from t1;
|
||||
a b c d
|
||||
|
@ -18,10 +18,10 @@ a b c d
|
|||
truncate table t1;
|
||||
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'c' at row 1
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
Warning 1264 Data truncated for column 'b' at row 2
|
||||
Warning 1264 Data truncated for column 'd' at row 2
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
Warning 1265 Data truncated for column 'd' at row 1
|
||||
Warning 1265 Data truncated for column 'b' at row 2
|
||||
Warning 1265 Data truncated for column 'd' at row 2
|
||||
SELECT * from t1;
|
||||
a b c d
|
||||
NULL NULL 0000-00-00 0000-00-00
|
||||
|
@ -31,7 +31,7 @@ drop table t1;
|
|||
create table t1 (a text, b text);
|
||||
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
|
||||
Warnings:
|
||||
Warning 1260 Row 3 doesn't contain data for all columns
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
select concat('|',a,'|'), concat('|',b,'|') from t1;
|
||||
concat('|',a,'|') concat('|',b,'|')
|
||||
|Field A| |Field B|
|
||||
|
@ -43,10 +43,10 @@ drop table t1;
|
|||
create table t1 (a int, b char(10));
|
||||
load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'a' at row 3
|
||||
Warning 1261 Row 3 was truncated; It contained more data than there where input columns
|
||||
Warning 1264 Data truncated for column 'a' at row 5
|
||||
Warning 1261 Row 5 was truncated; It contained more data than there where input columns
|
||||
Warning 1265 Data truncated for column 'a' at row 3
|
||||
Warning 1262 Row 3 was truncated; It contained more data than there where input columns
|
||||
Warning 1265 Data truncated for column 'a' at row 5
|
||||
Warning 1262 Row 5 was truncated; It contained more data than there where input columns
|
||||
select * from t1;
|
||||
a b
|
||||
1 row 1
|
||||
|
@ -57,8 +57,8 @@ a b
|
|||
truncate table t1;
|
||||
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'a' at row 4
|
||||
Warning 1260 Row 4 doesn't contain data for all columns
|
||||
Warning 1265 Data truncated for column 'a' at row 4
|
||||
Warning 1261 Row 4 doesn't contain data for all columns
|
||||
select * from t1;
|
||||
a b
|
||||
1 row 1
|
||||
|
|
|
@ -41,5 +41,9 @@ lock tables t1 write;
|
|||
check table t2;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 check error Table 't2' was not locked with LOCK TABLES
|
||||
insert into t1 select nr from t1;
|
||||
ERROR HY000: Table 't1' was not locked with LOCK TABLES
|
||||
unlock tables;
|
||||
lock tables t1 write, t1 as t1_alias read;
|
||||
insert into t1 select index1,nr from t1 as t1_alias;
|
||||
drop table t1,t2;
|
||||
|
|
2
mysql-test/r/lowercase2.require
Normal file
2
mysql-test/r/lowercase2.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
lower_case_table_names 2
|
108
mysql-test/r/lowercase_table2.result
Normal file
108
mysql-test/r/lowercase_table2.result
Normal file
|
@ -0,0 +1,108 @@
|
|||
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
|
||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||
DROP DATABASE IF EXISTS `test_$1`;
|
||||
CREATE TABLE T1 (a int);
|
||||
INSERT INTO T1 VALUES (1);
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
T1
|
||||
SHOW TABLES LIKE "t1";
|
||||
Tables_in_test (t1)
|
||||
T1
|
||||
SHOW CREATE TABLE T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`a` int(11) default NULL
|
||||
) TYPE=MyISAM
|
||||
RENAME TABLE T1 TO T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
T2
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
1
|
||||
RENAME TABLE T2 TO t3;
|
||||
SHOW TABLES LIKE "T3";
|
||||
Tables_in_test (T3)
|
||||
t3
|
||||
RENAME TABLE T3 TO T1;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
T1
|
||||
ALTER TABLE T1 add b int;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
t1
|
||||
ALTER TABLE T1 RENAME T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
T2
|
||||
LOCK TABLE T2 WRITE;
|
||||
ALTER TABLE T2 drop b;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
t2
|
||||
UNLOCK TABLES;
|
||||
RENAME TABLE T2 TO T1;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
T1
|
||||
SELECT * from T1;
|
||||
a
|
||||
1
|
||||
DROP TABLE T1;
|
||||
CREATE DATABASE `TEST_$1`;
|
||||
SHOW DATABASES LIKE "TEST%";
|
||||
Database (TEST%)
|
||||
TEST_$1
|
||||
DROP DATABASE `test_$1`;
|
||||
CREATE TABLE T1 (a int) engine=innodb;
|
||||
INSERT INTO T1 VALUES (1);
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
T1
|
||||
SHOW TABLES LIKE "t1";
|
||||
Tables_in_test (t1)
|
||||
T1
|
||||
SHOW CREATE TABLE T1;
|
||||
Table Create Table
|
||||
T1 CREATE TABLE `T1` (
|
||||
`a` int(11) default NULL
|
||||
) TYPE=InnoDB
|
||||
RENAME TABLE T1 TO T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
t2
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
1
|
||||
RENAME TABLE T2 TO t3;
|
||||
SHOW TABLES LIKE "T3";
|
||||
Tables_in_test (T3)
|
||||
t3
|
||||
RENAME TABLE T3 TO T1;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
t1
|
||||
ALTER TABLE T1 add b int;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
t1
|
||||
ALTER TABLE T1 RENAME T2;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
t2
|
||||
LOCK TABLE T2 WRITE;
|
||||
ALTER TABLE T2 drop b;
|
||||
SHOW TABLES LIKE "T2";
|
||||
Tables_in_test (T2)
|
||||
t2
|
||||
UNLOCK TABLES;
|
||||
RENAME TABLE T2 TO T1;
|
||||
SHOW TABLES LIKE "T1";
|
||||
Tables_in_test (T1)
|
||||
t1
|
||||
SELECT * from T1;
|
||||
a
|
||||
1
|
||||
DROP TABLE T1;
|
44
mysql-test/r/myisam-blob.result
Normal file
44
mysql-test/r/myisam-blob.result
Normal file
|
@ -0,0 +1,44 @@
|
|||
drop table if exists t1;
|
||||
CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
|
||||
INSERT INTO t1 (data) VALUES (NULL);
|
||||
UPDATE t1 set data=repeat('a',18*1024*1024);
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
18874368
|
||||
delete from t1 where left(data,1)='a';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
truncate table t1;
|
||||
INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
|
||||
INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
|
||||
delete from t1 where left(data,1)='b';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
UPDATE t1 set data=repeat('c',17*1024*1024);
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
delete from t1 where left(data,1)='c';
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
INSERT INTO t1 set data=repeat('a',18*1024*1024);
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
18874368
|
||||
alter table t1 modify data blob;
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
0
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (data BLOB) ENGINE=myisam;
|
||||
INSERT INTO t1 (data) VALUES (NULL);
|
||||
UPDATE t1 set data=repeat('a',18*1024*1024);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'data' at row 1
|
||||
select length(data) from t1;
|
||||
length(data)
|
||||
65535
|
||||
drop table t1;
|
|
@ -398,6 +398,68 @@ check table t1;
|
|||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
create table t1 ( a text not null, key a (a(20)));
|
||||
insert into t1 values ('aaa '),('aaa'),('aa');
|
||||
check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
repair table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
select concat(a,'.') from t1 where a='aaa';
|
||||
concat(a,'.')
|
||||
aaa.
|
||||
aaa .
|
||||
select concat(a,'.') from t1 where binary a='aaa';
|
||||
concat(a,'.')
|
||||
aaa.
|
||||
update t1 set a='bbb' where a='aaa';
|
||||
select concat(a,'.') from t1;
|
||||
concat(a,'.')
|
||||
bbb.
|
||||
bbb.
|
||||
aa.
|
||||
drop table t1;
|
||||
create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
|
||||
insert into t1 values('807780', '477', '165');
|
||||
insert into t1 values('807780', '477', '162');
|
||||
insert into t1 values('807780', '472', '162');
|
||||
select * from t1 where a='807780' and b='477' and c='165';
|
||||
a b c
|
||||
807780 477 165
|
||||
drop table t1;
|
||||
create table t1 (a blob);
|
||||
insert into t1 values('a '),('a');
|
||||
select concat(a,'.') from t1 where a='a';
|
||||
concat(a,'.')
|
||||
a.
|
||||
select concat(a,'.') from t1 where a='a ';
|
||||
concat(a,'.')
|
||||
a .
|
||||
alter table t1 add key(a(2));
|
||||
select concat(a,'.') from t1 where a='a';
|
||||
concat(a,'.')
|
||||
a.
|
||||
select concat(a,'.') from t1 where a='a ';
|
||||
concat(a,'.')
|
||||
a .
|
||||
drop table t1;
|
||||
create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
|
||||
insert into t1 (b) values ('a'),('a '),('a ');
|
||||
select concat(b,'.') from t1;
|
||||
concat(b,'.')
|
||||
a.
|
||||
a .
|
||||
a .
|
||||
update t1 set b='b ' where a=2;
|
||||
update t1 set b='b ' where a > 1;
|
||||
ERROR 23000: Duplicate entry 'b ' for key 2
|
||||
delete from t1 where b='b';
|
||||
select a,concat(b,'.') from t1;
|
||||
a concat(b,'.')
|
||||
1 a.
|
||||
3 a .
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
|
||||
create table t1 (a int, b varchar(200), c text not null) checksum=1;
|
||||
|
|
|
@ -24,11 +24,11 @@ insert into t1 values ("abirvalg");
|
|||
SET INSERT_ID=1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t2 values ();
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-0' INTO TABLE t1 FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
|
||||
--- Broken LOAD DATA --
|
||||
use test;
|
||||
|
@ -54,6 +54,12 @@ insert into t1 values ("abirvalg");
|
|||
SET INSERT_ID=1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t2 values ();
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-1-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-2-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-3-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-6-1' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word);
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t1 values ("Alas");
|
||||
|
||||
|
@ -63,18 +69,7 @@ SET TIMESTAMP=1000000000;
|
|||
insert into t1 values ("Alas");
|
||||
|
||||
--- --database --
|
||||
use test;
|
||||
SET TIMESTAMP=1000000000;
|
||||
create table t1 (word varchar(20));
|
||||
SET TIMESTAMP=1000000000;
|
||||
create table t2 (id int auto_increment not null primary key);
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t1 values ("abirvalg");
|
||||
SET INSERT_ID=1;
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t2 values ();
|
||||
SET TIMESTAMP=1000000000;
|
||||
insert into t1 values ("Alas");
|
||||
|
||||
--- --position --
|
||||
use test;
|
||||
|
|
|
@ -91,45 +91,45 @@ drop table t1;
|
|||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
Warning 1265 Data truncated for column 'd' at row 1
|
||||
UPDATE t1 SET d=1/NULL;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'd' at row 1
|
||||
Warning 1265 Data truncated for column 'd' at row 1
|
||||
UPDATE t1 SET d=NULL;
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
||||
INSERT INTO t1 (a) values (null);
|
||||
ERROR 23000: Column 'a' cannot be null
|
||||
INSERT INTO t1 (a) values (1/null);
|
||||
ERROR 23000: Column 'a' cannot be null
|
||||
INSERT INTO t1 (a) values (null),(null);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 2
|
||||
INSERT INTO t1 (b) values (null);
|
||||
ERROR 23000: Column 'b' cannot be null
|
||||
INSERT INTO t1 (b) values (1/null);
|
||||
ERROR 23000: Column 'b' cannot be null
|
||||
INSERT INTO t1 (b) values (null),(null);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 1
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
|
||||
INSERT INTO t1 (c) values (null);
|
||||
ERROR 23000: Column 'c' cannot be null
|
||||
INSERT INTO t1 (c) values (1/null);
|
||||
ERROR 23000: Column 'c' cannot be null
|
||||
INSERT INTO t1 (c) values (null),(null);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'c' at row 2
|
||||
INSERT INTO t1 (d) values (null);
|
||||
ERROR 23000: Column 'd' cannot be null
|
||||
INSERT INTO t1 (d) values (1/null);
|
||||
ERROR 23000: Column 'd' cannot be null
|
||||
INSERT INTO t1 (d) values (null),(null);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'd' at row 2
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'd' at row 2
|
||||
select * from t1;
|
||||
a b c d
|
||||
0 0000-00-00 00:00:00 0
|
||||
|
|
|
@ -337,7 +337,7 @@ index (id2)
|
|||
);
|
||||
insert into t1 values(null,null),(1,1);
|
||||
Warnings:
|
||||
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1
|
||||
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1
|
||||
select * from t1;
|
||||
id id2
|
||||
NULL 0
|
||||
|
|
|
@ -333,10 +333,10 @@ a b c
|
|||
1 NULL NULL
|
||||
alter table t1 modify b int not null, modify c varchar(10) not null;
|
||||
Warnings:
|
||||
Warning 1264 Data truncated for column 'b' at row 1
|
||||
Warning 1264 Data truncated for column 'c' at row 1
|
||||
Warning 1264 Data truncated for column 'b' at row 2
|
||||
Warning 1264 Data truncated for column 'c' at row 3
|
||||
Warning 1265 Data truncated for column 'b' at row 1
|
||||
Warning 1265 Data truncated for column 'c' at row 1
|
||||
Warning 1265 Data truncated for column 'b' at row 2
|
||||
Warning 1265 Data truncated for column 'c' at row 3
|
||||
explain select * from t1 order by a, b, c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL a 18 NULL 11 Using index
|
||||
|
|
|
@ -593,7 +593,7 @@ select * from t1;
|
|||
a
|
||||
set GLOBAL query_cache_size=1024;
|
||||
Warnings:
|
||||
Warning 1281 Query cache failed to set size 1024, new query cache size is 0
|
||||
Warning 1282 Query cache failed to set size 1024, new query cache size is 0
|
||||
show global variables like "query_cache_size";
|
||||
Variable_name Value
|
||||
query_cache_size 0
|
||||
|
@ -601,7 +601,7 @@ select * from t1;
|
|||
a
|
||||
set GLOBAL query_cache_size=10240;
|
||||
Warnings:
|
||||
Warning 1281 Query cache failed to set size 10240, new query cache size is 0
|
||||
Warning 1282 Query cache failed to set size 10240, new query cache size is 0
|
||||
show global variables like "query_cache_size";
|
||||
Variable_name Value
|
||||
query_cache_size 0
|
||||
|
@ -609,7 +609,7 @@ select * from t1;
|
|||
a
|
||||
set GLOBAL query_cache_size=20480;
|
||||
Warnings:
|
||||
Warning 1281 Query cache failed to set size 20480, new query cache size is 0
|
||||
Warning 1282 Query cache failed to set size 20480, new query cache size is 0
|
||||
show global variables like "query_cache_size";
|
||||
Variable_name Value
|
||||
query_cache_size 0
|
||||
|
@ -617,7 +617,7 @@ select * from t1;
|
|||
a
|
||||
set GLOBAL query_cache_size=40960;
|
||||
Warnings:
|
||||
Warning 1281 Query cache failed to set size 40960, new query cache size is 0
|
||||
Warning 1282 Query cache failed to set size 40960, new query cache size is 0
|
||||
show global variables like "query_cache_size";
|
||||
Variable_name Value
|
||||
query_cache_size 0
|
||||
|
|
|
@ -2,6 +2,7 @@ DROP TABLE IF EXISTS t1,t2;
|
|||
DROP DATABASE IF EXISTS test_$1;
|
||||
create database test_$1;
|
||||
create table test_$1.r1 (i int) raid_type=1;
|
||||
create table test_$1.r2 (i int) raid_type=1 raid_chunks=32;
|
||||
drop database test_$1;
|
||||
CREATE TABLE t1 (
|
||||
id int unsigned not null auto_increment primary key,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue