1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-5.0-ndb


sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
This commit is contained in:
unknown
2005-02-01 10:05:22 +01:00
172 changed files with 1624 additions and 816 deletions

View File

@ -382,8 +382,11 @@ libmysqld/examples/link_sources
libmysqld/examples/my_readline.h libmysqld/examples/my_readline.h
libmysqld/examples/mysql libmysqld/examples/mysql
libmysqld/examples/mysql.cc libmysqld/examples/mysql.cc
libmysqld/examples/mysql_client_test.c
libmysqld/examples/mysql_client_test_embedded
libmysqld/examples/mysqltest libmysqld/examples/mysqltest
libmysqld/examples/mysqltest.c libmysqld/examples/mysqltest.c
libmysqld/examples/mysqltest_embedded
libmysqld/examples/readline.cc libmysqld/examples/readline.cc
libmysqld/examples/sql_string.cc libmysqld/examples/sql_string.cc
libmysqld/examples/sql_string.h libmysqld/examples/sql_string.h
@ -1049,3 +1052,6 @@ vio/test-ssl
vio/test-sslclient vio/test-sslclient
vio/test-sslserver vio/test-sslserver
vio/viotest-ssl vio/viotest-ssl
include/mysqld_ername.h
include/mysqld_error.h
include/sql_state.h

18
BUILD/SETUP.sh Normal file → Executable file
View File

@ -6,12 +6,15 @@ then
exit 1 exit 1
fi fi
prefix_configs="--prefix=/usr/local/mysql"
just_print= just_print=
just_configure= just_configure=
full_debug= full_debug=
while test $# -gt 0 while test $# -gt 0
do do
case "$1" in case "$1" in
--prefix=* ) prefix_configs="$1"; shift ;;
--with-debug=full ) full_debug="=full"; shift ;;
-c | --just-configure ) just_configure=1; shift ;; -c | --just-configure ) just_configure=1; shift ;;
-n | --just-print | --print ) just_print=1; shift ;; -n | --just-print | --print ) just_print=1; shift ;;
-h | --help ) cat <<EOF; exit 0 ;; -h | --help ) cat <<EOF; exit 0 ;;
@ -19,13 +22,15 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message. -h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them. -n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure. -c, --just-configure Stop after running configure.
--with-debug=full Build with full debug.
Any other options will be passed directly to configure. --prefix=path Build with prefix 'path'.
Note: this script is intended for internal use by MySQL developers. Note: this script is intended for internal use by MySQL developers.
EOF EOF
--with-debug=full ) full_debug="=full"; shift ;; * )
* ) break ;; echo "Unknown option '$1'"
exit 1
break ;;
esac esac
done done
@ -62,11 +67,12 @@ fast_cflags="-O3 -fno-omit-frame-pointer"
reckless_cflags="-O3 -fomit-frame-pointer " reckless_cflags="-O3 -fomit-frame-pointer "
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
debug_extra_cflags="-O1 -Wuninitialized"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
amd64_cxxflags="-DBIG_TABLES" amd64_cxxflags="-DBIG_TABLES"
base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline" base_configs="$prefix_configs --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline"
static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static" static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static"
amd64_configs="" amd64_configs=""
alpha_configs="" # Not used yet alpha_configs="" # Not used yet
@ -80,7 +86,7 @@ local_infile_configs="--enable-local-infile"
debug_configs="--with-debug$full_debug" debug_configs="--with-debug$full_debug"
if [ -z "$full_debug" ] if [ -z "$full_debug" ]
then then
debug_cflags="$debug_cflags -O1 -Wuninitialized" debug_cflags="$debug_cflags $debug_extra_cflags"
fi fi
if gmake --version > /dev/null 2>&1 if gmake --version > /dev/null 2>&1

13
BUILD/compile-pentium64-debug Executable file
View File

@ -0,0 +1,13 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh" $@ --with-debug=full
extra_flags="$pentium64_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs "
. "$path/FINISH.sh"

View File

@ -172,6 +172,7 @@ nick@nick.leippe.com
papa@gbichot.local papa@gbichot.local
patg@krsna.patg.net patg@krsna.patg.net
patg@patrick-galbraiths-computer.local patg@patrick-galbraiths-computer.local
patg@pc248.lfp.kcls.org
paul@central.snake.net paul@central.snake.net
paul@frost.snake.net paul@frost.snake.net
paul@ice.local paul@ice.local
@ -240,6 +241,7 @@ tonu@x153.internalnet
tonu@x3.internalnet tonu@x3.internalnet
tsmith@build.mysql.com tsmith@build.mysql.com
tulin@build.mysql.com tulin@build.mysql.com
tulin@mysql.com
ulli@morbus.(none) ulli@morbus.(none)
venu@hundin.mysql.fi venu@hundin.mysql.fi
venu@myvenu.com venu@myvenu.com

View File

@ -156,7 +156,7 @@ $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2;
$ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build";
$ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
$slave_port=$mysql_tcp_port+16; $slave_port=$mysql_tcp_port+16;
$ndbcluster_port= 9350 + $opt_build_thread*2; $ndbcluster_port= 9350 + $opt_build_thread*4;
$manager_port=$mysql_tcp_port+1; $manager_port=$mysql_tcp_port+1;
$mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20";

View File

@ -27,9 +27,5 @@ EXTRA_DIST =
all: all:
: :
# Nothing to cleanup in this dummy directory.
clean:
:
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View File

@ -42,8 +42,8 @@ RSC=rc.exe
# PROP Output_Dir ".\debug" # PROP Output_Dir ".\debug"
# PROP Intermediate_Dir ".\debug" # PROP Intermediate_Dir ".\debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX # ADD BASE CPP /nologo /MTd /I "../extra" /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX # ADD CPP /nologo /MTd /I "../extra" /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX
# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "_DEBUG" # ADD BASE RSC /l 1033 /d "_DEBUG"
@ -67,8 +67,8 @@ LINK32=link.exe
# PROP Output_Dir ".\classic" # PROP Output_Dir ".\classic"
# PROP Intermediate_Dir ".\classic" # PROP Intermediate_Dir ".\classic"
# PROP Target_Dir "" # PROP Target_Dir ""
# 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 BASE CPP /nologo /MT /I "../extra" /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 CPP /nologo /MT /I "../extra" /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 BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG" # ADD BASE RSC /l 1033 /d "NDEBUG"
@ -92,8 +92,8 @@ LINK32=link.exe
# PROP Output_Dir ".\release" # PROP Output_Dir ".\release"
# PROP Intermediate_Dir ".\release" # PROP Intermediate_Dir ".\release"
# PROP Target_Dir "" # PROP Target_Dir ""
# 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 BASE CPP /nologo /MT /I "../extra" /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 CPP /nologo /MT /I "../extra" /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 BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32
# ADD BASE RSC /l 1033 /d "NDEBUG" # ADD BASE RSC /l 1033 /d "NDEBUG"

View File

@ -228,10 +228,6 @@ SOURCE=..\sql\ha_innodb.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\sql\ha_isammrg.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\ha_myisam.cpp SOURCE=..\sql\ha_myisam.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -169,10 +169,6 @@ SOURCE=..\sql\ha_innodb.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\sql\ha_isammrg.cpp
# End Source File
# Begin Source File
SOURCE=..\sql\ha_myisam.cpp SOURCE=..\sql\ha_myisam.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -18,7 +18,7 @@
#AUTOMAKE_OPTIONS = nostdinc #AUTOMAKE_OPTIONS = nostdinc
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
$(openssl_includes) -I$(top_srcdir)/extra $(openssl_includes) -I$(top_builddir)/include
LIBS = @CLIENT_LIBS@ LIBS = @CLIENT_LIBS@
LDADD= @CLIENT_EXTRA_LDFLAGS@ \ LDADD= @CLIENT_EXTRA_LDFLAGS@ \
$(top_builddir)/libmysql/libmysqlclient.la $(top_builddir)/libmysql/libmysqlclient.la

View File

@ -744,7 +744,7 @@ static int parse_args(int *argc, char*** argv)
static MYSQL* safe_connect() static MYSQL* safe_connect()
{ {
MYSQL *local_mysql = mysql_init(NULL); MYSQL *local_mysql= mysql_init(NULL);
if (!local_mysql) if (!local_mysql)
die("Failed on mysql_init"); die("Failed on mysql_init");
@ -752,9 +752,13 @@ static MYSQL* safe_connect()
if (opt_protocol) if (opt_protocol)
mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0))
die("failed on connect: %s", mysql_error(local_mysql)); {
char errmsg[256];
strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1);
mysql_close(local_mysql);
die("failed on connect: %s", errmsg);
}
local_mysql->reconnect= 1; local_mysql->reconnect= 1;
return local_mysql; return local_mysql;
} }
@ -781,9 +785,8 @@ static int check_master_version(MYSQL* mysql,
if (mysql_query(mysql, "SELECT VERSION()") || if (mysql_query(mysql, "SELECT VERSION()") ||
!(res = mysql_store_result(mysql))) !(res = mysql_store_result(mysql)))
{ {
char errmsg[FN_REFLEN]; char errmsg[256];
strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
strmake(errmsg, mysql_error(mysql), sizeof(errmsg) - 1);
mysql_close(mysql); mysql_close(mysql);
die("Error checking master version: %s", errmsg); die("Error checking master version: %s", errmsg);
} }

View File

@ -1531,14 +1531,11 @@ then
fi fi
fi fi
TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS"
# Should we use named pthread library ? # Should we use named pthread library ?
AC_MSG_CHECKING("named thread libs:") AC_MSG_CHECKING("named thread libs:")
if test "$with_named_thread" != "no" if test "$with_named_thread" != "no"
then then
LIBS="$with_named_thread $LIBS $with_named_thread" LIBS="$with_named_thread $LIBS $with_named_thread"
TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread"
with_posix_threads="yes" with_posix_threads="yes"
with_mit_threads="no" with_mit_threads="no"
AC_MSG_RESULT("$with_named_thread") AC_MSG_RESULT("$with_named_thread")
@ -1557,9 +1554,7 @@ else
then then
AC_MSG_CHECKING("for pthread_create in -lpthread"); AC_MSG_CHECKING("for pthread_create in -lpthread");
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
ac_save_TOOLS_LIBS="$TOOLS_LIBS"
LIBS="$LIBS -lpthread" LIBS="$LIBS -lpthread"
TOOLS_LIBS="$TOOLS_LIBS -lpthread"
AC_TRY_LINK( AC_TRY_LINK(
[#include <pthread.h>], [#include <pthread.h>],
[ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
@ -1568,7 +1563,6 @@ else
if test "$with_posix_threads" = "no" if test "$with_posix_threads" = "no"
then then
LIBS=" $ac_save_LIBS -lpthreads" LIBS=" $ac_save_LIBS -lpthreads"
TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads"
AC_MSG_CHECKING("for pthread_create in -lpthreads"); AC_MSG_CHECKING("for pthread_create in -lpthreads");
AC_TRY_LINK( AC_TRY_LINK(
[#include <pthread.h>], [#include <pthread.h>],
@ -1579,7 +1573,6 @@ else
then then
# This is for FreeBSD # This is for FreeBSD
LIBS="$ac_save_LIBS -pthread" LIBS="$ac_save_LIBS -pthread"
TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread"
AC_MSG_CHECKING("for pthread_create in -pthread"); AC_MSG_CHECKING("for pthread_create in -pthread");
AC_TRY_LINK( AC_TRY_LINK(
[#include <pthread.h>], [#include <pthread.h>],
@ -1590,7 +1583,6 @@ else
then then
with_mit_threads="yes" with_mit_threads="yes"
LIBS="$ac_save_LIBS" LIBS="$ac_save_LIBS"
TOOLS_LIBS="$ac_save_TOOLS_LIBS"
fi fi
fi fi
fi fi
@ -1678,12 +1670,12 @@ if test "$with_debug" = "yes"
then then
# Medium debug. # Medium debug.
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS"
elif test "$with_debug" = "full" elif test "$with_debug" = "full"
then then
# Full debug. Very slow in some cases # Full debug. Very slow in some cases
CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
else else
# Optimized version. No debug # Optimized version. No debug
CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
@ -2656,8 +2648,6 @@ AC_SUBST(sql_union_dirs)
# Some usefull subst # Some usefull subst
AC_SUBST(CC) AC_SUBST(CC)
AC_SUBST(GXX) AC_SUBST(GXX)
#Remove TOOLS_LIBS, because this is included in LIBRARIES
#AC_SUBST(TOOLS_LIBS)
# Set configuration options for make_binary_distribution # Set configuration options for make_binary_distribution
case $SYSTEM_TYPE in case $SYSTEM_TYPE in

View File

@ -26,6 +26,7 @@ EXTRA_DIST = example1.c example2.c example3.c \
NROFF_INC = example1.r example2.r example3.r main.r \ NROFF_INC = example1.r example2.r example3.r main.r \
factorial.r output1.r output2.r output3.r \ factorial.r output1.r output2.r output3.r \
output4.r output5.r output4.r output5.r
CLEANFILES = $(NROFF_INC) user.t user.ps
# Must be linked with libs that are not compiled yet # Must be linked with libs that are not compiled yet
@ -59,8 +60,5 @@ output5.r: factorial
@RM@ -f $@ @RM@ -f $@
@SED@ -e 's!\\!\\\\!g' $< > $@ @SED@ -e 's!\\!\\\\!g' $< > $@
clean:
@RM@ -f $(NROFF_INC) user.t user.ps
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View File

@ -16,25 +16,26 @@
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include \ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include \
@ndbcluster_includes@ -I$(top_srcdir)/sql \ @ndbcluster_includes@ -I$(top_srcdir)/sql \
-I$(top_srcdir)/extra -I$(top_builddir)/include
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \
../dbug/libdbug.a ../strings/libmystrings.a ../dbug/libdbug.a ../strings/libmystrings.a
BUILT_SOURCES= mysqld_error.h sql_state.h mysqld_ername.h BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \
$(top_builddir)/include/sql_state.h \
$(top_builddir)/include/mysqld_ername.h
pkginclude_HEADERS= $(BUILT_SOURCES) pkginclude_HEADERS= $(BUILT_SOURCES)
created_sources = created_include_files CLEANFILES = $(BUILT_SOURCES)
CLEANFILES = $(created_sources)
SUPERCLEANFILES = $(BUILT_SOURCES)
all: $(created_sources)
# This will build mysqld_error.h and sql_state.h # This will build mysqld_error.h and sql_state.h
mysqld_error.h: created_include_files $(top_builddir)/include/mysqld_error.h: comp_err
mysqld_ername.h: created_include_files $(top_builddir)/extra/comp_err \
sql_state.h: created_include_files --charset=$(top_srcdir)/sql/share/charsets \
--out-dir=$(top_builddir)/sql/share/ \
created_include_files: comp_err --header_file=$(top_builddir)/include/mysqld_error.h \
$(top_builddir)/extra/comp_err --charset=$(srcdir)/../sql/share/charsets --out-dir=$(top_builddir)/sql/share/ --header_file=$(top_builddir)/extra/mysqld_error.h --name_file=$(top_builddir)/extra/mysqld_ername.h --state_file=$(top_builddir)/extra/sql_state.h --in_file=$(srcdir)/../sql/share/errmsg.txt --name_file=$(top_builddir)/include/mysqld_ername.h \
touch created_include_files --state_file=$(top_builddir)/include/sql_state.h \
--in_file=$(top_srcdir)/sql/share/errmsg.txt
$(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h
$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h
bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \
resolve_stack_dump mysql_waitpid resolve_stack_dump mysql_waitpid

View File

@ -41,7 +41,7 @@ static char *HEADERFILE= (char*) "mysqld_error.h";
static char *NAMEFILE= (char*) "mysqld_ername.h"; static char *NAMEFILE= (char*) "mysqld_ername.h";
static char *STATEFILE= (char*) "sql_state.h"; static char *STATEFILE= (char*) "sql_state.h";
static char *TXTFILE= (char*) "../sql/share/errmsg.txt"; static char *TXTFILE= (char*) "../sql/share/errmsg.txt";
static char *DATADIR= (char*) "../sql/share/"; static char *DATADIRECTORY= (char*) "../sql/share/";
static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace"; static char *default_dbug_option= (char*) "d:t:O,/tmp/comp_err.trace";
/* Header for errmsg.sys files */ /* Header for errmsg.sys files */
@ -112,8 +112,8 @@ static struct my_option my_long_options[]=
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"in_file", 'F', "Input file", (gptr *) & TXTFILE, (gptr *) & TXTFILE, {"in_file", 'F', "Input file", (gptr *) & TXTFILE, (gptr *) & TXTFILE,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"out_dir", 'D', "Output base directory", (gptr *) & DATADIR, {"out_dir", 'D', "Output base directory", (gptr *) & DATADIRECTORY,
(gptr *) & DATADIR, (gptr *) & DATADIRECTORY,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"out_file", 'O', "Output filename (errmsg.sys)", (gptr *) & OUTFILE, {"out_file", 'O', "Output filename (errmsg.sys)", (gptr *) & OUTFILE,
(gptr *) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr *) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -281,7 +281,7 @@ static int create_sys_files(struct languages *lang_head,
DBUG_RETURN(1); DBUG_RETURN(1);
} }
outfile_end= strxmov(outfile, DATADIR, outfile_end= strxmov(outfile, DATADIRECTORY,
tmp_lang->lang_long_name, NullS); tmp_lang->lang_long_name, NullS);
if (!my_stat(outfile, &stat_info,MYF(0))) if (!my_stat(outfile, &stat_info,MYF(0)))
{ {

View File

@ -33,15 +33,10 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \
mysql_version.h.in my_handler.h my_time.h decimal.h mysql_version.h.in my_handler.h my_time.h decimal.h
# mysql_version.h are generated # mysql_version.h are generated
SUPERCLEANFILES = mysql_version.h my_config.h CLEANFILES = mysql_version.h my_config.h readline
# Some include files that may be moved and patched by configure # Some include files that may be moved and patched by configure
DISTCLEANFILES = sched.h $(SUPERCLEANFILES) DISTCLEANFILES = sched.h $(CLEANFILES)
clean:
$(RM) -fr readline
distclean:
$(RM) -fr readline
all-local: my_config.h all-local: my_config.h

View File

@ -110,6 +110,7 @@ typedef struct my_collation_handler_st
my_bool diff_if_only_endspace_difference); my_bool diff_if_only_endspace_difference);
int (*strnxfrm)(struct charset_info_st *, int (*strnxfrm)(struct charset_info_st *,
uchar *, uint, const uchar *, uint); uchar *, uint, const uchar *, uint);
uint (*strnxfrmlen)(struct charset_info_st *, uint);
my_bool (*like_range)(struct charset_info_st *, my_bool (*like_range)(struct charset_info_st *,
const char *s, uint s_length, const char *s, uint s_length,
pchar w_prefix, pchar w_one, pchar w_many, pchar w_prefix, pchar w_one, pchar w_many,
@ -259,7 +260,8 @@ extern CHARSET_INFO my_charset_cp1250_czech_ci;
/* declarations for simple charsets */ /* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint); uint);
uint my_strnxfrmlen_simple(CHARSET_INFO *, uint);
extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint,
const uchar *, uint, my_bool); const uchar *, uint, my_bool);

View File

@ -530,7 +530,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LEN 256 /* Max file name len */ #define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
#ifdef PATH_MAX
#define FN_REFLEN PATH_MAX/* Max length of full path-name */
#else
#define FN_REFLEN 512 /* Max length of full path-name */ #define FN_REFLEN 512 /* Max length of full path-name */
#endif
#define FN_EXTCHAR '.' #define FN_EXTCHAR '.'
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */

View File

@ -259,6 +259,8 @@ extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir; extern const char *charsets_dir;
extern char *defaults_extra_file; extern char *defaults_extra_file;
extern my_bool timed_mutexes;
typedef struct wild_file_pack /* Struct to hold info when selecting files */ typedef struct wild_file_pack /* Struct to hold info when selecting files */
{ {
uint wilds; /* How many wildcards */ uint wilds; /* How many wildcards */

View File

@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val(
{ {
byte* data; byte* data;
ut_ad(UNIV_SQL_NULL > ULINT_MAX);
if (len == UNIV_SQL_NULL) { if (len == UNIV_SQL_NULL) {
dfield_set_len(que_node_get_val(node), len); dfield_set_len(que_node_get_val(node), len);

View File

@ -526,7 +526,7 @@ bits of a record. (Only compact records have status bits.) */
UNIV_INLINE UNIV_INLINE
ulint ulint
rec_get_info_and_status_bits( rec_get_info_and_status_bits(
/*==============*/ /*=========================*/
/* out: info bits */ /* out: info bits */
rec_t* rec, /* in: physical record */ rec_t* rec, /* in: physical record */
ibool comp) /* in: TRUE=compact page format */ ibool comp) /* in: TRUE=compact page format */
@ -550,7 +550,7 @@ bits of a record. (Only compact records have status bits.) */
UNIV_INLINE UNIV_INLINE
void void
rec_set_info_and_status_bits( rec_set_info_and_status_bits(
/*==============*/ /*=========================*/
rec_t* rec, /* in: physical record */ rec_t* rec, /* in: physical record */
ibool comp, /* in: TRUE=compact page format */ ibool comp, /* in: TRUE=compact page format */
ulint bits) /* in: info bits */ ulint bits) /* in: info bits */

View File

@ -383,7 +383,9 @@ struct trx_struct{
dulint commit_lsn; /* lsn at the time of the commit */ dulint commit_lsn; /* lsn at the time of the commit */
ibool dict_operation; /* TRUE if the trx is used to create ibool dict_operation; /* TRUE if the trx is used to create
a table, create an index, or drop a a table, create an index, or drop a
table */ table. This is a hint that the table
may need to be dropped in crash
recovery. */
dulint table_id; /* table id if the preceding field is dulint table_id; /* table id if the preceding field is
TRUE */ TRUE */
/*------------------------------*/ /*------------------------------*/

View File

@ -81,9 +81,11 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */ /* Make a non-inline debug version */
#ifdef DBUG_ON #ifdef DBUG_ON
# define UNIV_DEBUG #define UNIV_DEBUG
#endif /* DBUG_ON */ #endif /* DBUG_ON */
/* /*
#define UNIV_DEBUG
#define UNIV_MEM_DEBUG #define UNIV_MEM_DEBUG
#define UNIV_IBUF_DEBUG #define UNIV_IBUF_DEBUG
#define UNIV_SYNC_DEBUG #define UNIV_SYNC_DEBUG
@ -122,7 +124,7 @@ by one. */
/* Definition for inline version */ /* Definition for inline version */
#ifdef __WIN__ #ifdef __WIN__
#define UNIV_INLINE __inline #define UNIV_INLINE __inline
#else #else
/* config.h contains the right def for 'inline' for the current compiler */ /* config.h contains the right def for 'inline' for the current compiler */
#if (__GNUC__ == 2) #if (__GNUC__ == 2)

View File

@ -15,6 +15,13 @@ Created 10/21/1995 Heikki Tuuri
#include "fil0fil.h" #include "fil0fil.h"
#include "buf0buf.h" #include "buf0buf.h"
#if defined(UNIV_HOTBACKUP) && defined(__WIN__)
/* Add includes for the _stat() call to compile on Windows */
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#endif /* UNIV_HOTBACKUP */
#undef HAVE_FDATASYNC #undef HAVE_FDATASYNC
#ifdef POSIX_ASYNC_IO #ifdef POSIX_ASYNC_IO

View File

@ -2561,17 +2561,6 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */
goto funct_exit; goto funct_exit;
} }
if (table->n_mysql_handles_opened > 1) {
ut_print_timestamp(stderr);
fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr);
ut_print_name(stderr, trx, table->name);
fputs("\n"
"InnoDB: though there are still open handles to it.\n", stderr);
err = DB_ERROR;
goto funct_exit;
}
/* TODO: could we replace the counter n_foreign_key_checks_running /* TODO: could we replace the counter n_foreign_key_checks_running
with lock checks on the table? Acquire here an exclusive lock on the with lock checks on the table? Acquire here an exclusive lock on the
table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that
@ -2594,7 +2583,6 @@ fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr);
lock_reset_all_on_table(table); lock_reset_all_on_table(table);
trx->dict_operation = TRUE;
trx->table_id = table->id; trx->table_id = table->id;
/* scan SYS_INDEXES for all indexes of the table */ /* scan SYS_INDEXES for all indexes of the table */

View File

@ -88,7 +88,9 @@ ut_malloc_low(
"InnoDB: Check if you should increase the swap file or\n" "InnoDB: Check if you should increase the swap file or\n"
"InnoDB: ulimits of your operating system.\n" "InnoDB: ulimits of your operating system.\n"
"InnoDB: On FreeBSD check you have compiled the OS with\n" "InnoDB: On FreeBSD check you have compiled the OS with\n"
"InnoDB: a big enough maximum process size.\n", "InnoDB: a big enough maximum process size.\n"
"InnoDB: Note that in most 32-bit computers the process\n"
"InnoDB: memory space is limited to 2 GB or 4 GB.\n",
(ulong) n, (ulong) ut_total_allocated_memory, (ulong) n, (ulong) ut_total_allocated_memory,
#ifdef __WIN__ #ifdef __WIN__
(ulong) GetLastError() (ulong) GetLastError()

View File

@ -82,10 +82,17 @@ ut_usectime(
ulint* sec, /* out: seconds since the Epoch */ ulint* sec, /* out: seconds since the Epoch */
ulint* ms) /* out: microseconds since the Epoch+*sec */ ulint* ms) /* out: microseconds since the Epoch+*sec */
{ {
#ifdef __WIN__
SYSTEMTIME st;
GetLocalTime(&st);
*sec = (ulint) st.wSecond;
*ms = (ulint) st.wMilliseconds;
#else
struct timeval tv; struct timeval tv;
gettimeofday(&tv,NULL); gettimeofday(&tv,NULL);
*sec = (ulint) tv.tv_sec; *sec = (ulint) tv.tv_sec;
*ms = (ulint) tv.tv_usec; *ms = (ulint) tv.tv_usec;
#endif
} }
/************************************************************** /**************************************************************

View File

@ -24,7 +24,7 @@ target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
LIBS = @CLIENT_LIBS@ LIBS = @CLIENT_LIBS@
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \ INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
-I$(top_srcdir)/extra -I$(top_builddir)/include
include $(srcdir)/Makefile.shared include $(srcdir)/Makefile.shared

View File

@ -1740,7 +1740,7 @@ static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row);
STMT_ATTR_UPDATE_MAX_LENGTH attribute is set. STMT_ATTR_UPDATE_MAX_LENGTH attribute is set.
*/ */
static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data);
static bool setup_one_fetch_function(MYSQL_BIND *bind, MYSQL_FIELD *field); static my_bool setup_one_fetch_function(MYSQL_BIND *bind, MYSQL_FIELD *field);
/* /*
Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME Maximum sizes of MYSQL_TYPE_DATE, MYSQL_TYPE_TIME, MYSQL_TYPE_DATETIME
@ -3718,7 +3718,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
longlongstore(buffer, data); longlongstore(buffer, data);
} }
*param->error= value != (param->is_unsigned ? *param->error= value != (param->is_unsigned ?
(double) (*(ulonglong*) buffer) : ulonglong2double(*(ulonglong*) buffer) :
(double) (*(longlong*) buffer)); (double) (*(longlong*) buffer));
break; break;
case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_FLOAT:

View File

@ -26,7 +26,7 @@ LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
INCLUDES = @MT_INCLUDES@ \ INCLUDES = @MT_INCLUDES@ \
-I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
-I$(top_srcdir)/extra -I$(top_builddir)/include
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include ## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
include $(top_srcdir)/libmysql/Makefile.shared include $(top_srcdir)/libmysql/Makefile.shared

View File

@ -28,7 +28,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \ -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
-I$(top_srcdir)/regex \ -I$(top_srcdir)/regex \
-I$(top_srcdir)/extra \ -I$(top_builddir)/include \
$(openssl_includes) @ZLIB_INCLUDES@ $(openssl_includes) @ZLIB_INCLUDES@
noinst_LIBRARIES = libmysqld_int.a noinst_LIBRARIES = libmysqld_int.a

View File

@ -1,7 +1,8 @@
noinst_PROGRAMS = mysql noinst_PROGRAMS = mysql
bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded
client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES)
tests_sources= $(mysql_client_test_embedded_SOURCES) tests_sources = $(mysql_client_test_embedded_SOURCES)
CLEANFILES = $(client_sources) $(tests_sources)
link_sources: link_sources:
for f in $(client_sources); do \ for f in $(client_sources); do \
@ -16,7 +17,7 @@ link_sources:
DEFS = -DEMBEDDED_LIBRARY DEFS = -DEMBEDDED_LIBRARY
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \
-I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \ -I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \
-I$(top_srcdir)/extra $(openssl_includes) -I$(top_builddir)/include $(openssl_includes)
LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
@ -31,9 +32,5 @@ mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
mysql_client_test_embedded_LINK = $(CXXLINK) mysql_client_test_embedded_LINK = $(CXXLINK)
mysql_client_test_embedded_SOURCES = mysql_client_test.c mysql_client_test_embedded_SOURCES = mysql_client_test.c
clean:
rm -f $(client_sources)
rm -f $(tests_sources)
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View File

@ -1,4 +1,4 @@
-- require r/have_federated_db.require -- require r/have_federated_db.require
disable_query_log; disable_query_log;
show variables like "have_federated_db"; show variables like "have_federated_engine";
enable_query_log; enable_query_log;

View File

@ -0,0 +1,4 @@
-- require r/ndb_default_cluster.require
disable_query_log;
show status like "Ndb_connected_host";
enable_query_log;

View File

@ -0,0 +1,30 @@
#################### include/testdb_only.inc ######################
# #
# We must prevent to work on databases created by customers, #
# because we DROP/CREATE/MODIFY objects with sometimes common #
# names like STAFF, EMPLOYEE etc. #
# #
# Therefore we check the environment variable USE_RUNNING_SERVER. #
# USE_RUNNING_SERVER is exported by "mysql-test-run" and could #
# contain the following values: #
# 0 -- mysql-test-run was started without the --extern option #
# That means the test will be performed within the test #
# area 'mysql-test/var/...' . #
# 1 -- mysql-test-run was started with the --extern option #
# That means the test will be performed by an already #
# running server and data modifications will most probably #
# outside of the common test area 'mysql-test/var/...' . #
# #
# If USE_RUNNING_SERVER is not 0 the test will be skipped. #
# #
###################################################################
--disable_query_log
eval set @USE_RUNNING_SERVER= '$USE_RUNNING_SERVER';
--require r/testdb_only.require
SELECT 'use extern server'
AS "Variable_name ",
IF(@USE_RUNNING_SERVER= '1','YES',
IF(@USE_RUNNING_SERVER= '0','NO','UNEXPECTED'))
AS "Value" ;
--enable_query_log

View File

@ -224,7 +224,7 @@ EXTRA_MASTER_OPT=""
EXTRA_MYSQL_TEST_OPT="" EXTRA_MYSQL_TEST_OPT=""
EXTRA_MYSQLDUMP_OPT="" EXTRA_MYSQLDUMP_OPT=""
EXTRA_MYSQLBINLOG_OPT="" EXTRA_MYSQLBINLOG_OPT=""
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
USE_NDBCLUSTER="" USE_NDBCLUSTER=""
USE_RUNNING_NDBCLUSTER="" USE_RUNNING_NDBCLUSTER=""
DO_GCOV="" DO_GCOV=""
@ -255,7 +255,7 @@ NDBD_EXTRA_OPTS=
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
--embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ --embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \
USE_RUNNING_SERVER="" RESULT_EXT=".es" TEST_MODE="embedded" ;; USE_RUNNING_SERVER=0 RESULT_EXT=".es" TEST_MODE="embedded" ;;
--user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
--force) FORCE=1 ;; --force) FORCE=1 ;;
--timer) USE_TIMER=1 ;; --timer) USE_TIMER=1 ;;
@ -265,8 +265,8 @@ while test $# -gt 0; do
MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;; MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
--slave-binary=*) --slave-binary=*)
SLAVE_MYSQLD=`$ECHO "$1" | $SED -e "s;--slave-binary=;;"` ;; SLAVE_MYSQLD=`$ECHO "$1" | $SED -e "s;--slave-binary=;;"` ;;
--local) USE_RUNNING_SERVER="" ;; --local) USE_RUNNING_SERVER=0 ;;
--extern) USE_RUNNING_SERVER="1" ;; --extern) USE_RUNNING_SERVER=1 ;;
--with-ndbcluster) --with-ndbcluster)
USE_NDBCLUSTER="--ndbcluster" ;; USE_NDBCLUSTER="--ndbcluster" ;;
--ndb-connectstring=*) --ndb-connectstring=*)
@ -303,7 +303,7 @@ while test $# -gt 0; do
--no-manager | --skip-manager) USE_MANAGER=0 ;; --no-manager | --skip-manager) USE_MANAGER=0 ;;
--manager) --manager)
USE_MANAGER=1 USE_MANAGER=1
USE_RUNNING_SERVER= USE_RUNNING_SERVER=0
;; ;;
--start-and-exit) --start-and-exit)
START_AND_EXIT=1 START_AND_EXIT=1
@ -372,7 +372,7 @@ while test $# -gt 0; do
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
# This needs to be checked properly # This needs to be checked properly
# USE_MANAGER=1 # USE_MANAGER=1
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
;; ;;
--client-gdb ) --client-gdb )
if [ x$BINARY_DIST = x1 ] ; then if [ x$BINARY_DIST = x1 ] ; then
@ -385,7 +385,7 @@ while test $# -gt 0; do
--manual-gdb ) --manual-gdb )
DO_GDB=1 DO_GDB=1
MANUAL_GDB=1 MANUAL_GDB=1
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
;; ;;
@ -394,7 +394,7 @@ while test $# -gt 0; do
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --ddd option" $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --ddd option"
fi fi
DO_DDD=1 DO_DDD=1
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
;; ;;
@ -412,7 +412,7 @@ while test $# -gt 0; do
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
SLEEP_TIME_AFTER_RESTART=10 SLEEP_TIME_AFTER_RESTART=10
SLEEP_TIME_FOR_DELETE=60 SLEEP_TIME_FOR_DELETE=60
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
if test "$1" = "--valgrind-all" if test "$1" = "--valgrind-all"
then then
VALGRIND="$VALGRIND -v --show-reachable=yes" VALGRIND="$VALGRIND -v --show-reachable=yes"
@ -627,9 +627,9 @@ fi
if [ -z "$1" ] if [ -z "$1" ]
then then
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=0
fi fi
if [ -n "$USE_RUNNING_SERVER" ] if [ $USE_RUNNING_SERVER -eq 1 ]
then then
MASTER_MYSOCK=$LOCAL_SOCKET; MASTER_MYSOCK=$LOCAL_SOCKET;
DBUSER=${DBUSER:-test} DBUSER=${DBUSER:-test}
@ -801,7 +801,7 @@ report_stats () {
$ECHO "http://www.mysql.com/doc/en/MySQL_test_suite.html" $ECHO "http://www.mysql.com/doc/en/MySQL_test_suite.html"
fi fi
if test -z "$USE_RUNNING_SERVER" if [ $USE_RUNNING_SERVER -eq 0 ]
then then
# Report if there was any fatal warnings/errors in the log files # Report if there was any fatal warnings/errors in the log files
@ -1511,7 +1511,7 @@ run_testcase ()
done done
fi fi
if [ -z "$USE_RUNNING_SERVER" ] ; if [ $USE_RUNNING_SERVER -eq 0 ] ;
then then
if [ -f $master_opt_file ] ; if [ -f $master_opt_file ] ;
then then
@ -1655,7 +1655,7 @@ run_testcase ()
if [ x$FORCE != x1 ] ; then if [ x$FORCE != x1 ] ; then
$ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'." $ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'."
$ECHO $ECHO
if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
[ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
then then
mysql_stop mysql_stop
@ -1664,7 +1664,7 @@ run_testcase ()
exit 1 exit 1
fi fi
FAILED_CASES="$FAILED_CASES $tname" FAILED_CASES="$FAILED_CASES $tname"
if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
[ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
then then
mysql_restart mysql_restart
@ -1683,7 +1683,7 @@ run_testcase ()
[ "$DO_GCOV" ] && gcov_prepare [ "$DO_GCOV" ] && gcov_prepare
[ "$DO_GPROF" ] && gprof_prepare [ "$DO_GPROF" ] && gprof_prepare
if [ -z "$USE_RUNNING_SERVER" ] if [ $USE_RUNNING_SERVER -eq 0 ]
then then
if [ -z "$FAST_START" ] if [ -z "$FAST_START" ]
then then
@ -1744,6 +1744,9 @@ fi
$ECHO "Starting Tests" $ECHO "Starting Tests"
# Some test cases need USE_RUNNING_SERVER
export USE_RUNNING_SERVER
# #
# This can probably be deleted # This can probably be deleted
# #
@ -1816,7 +1819,7 @@ fi
$ECHO $DASH72 $ECHO $DASH72
$ECHO $ECHO
if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && [ -z "$DO_DDD" ]
then then
mysql_stop mysql_stop
fi fi

View File

@ -130,9 +130,9 @@ delete from federated.t1;
select * from federated.t1 where id = 5; select * from federated.t1 where id = 5;
id name other created id name other created
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ); CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) );
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, other) values ('First Name', 11111); insert into federated.t1 (name, other) values ('First Name', 11111);
insert into federated.t1 (name, other) values ('Second Name', NULL); insert into federated.t1 (name, other) values ('Second Name', NULL);
insert into federated.t1 (name, other) values ('Third Name', 33333); insert into federated.t1 (name, other) values ('Third Name', 33333);
@ -162,7 +162,7 @@ id name other
7 Seventh Name NULL 7 Seventh Name NULL
10 NULL fee fie foe fum 10 NULL fee fie foe fum
update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL; update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL;
update federated.t1 set other = 'two two two two' where name = 'Secend Name'; update federated.t1 set other = 'two two two two' where name = 'Second Name';
update federated.t1 set other = 'seven seven' where name like 'Sec%'; update federated.t1 set other = 'seven seven' where name like 'Sec%';
update federated.t1 set other = 'seven seven' where name = 'Seventh Name'; update federated.t1 set other = 'seven seven' where name = 'Seventh Name';
update federated.t1 set name = 'Tenth Name' where other like 'fee fie%'; update federated.t1 set name = 'Tenth Name' where other like 'fee fie%';
@ -181,6 +181,85 @@ id name other
9 Ninth Name 99999 9 Ninth Name 99999
10 Tenth Name fee fie foe fum 10 Tenth Name fee fie foe fum
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name`
varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other) );
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, other) values ('First Name', '1111');
insert into federated.t1 (name, other) values ('Second Name', '2222');
insert into federated.t1 (name, other) values ('Third Name', '3333');
select * from federated.t1 where name = 'Second Name';
id name other
2 Second Name 2222
select * from federated.t1 where other = '2222';
id name other
2 Second Name 2222
select * from federated.t1 where name = 'Third Name';
id name other
3 Third Name 3333
select * from federated.t1 where name = 'Third Name' and other = '3333';
id name other
3 Third Name 3333
drop table if exists federated.t1;
CREATE TABLE federated.t1
(id int NOT NULL auto_increment,
name char(32) NOT NULL DEFAULT '',
bincol binary(4) NOT NULL,
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
other int NOT NULL DEFAULT 0,
primary key(id),
key nameoth(name, other),
key bincol(bincol),
key floatval(floatval));
drop table if exists federated.t1;
CREATE TABLE federated.t1
(id int NOT NULL auto_increment,
name char(32) NOT NULL DEFAULT '',
bincol binary(4) NOT NULL,
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
other int NOT NULL DEFAULT 0,
primary key(id),
key nameoth(name,other),
key bincol(bincol),
key floatval(floatval))
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, bincol, floatval, other) values ('first', 0x65, 11.11, 1111);
insert into federated.t1 (name, bincol, floatval, other) values ('second', 0x66, 22.22, 2222);
insert into federated.t1 (name, bincol, floatval, other) values ('third', 'g', 22.22, 2222);
select * from federated.t1;
id name bincol floatval other
1 first e 11.11 1111
2 second f 22.22 2222
3 third g 22.22 2222
select * from federated.t1 where name = 'second';
id name bincol floatval other
2 second f 22.22 2222
select * from federated.t1 where bincol= 'f';
id name bincol floatval other
2 second f 22.22 2222
select * from federated.t1 where bincol= 0x66;
id name bincol floatval other
2 second f 22.22 2222
select * from federated.t1 where bincol= 0x67;
id name bincol floatval other
3 third g 22.22 2222
select * from federated.t1 where bincol= 'g';
id name bincol floatval other
3 third g 22.22 2222
select * from federated.t1 where floatval=11.11;
id name bincol floatval other
1 first e 11.11 1111
select * from federated.t1 where name='third';
id name bincol floatval other
3 third g 22.22 2222
select * from federated.t1 where other=2222;
id name bincol floatval other
2 second f 22.22 2222
3 third g 22.22 2222
select * from federated.t1 where name='third' and other=2222;
id name bincol floatval other
3 third g 22.22 2222
drop table if exists federated.t1;
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1; CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1'; CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
@ -550,16 +629,46 @@ delete from federated.t1 where i50=20;
select * from federated.t1; select * from federated.t1;
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
drop table if exists federated.t1; drop table if exists federated.t1;
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) DEFAULT CHARSET=latin1; create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
drop table if exists federated.t1; drop table if exists federated.t1;
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1'; create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03'); insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04'); insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
select * from federated.t1; select * from federated.t1;
id code fileguts creation_date entered_time id code fileguts creation_date entered_time
1 ASDFWERQWETWETAWETA *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2003-03-03 03:03:03 2004-04-04 04:04:04 1 ASDFWERQWETWETAWETA *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2003-03-03 03:03:03 2004-04-04 04:04:04
2 DEUEUEUEUEUEUEUEUEU *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2004-04-04 04:04:04 2004-04-04 04:04:04 2 DEUEUEUEUEUEUEUEUEU *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2004-04-04 04:04:04 2004-04-04 04:04:04
3 DEUEUEUEUEUEUEUEUEU jimbob 2004-04-04 04:04:04 2004-04-04 04:04:04
select * from federated.t1 where fileguts = 'jimbob';
id code fileguts creation_date entered_time
3 DEUEUEUEUEUEUEUEUEU jimbob 2004-04-04 04:04:04 2004-04-04 04:04:04
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id));
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, country_id, other) values ('Kumar', 1, 11111);
insert into federated.t1 (name, country_id, other) values ('Lenz', 2, 22222);
insert into federated.t1 (name, country_id, other) values ('Marizio', 3, 33333);
insert into federated.t1 (name, country_id, other) values ('Monty', 4, 33333);
insert into federated.t1 (name, country_id, other) values ('Sanja', 5, 33333);
drop table if exists federated.countries;
Warnings:
Note 1051 Unknown table 'countries'
CREATE TABLE federated.countries ( `id` int(20) NOT NULL auto_increment, `country` varchar(32), primary key (id));
insert into federated.countries (country) values ('India');
insert into federated.countries (country) values ('Germany');
insert into federated.countries (country) values ('Italy');
insert into federated.countries (country) values ('Finland');
insert into federated.countries (country) values ('Ukraine');
select federated.t1.*, federated.countries.country from federated.t1 left join federated.countries on federated.t1.country_id = federated.countries.id;
id country_id name other country
1 1 Kumar 11111 India
2 2 Lenz 22222 Germany
3 3 Marizio 33333 Italy
4 4 Monty 33333 Finland
5 5 Sanja 33333 Ukraine
drop table federated.countries;
drop table if exists federated.t1; drop table if exists federated.t1;
drop database if exists federated; drop database if exists federated;
drop table if exists federated.t1; drop table if exists federated.t1;

View File

@ -1,2 +1,2 @@
Variable_name Value Variable_name Value
have_federated_db YES have_federated_engine YES

View File

@ -571,8 +571,11 @@ where table_schema='information_schema' limit 2;
TABLE_NAME TABLE_TYPE ENGINE TABLE_NAME TABLE_TYPE ENGINE
SCHEMATA TEMPORARY MyISAM SCHEMATA TEMPORARY MyISAM
TABLES TEMPORARY MyISAM TABLES TEMPORARY MyISAM
show tables from information_schema like "t%"; show tables from information_schema like "T%";
Tables_in_information_schema (t%) Tables_in_information_schema (T%)
TABLES
TABLE_PRIVILEGES
TABLE_CONSTRAINTS
create database information_schema; create database information_schema;
ERROR HY000: Can't create database 'information_schema'; database exists ERROR HY000: Can't create database 'information_schema'; database exists
use information_schema; use information_schema;

View File

@ -638,3 +638,15 @@ No Field Count
0 1 100 0 1 100
0 2 100 0 2 100
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
NO int(11) NOT NULL default '0',
SEQ int(11) NOT NULL default '0',
PRIMARY KEY (ID),
KEY t1$NO (SEQ,NO)
) ENGINE=MyISAM;
INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
ID NO SEQ
1 1 1
drop table t1;

View File

@ -1,4 +1,4 @@
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`; DROP DATABASE IF EXISTS `test_$1`;
CREATE TABLE T1 (a int); CREATE TABLE T1 (a int);
@ -131,13 +131,13 @@ show tables like 't1%';
Tables_in_test (t1%) Tables_in_test (t1%)
t1 t1
drop table t1; drop table t1;
create temporary table tT(a int(11), b varchar(8)); create temporary table T1(a int(11), b varchar(8));
insert into tT values (1, 'abc'); insert into T1 values (1, 'abc');
select * from tT; select * from T1;
a b a b
1 abc 1 abc
alter table tT add index (a); alter table T1 add index (a);
select * from tT; select * from T1;
a b a b
1 abc 1 abc
drop table tT; drop table T1;

View File

@ -34,13 +34,13 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int) ENGINE=ndbcluster; col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
show table status; show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ndbcluster 10 Dynamic 0 0 0 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2 t1 ndbcluster 10 Dynamic 0 0 # # 0 # 1 # # # latin1_swedish_ci NULL #
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
show table status; show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ndbcluster 10 Dynamic 9 96 131072 0 0 0 101 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2 t1 ndbcluster 10 Dynamic 9 96 # # 0 # 101 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col1 col2 col3 col4 col5 col6 to_be_deleted col1 col2 col3 col4 col5 col6 to_be_deleted
0 4 3 5 PENDING 1 7 0 4 3 5 PENDING 1 7
@ -60,7 +60,7 @@ change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first; modify column col6 int not null first;
show table status; show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ndbcluster 10 Dynamic 9 152 131072 0 0 0 102 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2 t1 ndbcluster 10 Dynamic 9 152 # # 0 # 102 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 0 3 4 5 PENDING 0000-00-00 00:00:00 1 0 3 4 5 PENDING 0000-00-00 00:00:00
@ -75,7 +75,7 @@ col6 col1 col3 fourth col4 col4_5 col5 col7 col8
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
show table status; show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 ndbcluster 10 Dynamic 10 152 131072 0 0 0 103 NULL NULL NULL latin1_swedish_ci NULL number_of_replicas: 2 t1 ndbcluster 10 Dynamic 10 152 # # 0 # 103 # # # latin1_swedish_ci NULL #
select * from t1 order by col1; select * from t1 order by col1;
col6 col1 col3 fourth col4 col4_5 col5 col7 col8 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
1 0 3 4 5 PENDING 0000-00-00 00:00:00 1 0 3 4 5 PENDING 0000-00-00 00:00:00

View File

@ -144,8 +144,8 @@ Handler_discover 1
flush tables; flush tables;
show table status; show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL #
t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL number_of_replicas: 2 t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL #
show status like 'handler_discover%'; show status like 'handler_discover%';
Variable_name Value Variable_name Value
Handler_discover 2 Handler_discover 2

View File

@ -0,0 +1,2 @@
Variable_name Value
Ndb_connected_host localhost

View File

@ -432,16 +432,16 @@ index(ye),
index(ti), index(ti),
index(ts) index(ts)
) engine=ndb; ) engine=ndb;
insert into t1 (pk,dt,da,ye,ti) values insert into t1 (pk,dt,da,ye,ti,ts) values
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'),
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'),
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'),
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'),
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'),
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'),
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'),
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'),
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00';
count(*)-9 count(*)-9
0 0
@ -529,6 +529,30 @@ count(*)-8
select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
count(*)-9 count(*)-9
0 0
select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00';
count(*)-9
0
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00';
count(*)-7
0
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05';
count(*)-7
0
select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06';
count(*)-5
0
select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11';
count(*)-5
0
select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11';
count(*)-6
0
select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59';
count(*)-8
0
select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
count(*)-9
0
drop table t1; drop table t1;
create table t1(a int primary key, b int not null, index(b)); create table t1(a int primary key, b int not null, index(b));
insert into t1 values (1,1), (2,2); insert into t1 values (1,1), (2,2);

View File

@ -612,3 +612,17 @@ a b c
3 NULL NULL 3 NULL NULL
4 4 NULL 4 4 NULL
drop table t1, t8; drop table t1, t8;
create table t1(
id integer not null auto_increment,
month integer not null,
year integer not null,
code varchar( 2) not null,
primary key ( id),
unique idx_t1( month, code, year)
) engine=ndb;
INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
select * from t1 where code = '12' and month = 4 and year = 2004 ;
id month year code
1 4 2004 12
drop table t1;

View File

@ -778,3 +778,20 @@ sid wnid
39560 01019090000 39560 01019090000
37994 01019090000 37994 01019090000
drop table t1; drop table t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
SELECT a FROM t1 ORDER BY a;
a
1
1
1
2
2
(SELECT a FROM t1) ORDER BY a;
a
1
1
1
2
2
DROP TABLE t1;

View File

@ -0,0 +1,2 @@
Variable_name Value
use extern server NO

View File

@ -6,6 +6,7 @@ delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges; flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
flush user_resources;
select * from t1; select * from t1;
i i
select * from t1; select * from t1;
@ -16,6 +17,7 @@ select * from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_questions' resource (current value: 2) ERROR 42000: User 'mysqltest_1' has exceeded the 'max_questions' resource (current value: 2)
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
flush user_resources;
select * from t1; select * from t1;
i i
select * from t1; select * from t1;
@ -34,6 +36,7 @@ select * from t1;
i i
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
flush user_resources;
select * from t1; select * from t1;
i i
select * from t1; select * from t1;
@ -47,6 +50,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections' resource (cur
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
flush privileges; flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2; grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
flush user_resources;
select * from t1; select * from t1;
i i
select * from t1; select * from t1;
@ -56,6 +60,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource
select * from t1; select * from t1;
i i
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3; grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
select * from t1; select * from t1;
i i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK); connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
@ -71,6 +76,7 @@ select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections @@session.max_user_connections @@global.max_user_connections
2 2 2 2
grant usage on *.* to mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost;
flush user_resources;
select @@session.max_user_connections, @@global.max_user_connections; select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections @@session.max_user_connections @@global.max_user_connections
2 2 2 2
@ -79,6 +85,7 @@ i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK); connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3; grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
select @@session.max_user_connections, @@global.max_user_connections; select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections @@session.max_user_connections @@global.max_user_connections
3 2 3 2

View File

@ -1,6 +1,6 @@
# #
# Simple test for archive example # Simple test for archive example
# Taken fromm the select test # Taken from the select test
# #
-- source include/have_archive.inc -- source include/have_archive.inc

View File

@ -68,12 +68,14 @@ select * from federated.t1 where id = 5;
delete from federated.t1; delete from federated.t1;
select * from federated.t1 where id = 5; select * from federated.t1 where id = 5;
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
connection slave; connection slave;
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ); CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) );
connection master;
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, other) values ('First Name', 11111); insert into federated.t1 (name, other) values ('First Name', 11111);
insert into federated.t1 (name, other) values ('Second Name', NULL); insert into federated.t1 (name, other) values ('Second Name', NULL);
insert into federated.t1 (name, other) values ('Third Name', 33333); insert into federated.t1 (name, other) values ('Third Name', 33333);
@ -90,19 +92,78 @@ select * from federated.t1 where name IS NULL;
select * from federated.t1 where name IS NULL and other IS NULL; select * from federated.t1 where name IS NULL and other IS NULL;
select * from federated.t1 where name IS NULL or other IS NULL; select * from federated.t1 where name IS NULL or other IS NULL;
update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL; update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL;
update federated.t1 set other = 'two two two two' where name = 'Secend Name'; update federated.t1 set other = 'two two two two' where name = 'Second Name';
update federated.t1 set other = 'seven seven' where name like 'Sec%'; update federated.t1 set other = 'seven seven' where name like 'Sec%';
update federated.t1 set other = 'seven seven' where name = 'Seventh Name'; update federated.t1 set other = 'seven seven' where name = 'Seventh Name';
update federated.t1 set name = 'Tenth Name' where other like 'fee fie%'; update federated.t1 set name = 'Tenth Name' where other like 'fee fie%';
select * from federated.t1 where name IS NULL or other IS NULL ; select * from federated.t1 where name IS NULL or other IS NULL ;
select * from federated.t1; select * from federated.t1;
# test multi-keys
connection slave;
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name`
varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other) );
connection master;
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, other) values ('First Name', '1111');
insert into federated.t1 (name, other) values ('Second Name', '2222');
insert into federated.t1 (name, other) values ('Third Name', '3333');
select * from federated.t1 where name = 'Second Name';
select * from federated.t1 where other = '2222';
select * from federated.t1 where name = 'Third Name';
select * from federated.t1 where name = 'Third Name' and other = '3333';
connection slave;
drop table if exists federated.t1;
CREATE TABLE federated.t1
(id int NOT NULL auto_increment,
name char(32) NOT NULL DEFAULT '',
bincol binary(4) NOT NULL,
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
other int NOT NULL DEFAULT 0,
primary key(id),
key nameoth(name, other),
key bincol(bincol),
key floatval(floatval));
# test other types of indexes
connection master;
drop table if exists federated.t1;
CREATE TABLE federated.t1
(id int NOT NULL auto_increment,
name char(32) NOT NULL DEFAULT '',
bincol binary(4) NOT NULL,
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
other int NOT NULL DEFAULT 0,
primary key(id),
key nameoth(name,other),
key bincol(bincol),
key floatval(floatval))
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, bincol, floatval, other) values ('first', 0x65, 11.11, 1111);
insert into federated.t1 (name, bincol, floatval, other) values ('second', 0x66, 22.22, 2222);
insert into federated.t1 (name, bincol, floatval, other) values ('third', 'g', 22.22, 2222);
select * from federated.t1;
select * from federated.t1 where name = 'second';
select * from federated.t1 where bincol= 'f';
select * from federated.t1 where bincol= 0x66;
select * from federated.t1 where bincol= 0x67;
select * from federated.t1 where bincol= 'g';
select * from federated.t1 where floatval=11.11;
select * from federated.t1 where name='third';
select * from federated.t1 where other=2222;
select * from federated.t1 where name='third' and other=2222;
# test NULLs
connection slave; connection slave;
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1; CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
connection master; connection master;
# test NULLs
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1'; CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
# these both should be the same # these both should be the same
@ -452,15 +513,17 @@ select * from federated.t1;
connection slave; connection slave;
drop table if exists federated.t1; drop table if exists federated.t1;
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) DEFAULT CHARSET=latin1; create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
connection master; connection master;
drop table if exists federated.t1; drop table if exists federated.t1;
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1'; create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03'); insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04'); insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
select * from federated.t1; select * from federated.t1;
drop table if exists federated.t1; select * from federated.t1 where fileguts = 'jimbob';
# test blob indexes
# TODO # TODO
# #
@ -490,11 +553,36 @@ drop table if exists federated.t1;
# drop table if exists federated.t1; # drop table if exists federated.t1;
# #
# test joins with non-federated table
connection slave; connection slave;
drop table if exists federated.t1; drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id));
connection master;
drop table if exists federated.t1;
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
insert into federated.t1 (name, country_id, other) values ('Kumar', 1, 11111);
insert into federated.t1 (name, country_id, other) values ('Lenz', 2, 22222);
insert into federated.t1 (name, country_id, other) values ('Marizio', 3, 33333);
insert into federated.t1 (name, country_id, other) values ('Monty', 4, 33333);
insert into federated.t1 (name, country_id, other) values ('Sanja', 5, 33333);
drop table if exists federated.countries;
CREATE TABLE federated.countries ( `id` int(20) NOT NULL auto_increment, `country` varchar(32), primary key (id));
insert into federated.countries (country) values ('India');
insert into federated.countries (country) values ('Germany');
insert into federated.countries (country) values ('Italy');
insert into federated.countries (country) values ('Finland');
insert into federated.countries (country) values ('Ukraine');
select federated.t1.*, federated.countries.country from federated.t1 left join federated.countries on federated.t1.country_id = federated.countries.id;
drop table federated.countries;
connection master; connection master;
--disable_warnings --disable_warnings
drop table if exists federated.t1;
drop database if exists federated; drop database if exists federated;
--enable_warnings --enable_warnings

View File

@ -281,7 +281,7 @@ drop view vo;
select TABLE_NAME,TABLE_TYPE,ENGINE select TABLE_NAME,TABLE_TYPE,ENGINE
from information_schema.tables from information_schema.tables
where table_schema='information_schema' limit 2; where table_schema='information_schema' limit 2;
show tables from information_schema like "t%"; show tables from information_schema like "T%";
--error 1007 --error 1007
create database information_schema; create database information_schema;

View File

@ -180,3 +180,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2
select * from t2; select * from t2;
drop table t1, t2; drop table t1, t2;
#
# BUG#6034 - Error code 124: Wrong medium type
#
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
NO int(11) NOT NULL default '0',
SEQ int(11) NOT NULL default '0',
PRIMARY KEY (ID),
KEY t1$NO (SEQ,NO)
) ENGINE=MyISAM;
INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1);
select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1);
drop table t1;

View File

@ -10,7 +10,7 @@ show variables like "lower_case_table_names";
enable_query_log; enable_query_log;
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`; DROP DATABASE IF EXISTS `test_$1`;
--enable_warnings --enable_warnings
@ -105,9 +105,9 @@ drop table t1;
# Bug #7261: Alter table loses temp table # Bug #7261: Alter table loses temp table
# #
create temporary table tT(a int(11), b varchar(8)); create temporary table T1(a int(11), b varchar(8));
insert into tT values (1, 'abc'); insert into T1 values (1, 'abc');
select * from tT; select * from T1;
alter table tT add index (a); alter table T1 add index (a);
select * from tT; select * from T1;
drop table tT; drop table T1;

View File

@ -47,10 +47,12 @@ col3 varchar (20) not null,
col4 varchar(4) not null, col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int) ENGINE=ndbcluster; col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO; SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7); (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
alter table t1 alter table t1
@ -59,9 +61,11 @@ add column col7 varchar(30) not null after col5,
add column col8 datetime not null, drop column to_be_deleted, add column col8 datetime not null, drop column to_be_deleted,
change column col2 fourth varchar(30) not null after col3, change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first; modify column col6 int not null first;
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00'); insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
show table status; show table status;
select * from t1 order by col1; select * from t1 order by col1;
delete from t1; delete from t1;

View File

@ -176,7 +176,7 @@ show status like 'handler_discover%';
flush tables; flush tables;
system rm var/master-data/test/t7.frm ; system rm var/master-data/test/t7.frm ;
--replace_column 7 # 8 # 9 # 12 # 13 # 15 # --replace_column 7 # 8 # 9 # 12 # 13 # 15 # 18 #
show table status; show table status;
show status like 'handler_discover%'; show status like 'handler_discover%';

View File

@ -220,16 +220,16 @@ create table t1 (
index(ts) index(ts)
) engine=ndb; ) engine=ndb;
insert into t1 (pk,dt,da,ye,ti) values insert into t1 (pk,dt,da,ye,ti,ts) values
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'),
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'),
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'),
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'),
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'),
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'),
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'),
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'),
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
# datetime # datetime
select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00';
@ -268,6 +268,16 @@ select count(*)-6 from t1 use index (ti) where ti <= '10:11:11';
select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; select count(*)-8 from t1 use index (ti) where ti < '23:59:59';
select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
# timestamp
select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00';
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00';
select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05';
select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06';
select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11';
select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11';
select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59';
select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59';
drop table t1; drop table t1;
# bug#7798 # bug#7798

View File

@ -286,3 +286,24 @@ select * from t8 order by a;
select * from t1 order by a; select * from t1 order by a;
drop table t1, t8; drop table t1, t8;
###############################
# Bug 8101
#
# Unique index not specified in the same order as in table
#
create table t1(
id integer not null auto_increment,
month integer not null,
year integer not null,
code varchar( 2) not null,
primary key ( id),
unique idx_t1( month, code, year)
) engine=ndb;
INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
select * from t1 where code = '12' and month = 4 and year = 2004 ;
drop table t1;

View File

@ -1,4 +1,5 @@
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_default_cluster.inc
--disable_warnings --disable_warnings
use test; use test;

View File

@ -539,3 +539,13 @@ explain select * from t1 where wnid like '0101%' order by wnid;
select * from t1 where wnid like '0101%' order by wnid; select * from t1 where wnid like '0101%' order by wnid;
drop table t1; drop table t1;
#
# Bug #7672 - a wrong result for a select query in braces followed by order by
#
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
SELECT a FROM t1 ORDER BY a;
(SELECT a FROM t1) ORDER BY a;
DROP TABLE t1;

View File

@ -19,6 +19,8 @@ flush privileges;
# Test of MAX_QUERIES_PER_HOUR limit # Test of MAX_QUERIES_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
# This ensures that counters are reset and makes test scheduling independent
flush user_resources;
connect (mqph, localhost, mysqltest_1,,); connect (mqph, localhost, mysqltest_1,,);
connection mqph; connection mqph;
select * from t1; select * from t1;
@ -37,6 +39,7 @@ disconnect mqph2;
# Test of MAX_UPDATES_PER_HOUR limit # Test of MAX_UPDATES_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
flush user_resources;
connect (muph, localhost, mysqltest_1,,); connect (muph, localhost, mysqltest_1,,);
connection muph; connection muph;
select * from t1; select * from t1;
@ -60,6 +63,7 @@ disconnect muph2;
# Test of MAX_CONNECTIONS_PER_HOUR limit # Test of MAX_CONNECTIONS_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2; grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
flush user_resources;
connect (mcph1, localhost, mysqltest_1,,); connect (mcph1, localhost, mysqltest_1,,);
connection mcph1; connection mcph1;
select * from t1; select * from t1;
@ -86,6 +90,7 @@ drop user mysqltest_1@localhost;
# We need this to reset internal mqh_used variable # We need this to reset internal mqh_used variable
flush privileges; flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2; grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
flush user_resources;
connect (muc1, localhost, mysqltest_1,,); connect (muc1, localhost, mysqltest_1,,);
connection muc1; connection muc1;
select * from t1; select * from t1;
@ -102,6 +107,7 @@ select * from t1;
# Changing of limit should also help (and immediately) # Changing of limit should also help (and immediately)
connection default; connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3; grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
connect (muc4, localhost, mysqltest_1,,); connect (muc4, localhost, mysqltest_1,,);
connection muc4; connection muc4;
select * from t1; select * from t1;
@ -127,6 +133,7 @@ set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections; select @@session.max_user_connections, @@global.max_user_connections;
# Let us check that global limit works # Let us check that global limit works
grant usage on *.* to mysqltest_1@localhost; grant usage on *.* to mysqltest_1@localhost;
flush user_resources;
connect (muca1, localhost, mysqltest_1,,); connect (muca1, localhost, mysqltest_1,,);
connection muca1; connection muca1;
select @@session.max_user_connections, @@global.max_user_connections; select @@session.max_user_connections, @@global.max_user_connections;
@ -139,6 +146,7 @@ connect (muca3, localhost, mysqltest_1,,);
# Now we are testing that per-account limit prevails over gloabl limit # Now we are testing that per-account limit prevails over gloabl limit
connection default; connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3; grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
connect (muca3, localhost, mysqltest_1,,); connect (muca3, localhost, mysqltest_1,,);
connection muca3; connection muca3;
select @@session.max_user_connections, @@global.max_user_connections; select @@session.max_user_connections, @@global.max_user_connections;

View File

@ -25,6 +25,8 @@
#include "my_alarm.h" #include "my_alarm.h"
#endif #endif
my_bool timed_mutexes= 0;
/* from my_init */ /* from my_init */
my_string home_dir=0,my_progname=0; my_string home_dir=0,my_progname=0;
char NEAR curr_dir[FN_REFLEN]= {0}, char NEAR curr_dir[FN_REFLEN]= {0},

View File

@ -1,12 +1,13 @@
SUBDIRS = src tools . include @ndb_opt_subdirs@ SUBDIRS = src tools . include @ndb_opt_subdirs@
DIST_SUBDIRS = src tools include test docs DIST_SUBDIRS = src tools include test docs
EXTRA_DIST = config EXTRA_DIST = config ndbapi-examples
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
dist-hook: dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS` -rm -rf `find $(distdir) -type d -name SCCS`
-rm -rf `find $(distdir) -type d -name old_files` -rm -rf `find $(distdir) -type d -name old_files`
-rm -rf `find $(distdir)/ndbapi-examples -name '*.o'`
list='$(SUBDIRS)'; for subdir in $$list; do \ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" != "." -a "$$subdir" != "include"; then \ if test "$$subdir" != "." -a "$$subdir" != "include"; then \
files="`find $$subdir -name '*\.h'` `find $$subdir -name '*\.hpp'`"; \ files="`find $$subdir -name '*\.h'` `find $$subdir -name '*\.hpp'`"; \

View File

@ -9,7 +9,7 @@ DOXYOUT = .doxyout
NDB_RELEASE = @NDB_VERSION_MAJOR@.@NDB_VERSION_MINOR@.@NDB_VERSION_BUILD@-@NDB_VERSION_STATUS@ NDB_RELEASE = @NDB_VERSION_MAJOR@.@NDB_VERSION_MINOR@.@NDB_VERSION_BUILD@-@NDB_VERSION_STATUS@
clean: clean-local:
rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html rm -rf ndbapi.pdf ndbapi.html mgmapi.pdf mgmapi.html
rm -rf $(DOXYTMP) $(DOXYOUT) rm -rf $(DOXYTMP) $(DOXYOUT)
@ -48,7 +48,7 @@ ndbapi.html: $(noinst_HEADERS)
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \
mkdir -p $(DOXYTMP) $(DOXYOUT); \ mkdir -p $(DOXYTMP) $(DOXYOUT); \
@CP@ $(top_srcdir)/ndb/include/ndbapi/* $(DOXYTMP); \ @CP@ $(top_srcdir)/ndb/include/ndbapi/* $(DOXYTMP); \
@CP@ $(top_srcdir)/ndb/examples/*/*.[ch]pp $(DOXYTMP); \ @CP@ $(top_srcdir)/ndb/ndbapi-examples/*/*.[ch]pp $(DOXYTMP); \
@PERL@ $(DOXYDIR)/predoxy.pl; \ @PERL@ $(DOXYDIR)/predoxy.pl; \
mv footer.html $(DOXYTMP); \ mv footer.html $(DOXYTMP); \
(cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.ndbapi); \ (cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.ndbapi); \

View File

@ -9,6 +9,7 @@ ndb_version.h
ndbapiinclude_HEADERS = \ ndbapiinclude_HEADERS = \
ndbapi/ndbapi_limits.h \ ndbapi/ndbapi_limits.h \
ndbapi/ndb_opt_defaults.h \
ndbapi/Ndb.hpp \ ndbapi/Ndb.hpp \
ndbapi/NdbApi.hpp \ ndbapi/NdbApi.hpp \
ndbapi/NdbTransaction.hpp \ ndbapi/NdbTransaction.hpp \

View File

@ -207,7 +207,7 @@ public:
NotUnique = 4251, NotUnique = 4251,
AllocationError = 4252, AllocationError = 4252,
CreateIndexTableFailed = 4253, CreateIndexTableFailed = 4253,
InvalidAttributeOrder = 4255 DuplicateAttributes = 4258
}; };
private: private:

View File

@ -276,7 +276,9 @@ public:
ExtBit = NdbSqlUtil::Type::Bit, ExtBit = NdbSqlUtil::Type::Bit,
ExtLongvarchar = NdbSqlUtil::Type::Longvarchar, ExtLongvarchar = NdbSqlUtil::Type::Longvarchar,
ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary, ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary,
ExtTime = NdbSqlUtil::Type::Time ExtTime = NdbSqlUtil::Type::Time,
ExtYear = NdbSqlUtil::Type::Year,
ExtTimestamp = NdbSqlUtil::Type::Timestamp
}; };
// Attribute data interpretation // Attribute data interpretation
@ -389,6 +391,14 @@ public:
AttributeSize = DictTabInfo::an8Bit; AttributeSize = DictTabInfo::an8Bit;
AttributeArraySize = 3 * AttributeExtLength; AttributeArraySize = 3 * AttributeExtLength;
break; break;
case DictTabInfo::ExtYear:
AttributeSize = DictTabInfo::an8Bit;
AttributeArraySize = 1 * AttributeExtLength;
break;
case DictTabInfo::ExtTimestamp:
AttributeSize = DictTabInfo::an8Bit;
AttributeArraySize = 4 * AttributeExtLength;
break;
default: default:
return false; return false;
}; };

View File

@ -121,6 +121,7 @@
#define CFG_SHM_CHECKSUM 501 #define CFG_SHM_CHECKSUM 501
#define CFG_SHM_KEY 502 #define CFG_SHM_KEY 502
#define CFG_SHM_BUFFER_MEM 503 #define CFG_SHM_BUFFER_MEM 503
#define CFG_SHM_SIGNUM 504
#define CFG_SCI_HOST1_ID_0 550 #define CFG_SCI_HOST1_ID_0 550
#define CFG_SCI_HOST1_ID_1 551 #define CFG_SCI_HOST1_ID_1 551

View File

@ -61,7 +61,9 @@
#define NDB_TYPE_LONG_VARCHAR 23 #define NDB_TYPE_LONG_VARCHAR 23
#define NDB_TYPE_LONG_VARBINARY 24 #define NDB_TYPE_LONG_VARBINARY 24
#define NDB_TYPE_TIME 25 #define NDB_TYPE_TIME 25
#define NDB_TYPE_YEAR 26
#define NDB_TYPE_TIMESTAMP 27
#define NDB_TYPE_MAX 26 #define NDB_TYPE_MAX 28
#endif #endif

View File

@ -196,7 +196,9 @@ public:
Bit = NDB_TYPE_BIT, ///< Bit, length specifies no of bits Bit = NDB_TYPE_BIT, ///< Bit, length specifies no of bits
Longvarchar = NDB_TYPE_LONG_VARCHAR, ///< Length bytes: 2, little-endian Longvarchar = NDB_TYPE_LONG_VARCHAR, ///< Length bytes: 2, little-endian
Longvarbinary = NDB_TYPE_LONG_VARBINARY, ///< Length bytes: 2, little-endian Longvarbinary = NDB_TYPE_LONG_VARBINARY, ///< Length bytes: 2, little-endian
Time = NDB_TYPE_TIME ///< Time without date Time = NDB_TYPE_TIME, ///< Time without date
Year = NDB_TYPE_YEAR, ///< Year 1901-2155 (1 byte)
Timestamp = NDB_TYPE_TIMESTAMP ///< Unix time
}; };
/** /**

View File

@ -53,7 +53,7 @@ public:
COND_GE = 2, ///< upper bound COND_GE = 2, ///< upper bound
COND_GT = 3, ///< upper bound, strict COND_GT = 3, ///< upper bound, strict
COND_EQ = 4, ///< equality COND_EQ = 4, ///< equality
COND_NE = 5 COND_NE = 5 ///< not equal
}; };
/** /**

View File

@ -0,0 +1,23 @@
/* Copyright (C) 2003 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDB_OPT_DEFAULTS_H
#define NDB_OPT_DEFAULTS_H
#define OPT_NDB_SHM_SIGNUM_DEFAULT 0
#define OPT_NDB_SHM_DEFAULT 0
#endif

View File

@ -77,6 +77,7 @@ struct SHM_TransporterConfiguration {
Uint32 shmKey; Uint32 shmKey;
Uint32 shmSize; Uint32 shmSize;
int signum;
}; };
/** /**

View File

@ -92,7 +92,9 @@ public:
Bit = NDB_TYPE_BIT, Bit = NDB_TYPE_BIT,
Longvarchar = NDB_TYPE_LONG_VARCHAR, Longvarchar = NDB_TYPE_LONG_VARCHAR,
Longvarbinary = NDB_TYPE_LONG_VARBINARY, Longvarbinary = NDB_TYPE_LONG_VARBINARY,
Time = NDB_TYPE_TIME Time = NDB_TYPE_TIME,
Year = NDB_TYPE_YEAR,
Timestamp = NDB_TYPE_TIMESTAMP
}; };
Enum m_typeId; // redundant Enum m_typeId; // redundant
Cmp* m_cmp; // comparison method Cmp* m_cmp; // comparison method
@ -161,6 +163,8 @@ private:
static Cmp cmpLongvarchar; static Cmp cmpLongvarchar;
static Cmp cmpLongvarbinary; static Cmp cmpLongvarbinary;
static Cmp cmpTime; static Cmp cmpTime;
static Cmp cmpYear;
static Cmp cmpTimestamp;
}; };
#endif #endif

View File

@ -22,24 +22,16 @@
#include <my_getopt.h> #include <my_getopt.h>
#include <mysql_version.h> #include <mysql_version.h>
#include <ndb_version.h> #include <ndb_version.h>
#include <ndb_opt_defaults.h>
#define NDB_STD_OPTS_VARS \ #define NDB_STD_OPTS_VARS \
const char *opt_connect_str= 0;\ const char *opt_connect_str= 0;\
my_bool opt_ndb_shm;\
my_bool opt_ndb_optimized_node_selection my_bool opt_ndb_optimized_node_selection
#define NDB_STD_OPTS_OPTIONS \ my_bool opt_ndb_shm;
OPT_NDB_SHM= 256,\
OPT_NDB_OPTIMIZED_NODE_SELECTION
#define OPT_NDB_CONNECTSTRING 'c' #define OPT_NDB_CONNECTSTRING 'c'
#if defined(NOT_ENOUGH_TESTED) && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
#define OPT_NDB_SHM_DEFAULT 1
#else
#define OPT_NDB_SHM_DEFAULT 0
#endif
#define NDB_STD_OPTS_COMMON \ #define NDB_STD_OPTS_COMMON \
{ "usage", '?', "Display this help and exit.", \ { "usage", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
@ -75,4 +67,51 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION
#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON #define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
#endif #endif
static void ndb_std_print_version()
{
printf("MySQL distrib %s, for %s (%s)\n",
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
static void usage();
enum ndb_std_options {
OPT_NDB_SHM= 256,
OPT_NDB_SHM_SIGNUM,
OPT_NDB_OPTIMIZED_NODE_SELECTION,
NDB_STD_OPTIONS_LAST /* should always be last in this enum */
};
static my_bool
ndb_std_get_one_option(int optid,
const struct my_option *opt __attribute__((unused)),
const char *argument)
{
switch (optid) {
case '#':
if (argument)
{
DBUG_PUSH(argument);
}
break;
case 'V':
ndb_std_print_version();
exit(0);
case '?':
usage();
exit(0);
case OPT_NDB_SHM:
if (opt_ndb_shm)
{
#ifndef NDB_SHM_TRANSPORTER
printf("Warning: binary not compiled with shared memory support,\n"
"Tcp connections will now be used instead\n");
opt_ndb_shm= 0;
#endif
}
break;
}
return 0;
}
#endif /*_NDB_OPTS_H */ #endif /*_NDB_OPTS_H */

View File

@ -14,7 +14,9 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "IPCConfig.hpp" #include <ndb_global.h>
#include <ndb_opt_defaults.h>
#include <IPCConfig.hpp>
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <NdbHost.h> #include <NdbHost.h>
@ -381,7 +383,12 @@ IPCConfig::configureTransporters(Uint32 nodeId,
if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break; if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break;
if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break; if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break;
{
Uint32 tmp;
if(iter.get(CFG_SHM_SIGNUM, &tmp)) break;
conf.signum= tmp;
}
conf.port= server_port; conf.port= server_port;
conf.localHostName = localHostName; conf.localHostName = localHostName;
conf.remoteHostName = remoteHostName; conf.remoteHostName = remoteHostName;

View File

@ -24,6 +24,10 @@
/*#define USE_PTHREAD_EXTRAS*/ /*#define USE_PTHREAD_EXTRAS*/
#ifdef NDB_SHM_TRANSPORTER
int g_ndb_shm_signum= 0;
#endif
struct NdbThread struct NdbThread
{ {
pthread_t thread; pthread_t thread;
@ -37,14 +41,19 @@ void*
ndb_thread_wrapper(void* _ss){ ndb_thread_wrapper(void* _ss){
void * ret; void * ret;
struct NdbThread * ss = (struct NdbThread *)_ss; struct NdbThread * ss = (struct NdbThread *)_ss;
DBUG_ENTER("ndb_thread_wrapper");
#ifdef NDB_SHM_TRANSPORTER #ifdef NDB_SHM_TRANSPORTER
sigset_t mask; if (g_ndb_shm_signum)
sigemptyset(&mask); {
sigaddset(&mask, SIGUSR1); sigset_t mask;
pthread_sigmask(SIG_BLOCK, &mask, 0); DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum));
sigemptyset(&mask);
sigaddset(&mask, g_ndb_shm_signum);
pthread_sigmask(SIG_BLOCK, &mask, 0);
}
#endif #endif
ret= (* ss->func)(ss->object); ret= (* ss->func)(ss->object);
return ret; DBUG_RETURN(ret);
} }

View File

@ -26,6 +26,8 @@
#include <InputStream.hpp> #include <InputStream.hpp>
#include <OutputStream.hpp> #include <OutputStream.hpp>
extern int g_ndb_shm_signum;
SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg,
const char *lHostName, const char *lHostName,
const char *rHostName, const char *rHostName,
@ -62,7 +64,9 @@ SHM_Transporter::~SHM_Transporter(){
bool bool
SHM_Transporter::initTransporter(){ SHM_Transporter::initTransporter(){
return true; if (g_ndb_shm_signum)
return true;
return false;
} }
void void
@ -355,6 +359,6 @@ SHM_Transporter::doSend()
if(m_last_signal) if(m_last_signal)
{ {
m_last_signal = 0; m_last_signal = 0;
kill(m_remote_pid, SIGUSR1); kill(m_remote_pid, g_ndb_shm_signum);
} }
} }

View File

@ -38,6 +38,7 @@
#ifdef NDB_SHM_TRANSPORTER #ifdef NDB_SHM_TRANSPORTER
#include "SHM_Transporter.hpp" #include "SHM_Transporter.hpp"
extern int g_ndb_shm_signum;
#endif #endif
#include "TransporterCallback.hpp" #include "TransporterCallback.hpp"
@ -152,22 +153,13 @@ TransporterRegistry::disconnectAll(){
bool bool
TransporterRegistry::init(NodeId nodeId) { TransporterRegistry::init(NodeId nodeId) {
DBUG_ENTER("TransporterRegistry::init");
nodeIdSpecified = true; nodeIdSpecified = true;
localNodeId = nodeId; localNodeId = nodeId;
DEBUG("TransporterRegistry started node: " << localNodeId); DEBUG("TransporterRegistry started node: " << localNodeId);
#ifdef NDB_SHM_TRANSPORTER DBUG_RETURN(true);
/**
* Make sure to block SIGUSR1
* TransporterRegistry::init is run from "main" thread
*/
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);
pthread_sigmask(SIG_BLOCK, &mask, 0);
#endif
return true;
} }
bool bool
@ -406,6 +398,7 @@ TransporterRegistry::createTransporter(SCI_TransporterConfiguration *config) {
bool bool
TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) {
DBUG_ENTER("TransporterRegistry::createTransporter SHM");
#ifdef NDB_SHM_TRANSPORTER #ifdef NDB_SHM_TRANSPORTER
if(!nodeIdSpecified){ if(!nodeIdSpecified){
init(config->localNodeId); init(config->localNodeId);
@ -414,6 +407,22 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) {
if(config->localNodeId != localNodeId) if(config->localNodeId != localNodeId)
return false; return false;
if (!g_ndb_shm_signum) {
g_ndb_shm_signum= config->signum;
DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum));
/**
* Make sure to block g_ndb_shm_signum
* TransporterRegistry::init is run from "main" thread
*/
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, g_ndb_shm_signum);
pthread_sigmask(SIG_BLOCK, &mask, 0);
}
if(config->signum != g_ndb_shm_signum)
return false;
if(theTransporters[config->remoteNodeId] != NULL) if(theTransporters[config->remoteNodeId] != NULL)
return false; return false;
@ -443,9 +452,9 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) {
nTransporters++; nTransporters++;
nSHMTransporters++; nSHMTransporters++;
return true; DBUG_RETURN(true);
#else #else
return false; DBUG_RETURN(false);
#endif #endif
} }
@ -1337,6 +1346,7 @@ shm_sig_handler(int signo)
void void
TransporterRegistry::startReceiving() TransporterRegistry::startReceiving()
{ {
DBUG_ENTER("TransporterRegistry::startReceiving");
#ifdef NDB_OSE_TRANSPORTER #ifdef NDB_OSE_TRANSPORTER
if(theOSEReceiver != NULL){ if(theOSEReceiver != NULL){
theOSEReceiver->createPhantom(); theOSEReceiver->createPhantom();
@ -1355,26 +1365,34 @@ TransporterRegistry::startReceiving()
#ifdef NDB_SHM_TRANSPORTER #ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid(); m_shm_own_pid = getpid();
struct sigaction sa; if (g_ndb_shm_signum)
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGUSR1);
pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
sa.sa_handler = shm_sig_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
int ret;
while((ret = sigaction(SIGUSR1, &sa, 0)) == -1 && errno == EINTR);
if(ret != 0)
{ {
g_eventLogger.error("Failed to install signal handler for SHM transporter" DBUG_PRINT("info",("Install signal handler for signum %d",
" errno: %d (%s)", errno, g_ndb_shm_signum));
struct sigaction sa;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, g_ndb_shm_signum);
pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
sa.sa_handler = shm_sig_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
int ret;
while((ret = sigaction(g_ndb_shm_signum, &sa, 0)) == -1 && errno == EINTR);
if(ret != 0)
{
DBUG_PRINT("error",("Install failed"));
g_eventLogger.error("Failed to install signal handler for"
" SHM transporter errno: %d (%s)", errno,
#ifdef HAVE_STRERROR #ifdef HAVE_STRERROR
strerror(errno)); strerror(errno)
#else #else
""); ""
#endif #endif
);
}
} }
#endif #endif // NDB_SHM_TRANSPORTER
DBUG_VOID_RETURN;
} }
void void

View File

@ -179,6 +179,14 @@ NdbSqlUtil::m_typeList[] = {
{ {
Type::Time, Type::Time,
cmpTime cmpTime
},
{
Type::Year,
cmpYear
},
{
Type::Timestamp,
cmpTimestamp
} }
}; };
@ -670,6 +678,40 @@ NdbSqlUtil::cmpLongvarbinary(const void* info, const void* p1, unsigned n1, cons
return CmpUnknown; return CmpUnknown;
} }
int
NdbSqlUtil::cmpYear(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
{
if (n2 >= sizeof(Uint8)) {
Uint8 v1, v2;
memcpy(&v1, p1, sizeof(Uint8));
memcpy(&v2, p2, sizeof(Uint8));
if (v1 < v2)
return -1;
if (v1 > v2)
return +1;
return 0;
}
assert(! full);
return CmpUnknown;
}
int
NdbSqlUtil::cmpTimestamp(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full)
{
if (n2 >= sizeof(Uint32)) {
Uint32 v1, v2;
memcpy(&v1, p1, sizeof(Uint32));
memcpy(&v2, p2, sizeof(Uint32));
if (v1 < v2)
return -1;
if (v1 > v2)
return +1;
return 0;
}
assert(! full);
return CmpUnknown;
}
// check charset // check charset
bool bool

Some files were not shown because too many files have changed in this diff Show More