Commit cee870e9 authored by tulin@build.mysql.com's avatar tulin@build.mysql.com

Merge bk-internal:/home/bk/mysql-4.1

into build.mysql.com:/users/tulin/mysql-4.1-cluster-extra
parents 2d1aa1c8 22639def
......@@ -946,3 +946,59 @@ libmysqld/ha_tina.cc
analyse.test
client/mysqladmin.c
mysql-4.1.8-win-src.zip
ndb/include/ndb_version.h
ndb/include/ndb_global.h
mysql-test/mysql-test-run.log
mysql-test/r/alter_table.err
mysql-test/r/archive.err
mysql-test/r/bdb-alter-table-1.err
mysql-test/r/bdb-alter-table-2.err
mysql-test/r/bdb-crash.err
mysql-test/r/bdb-deadlock.err
mysql-test/r/bdb.err
mysql-test/r/bdb_cache.err
mysql-test/r/client_test.err
mysql-test/r/csv.err
mysql-test/r/ctype_ucs.err
mysql-test/r/derived.err
mysql-test/r/exampledb.err
mysql-test/r/func_encrypt.err
mysql-test/r/isam.err
mysql-test/r/lowercase_table2.err
mysql-test/r/multi_update.err
mysql-test/r/mysql_protocols.err
mysql-test/r/mysqlbinlog.err
mysql-test/r/mysqlbinlog2.err
mysql-test/r/mysqldump.err
mysql-test/r/mysqltest.err
mysql-test/r/ndb_alter_table.err
mysql-test/r/ndb_autodiscover.err
mysql-test/r/ndb_autodiscover2.err
mysql-test/r/ndb_basic.err
mysql-test/r/ndb_blob.err
mysql-test/r/ndb_cache.err
mysql-test/r/ndb_charset.err
mysql-test/r/ndb_index.err
mysql-test/r/ndb_index_ordered.err
mysql-test/r/ndb_index_unique.err
mysql-test/r/ndb_insert.err
mysql-test/r/ndb_limit.err
mysql-test/r/ndb_lock.err
mysql-test/r/ndb_minmax.err
mysql-test/r/ndb_replace.err
mysql-test/r/ndb_subquery.err
mysql-test/r/ndb_transaction.err
mysql-test/r/ndb_truncate.err
mysql-test/r/ndb_types.err
mysql-test/r/ndb_update.err
mysql-test/r/openssl_1.err
mysql-test/r/ps_1general.err
mysql-test/r/ps_6bdb.err
mysql-test/r/ps_7ndb.err
mysql-test/r/query_cache.err
mysql-test/r/query_cache_merge.err
mysql-test/r/raid.err
mysql-test/r/repair.err
mysql-test/r/replace.err
mysql-test/r/rpl000001.err
mysql-test/r/rpl000015.err
#!/bin/sh
#
# This script's purpose is to update the automake/autoconf helper scripts and
# to run a plain "configure" without any special compile flags. Only features
# that affect the content of the source distribution are enabled. The resulting
# tree can then be picked up by "make dist" to create the "pristine source
# package" that is used as the basis for all other binary builds.
#
make distclean
aclocal
autoheader
libtoolize --automake --force --copy
automake --force --add-missing --copy
autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
# Default to gcc for CC and CXX
if test -z "$CXX" ; then
export CXX=gcc
fi
if test -z "$CC" ; then
export CC=gcc
fi
# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
if ! (echo "$CC" | grep "ccache" > /dev/null)
then
export CC="ccache $CC"
fi
if ! (echo "$CXX" | grep "ccache" > /dev/null)
then
export CXX="ccache $CXX"
fi
fi
# Make sure to enable all features that affect "make dist"
./configure \
--with-embedded-server \
--with-berkeley-db \
--with-innodb \
--enable-thread-safe-client \
--with-ndbcluster
make
......@@ -103,6 +103,7 @@ lenz@mysql.com
magnus@neptunus.(none)
magnus@shellback.(none)
marko@hundin.mysql.fi
marty@linux.site
mats@mysql.com
matt@booty.(none)
matt@mysql.com
......@@ -164,6 +165,7 @@ paul@frost.snake.net
paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com
paul@snake-hub.snake.net
paul@teton.kitebird.com
pekka@mysql.com
pem@mysql.com
......
#!/bin/sh
if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ]
then
echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user."
echo "as a workaround set BK_USER to your nickname"
echo "e.g.: export BK_USER='bar'"
echo ""
echo "Checkin FAILED!"
echo "Set BK_USER and retry."
exit 1
fi
if [ `tail -c1 $BK_FILE` ]
then
echo "File $BK_FILE does not end with a new-line character!"
......
......@@ -26,7 +26,7 @@ else
}
# Some predefined settings
$build_command= "BUILD/compile-pentium-max";
$build_command= "BUILD/compile-dist";
$PWD= cwd();
$opt_docdir= $PWD . "/mysqldoc";
$opt_archive_log= undef;
......@@ -122,18 +122,8 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run))
#
if ($opt_pull)
{
&logger("Updating BK tree $REPO to latest ChangeSet first");
chdir ($REPO) or &abort("Could not chdir to $REPO!");
&run_command("bk pull", "Could not update $REPO!");
chdir ($PWD) or &abort("Could not chdir to $PWD!");
unless ($opt_skip_manual)
{
&logger("Updating manual tree in $opt_docdir");
chdir ($opt_docdir) or &abort("Could not chdir to $opt_docdir!");
&run_command("bk pull", "Could not update $opt_docdir!");
chdir ($PWD) or &abort("Could not chdir to $PWD!");
}
&bk_pull("$REPO");
&bk_pull("$opt_docdir") unless ($opt_skip_manual);
}
#
......@@ -262,7 +252,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 -mv";
$command= "bk changes -v";
$command.= " -r" if ($opt_changelog ne "" || $opt_revision);
$command.= $opt_changelog if $opt_changelog ne "";
$command.= ".." if ($opt_changelog ne "" && !$opt_revision);
......@@ -270,7 +260,7 @@ if (defined $opt_changelog)
$command.= " " . $REPO . " > $target_dir/ChangeLog";
&logger($command);
# We cannot use run_command here because of output redirection
if (!$opt_dry_run)
unless ($opt_dry_run)
{
system($command) == 0 or &abort("Could not create $target_dir/ChangeLog!");
}
......@@ -281,17 +271,17 @@ if (defined $opt_changelog)
#
unless ($opt_skip_manual)
{
$msg= "Updating manual files";
&logger($msg);
&logger("Updating manual files");
foreach $file qw/internals manual reservedwords/
{
system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0
or &abort("Could not update $file.texi in $target_dir/Docs/!");
}
system ("rm -f $target_dir/Docs/Images/Makefile*") == 0
or &abort("Could not remove Makefiles in $target_dir/Docs/Images/!");
system ("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images") == 0
or &abort("Could not copy image files in $target_dir/Docs/Images/!");
&run_command("rm -f $target_dir/Docs/Images/Makefile*",
"Could not remove Makefiles in $target_dir/Docs/Images/!");
&run_command("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images",
"Could not copy image files in $target_dir/Docs/Images/!");
}
#
......@@ -377,6 +367,18 @@ if ($opt_archive_log)
exit 0;
#
# Run a BK pull on the given BK tree
#
sub bk_pull
{
my $bk_tree= $_[0];
&logger("Updating BK tree $bk_tree to latest ChangeSet first");
chdir ($bk_tree) or &abort("Could not chdir to $bk_tree!");
&run_command("bk pull", "Could not update $bk_tree!");
chdir ($PWD) or &abort("Could not chdir to $PWD!");
}
#
# Print the help text message (with an optional message on top)
#
......
......@@ -23,14 +23,14 @@ EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@sql_server_dirs@ @sql_client_dirs@ scripts man tests \
@sql_union_dirs@ scripts man tests \
netware @libmysqld_dirs@ \
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@
DIST_SUBDIRS = . include @docs_dirs@ zlib \
@readline_topdir@ sql-common \
@thread_dirs@ pstack \
@sql_server_dirs@ @sql_client_dirs@ scripts @man_dirs@ tests SSL\
@sql_union_dirs@ scripts @man_dirs@ tests SSL\
BUILD netware os2 @libmysqld_dirs@ \
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@
......
......@@ -51,8 +51,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\"
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\"
!ELSEIF "$(CFG)" == "mysqldump - Win32 Debug"
......@@ -76,8 +76,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\"
!ELSEIF "$(CFG)" == "mysqldump - Win32 classic"
......@@ -103,8 +103,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\"
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\"
# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\"
# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\"
!ENDIF
......
......@@ -67,8 +67,8 @@ LINK32=link.exe
# PROP Output_Dir ".\classic"
# PROP Intermediate_Dir ".\classic"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
# ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG"
......@@ -77,8 +77,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ELSEIF "$(CFG)" == "mysqltest - Win32 Release"
......@@ -92,8 +92,8 @@ LINK32=link.exe
# PROP Output_Dir ".\release"
# PROP Intermediate_Dir ".\release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
# ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG"
......@@ -102,8 +102,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386
!ENDIF
......
......@@ -76,8 +76,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console
!ENDIF
......
......@@ -49,4 +49,5 @@ enum options_client
#ifdef HAVE_NDBCLUSTER_DB
,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING
#endif
,OPT_IGNORE_TABLE
};
......@@ -43,6 +43,7 @@
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>
#include <hash.h>
#include "client_priv.h"
#include "mysql.h"
......@@ -128,6 +129,15 @@ const char *compatible_mode_names[]=
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names, NULL};
#define TABLE_RULE_HASH_SIZE 16
typedef struct st_table_rule_ent
{
char* key; /* dbname.tablename */
uint key_len;
} TABLE_RULE_ENT;
HASH ignore_table;
static struct my_option my_long_options[] =
{
......@@ -233,6 +243,11 @@ static struct my_option my_long_options[] =
(gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", (gptr*) &current_host,
(gptr*) &current_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"ignore-table", OPT_IGNORE_TABLE,
"Do not dump the specified table. To specify more than one table to ignore, "
"use the directive multiple times, once for each table. Each table must "
"be specified with both database and table names, e.g. --ignore-table=database.table",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...",
(gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
......@@ -502,6 +517,28 @@ static void write_footer(FILE *sql_file)
} /* write_footer */
static void free_table_ent(TABLE_RULE_ENT* e)
{
my_free((gptr) e, MYF(0));
}
static byte* get_table_key(TABLE_RULE_ENT* e, uint* len,
my_bool not_used __attribute__((unused)))
{
*len= e->key_len;
return (byte*)e->key;
}
void init_table_rule_hash(HASH* h)
{
if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0,
(hash_get_key) get_table_key,
(hash_free_key) free_table_ent, 0))
exit(EX_EOM);
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
......@@ -573,6 +610,30 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case (int) OPT_TABLES:
opt_databases=0;
break;
case (int) OPT_IGNORE_TABLE:
{
uint len= (uint)strlen(argument);
TABLE_RULE_ENT* e;
if (!strchr(argument, '.'))
{
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
exit(1);
}
/* len is always > 0 because we know the there exists a '.' */
e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME));
if (!e)
exit(EX_EOM);
e->key= (char*)e + sizeof(TABLE_RULE_ENT);
e->key_len= len;
memcpy(e->key, argument, len);
if (!hash_inited(&ignore_table))
init_table_rule_hash(&ignore_table);
if(my_hash_insert(&ignore_table, (byte*)e))
exit(EX_EOM);
break;
}
case (int) OPT_COMPATIBLE:
{
char buff[255];
......@@ -1946,6 +2007,14 @@ static int init_dumping(char *database)
} /* init_dumping */
my_bool include_table(byte* hash_key, uint len)
{
if (hash_search(&ignore_table, (byte*) hash_key, len))
return FALSE;
return TRUE;
}
static int dump_all_tables_in_db(char *database)
{
......@@ -1953,6 +2022,12 @@ static int dump_all_tables_in_db(char *database)
uint numrows;
char table_buff[NAME_LEN*2+3];
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
char *afterdot;
afterdot= strmov(hash_key, database);
*afterdot++= '.';
if (init_dumping(database))
return 1;
if (opt_xml)
......@@ -1961,7 +2036,7 @@ static int dump_all_tables_in_db(char *database)
{
DYNAMIC_STRING query;
init_dynamic_string(&query, "LOCK TABLES ", 256, 1024);
for (numrows=0 ; (table = getTableName(1)) ; numrows++)
for (numrows= 0 ; (table= getTableName(1)) ; numrows++)
{
dynstr_append(&query, quote_name(table, table_buff, 1));
dynstr_append(&query, " READ /*!32311 LOCAL */,");
......@@ -1977,7 +2052,10 @@ static int dump_all_tables_in_db(char *database)
DBerror(sock, "when doing refresh");
/* We shall continue here, if --force was given */
}
while ((table = getTableName(0)))
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
if (include_table(hash_key, end - hash_key))
{
numrows = getTableStructure(table, database);
if (!dFlag && numrows > 0)
......@@ -1985,6 +2063,7 @@ static int dump_all_tables_in_db(char *database)
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0;
}
}
if (opt_xml)
{
fputs("</database>\n", md_result_file);
......
......@@ -538,7 +538,6 @@ static void free_used_memory()
mysql_server_end();
if (ps_protocol)
ps_free_reg();
my_end(MY_CHECK_ERROR);
DBUG_VOID_RETURN;
}
......@@ -556,6 +555,7 @@ static void die(const char* fmt, ...)
}
va_end(args);
free_used_memory();
my_end(MY_CHECK_ERROR);
exit(1);
}
......@@ -568,6 +568,7 @@ static void abort_not_supported_test()
if (!silent)
printf("skipped\n");
free_used_memory();
my_end(MY_CHECK_ERROR);
exit(2);
}
......@@ -3655,6 +3656,7 @@ int main(int argc, char **argv)
if (!got_end_timer)
timer_output(); /* No end_timer cmd, end it */
free_used_memory();
my_end(MY_CHECK_ERROR);
exit(error ? 1 : 0);
return error ? 1 : 0; /* Keep compiler happy */
}
......
......@@ -23,7 +23,7 @@ NDB_VERSION_STATUS=""
# Remember that regexps needs to quote [ and ] since this is run through m4
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"`
MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'`
# The port should be constant for a LONG time
MYSQL_TCP_PORT_DEFAULT=3306
......@@ -2832,7 +2832,7 @@ thread_dirs=
dnl This probably should be cleaned up more - for now the threaded
dnl client is just using plain-old libs.
sql_client_dirs="libmysql client"
sql_client_dirs="libmysql strings regex client"
linked_client_targets="linked_libmysql_sources"
CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS
if test "$THREAD_SAFE_CLIENT" != "no"
......@@ -3014,6 +3014,20 @@ AC_SUBST(sql_server_dirs)
AC_SUBST(thread_dirs)
AC_SUBST(server_scripts)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
# Start with the (longer) server list, add each client item not yet present.
sql_union_dirs=" $sql_server_dirs "
for DIR in $sql_client_dirs
do
if echo $sql_union_dirs | grep " $DIR " >/dev/null
then
: # already present, skip
else
sql_union_dirs="$sql_union_dirs $DIR "
fi
done
AC_SUBST(sql_union_dirs)
#if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes"
#then
# MIT pthreads does now support connecting with unix sockets
......
......@@ -45,7 +45,8 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map,
HANDLE event_server_wrote,
HANDLE event_server_read,
HANDLE event_client_wrote,
HANDLE event_client_read);
HANDLE event_client_read,
HANDLE event_conn_closed);
int vio_read_pipe(Vio *vio, gptr buf, int size);
int vio_write_pipe(Vio *vio, const gptr buf, int size);
int vio_close_pipe(Vio * vio);
......@@ -197,6 +198,7 @@ struct st_vio
HANDLE event_server_read;
HANDLE event_client_wrote;
HANDLE event_client_read;
HANDLE event_conn_closed;
long shared_memory_remain;
char *shared_memory_pos;
NET *net;
......
......@@ -326,7 +326,7 @@ buf_read_page(
if (err == DB_TABLESPACE_DELETED) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: error: trying to access tablespace %lu page no. %lu,\n"
" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n"
"InnoDB: but the tablespace does not exist or is just being dropped.\n",
(ulong) space, (ulong) offset);
}
......
......@@ -205,12 +205,14 @@ dict_print(void)
In a crash recovery we already have all the tablespace objects created.
This function compares the space id information in the InnoDB data dictionary
to what we already read with fil_load_single_table_tablespaces().
In a normal startup we just scan the biggest space id, and store it to
fil_system. */
In a normal startup, we create the tablespace objects for every table in
InnoDB's data dictionary, if the corresponding .ibd file exists.
We also scan the biggest space id, and store it to fil_system. */
void
dict_check_tablespaces_or_store_max_id(
/*===================================*/
dict_check_tablespaces_and_store_max_id(
/*====================================*/
ibool in_crash_recovery) /* in: are we doing a crash recovery */
{
dict_table_t* sys_tables;
......@@ -280,6 +282,14 @@ dict_check_tablespaces_or_store_max_id(
FALSE, TRUE, TRUE);
}
if (space_id != 0 && !in_crash_recovery) {
/* It is a normal database startup: create the space
object and check that the .ibd file exists. */
fil_open_single_table_tablespace(FALSE, space_id,
name);
}
mem_free(name);
if (space_id > max_space_id) {
......@@ -796,8 +806,18 @@ dict_load_table(
/* Ok; (if we did a crash recovery then the tablespace
can already be in the memory cache) */
} else {
/* In >= 4.1.9, InnoDB scans the data dictionary also
at a normal mysqld startup. It is an error if the
space object does not exist in memory. */
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: error: space object of table %s,\n"
"InnoDB: space id %lu did not exist in memory. Retrying an open.\n",
name, (ulong)space);
/* Try to open the tablespace */
if (!fil_open_single_table_tablespace(space, name)) {
if (!fil_open_single_table_tablespace(TRUE,
space, name)) {
/* We failed to find a sensible tablespace
file */
......
......@@ -466,6 +466,10 @@ fil_node_open_file(
ulint size_low;
ulint size_high;
ibool ret;
byte* buf2;
byte* page;
ibool success;
ulint space_id;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
......@@ -494,6 +498,8 @@ fil_node_open_file(
system->n_open++;
if (node->size == 0) {
ut_a(space->purpose != FIL_LOG);
os_file_get_size(node->handle, &size_low, &size_high);
size_bytes = (((ib_longlong)size_high) << 32)
......@@ -507,6 +513,46 @@ fil_node_open_file(
ut_a(space->id != 0);
if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
fprintf(stderr,
"InnoDB: Error: the size of single-table tablespace file %s\n"
"InnoDB: is only %lu %lu, should be at least %lu!", node->name,
(ulong) size_high,
(ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE));
ut_a(0);
}
/* Read the first page of the tablespace */
buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
/* Align the memory for file i/o if we might have O_DIRECT
set */
page = ut_align(buf2, UNIV_PAGE_SIZE);
success = os_file_read(node->handle, page, 0, 0,
UNIV_PAGE_SIZE);
space_id = fsp_header_get_space_id(page);
ut_free(buf2);
if (space_id == ULINT_UNDEFINED || space_id == 0) {
fprintf(stderr,
"InnoDB: Error: tablespace id %lu in file %s is not sensible\n",
(ulong) space_id,
node->name);
ut_a(0);
}
if (space_id != space->id) {
fprintf(stderr,
"InnoDB: Error: tablespace id is %lu in the data dictionary\n"
"InnoDB: but in file %s it is %lu!\n", space->id, node->name, space_id);
ut_a(0);
}
if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
node->size = (ulint) ((size_bytes / (1024 * 1024))
* ((1024 * 1024) / UNIV_PAGE_SIZE));
......@@ -2487,18 +2533,26 @@ fil_reset_too_high_lsns(
}
/************************************************************************
Tries to open a single-table tablespace and checks the space id is right in
it. If does not succeed, prints an error message to the .err log. This
function is used to open the tablespace when we load a table definition
to the dictionary cache. NOTE that we assume this operation is used under the
protection of the dictionary mutex, so that two users cannot race here. This
operation does not leave the file associated with the tablespace open, but
closes it after we have looked at the space id in it. */
Tries to open a single-table tablespace and optionally checks the space id is
right in it. If does not succeed, prints an error message to the .err log. This
function is used to open a tablespace when we start up mysqld, and also in
IMPORT TABLESPACE.
NOTE that we assume this operation is used either at the database startup
or under the protection of the dictionary mutex, so that two users cannot
race here. This operation does not leave the file associated with the
tablespace open, but closes it after we have looked at the space id in it. */
ibool
fil_open_single_table_tablespace(
/*=============================*/
/* out: TRUE if success */
ibool check_space_id, /* in: should we check that the space
id in the file is right; we assume
that this function runs much faster
if no check is made, since accessing
the file inode probably is much
faster (the OS caches them) than
accessing the first page of the file */
ulint id, /* in: space id */
const char* name) /* in: table name in the
databasename/tablename format */
......@@ -2540,6 +2594,12 @@ fil_open_single_table_tablespace(
return(FALSE);
}
if (!check_space_id) {
space_id = id;
goto skip_check;
}
/* Read the first page of the tablespace */
buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
......@@ -2552,6 +2612,8 @@ fil_open_single_table_tablespace(
space_id = fsp_header_get_space_id(page);
ut_free(buf2);
if (space_id != id) {
ut_print_timestamp(stderr);
......@@ -2572,6 +2634,7 @@ fil_open_single_table_tablespace(
goto func_exit;
}
skip_check:
success = fil_space_create(filepath, space_id, FIL_TABLESPACE);
if (!success) {
......@@ -2584,7 +2647,6 @@ fil_open_single_table_tablespace(
fil_node_create(filepath, 0, space_id, FALSE);
func_exit:
os_file_close(file);
ut_free(buf2);
mem_free(filepath);
return(ret);
......@@ -2651,7 +2713,7 @@ fil_load_single_table_tablespace(
fprintf(stderr,
"InnoDB: Error: could not open single-table tablespace file\n"
"InnoDB: %s!\n"
"InnoDB: We do not continue crash recovery, because the table will become\n"
"InnoDB: We do not continue the crash recovery, because the table may become\n"
"InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.\n"
"InnoDB: To fix the problem and start mysqld:\n"
"InnoDB: 1) If there is a permission problem in the file and mysqld cannot\n"
......@@ -2822,8 +2884,9 @@ fil_load_single_table_tablespace(
goto func_exit;
}
/* We do not measure the size of the file, that is why we pass the 0
below */
/* We do not use the size information we have about the file, because
the rounding formula for extents and pages is somewhat complex; we
let fil_node_open() do that task. */
fil_node_create(filepath, 0, space_id, FALSE);
func_exit:
......
......@@ -18,12 +18,14 @@ Created 4/24/1996 Heikki Tuuri
In a crash recovery we already have all the tablespace objects created.
This function compares the space id information in the InnoDB data dictionary
to what we already read with fil_load_single_table_tablespaces().
In a normal startup we just scan the biggest space id, and store it to
fil_system. */
In a normal startup, we create the tablespace objects for every table in
InnoDB's data dictionary, if the corresponding .ibd file exists.
We also scan the biggest space id, and store it to fil_system. */
void
dict_check_tablespaces_or_store_max_id(
/*===================================*/
dict_check_tablespaces_and_store_max_id(
/*====================================*/
ibool in_crash_recovery); /* in: are we doing a crash recovery */
/************************************************************************
Finds the first table name in the given database. */
......
......@@ -364,16 +364,26 @@ fil_create_new_single_table_tablespace(
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
/************************************************************************
Tries to open a single-table tablespace and checks the space id is right in
it. If does not succeed, prints an error message to the .err log. This
function is used to open the tablespace when we load a table definition
to the dictionary cache. NOTE that we assume this operation is used under the
protection of the dictionary mutex, so that two users cannot race here. */
Tries to open a single-table tablespace and optionally checks the space id is
right in it. If does not succeed, prints an error message to the .err log. This
function is used to open a tablespace when we start up mysqld, and also in
IMPORT TABLESPACE.
NOTE that we assume this operation is used either at the database startup
or under the protection of the dictionary mutex, so that two users cannot
race here. This operation does not leave the file associated with the
tablespace open, but closes it after we have looked at the space id in it. */
ibool
fil_open_single_table_tablespace(
/*=============================*/
/* out: TRUE if success */
ibool check_space_id, /* in: should we check that the space
id in the file is right; we assume
that this function runs much faster
if no check is made, since accessing
the file inode probably is much
faster (the OS caches them) than
accessing the first page of the file */
ulint id, /* in: space id */
const char* name); /* in: table name in the
databasename/tablename format */
......
......@@ -367,25 +367,7 @@ row_drop_table_for_mysql(
/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
means that this function deletes the .ibd file and assigns a new table id for
the table. Also the flag table->ibd_file_missing is set TRUE.
How do we prevent crashes caused by ongoing operations on the table? Old
operations could try to access non-existent pages.
1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock
on the table before we can do DISCARD TABLESPACE. Then there are no running
queries on the table.
2) Purge and rollback: we assign a new table id for the table. Since purge and
rollback look for the table based on the table id, they see the table as
'dropped' and discard their operations.
3) Insert buffer: we remove all entries for the tablespace in the insert
buffer tree; as long as the tablespace mem object does not exist, ongoing
insert buffer page merges are discarded in buf0rea.c. If we recreate the
tablespace mem object with IMPORT TABLESPACE later, then the tablespace will
have the same id, but the tablespace_version field in the mem object is
different, and ongoing old insert buffer page merges get discarded.
4) Linear readahead and random readahead: we use the same method as in 3) to
discard ongoing operations. */
the table. Also the flag table->ibd_file_missing is set TRUE. */
int
row_discard_tablespace_for_mysql(
......
......@@ -378,6 +378,19 @@ struct trx_struct{
replication slave, this is the
position in the log file up to which
replication has processed */
/* A MySQL variable mysql_thd->synchronous_repl tells if we have
to use synchronous replication. See ha_innodb.cc. */
char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL
replication is used, the binlog name
up to which we must communicate the
binlog to the slave, before returning
from a commit; this is the same as
mysql_log_file_name, but we allocate
and copy the name to a separate buffer
here */
ib_longlong repl_wait_binlog_pos;/* see above at
repl_wait_binlog_name */
os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
with this transaction object */
ulint mysql_process_no;/* since in Linux, 'top' reports
......
......@@ -2990,8 +2990,7 @@ recv_reset_log_files_for_backup(
memcpy(name + log_dir_len, logfilename, sizeof logfilename);
buf = ut_malloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE);
memset(buf, LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE, '\0');
memset(buf, '\0', LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE);
for (i = 0; i < n_log_files; i++) {
......
......@@ -1173,7 +1173,7 @@ row_ins_check_foreign_constraint(
check_index = foreign->foreign_index;
}
if (check_table == NULL) {
if (check_table == NULL || check_table->ibd_file_missing) {
if (check_ref) {
FILE* ef = dict_foreign_err_file;
mutex_enter(&dict_foreign_err_mutex);
......@@ -1192,7 +1192,7 @@ row_ins_check_foreign_constraint(
dtuple_print(ef, entry);
fputs("\nBut the parent table ", ef);
ut_print_name(ef, trx, foreign->referenced_table_name);
fputs(" does not currently exist!\n", ef);
fputs("\nor its .ibd file does not currently exist!\n", ef);
mutex_exit(&dict_foreign_err_mutex);
return(DB_NO_REFERENCED_ROW);
......@@ -1415,8 +1415,34 @@ row_ins_check_foreign_constraints(
row_mysql_freeze_data_dictionary(trx);
}
if (foreign->referenced_table) {
mutex_enter(&(dict_sys->mutex));
(foreign->referenced_table
->n_foreign_key_checks_running)++;
mutex_exit(&(dict_sys->mutex));
}
/* NOTE that if the thread ends up waiting for a lock
we will release dict_operation_lock temporarily!
But the counter on the table protects the referenced
table from being dropped while the check is running. */
err = row_ins_check_foreign_constraint(TRUE, foreign,
table, entry, thr);
if (foreign->referenced_table) {
mutex_enter(&(dict_sys->mutex));
ut_a(foreign->referenced_table
->n_foreign_key_checks_running > 0);
(foreign->referenced_table
->n_foreign_key_checks_running)--;
mutex_exit(&(dict_sys->mutex));
}
if (got_s_lock) {
row_mysql_unfreeze_data_dictionary(trx);
}
......
This diff is collapsed.
......@@ -2776,7 +2776,7 @@ row_search_for_mysql(
/* out: DB_SUCCESS,
DB_RECORD_NOT_FOUND,
DB_END_OF_INDEX, DB_DEADLOCK,
DB_LOCK_TABLE_FULL,
DB_LOCK_TABLE_FULL, DB_CORRUPTION,
or DB_TOO_BIG_RECORD */
byte* buf, /* in/out: buffer for the fetched
row in the MySQL format */
......@@ -2829,6 +2829,20 @@ row_search_for_mysql(
ut_ad(index && pcur && search_tuple);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
if (prebuilt->table->ibd_file_missing) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Error:\n"
"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n"
"InnoDB: table %s does not exist.\n"
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
}
if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) {
fprintf(stderr,
"InnoDB: Error: trying to free a corrupt\n"
......
......@@ -381,8 +381,14 @@ row_upd_changes_field_size_or_external(
new_len = new_val->len;
if (new_len == UNIV_SQL_NULL) {
/* A bug fixed on Dec 31st, 2004: we looked at the
SQL NULL size from the wrong field! We may backport
this fix also to 4.0. The merge to 5.0 will be made
manually immediately after we commit this to 4.1. */
new_len = dtype_get_sql_null_size(
dict_index_get_nth_type(index, i));
dict_index_get_nth_type(index,
upd_field->field_no));
}
old_len = rec_get_nth_field_size(rec, upd_field->field_no);
......
......@@ -1378,14 +1378,39 @@ NetWare. */
return(DB_ERROR);
}
/* Since ibuf init is in dict_boot, and ibuf is needed
in any disk i/o, first call dict_boot */
/* Since the insert buffer init is in dict_boot, and the
insert buffer is needed in any disk i/o, first we call
dict_boot(). Note that trx_sys_init_at_db_start() only needs
to access space 0, and the insert buffer at this stage already
works for space 0. */
dict_boot();
trx_sys_init_at_db_start();
/* The following needs trx lists which are initialized in
trx_sys_init_at_db_start */
if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
/* The following call is necessary for the insert
buffer to work with multiple tablespaces. We must
know the mapping between space id's and .ibd file
names.
In a crash recovery, we check that the info in data
dictionary is consistent with what we already know
about space id's from the call of
fil_load_single_table_tablespaces().
In a normal startup, we create the space objects for
every table in the InnoDB data dictionary that has
an .ibd file.
We also determine the maximum tablespace id used.
TODO: We may have incomplete transactions in the
data dictionary tables. Does that harm the scanning of
the data dictionary below? */
dict_check_tablespaces_and_store_max_id(
recv_needed_recovery);
}
srv_startup_is_before_trx_rollback_phase = FALSE;
......@@ -1393,6 +1418,9 @@ NetWare. */
system */
fsp_header_get_free_limit(0);
/* recv_recovery_from_checkpoint_finish needs trx lists which
are initialized in trx_sys_init_at_db_start(). */
recv_recovery_from_checkpoint_finish();
}
......@@ -1433,13 +1461,6 @@ NetWare. */
}
}
#endif /* UNIV_LOG_ARCHIVE */
if (!create_new_db && srv_force_recovery == 0) {
/* After a crash recovery we only check that the info in data
dictionary is consistent with what we already know about space
id's from the call of fil_load_single_table_tablespaces(). */
dict_check_tablespaces_or_store_max_id(recv_needed_recovery);
}
if (srv_measure_contention) {
/* os_thread_create(&test_measure_cont, NULL, thread_ids +
......@@ -1507,6 +1528,21 @@ NetWare. */
"InnoDB: the sum of data file sizes is %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0
&& sum_of_data_file_sizes < tablespace_size_in_header) {
/* This is a fatal error, the tail of a tablespace is
missing */
fprintf(stderr,
"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
"InnoDB: inappropriate way, removing ibdata files from there?\n"
"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
return(DB_ERROR);
}
}
if (srv_auto_extend_last_data_file
......@@ -1517,6 +1553,18 @@ NetWare. */
"InnoDB: the sum of data file sizes is only %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
if (srv_force_recovery == 0) {
fprintf(stderr,
"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
"InnoDB: inappropriate way, removing ibdata files from there?\n"
"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
return(DB_ERROR);
}
}
/* Check that os_fast_mutexes work as expected */
......
......@@ -110,6 +110,9 @@ trx_create(
trx->mysql_master_log_file_name = "";
trx->mysql_master_log_pos = 0;
trx->repl_wait_binlog_name = NULL;
trx->repl_wait_binlog_pos = 0;
mutex_create(&(trx->undo_mutex));
mutex_set_level(&(trx->undo_mutex), SYNC_TRX_UNDO);
......@@ -271,6 +274,11 @@ trx_free(
trx_undo_arr_free(trx->undo_no_arr);
}
if (trx->repl_wait_binlog_name != NULL) {
mem_free(trx->repl_wait_binlog_name);
}
ut_a(UT_LIST_GET_LEN(trx->signals) == 0);
ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0);
......
......@@ -1466,12 +1466,14 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff,
if (_mi_ft_add(info,i,(char*) key,buff,filepos))
goto err;
}
#ifdef HAVE_SPATIAL
else if (info->s->keyinfo[i].flag & HA_SPATIAL)
{
uint key_length=_mi_make_key(info,i,key,buff,filepos);
if (rtree_insert(info, i, key, key_length))
goto err;
}
#endif /*HAVE_SPATIAL*/
else
{
uint key_length=_mi_make_key(info,i,key,buff,filepos);
......
This diff is collapsed.
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
# These are not to be prefixed with "mtr_"
sub gcov_prepare ();
sub gcov_collect ();
##############################################################################
#
#
#
##############################################################################
sub gcov_prepare () {
`find $::glob_basedir -name \*.gcov \
-or -name \*.da | xargs rm`;
}
sub gcov_collect () {
print "Collecting source coverage info...\n";
-f $::opt_gcov_msg and unlink($::opt_gcov_msg);
-f $::opt_gcov_err and unlink($::opt_gcov_err);
foreach my $d ( @::mysqld_src_dirs )
{
chdir("$::glob_basedir/$d");
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
{
`$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`;
}
chdir($::glob_mysql_test_dir);
}
print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n";
}
1;
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
# These are not to be prefixed with "mtr_"
sub gprof_prepare ();
sub gprof_collect ();
##############################################################################
#
#
#
##############################################################################
sub gprof_prepare () {
rmtree($::opt_gprof_dir);
mkdir($::opt_gprof_dir);
}
# FIXME what about master1 and slave1?!
sub gprof_collect () {
if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" )
{
# FIXME check result code?!
mtr_run("gprof",
[$::exe_master_mysqld,
"$::master->[0]->{'path_myddir'}/gmon.out"],
$::opt_gprof_master, "", "", "");
print "Master execution profile has been saved in $::opt_gprof_master\n";
}
if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" )
{
# FIXME check result code?!
mtr_run("gprof",
[$::exe_slave_mysqld,
"$::slave->[0]->{'path_myddir'}/gmon.out"],
$::opt_gprof_slave, "", "", "");
print "Slave execution profile has been saved in $::opt_gprof_slave\n";
}
}
1;
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
sub mtr_get_pid_from_file ($);
sub mtr_get_opts_from_file ($);
sub mtr_tofile ($@);
sub mtr_tonewfile($@);
##############################################################################
#
#
#
##############################################################################
sub mtr_get_pid_from_file ($) {
my $file= shift;
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
my $pid= <FILE>;
chomp($pid);
close FILE;
return $pid;
}
sub mtr_get_opts_from_file ($) {
my $file= shift;
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
my @args;
while ( <FILE> )
{
chomp;
s/\$MYSQL_TEST_DIR/$::glob_mysql_test_dir/g;
push(@args, split(' ', $_));
}
close FILE;
return \@args;
}
sub mtr_fromfile ($) {
my $file= shift;
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
my $text= join('', <FILE>);
close FILE;
return $text;
}
sub mtr_tofile ($@) {
my $file= shift;
open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!");
print FILE join("", @_);
close FILE;
}
sub mtr_tonewfile ($@) {
my $file= shift;
open(FILE,">",$file) or mtr_error("can't open file \"$file\": $!");
print FILE join("", @_);
close FILE;
}
1;
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
sub mtr_match_prefix ($$);
sub mtr_match_extension ($$);
sub mtr_match_any_exact ($$);
##############################################################################
#
#
#
##############################################################################
# Match a prefix and return what is after the prefix
sub mtr_match_prefix ($$) {
my $string= shift;
my $prefix= shift;
if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp
{
return $1;
}
else
{
return undef; # NULL
}
}
# Match extension and return the name without extension
sub mtr_match_extension ($$) {
my $file= shift;
my $ext= shift;
if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something
{
return $1;
}
else
{
return undef; # NULL
}
}
sub mtr_match_any_exact ($$) {
my $string= shift;
my $mlist= shift;
foreach my $m (@$mlist)
{
if ( $string eq $m )
{
return 1;
}
}
return 0;
}
1;
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
sub mtr_full_hostname ();
sub mtr_init_args ($);
sub mtr_add_arg ($$);
##############################################################################
#
# Misc
#
##############################################################################
# We want the fully qualified host name and hostname() may have returned
# only the short name. So we use the resolver to find out.
sub mtr_full_hostname () {
my $hostname= hostname();
if ( $hostname !~ /\./ )
{
my $address= gethostbyname($hostname)
or die "Couldn't resolve $hostname : $!";
my $fullname= gethostbyaddr($address, AF_INET);
$hostname= $fullname if $fullname;
}
return $hostname;
}
# FIXME move to own lib
sub mtr_init_args ($) {
my $args = shift;
$$args = []; # Empty list
}
sub mtr_add_arg ($$) {
my $args= shift;
my $format= shift;
my @fargs = @_;
push(@$args, sprintf($format, @fargs));
}
1;
This diff is collapsed.
# -*- cperl -*-
# This is a library file used by the Perl version of mysql-test-run,
# and is part of the translation of the Bourne shell script with the
# same name.
use strict;
sub mtr_report_test_name($);
sub mtr_report_test_passed($);
sub mtr_report_test_failed($);
sub mtr_report_test_skipped($);
sub mtr_show_failed_diff ($);
sub mtr_report_stats ($);
sub mtr_print_line ();
sub mtr_print_thick_line ();
sub mtr_print_header ();
sub mtr_report (@);
sub mtr_warning (@);
sub mtr_error (@);
sub mtr_debug (@);
##############################################################################
#
#
#
##############################################################################
# We can't use diff -u or diff -a as these are not portable
sub mtr_show_failed_diff ($) {
my $tname= shift;
my $reject_file= "r/$tname.reject";
my $result_file= "r/$tname.result";
my $eval_file= "r/$tname.eval";
if ( -f $eval_file )
{
$result_file= $eval_file;
}
elsif ( $::opt_result_ext and
( $::opt_record or -f "$result_file$::opt_result_ext" ))
{
# If we have an special externsion for result files we use it if we are
# recording or a result file with that extension exists.
$result_file= "$result_file$::opt_result_ext";
}
if ( -f $reject_file )
{
print "Below are the diffs between actual and expected results:\n";
print "-------------------------------------------------------\n";
# FIXME check result code?!
mtr_run("diff",["-c",$result_file,$reject_file], "", "", "", "");
print "-------------------------------------------------------\n";
print "Please follow the instructions outlined at\n";
print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n";
print "to find the reason to this problem and how to report this.\n\n";
}
}
sub mtr_report_test_name ($) {
my $tinfo= shift;
printf "%-31s ", $tinfo->{'name'};
}
sub mtr_report_test_skipped ($) {
my $tinfo= shift;
$tinfo->{'result'}= 'MTR_RES_SKIPPED';
print "[ skipped ]\n";
}
sub mtr_report_test_passed ($) {
my $tinfo= shift;
my $timer= "";
# FIXME
# if ( $::opt_timer and -f "$::glob_mysql_test_dir/var/log/timer" )
# {
# $timer= `cat var/log/timer`;
# $timer= sprintf "%13s", $timer;
# }
$tinfo->{'result'}= 'MTR_RES_PASSED';
print "[ pass ] $timer\n";
}
sub mtr_report_test_failed ($) {
my $tinfo= shift;
$tinfo->{'result'}= 'MTR_RES_FAILED';
print "[ fail ]\n";
print "Errors are (from $::path_timefile) :\n";
print mtr_fromfile($::path_timefile); # FIXME print_file() instead
print "\n(the last lines may be the most important ones)\n";
}
sub mtr_report_stats ($) {
my $tests= shift;
# ----------------------------------------------------------------------
# Find out how we where doing
# ----------------------------------------------------------------------
my $tot_skiped= 0;
my $tot_passed= 0;
my $tot_failed= 0;
my $tot_tests= 0;
foreach my $tinfo (@$tests)
{
if ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' )
{
$tot_skiped++;
}
elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' )
{
$tot_tests++;
$tot_passed++;
}
elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' )
{
$tot_tests++;
$tot_failed++;
}
}
# ----------------------------------------------------------------------
# Print out a summary report to screen
# ----------------------------------------------------------------------
if ( ! $tot_failed )
{
print "All $tot_tests tests were successful.\n";
}
else
{
my $ratio= $tot_passed * 100 / $tot_tests;
printf "Failed $tot_failed/$tot_tests tests, " .
"%.2f\% successful.\n\n", $ratio;
print
"The log files in var/log may give you some hint\n",
"of what when wrong.\n",
"If you want to report this error, please read first ",
"the documentation at\n",
"http://www.mysql.com/doc/en/MySQL_test_suite.html\n";
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
if ( ! $::glob_use_running_server )
{
# Report if there was any fatal warnings/errors in the log files
#
unlink("$::glob_mysql_test_dir/var/log/warnings");
unlink("$::glob_mysql_test_dir/var/log/warnings.tmp");
# Remove some non fatal warnings from the log files
# FIXME what is going on ????? ;-)
# sed -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
# var/log/*.err \
# | sed -e 's!Warning: Table:.* on rename!!g' \
# > var/log/warnings.tmp;
#
# found_error=0;
# # Find errors
# for i in "^Warning:" "^Error:" "^==.* at 0x"
# do
# if ( $GREP "$i" var/log/warnings.tmp >> var/log/warnings )
# {
# found_error=1
# }
# done
# unlink("$::glob_mysql_test_dir/var/log/warnings.tmp");
# if ( $found_error= "1" )
# {
# print "WARNING: Got errors/warnings while running tests. Please examine\n"
# print "$::glob_mysql_test_dir/var/log/warnings for details.\n"
# }
# }
}
print "\n";
if ( $tot_failed != 0 )
{
print "mysql-test-run: *** Failing the test(s):";
foreach my $tinfo (@$tests)
{
if ( $tinfo->{'result'} eq 'MTR_RES_FAILED' )
{
print " $tinfo->{'name'}";
}
}
print "\n";
mtr_error("there where failing test cases");
}
}
##############################################################################
#
# Text formatting
#
##############################################################################
sub mtr_print_line () {
print '-' x 55, "\n";
}
sub mtr_print_thick_line () {
print '=' x 55, "\n";
}
sub mtr_print_header () {
print "\n";
if ( $::opt_timer )
{
print "TEST RESULT TIME (ms)\n";
}
else
{
print "TEST RESULT\n";
}
mtr_print_line();
print "\n";
}
##############################################################################
#
# Misc
#
##############################################################################
sub mtr_report (@) {
print join(" ", @_),"\n";
}
sub mtr_warning (@) {
print STDERR "mysql-test-run: WARNING: ",join(" ", @_),"\n";
}
sub mtr_error (@) {
die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n";
}
sub mtr_debug (@) {
if ( $::opt_script_debug )
{
print STDERR "####: ",join(" ", @_),"\n";
}
}
1;
......@@ -327,7 +327,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error, HANDLE *pid)
{
intptr_t result;
bool result;
int i;
STARTUPINFO startup_info;
PROCESS_INFORMATION process_information;
......@@ -665,7 +665,11 @@ void del_tree(char *dir)
rmdir(dir);
#else
struct _finddata_t parent;
#if defined(_MSC_VER) && _MSC_VER > 1200
intptr_t handle;
#else
long handle;
#endif /* _MSC_VER && _MSC_VER > 1200 */
char temp[FN_REFLEN];
char mask[FN_REFLEN];
......@@ -728,7 +732,11 @@ int removef(const char *format, ...)
va_list ap;
char path[FN_REFLEN];
struct _finddata_t parent;
#if defined(_MSC_VER) && _MSC_VER > 1200
intptr_t handle;
#else
long handle;
#endif /* _MSC_VER && _MSC_VER > 1200 */
char temp[FN_REFLEN];
char *p;
......
This diff is collapsed.
......@@ -596,7 +596,8 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR TESTS_BINDIR
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR
export NDB_TOOLS_DIR
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
......
......@@ -37,7 +37,8 @@
#include <sys/mode.h>
#endif
#ifdef __WIN__
#include <Shlwapi.h>
#include <windows.h>
#include <shlwapi.h>
#include <direct.h>
#endif
......@@ -89,15 +90,25 @@ static char master_socket[FN_REFLEN]= "./var/tmp/master.sock";
static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock";
#endif
#define MAX_COUNT_TESTES 1024
#ifdef __WIN__
# define sting_compare_func _stricmp
#else
# ifdef HAVE_STRCASECMP
# define sting_compare_func strcasecmp
# else
# define sting_compare_func strcmp
# endif
#endif
/* comma delimited list of tests to skip or empty string */
#ifndef __WIN__
static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix ";
#else
/*
The most ignore testes contain the calls of system command
*/
#define MAX_COUNT_TESTES 1024
/*
lowercase_table3 is disabled by Gerg
system_mysql_db_fix is disabled by Gerg
sp contains a command system
......@@ -1437,12 +1448,11 @@ void setup(char *file __attribute__((unused)))
/*
Compare names of testes for right order
*/
#ifdef __WIN__
int compare( const void *arg1, const void *arg2 )
{
return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
return sting_compare_func( * ( char** ) arg1, * ( char** ) arg2 );
}
#endif
/******************************************************************************
......@@ -1454,6 +1464,10 @@ int compare( const void *arg1, const void *arg2 )
int main(int argc, char **argv)
{
int is_ignore_list= 0;
char **names= 0;
char **testes= 0;
int name_index;
int index;
/* setup */
setup(argv[0]);
......@@ -1517,6 +1531,11 @@ int main(int argc, char **argv)
else
{
/* run all tests */
testes= malloc(MAX_COUNT_TESTES*sizeof(void*));
if (!testes)
die("can not allcate memory for sorting");
names= testes;
name_index= 0;
#ifndef __WIN__
struct dirent *entry;
DIR *parent;
......@@ -1533,26 +1552,31 @@ int main(int argc, char **argv)
strcpy(test, strlwr(entry->d_name));
/* find the test suffix */
if ((position= strinstr(test, TEST_SUFFIX)) != 0)
{
if (name_index < MAX_COUNT_TESTES)
{
/* null terminate at the suffix */
*(test + position - 1)= '\0';
/* run test */
run_test(test);
/* insert test */
*names= malloc(FN_REFLEN);
strcpy(*names,test);
names++;
name_index++;
}
else
die("can not sort files, array is overloaded");
}
}
closedir(parent);
}
#else
{
struct _finddata_t dir;
intptr_t handle;
int* handle;
char test[FN_LEN];
char mask[FN_REFLEN];
char *p;
int position;
char **names= 0;
char **testes= 0;
int name_index;
int index;
/* single test */
single_test= FALSE;
......@@ -1564,9 +1588,6 @@ int main(int argc, char **argv)
die("Unable to open tests directory.");
}
names= malloc(MAX_COUNT_TESTES*4);
testes= names;
name_index= 0;
do
{
......@@ -1577,31 +1598,34 @@ int main(int argc, char **argv)
/* find the test suffix */
if ((position= strinstr(test, TEST_SUFFIX)) != 0)
{
p= test + position - 1;
if (name_index < MAX_COUNT_TESTES)
{
/* null terminate at the suffix */
*p= 0;
*(test + position - 1)= '\0';
/* insert test */
*names= malloc(FN_REFLEN);
strcpy(*names,test);
names++;
name_index++;
}
else
die("can not sort files, array is overloaded");
}
}
}while (_findnext(handle,&dir) == 0);
_findclose(handle);
}
#endif
qsort( (void *)testes, name_index, sizeof( char * ), compare );
for (index= 0; index <= name_index; index++)
for (index= 0; index < name_index; index++)
{
run_test(testes[index]);
free(testes[index]);
}
free(testes);
#endif
}
/* stop server */
......
......@@ -121,7 +121,7 @@ create database mysqltest;
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
alter table t1 rename t2;
ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
......
......@@ -178,3 +178,12 @@ aaa aa
aab aa
aac aa
DROP TABLE t1;
select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour)
2004-12-30 00:00:00
select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00');
timediff(cast('2004-12-30 12:00:00' as time), '12:00:00')
00:00:00
select timediff(cast('1 12:00:00' as time), '12:00:00');
timediff(cast('1 12:00:00' as time), '12:00:00')
24:00:00
......@@ -63,8 +63,4 @@ a0
select 'a' union select concat('a', -0.0);
a
a
a-0.0
select 'a' union select concat('a', -0.0000);
a
a
a-0.0000
good
......@@ -691,3 +691,15 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de
total reg
10 2004-12-10
drop table t1;
select quote(ltrim(concat(' ', 'a')));
quote(ltrim(concat(' ', 'a')))
'a'
select quote(trim(concat(' ', 'a')));
quote(trim(concat(' ', 'a')))
'a'
select trim(null from 'kate') as "must_be_null";
must_be_null
NULL
select trim('xyz' from null) as "must_be_null";
must_be_null
NULL
......@@ -474,12 +474,15 @@ unix_timestamp(@a)
select unix_timestamp('1969-12-01 19:00:01');
unix_timestamp('1969-12-01 19:00:01')
0
select from_unixtime(0);
from_unixtime(0)
select from_unixtime(-1);
from_unixtime(-1)
NULL
select from_unixtime(2145916800);
from_unixtime(2145916800)
NULL
select from_unixtime(0);
from_unixtime(0)
1970-01-01 03:00:00
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -675,4 +675,9 @@ a b c
1 2 0
1 1 1
1 1 0
show index from t3;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a 1 a A NULL NULL NULL YES BTREE
t3 1 a 2 b A NULL NULL NULL YES BTREE
t3 1 a 3 c A NULL NULL NULL YES BTREE
drop table t1, t2, t3;
This diff is collapsed.
This diff is collapsed.
......@@ -3027,7 +3027,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment