mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 00:34:18 +01:00
Merge mysql.com:/home/stewart/Documents/MySQL/5.0/ndb-dynamic-ports-impl5
into mysql.com:/home/stewart/Documents/MySQL/5.0/ndb-wl2278 ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged
This commit is contained in:
commit
e59f456d18
241 changed files with 3019 additions and 1499 deletions
|
@ -382,8 +382,11 @@ libmysqld/examples/link_sources
|
|||
libmysqld/examples/my_readline.h
|
||||
libmysqld/examples/mysql
|
||||
libmysqld/examples/mysql.cc
|
||||
libmysqld/examples/mysql_client_test.c
|
||||
libmysqld/examples/mysql_client_test_embedded
|
||||
libmysqld/examples/mysqltest
|
||||
libmysqld/examples/mysqltest.c
|
||||
libmysqld/examples/mysqltest_embedded
|
||||
libmysqld/examples/readline.cc
|
||||
libmysqld/examples/sql_string.cc
|
||||
libmysqld/examples/sql_string.h
|
||||
|
@ -396,6 +399,7 @@ libmysqld/gstream.cc
|
|||
libmysqld/ha_archive.cc
|
||||
libmysqld/ha_berkeley.cc
|
||||
libmysqld/ha_example.cc
|
||||
libmysqld/ha_federated.cc
|
||||
libmysqld/ha_heap.cc
|
||||
libmysqld/ha_innobase.cc
|
||||
libmysqld/ha_innodb.cc
|
||||
|
@ -1036,6 +1040,7 @@ test/tools/verify_index
|
|||
test_xml
|
||||
tests/client_test
|
||||
tests/connect_test
|
||||
tests/mysql_client_test
|
||||
thread_test
|
||||
tmp/*
|
||||
tools/my_vsnprintf.c
|
||||
|
@ -1047,3 +1052,6 @@ vio/test-ssl
|
|||
vio/test-sslclient
|
||||
vio/test-sslserver
|
||||
vio/viotest-ssl
|
||||
include/mysqld_ername.h
|
||||
include/mysqld_error.h
|
||||
include/sql_state.h
|
||||
|
|
18
BUILD/SETUP.sh
Normal file → Executable file
18
BUILD/SETUP.sh
Normal file → Executable file
|
@ -6,12 +6,15 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
prefix_configs="--prefix=/usr/local/mysql"
|
||||
just_print=
|
||||
just_configure=
|
||||
full_debug=
|
||||
while test $# -gt 0
|
||||
do
|
||||
case "$1" in
|
||||
--prefix=* ) prefix_configs="$1"; shift ;;
|
||||
--with-debug=full ) full_debug="=full"; shift ;;
|
||||
-c | --just-configure ) just_configure=1; shift ;;
|
||||
-n | --just-print | --print ) just_print=1; shift ;;
|
||||
-h | --help ) cat <<EOF; exit 0 ;;
|
||||
|
@ -19,13 +22,15 @@ Usage: $0 [-h|-n] [configure-options]
|
|||
-h, --help Show this help message.
|
||||
-n, --just-print Don't actually run any commands; just print them.
|
||||
-c, --just-configure Stop after running configure.
|
||||
|
||||
Any other options will be passed directly to configure.
|
||||
--with-debug=full Build with full debug.
|
||||
--prefix=path Build with prefix 'path'.
|
||||
|
||||
Note: this script is intended for internal use by MySQL developers.
|
||||
EOF
|
||||
--with-debug=full ) full_debug="=full"; shift ;;
|
||||
* ) break ;;
|
||||
* )
|
||||
echo "Unknown option '$1'"
|
||||
exit 1
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
@ -62,11 +67,12 @@ fast_cflags="-O3 -fno-omit-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_extra_cflags="-O1 -Wuninitialized"
|
||||
|
||||
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
|
||||
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"
|
||||
amd64_configs=""
|
||||
alpha_configs="" # Not used yet
|
||||
|
@ -80,7 +86,7 @@ local_infile_configs="--enable-local-infile"
|
|||
debug_configs="--with-debug$full_debug"
|
||||
if [ -z "$full_debug" ]
|
||||
then
|
||||
debug_cflags="$debug_cflags -O1 -Wuninitialized"
|
||||
debug_cflags="$debug_cflags $debug_extra_cflags"
|
||||
fi
|
||||
|
||||
if gmake --version > /dev/null 2>&1
|
||||
|
|
13
BUILD/compile-pentium64-debug
Executable file
13
BUILD/compile-pentium64-debug
Executable 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"
|
|
@ -172,6 +172,7 @@ nick@nick.leippe.com
|
|||
papa@gbichot.local
|
||||
patg@krsna.patg.net
|
||||
patg@patrick-galbraiths-computer.local
|
||||
patg@pc248.lfp.kcls.org
|
||||
paul@central.snake.net
|
||||
paul@frost.snake.net
|
||||
paul@ice.local
|
||||
|
@ -240,6 +241,7 @@ tonu@x153.internalnet
|
|||
tonu@x3.internalnet
|
||||
tsmith@build.mysql.com
|
||||
tulin@build.mysql.com
|
||||
tulin@mysql.com
|
||||
ulli@morbus.(none)
|
||||
venu@hundin.mysql.fi
|
||||
venu@myvenu.com
|
||||
|
|
|
@ -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{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl";
|
||||
$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;
|
||||
$mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20";
|
||||
|
||||
|
|
|
@ -27,9 +27,5 @@ EXTRA_DIST =
|
|||
all:
|
||||
:
|
||||
|
||||
# Nothing to cleanup in this dummy directory.
|
||||
clean:
|
||||
:
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -42,8 +42,8 @@ RSC=rc.exe
|
|||
# PROP Output_Dir ".\debug"
|
||||
# PROP Intermediate_Dir ".\debug"
|
||||
# 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 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 "../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 MTL /nologo /tlb".\debug\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "_DEBUG"
|
||||
|
@ -67,8 +67,8 @@ LINK32=link.exe
|
|||
# PROP Output_Dir ".\classic"
|
||||
# PROP Intermediate_Dir ".\classic"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
|
||||
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX
|
||||
# ADD BASE 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 "../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 MTL /nologo /tlb".\classic\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "NDEBUG"
|
||||
|
@ -92,8 +92,8 @@ LINK32=link.exe
|
|||
# PROP Output_Dir ".\release"
|
||||
# PROP Intermediate_Dir ".\release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
|
||||
# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX
|
||||
# ADD BASE 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 "../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 MTL /nologo /tlb".\release\mysqltest.tlb" /win32
|
||||
# ADD BASE RSC /l 1033 /d "NDEBUG"
|
||||
|
|
|
@ -228,10 +228,6 @@ SOURCE=..\sql\ha_innodb.cpp
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\sql\ha_isammrg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\sql\ha_myisam.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -169,10 +169,6 @@ SOURCE=..\sql\ha_innodb.cpp
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\sql\ha_isammrg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\sql\ha_myisam.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#AUTOMAKE_OPTIONS = nostdinc
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \
|
||||
$(openssl_includes) -I$(top_srcdir)/extra
|
||||
$(openssl_includes) -I$(top_builddir)/include
|
||||
LIBS = @CLIENT_LIBS@
|
||||
LDADD= @CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(top_builddir)/libmysql/libmysqlclient.la
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
const char *VER= "14.7";
|
||||
const char *VER= "14.8";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
|
@ -144,6 +144,7 @@ static char *current_host,*current_db,*current_user=0,*opt_password=0,
|
|||
*current_prompt=0, *delimiter_str= 0,
|
||||
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
|
||||
static char *histfile;
|
||||
static char *histfile_tmp;
|
||||
static String glob_buffer,old_buffer;
|
||||
static String processed_prompt;
|
||||
static char *full_username=0,*part_username=0,*default_prompt=0;
|
||||
|
@ -442,6 +443,13 @@ int main(int argc,char *argv[])
|
|||
if (verbose)
|
||||
tee_fprintf(stdout, "Reading history-file %s\n",histfile);
|
||||
read_history(histfile);
|
||||
if (!(histfile_tmp= (char*) my_malloc((uint) strlen(histfile) + 5,
|
||||
MYF(MY_WME))))
|
||||
{
|
||||
fprintf(stderr, "Couldn't allocate memory for temp histfile!\n");
|
||||
exit(1);
|
||||
}
|
||||
sprintf(histfile_tmp, "%s.TMP", histfile);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -470,7 +478,8 @@ sig_handler mysql_end(int sig)
|
|||
/* write-history */
|
||||
if (verbose)
|
||||
tee_fprintf(stdout, "Writing history-file %s\n",histfile);
|
||||
write_history(histfile);
|
||||
if (!write_history(histfile_tmp))
|
||||
my_rename(histfile_tmp, histfile, MYF(MY_WME));
|
||||
}
|
||||
batch_readline_end(status.line_buff);
|
||||
completion_hash_free(&ht);
|
||||
|
@ -485,6 +494,7 @@ sig_handler mysql_end(int sig)
|
|||
my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(opt_mysql_unix_port,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(histfile,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(histfile_tmp,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(current_host,MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(current_user,MYF(MY_ALLOW_ZERO_PTR));
|
||||
|
@ -1430,12 +1440,6 @@ static void build_completion_hash(bool rehash, bool write_info)
|
|||
if (status.batch || quick || !current_db)
|
||||
DBUG_VOID_RETURN; // We don't need completion in batches
|
||||
|
||||
if (tables)
|
||||
{
|
||||
mysql_free_result(tables);
|
||||
tables=0;
|
||||
}
|
||||
|
||||
/* hash SQL commands */
|
||||
while (cmd->name) {
|
||||
add_word(&ht,(char*) cmd->name);
|
||||
|
@ -1681,8 +1685,8 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
else if (num_fields >= 2 && num_rows)
|
||||
{
|
||||
init_pager();
|
||||
char last_char;
|
||||
|
||||
char last_char= 0;
|
||||
|
||||
int num_name= 0, num_cat= 0;
|
||||
LINT_INIT(num_name);
|
||||
LINT_INIT(num_cat);
|
||||
|
@ -1693,7 +1697,6 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
put_info("To make a more specific request, please type 'help <item>',\nwhere <item> is one of the following", INFO_INFO);
|
||||
num_name= 0;
|
||||
num_cat= 1;
|
||||
last_char= '_';
|
||||
}
|
||||
else if ((cur= mysql_fetch_row(result)))
|
||||
{
|
||||
|
@ -1703,7 +1706,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
|||
num_cat= 2;
|
||||
print_help_item(&cur,1,2,&last_char);
|
||||
}
|
||||
|
||||
|
||||
while ((cur= mysql_fetch_row(result)))
|
||||
print_help_item(&cur,num_name,num_cat,&last_char);
|
||||
tee_fprintf(PAGER, "\n");
|
||||
|
|
|
@ -744,7 +744,7 @@ static int parse_args(int *argc, char*** argv)
|
|||
|
||||
static MYSQL* safe_connect()
|
||||
{
|
||||
MYSQL *local_mysql = mysql_init(NULL);
|
||||
MYSQL *local_mysql= mysql_init(NULL);
|
||||
|
||||
if (!local_mysql)
|
||||
die("Failed on mysql_init");
|
||||
|
@ -752,9 +752,13 @@ static MYSQL* safe_connect()
|
|||
if (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))
|
||||
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;
|
||||
|
||||
return local_mysql;
|
||||
}
|
||||
|
||||
|
@ -781,9 +785,10 @@ static int check_master_version(MYSQL* mysql,
|
|||
if (mysql_query(mysql, "SELECT VERSION()") ||
|
||||
!(res = mysql_store_result(mysql)))
|
||||
{
|
||||
char errmsg[256];
|
||||
strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
|
||||
mysql_close(mysql);
|
||||
die("Error checking master version: %s",
|
||||
mysql_error(mysql));
|
||||
die("Error checking master version: %s", errmsg);
|
||||
}
|
||||
if (!(row = mysql_fetch_row(res)))
|
||||
{
|
||||
|
|
|
@ -2436,8 +2436,7 @@ static const char *check_if_ignore_table(const char *table_name)
|
|||
fprintf(stderr,
|
||||
"Error: Couldn't read status information for table %s (%s)\n",
|
||||
table_name, mysql_error(sock));
|
||||
if (res)
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
return 0; /* assume table is ok */
|
||||
}
|
||||
if (!(row[1]))
|
||||
|
@ -2448,7 +2447,7 @@ static const char *check_if_ignore_table(const char *table_name)
|
|||
strcmp(row[1], (result= "MRG_ISAM")))
|
||||
result= 0;
|
||||
}
|
||||
mysql_free_result(res);
|
||||
mysql_free_result(res);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -733,9 +733,10 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw,
|
|||
die("Empty variable");
|
||||
}
|
||||
length= (uint) (var_name - save_var_name);
|
||||
if (length >= MAX_VAR_NAME)
|
||||
die("Too long variable name: %s", save_var_name);
|
||||
|
||||
if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length)) &&
|
||||
length < MAX_VAR_NAME)
|
||||
if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length)))
|
||||
{
|
||||
char buff[MAX_VAR_NAME+1];
|
||||
strmake(buff, save_var_name, length);
|
||||
|
|
14
configure.in
14
configure.in
|
@ -1531,14 +1531,11 @@ then
|
|||
fi
|
||||
fi
|
||||
|
||||
TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS"
|
||||
|
||||
# Should we use named pthread library ?
|
||||
AC_MSG_CHECKING("named thread libs:")
|
||||
if test "$with_named_thread" != "no"
|
||||
then
|
||||
LIBS="$with_named_thread $LIBS $with_named_thread"
|
||||
TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread"
|
||||
with_posix_threads="yes"
|
||||
with_mit_threads="no"
|
||||
AC_MSG_RESULT("$with_named_thread")
|
||||
|
@ -1557,9 +1554,7 @@ else
|
|||
then
|
||||
AC_MSG_CHECKING("for pthread_create in -lpthread");
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_TOOLS_LIBS="$TOOLS_LIBS"
|
||||
LIBS="$LIBS -lpthread"
|
||||
TOOLS_LIBS="$TOOLS_LIBS -lpthread"
|
||||
AC_TRY_LINK(
|
||||
[#include <pthread.h>],
|
||||
[ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
|
||||
|
@ -1568,7 +1563,6 @@ else
|
|||
if test "$with_posix_threads" = "no"
|
||||
then
|
||||
LIBS=" $ac_save_LIBS -lpthreads"
|
||||
TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads"
|
||||
AC_MSG_CHECKING("for pthread_create in -lpthreads");
|
||||
AC_TRY_LINK(
|
||||
[#include <pthread.h>],
|
||||
|
@ -1579,7 +1573,6 @@ else
|
|||
then
|
||||
# This is for FreeBSD
|
||||
LIBS="$ac_save_LIBS -pthread"
|
||||
TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread"
|
||||
AC_MSG_CHECKING("for pthread_create in -pthread");
|
||||
AC_TRY_LINK(
|
||||
[#include <pthread.h>],
|
||||
|
@ -1590,7 +1583,6 @@ else
|
|||
then
|
||||
with_mit_threads="yes"
|
||||
LIBS="$ac_save_LIBS"
|
||||
TOOLS_LIBS="$ac_save_TOOLS_LIBS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -1678,12 +1670,12 @@ if test "$with_debug" = "yes"
|
|||
then
|
||||
# Medium debug.
|
||||
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"
|
||||
then
|
||||
# Full debug. Very slow in some cases
|
||||
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
|
||||
# Optimized version. No debug
|
||||
CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
|
||||
|
@ -2656,8 +2648,6 @@ AC_SUBST(sql_union_dirs)
|
|||
# Some usefull subst
|
||||
AC_SUBST(CC)
|
||||
AC_SUBST(GXX)
|
||||
#Remove TOOLS_LIBS, because this is included in LIBRARIES
|
||||
#AC_SUBST(TOOLS_LIBS)
|
||||
|
||||
# Set configuration options for make_binary_distribution
|
||||
case $SYSTEM_TYPE in
|
||||
|
|
|
@ -26,6 +26,7 @@ EXTRA_DIST = example1.c example2.c example3.c \
|
|||
NROFF_INC = example1.r example2.r example3.r main.r \
|
||||
factorial.r output1.r output2.r output3.r \
|
||||
output4.r output5.r
|
||||
CLEANFILES = $(NROFF_INC) user.t user.ps
|
||||
|
||||
|
||||
# Must be linked with libs that are not compiled yet
|
||||
|
@ -59,8 +60,5 @@ output5.r: factorial
|
|||
@RM@ -f $@
|
||||
@SED@ -e 's!\\!\\\\!g' $< > $@
|
||||
|
||||
clean:
|
||||
@RM@ -f $(NROFF_INC) user.t user.ps
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -16,25 +16,26 @@
|
|||
|
||||
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include \
|
||||
@ndbcluster_includes@ -I$(top_srcdir)/sql \
|
||||
-I$(top_srcdir)/extra
|
||||
-I$(top_builddir)/include
|
||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.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)
|
||||
created_sources = created_include_files
|
||||
CLEANFILES = $(created_sources)
|
||||
SUPERCLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
all: $(created_sources)
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
# This will build mysqld_error.h and sql_state.h
|
||||
mysqld_error.h: created_include_files
|
||||
mysqld_ername.h: created_include_files
|
||||
sql_state.h: created_include_files
|
||||
|
||||
created_include_files: comp_err
|
||||
$(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
|
||||
touch created_include_files
|
||||
$(top_builddir)/include/mysqld_error.h: comp_err
|
||||
$(top_builddir)/extra/comp_err \
|
||||
--charset=$(top_srcdir)/sql/share/charsets \
|
||||
--out-dir=$(top_builddir)/sql/share/ \
|
||||
--header_file=$(top_builddir)/include/mysqld_error.h \
|
||||
--name_file=$(top_builddir)/include/mysqld_ername.h \
|
||||
--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 \
|
||||
resolve_stack_dump mysql_waitpid
|
||||
|
|
|
@ -41,7 +41,7 @@ static char *HEADERFILE= (char*) "mysqld_error.h";
|
|||
static char *NAMEFILE= (char*) "mysqld_ername.h";
|
||||
static char *STATEFILE= (char*) "sql_state.h";
|
||||
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";
|
||||
|
||||
/* 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},
|
||||
{"in_file", 'F', "Input file", (gptr *) & TXTFILE, (gptr *) & TXTFILE,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"out_dir", 'D', "Output base directory", (gptr *) & DATADIR,
|
||||
(gptr *) & DATADIR,
|
||||
{"out_dir", 'D', "Output base directory", (gptr *) & DATADIRECTORY,
|
||||
(gptr *) & DATADIRECTORY,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"out_file", 'O', "Output filename (errmsg.sys)", (gptr *) & OUTFILE,
|
||||
(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);
|
||||
}
|
||||
|
||||
outfile_end= strxmov(outfile, DATADIR,
|
||||
outfile_end= strxmov(outfile, DATADIRECTORY,
|
||||
tmp_lang->lang_long_name, NullS);
|
||||
if (!my_stat(outfile, &stat_info,MYF(0)))
|
||||
{
|
||||
|
|
|
@ -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 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
|
||||
DISTCLEANFILES = sched.h $(SUPERCLEANFILES)
|
||||
|
||||
clean:
|
||||
$(RM) -fr readline
|
||||
distclean:
|
||||
$(RM) -fr readline
|
||||
DISTCLEANFILES = sched.h $(CLEANFILES)
|
||||
|
||||
all-local: my_config.h
|
||||
|
||||
|
|
|
@ -110,6 +110,7 @@ typedef struct my_collation_handler_st
|
|||
my_bool diff_if_only_endspace_difference);
|
||||
int (*strnxfrm)(struct charset_info_st *,
|
||||
uchar *, uint, const uchar *, uint);
|
||||
uint (*strnxfrmlen)(struct charset_info_st *, uint);
|
||||
my_bool (*like_range)(struct charset_info_st *,
|
||||
const char *s, uint s_length,
|
||||
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 */
|
||||
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,
|
||||
const uchar *, uint, my_bool);
|
||||
|
||||
|
|
|
@ -530,7 +530,11 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
|||
#define FN_LEN 256 /* Max file name len */
|
||||
#define FN_HEADLEN 253 /* Max length of filepart of file name */
|
||||
#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 */
|
||||
#endif
|
||||
#define FN_EXTCHAR '.'
|
||||
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
|
||||
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
|
||||
|
@ -1084,7 +1088,7 @@ do { doubleget_union _tmp; \
|
|||
#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
|
||||
|
||||
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
||||
#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\
|
||||
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\
|
||||
*(((char*)T)+1)=(char) ((byte *) &V)[5];\
|
||||
*(((char*)T)+2)=(char) ((byte *) &V)[6];\
|
||||
*(((char*)T)+3)=(char) ((byte *) &V)[7];\
|
||||
|
|
|
@ -259,6 +259,8 @@ extern char wild_many,wild_one,wild_prefix;
|
|||
extern const char *charsets_dir;
|
||||
extern char *defaults_extra_file;
|
||||
|
||||
extern my_bool timed_mutexes;
|
||||
|
||||
typedef struct wild_file_pack /* Struct to hold info when selecting files */
|
||||
{
|
||||
uint wilds; /* How many wildcards */
|
||||
|
|
|
@ -1022,7 +1022,8 @@ calculate_sizes_again:
|
|||
|
||||
/* Now, try the insert */
|
||||
|
||||
*rec = page_cur_insert_rec_low(page_cursor, entry, index, NULL, mtr);
|
||||
*rec = page_cur_insert_rec_low(page_cursor, entry, index,
|
||||
NULL, NULL, mtr);
|
||||
if (!(*rec)) {
|
||||
/* If the record did not fit, reorganize */
|
||||
btr_page_reorganize(page, index, mtr);
|
||||
|
|
|
@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val(
|
|||
{
|
||||
byte* data;
|
||||
|
||||
ut_ad(UNIV_SQL_NULL > ULINT_MAX);
|
||||
|
||||
if (len == UNIV_SQL_NULL) {
|
||||
dfield_set_len(que_node_get_val(node), len);
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ page_cur_rec_insert(
|
|||
page_cur_t* cursor, /* in: a page cursor */
|
||||
rec_t* rec, /* in: record to insert */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
ulint* offsets,/* in: rec_get_offsets(rec, index) */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/***************************************************************
|
||||
Inserts a record next to page cursor. Returns pointer to inserted record if
|
||||
|
@ -160,6 +161,7 @@ page_cur_insert_rec_low(
|
|||
dtuple_t* tuple, /* in: pointer to a data tuple or NULL */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
rec_t* rec, /* in: pointer to a physical record or NULL */
|
||||
ulint* offsets,/* in: rec_get_offsets(rec, index) or NULL */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/*****************************************************************
|
||||
Copies records from page to a newly created page, from a given record onward,
|
||||
|
|
|
@ -195,7 +195,7 @@ page_cur_tuple_insert(
|
|||
dict_index_t* index, /* in: record descriptor */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(page_cur_insert_rec_low(cursor, tuple, index, NULL, mtr));
|
||||
return(page_cur_insert_rec_low(cursor, tuple, index, NULL, NULL, mtr));
|
||||
}
|
||||
|
||||
/***************************************************************
|
||||
|
@ -211,8 +211,10 @@ page_cur_rec_insert(
|
|||
page_cur_t* cursor, /* in: a page cursor */
|
||||
rec_t* rec, /* in: record to insert */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
ulint* offsets,/* in: rec_get_offsets(rec, index) */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
return(page_cur_insert_rec_low(cursor, NULL, index, rec, mtr));
|
||||
return(page_cur_insert_rec_low(cursor, NULL, index, rec,
|
||||
offsets, mtr));
|
||||
}
|
||||
|
||||
|
|
|
@ -133,6 +133,27 @@ rec_set_status(
|
|||
rec_t* rec, /* in: physical record */
|
||||
ulint bits); /* in: info bits */
|
||||
|
||||
/**********************************************************
|
||||
The following function is used to retrieve the info and status
|
||||
bits of a record. (Only compact records have status bits.) */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
rec_get_info_and_status_bits(
|
||||
/*=========================*/
|
||||
/* out: info bits */
|
||||
rec_t* rec, /* in: physical record */
|
||||
ibool comp); /* in: TRUE=compact page format */
|
||||
/**********************************************************
|
||||
The following function is used to set the info and status
|
||||
bits of a record. (Only compact records have status bits.) */
|
||||
UNIV_INLINE
|
||||
void
|
||||
rec_set_info_and_status_bits(
|
||||
/*=========================*/
|
||||
rec_t* rec, /* in: physical record */
|
||||
ibool comp, /* in: TRUE=compact page format */
|
||||
ulint bits); /* in: info bits */
|
||||
|
||||
/**********************************************************
|
||||
The following function tells if record is delete marked. */
|
||||
UNIV_INLINE
|
||||
|
|
|
@ -520,6 +520,53 @@ rec_set_status(
|
|||
REC_NEW_STATUS_MASK, REC_NEW_STATUS_SHIFT);
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
The following function is used to retrieve the info and status
|
||||
bits of a record. (Only compact records have status bits.) */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
rec_get_info_and_status_bits(
|
||||
/*=========================*/
|
||||
/* out: info bits */
|
||||
rec_t* rec, /* in: physical record */
|
||||
ibool comp) /* in: TRUE=compact page format */
|
||||
{
|
||||
ulint bits;
|
||||
#if (REC_NEW_STATUS_MASK >> REC_NEW_STATUS_SHIFT) \
|
||||
& (REC_INFO_BITS_MASK >> REC_INFO_BITS_SHIFT)
|
||||
# error "REC_NEW_STATUS_MASK and REC_INFO_BITS_MASK overlap"
|
||||
#endif
|
||||
if (comp) {
|
||||
bits = rec_get_info_bits(rec, TRUE) | rec_get_status(rec);
|
||||
} else {
|
||||
bits = rec_get_info_bits(rec, FALSE);
|
||||
ut_ad(!(bits & ~(REC_INFO_BITS_MASK >> REC_INFO_BITS_SHIFT)));
|
||||
}
|
||||
return(bits);
|
||||
}
|
||||
/**********************************************************
|
||||
The following function is used to set the info and status
|
||||
bits of a record. (Only compact records have status bits.) */
|
||||
UNIV_INLINE
|
||||
void
|
||||
rec_set_info_and_status_bits(
|
||||
/*=========================*/
|
||||
rec_t* rec, /* in: physical record */
|
||||
ibool comp, /* in: TRUE=compact page format */
|
||||
ulint bits) /* in: info bits */
|
||||
{
|
||||
#if (REC_NEW_STATUS_MASK >> REC_NEW_STATUS_SHIFT) \
|
||||
& (REC_INFO_BITS_MASK >> REC_INFO_BITS_SHIFT)
|
||||
# error "REC_NEW_STATUS_MASK and REC_INFO_BITS_MASK overlap"
|
||||
#endif
|
||||
if (comp) {
|
||||
rec_set_status(rec, bits & REC_NEW_STATUS_MASK);
|
||||
} else {
|
||||
ut_ad(!(bits & ~(REC_INFO_BITS_MASK >> REC_INFO_BITS_SHIFT)));
|
||||
}
|
||||
rec_set_info_bits(rec, comp, bits & ~REC_NEW_STATUS_MASK);
|
||||
}
|
||||
|
||||
/**********************************************************
|
||||
The following function tells if record is delete marked. */
|
||||
UNIV_INLINE
|
||||
|
|
|
@ -383,7 +383,9 @@ struct trx_struct{
|
|||
dulint commit_lsn; /* lsn at the time of the commit */
|
||||
ibool dict_operation; /* TRUE if the trx is used to create
|
||||
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
|
||||
TRUE */
|
||||
/*------------------------------*/
|
||||
|
|
|
@ -80,6 +80,10 @@ memory is read outside the allocated blocks. */
|
|||
|
||||
/* Make a non-inline debug version */
|
||||
|
||||
#ifdef DBUG_ON
|
||||
#define UNIV_DEBUG
|
||||
#endif /* DBUG_ON */
|
||||
|
||||
/*
|
||||
#define UNIV_DEBUG
|
||||
#define UNIV_MEM_DEBUG
|
||||
|
@ -120,7 +124,7 @@ by one. */
|
|||
/* Definition for inline version */
|
||||
|
||||
#ifdef __WIN__
|
||||
#define UNIV_INLINE __inline
|
||||
#define UNIV_INLINE __inline
|
||||
#else
|
||||
/* config.h contains the right def for 'inline' for the current compiler */
|
||||
#if (__GNUC__ == 2)
|
||||
|
|
|
@ -15,6 +15,13 @@ Created 10/21/1995 Heikki Tuuri
|
|||
#include "fil0fil.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
|
||||
|
||||
#ifdef POSIX_ASYNC_IO
|
||||
|
|
|
@ -605,8 +605,8 @@ page_cur_insert_rec_write_log(
|
|||
log_end = &log_ptr[5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
|
||||
}
|
||||
|
||||
if ((rec_get_info_bits(insert_rec, index->table->comp) !=
|
||||
rec_get_info_bits(cursor_rec, index->table->comp))
|
||||
if ((rec_get_info_and_status_bits(insert_rec, index->table->comp) !=
|
||||
rec_get_info_and_status_bits(cursor_rec, index->table->comp))
|
||||
|| (extra_size != cur_extra_size)
|
||||
|| (rec_size != cur_rec_size)) {
|
||||
|
||||
|
@ -622,7 +622,8 @@ page_cur_insert_rec_write_log(
|
|||
if (extra_info_yes) {
|
||||
/* Write the info bits */
|
||||
mach_write_to_1(log_ptr,
|
||||
rec_get_info_bits(insert_rec, index->table->comp));
|
||||
rec_get_info_and_status_bits(insert_rec,
|
||||
index->table->comp));
|
||||
log_ptr++;
|
||||
|
||||
/* Write the record origin offset */
|
||||
|
@ -673,7 +674,7 @@ page_cur_parse_insert_rec(
|
|||
byte buf1[1024];
|
||||
byte* buf;
|
||||
byte* ptr2 = ptr;
|
||||
ulint info_bits = 0; /* remove warning */
|
||||
ulint info_and_status_bits = 0; /* remove warning */
|
||||
page_cur_t cursor;
|
||||
mem_heap_t* heap = NULL;
|
||||
ulint offsets_[100] = { 100, };
|
||||
|
@ -723,7 +724,7 @@ page_cur_parse_insert_rec(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
info_bits = mach_read_from_1(ptr);
|
||||
info_and_status_bits = mach_read_from_1(ptr);
|
||||
ptr++;
|
||||
|
||||
ptr = mach_parse_compressed(ptr, end_ptr, &origin_offset);
|
||||
|
@ -768,7 +769,8 @@ page_cur_parse_insert_rec(
|
|||
ULINT_UNDEFINED, &heap);
|
||||
|
||||
if (extra_info_yes == 0) {
|
||||
info_bits = rec_get_info_bits(cursor_rec, index->table->comp);
|
||||
info_and_status_bits = rec_get_info_and_status_bits(
|
||||
cursor_rec, index->table->comp);
|
||||
origin_offset = rec_offs_extra_size(offsets);
|
||||
mismatch_index = rec_offs_size(offsets) - end_seg_len;
|
||||
}
|
||||
|
@ -783,11 +785,12 @@ page_cur_parse_insert_rec(
|
|||
|
||||
if (mismatch_index >= UNIV_PAGE_SIZE) {
|
||||
fprintf(stderr,
|
||||
"Is short %lu, info_bits %lu, offset %lu, "
|
||||
"Is short %lu, info_and_status_bits %lu, offset %lu, "
|
||||
"o_offset %lu\n"
|
||||
"mismatch index %lu, end_seg_len %lu\n"
|
||||
"parsed len %lu\n",
|
||||
(ulong) is_short, (ulong) info_bits, (ulong) offset,
|
||||
(ulong) is_short, (ulong) info_and_status_bits,
|
||||
(ulong) offset,
|
||||
(ulong) origin_offset,
|
||||
(ulong) mismatch_index, (ulong) end_seg_len,
|
||||
(ulong) (ptr - ptr2));
|
||||
|
@ -803,21 +806,14 @@ page_cur_parse_insert_rec(
|
|||
ut_memcpy(buf, rec_get_start(cursor_rec, offsets), mismatch_index);
|
||||
ut_memcpy(buf + mismatch_index, ptr, end_seg_len);
|
||||
|
||||
rec_set_info_bits(buf + origin_offset, index->table->comp, info_bits);
|
||||
|
||||
/* Set the status bits for new-style records. */
|
||||
if (index->table->comp) {
|
||||
/* Leaf pages (level 0) contain ordinary records;
|
||||
non-leaf pages contain node pointer records. */
|
||||
ulint level = page_header_get_field(
|
||||
buf_frame_align(cursor_rec), PAGE_LEVEL);
|
||||
rec_set_status(buf + origin_offset,
|
||||
level ? REC_STATUS_NODE_PTR : REC_STATUS_ORDINARY);
|
||||
}
|
||||
rec_set_info_and_status_bits(buf + origin_offset, index->table->comp,
|
||||
info_and_status_bits);
|
||||
|
||||
page_cur_position(cursor_rec, &cursor);
|
||||
|
||||
page_cur_rec_insert(&cursor, buf + origin_offset, index, mtr);
|
||||
offsets = rec_get_offsets(buf + origin_offset, index, offsets,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
page_cur_rec_insert(&cursor, buf + origin_offset, index, offsets, mtr);
|
||||
|
||||
if (buf != buf1) {
|
||||
|
||||
|
@ -846,6 +842,7 @@ page_cur_insert_rec_low(
|
|||
dtuple_t* tuple, /* in: pointer to a data tuple or NULL */
|
||||
dict_index_t* index, /* in: record descriptor */
|
||||
rec_t* rec, /* in: pointer to a physical record or NULL */
|
||||
ulint* offsets,/* in: rec_get_offsets(rec, index) or NULL */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
byte* insert_buf = NULL;
|
||||
|
@ -863,8 +860,6 @@ page_cur_insert_rec_low(
|
|||
rec_t* owner_rec;
|
||||
ulint n_owned;
|
||||
mem_heap_t* heap = NULL;
|
||||
ulint offsets_[100] = { 100, };
|
||||
ulint* offsets = offsets_;
|
||||
ibool comp = index->table->comp;
|
||||
|
||||
ut_ad(cursor && mtr);
|
||||
|
@ -882,8 +877,11 @@ page_cur_insert_rec_low(
|
|||
if (tuple != NULL) {
|
||||
rec_size = rec_get_converted_size(index, tuple);
|
||||
} else {
|
||||
offsets = rec_get_offsets(rec, index, offsets,
|
||||
if (!offsets) {
|
||||
offsets = rec_get_offsets(rec, index, offsets,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
}
|
||||
ut_ad(rec_offs_validate(rec, index, offsets));
|
||||
rec_size = rec_offs_size(offsets);
|
||||
}
|
||||
|
||||
|
@ -1131,8 +1129,6 @@ page_copy_rec_list_end_to_created_page(
|
|||
slot_index = 0;
|
||||
n_recs = 0;
|
||||
|
||||
heap = mem_heap_create(100);
|
||||
|
||||
/* should be do ... until, comment by Jani */
|
||||
while (rec != page_get_supremum_rec(page)) {
|
||||
offsets = rec_get_offsets(rec, index, offsets,
|
||||
|
|
|
@ -463,6 +463,9 @@ page_copy_rec_list_end_no_locks(
|
|||
page_cur_t cur1;
|
||||
page_cur_t cur2;
|
||||
rec_t* sup;
|
||||
mem_heap_t* heap = NULL;
|
||||
ulint offsets_[100] = { 100, };
|
||||
ulint* offsets = offsets_;
|
||||
|
||||
page_cur_position(rec, &cur1);
|
||||
|
||||
|
@ -483,8 +486,11 @@ page_copy_rec_list_end_no_locks(
|
|||
sup = page_get_supremum_rec(page);
|
||||
|
||||
while (sup != page_cur_get_rec(&cur1)) {
|
||||
if (!page_cur_rec_insert(&cur2,
|
||||
page_cur_get_rec(&cur1), index, mtr)) {
|
||||
rec_t* cur1_rec = page_cur_get_rec(&cur1);
|
||||
offsets = rec_get_offsets(cur1_rec, index, offsets,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
if (!page_cur_rec_insert(&cur2, cur1_rec, index,
|
||||
offsets, mtr)) {
|
||||
/* Track an assertion failure reported on the mailing
|
||||
list on June 18th, 2003 */
|
||||
|
||||
|
@ -503,7 +509,11 @@ page_copy_rec_list_end_no_locks(
|
|||
page_cur_move_to_next(&cur1);
|
||||
page_cur_move_to_next(&cur2);
|
||||
}
|
||||
}
|
||||
|
||||
if (heap) {
|
||||
mem_heap_free(heap);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
Copies records from page to new_page, from a given record onward,
|
||||
|
@ -553,6 +563,9 @@ page_copy_rec_list_start(
|
|||
page_cur_t cur1;
|
||||
page_cur_t cur2;
|
||||
rec_t* old_end;
|
||||
mem_heap_t* heap = NULL;
|
||||
ulint offsets_[100] = { 100, };
|
||||
ulint* offsets = offsets_;
|
||||
|
||||
page_cur_set_before_first(page, &cur1);
|
||||
|
||||
|
@ -570,8 +583,13 @@ page_copy_rec_list_start(
|
|||
/* Copy records from the original page to the new page */
|
||||
|
||||
while (page_cur_get_rec(&cur1) != rec) {
|
||||
ut_a(page_cur_rec_insert(&cur2,
|
||||
page_cur_get_rec(&cur1), index, mtr));
|
||||
rec_t* ins_rec;
|
||||
rec_t* cur1_rec = page_cur_get_rec(&cur1);
|
||||
offsets = rec_get_offsets(cur1_rec, index, offsets,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
ins_rec = page_cur_rec_insert(&cur2, cur1_rec, index,
|
||||
offsets, mtr);
|
||||
ut_a(ins_rec);
|
||||
|
||||
page_cur_move_to_next(&cur1);
|
||||
page_cur_move_to_next(&cur2);
|
||||
|
@ -584,7 +602,11 @@ page_copy_rec_list_start(
|
|||
page_update_max_trx_id(new_page, page_get_max_trx_id(page));
|
||||
|
||||
btr_search_move_or_delete_hash_entries(new_page, page, index);
|
||||
}
|
||||
|
||||
if (heap) {
|
||||
mem_heap_free(heap);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
Writes a log record of a record list end or start deletion. */
|
||||
|
|
|
@ -1120,7 +1120,6 @@ row_ins_check_foreign_constraint(
|
|||
dict_table_t* check_table;
|
||||
dict_index_t* check_index;
|
||||
ulint n_fields_cmp;
|
||||
ibool unique_search;
|
||||
rec_t* rec;
|
||||
btr_pcur_t pcur;
|
||||
ibool moved;
|
||||
|
@ -1240,14 +1239,6 @@ run_again:
|
|||
|
||||
dtuple_set_n_fields_cmp(entry, foreign->n_fields);
|
||||
|
||||
if (dict_index_get_n_unique(check_index) <= foreign->n_fields) {
|
||||
/* We can just set a LOCK_REC_NOT_GAP type lock */
|
||||
|
||||
unique_search = TRUE;
|
||||
} else {
|
||||
unique_search = FALSE;
|
||||
}
|
||||
|
||||
btr_pcur_open(check_index, entry, PAGE_CUR_GE,
|
||||
BTR_SEARCH_LEAF, &pcur, &mtr);
|
||||
|
||||
|
@ -1289,18 +1280,14 @@ run_again:
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
/* Found a matching record */
|
||||
ulint lock_type;
|
||||
/* Found a matching record. Lock only
|
||||
a record because we can allow inserts
|
||||
into gaps */
|
||||
|
||||
if (unique_search) {
|
||||
lock_type = LOCK_REC_NOT_GAP;
|
||||
} else {
|
||||
lock_type = LOCK_ORDINARY;
|
||||
}
|
||||
err = row_ins_set_shared_rec_lock(
|
||||
LOCK_REC_NOT_GAP, rec,
|
||||
check_index, offsets, thr);
|
||||
|
||||
err = row_ins_set_shared_rec_lock(lock_type,
|
||||
rec, check_index, offsets, thr);
|
||||
|
||||
if (err != DB_SUCCESS) {
|
||||
|
||||
break;
|
||||
|
|
|
@ -2561,17 +2561,6 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */
|
|||
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
|
||||
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
|
||||
|
@ -2594,7 +2583,6 @@ fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr);
|
|||
|
||||
lock_reset_all_on_table(table);
|
||||
|
||||
trx->dict_operation = TRUE;
|
||||
trx->table_id = table->id;
|
||||
|
||||
/* scan SYS_INDEXES for all indexes of the table */
|
||||
|
|
|
@ -88,7 +88,9 @@ ut_malloc_low(
|
|||
"InnoDB: Check if you should increase the swap file or\n"
|
||||
"InnoDB: ulimits of your operating system.\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,
|
||||
#ifdef __WIN__
|
||||
(ulong) GetLastError()
|
||||
|
|
|
@ -82,10 +82,17 @@ ut_usectime(
|
|||
ulint* sec, /* out: seconds since the Epoch */
|
||||
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;
|
||||
gettimeofday(&tv,NULL);
|
||||
*sec = (ulint) tv.tv_sec;
|
||||
*ms = (ulint) tv.tv_usec;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
|
|
|
@ -24,7 +24,7 @@ target = libmysqlclient.la
|
|||
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
|
||||
LIBS = @CLIENT_LIBS@
|
||||
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
|
||||
-I$(top_srcdir)/extra
|
||||
-I$(top_builddir)/include
|
||||
|
||||
include $(srcdir)/Makefile.shared
|
||||
|
||||
|
|
|
@ -65,8 +65,9 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
|
|||
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
|
||||
charset.lo charset-def.lo hash.lo mf_iocache.lo \
|
||||
mf_iocache2.lo my_seek.lo my_sleep.lo \
|
||||
my_pread.lo mf_cache.lo md5.lo sha1.lo\
|
||||
my_getopt.lo my_gethostbyname.lo my_port.lo
|
||||
my_pread.lo mf_cache.lo md5.lo sha1.lo \
|
||||
my_getopt.lo my_gethostbyname.lo my_port.lo \
|
||||
my_rename.lo
|
||||
sqlobjects = net.lo
|
||||
sql_cmn_objects = pack.lo client.lo my_time.lo
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
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
|
||||
|
@ -3077,7 +3077,7 @@ static my_bool int_is_null_false= 0;
|
|||
values and mysql_stmt_execute() the statement.
|
||||
|
||||
See also: mysql_stmt_send_long_data() for sending long text/blob
|
||||
data in pieces, examples in tests/client_test.c.
|
||||
data in pieces, examples in tests/mysql_client_test.c.
|
||||
Next steps you might want to make:
|
||||
- execute statement with mysql_stmt_execute(),
|
||||
- reset statement using mysql_stmt_reset() or reprepare it with
|
||||
|
@ -3718,7 +3718,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
longlongstore(buffer, data);
|
||||
}
|
||||
*param->error= value != (param->is_unsigned ?
|
||||
(double) (*(ulonglong*) buffer) :
|
||||
ulonglong2double(*(ulonglong*) buffer) :
|
||||
(double) (*(longlong*) buffer));
|
||||
break;
|
||||
case MYSQL_TYPE_FLOAT:
|
||||
|
|
|
@ -26,7 +26,7 @@ LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@
|
|||
|
||||
INCLUDES = @MT_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
|
||||
include $(top_srcdir)/libmysql/Makefile.shared
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
|||
INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
|
||||
-I$(top_srcdir)/regex \
|
||||
-I$(top_srcdir)/extra \
|
||||
-I$(top_builddir)/include \
|
||||
$(openssl_includes) @ZLIB_INCLUDES@
|
||||
|
||||
noinst_LIBRARIES = libmysqld_int.a
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
noinst_PROGRAMS = mysqltest mysql client_test
|
||||
client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES)
|
||||
tests_sources= $(client_test_SOURCES)
|
||||
noinst_PROGRAMS = mysql
|
||||
bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded
|
||||
client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES)
|
||||
tests_sources = $(mysql_client_test_embedded_SOURCES)
|
||||
CLEANFILES = $(client_sources) $(tests_sources)
|
||||
|
||||
link_sources:
|
||||
for f in $(client_sources); do \
|
||||
|
@ -15,24 +17,20 @@ link_sources:
|
|||
DEFS = -DEMBEDDED_LIBRARY
|
||||
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \
|
||||
-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@
|
||||
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS)
|
||||
|
||||
mysqltest_LINK = $(CXXLINK)
|
||||
mysqltest_SOURCES = mysqltest.c
|
||||
mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
|
||||
mysqltest_embedded_LINK = $(CXXLINK)
|
||||
mysqltest_embedded_SOURCES = mysqltest.c
|
||||
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
|
||||
|
||||
mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
|
||||
my_readline.h sql_string.h completion_hash.h
|
||||
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
|
||||
|
||||
client_test_LINK = $(CXXLINK)
|
||||
client_test_SOURCES = client_test.c
|
||||
|
||||
clean:
|
||||
rm -f $(client_sources)
|
||||
rm -f $(tests_sources)
|
||||
mysql_client_test_embedded_LINK = $(CXXLINK)
|
||||
mysql_client_test_embedded_SOURCES = mysql_client_test.c
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
@ -346,11 +346,12 @@ static void _ftb_init_index_search(FT_INFO *ftb)
|
|||
if (ftbe->flags & FTB_FLAG_NO || /* 2 */
|
||||
ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */
|
||||
{
|
||||
FTB_EXPR *top_ftbe=ftbe->up->up;
|
||||
FTB_EXPR *top_ftbe=ftbe->up;
|
||||
ftbw->docid[0]=HA_OFFSET_ERROR;
|
||||
for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up)
|
||||
if (!(ftbe->flags & FTB_FLAG_NO))
|
||||
ftbe->yweaks++;
|
||||
for (ftbe=(FTB_EXPR *)ftbw;
|
||||
ftbe != top_ftbe && !(ftbe->flags & FTB_FLAG_NO);
|
||||
ftbe=ftbe->up)
|
||||
ftbe->up->yweaks++;
|
||||
ftbe=0;
|
||||
break;
|
||||
}
|
||||
|
@ -364,7 +365,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
|
|||
else
|
||||
reset_tree(& ftb->no_dupes);
|
||||
}
|
||||
|
||||
|
||||
if (_ft2_search(ftb, ftbw, 1))
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -184,21 +184,14 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
|
|||
my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+
|
||||
(uint) (share->pack.header_length+7),
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
{
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
goto err1;
|
||||
}
|
||||
tmp_buff=share->decode_tables+length;
|
||||
disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE);
|
||||
|
||||
if (my_read(file,disk_cache,
|
||||
(uint) (share->pack.header_length-sizeof(header)),
|
||||
MYF(MY_NABP)))
|
||||
{
|
||||
my_free((gptr) share->decode_trees,MYF(0));
|
||||
my_free((gptr) share->decode_tables,MYF(0));
|
||||
goto err2;
|
||||
}
|
||||
|
||||
huff_tree_bits=max_bit(trees ? trees-1 : 0);
|
||||
init_bit_buffer(&bit_buff, (uchar*) disk_cache,
|
||||
|
|
|
@ -948,15 +948,14 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length)
|
|||
/* check for redundant root (not leaf, 1 child) and eliminate */
|
||||
if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
|
||||
goto err1;
|
||||
if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS,
|
||||
if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS,
|
||||
info->buff, 0))
|
||||
goto err1;
|
||||
nod_flag = mi_test_if_nod(info->buff);
|
||||
page_size = mi_getint(info->buff);
|
||||
if (nod_flag && (page_size == 2 + key_length +
|
||||
(nod_flag ? nod_flag : info->s->base.rec_reflength)))
|
||||
if (nod_flag && (page_size == 2 + key_length + nod_flag))
|
||||
{
|
||||
my_off_t new_root = _mi_kpos(nod_flag,
|
||||
my_off_t new_root = _mi_kpos(nod_flag,
|
||||
rt_PAGE_FIRST_KEY(info->buff, nod_flag));
|
||||
if (_mi_dispose(info, keyinfo, old_root, DFLT_INIT_HITS))
|
||||
goto err1;
|
||||
|
|
|
@ -162,7 +162,10 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
|
|||
{
|
||||
if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer,
|
||||
maxbuffer/2))
|
||||
{
|
||||
my_free((gptr) sort_keys,MYF(0));
|
||||
sort_keys= 0;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- require r/have_federated_db.require
|
||||
disable_query_log;
|
||||
show variables like "have_federated_db";
|
||||
show variables like "have_federated_engine";
|
||||
enable_query_log;
|
||||
|
|
4
mysql-test/include/ndb_default_cluster.inc
Normal file
4
mysql-test/include/ndb_default_cluster.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
-- require r/ndb_default_cluster.require
|
||||
disable_query_log;
|
||||
show status like "Ndb_connected_host";
|
||||
enable_query_log;
|
30
mysql-test/include/testdb_only.inc
Normal file
30
mysql-test/include/testdb_only.inc
Normal 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
|
|
@ -198,6 +198,13 @@ LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH"
|
|||
DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH"
|
||||
export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
|
||||
|
||||
#
|
||||
# Allow anyone in the group to see the generated database files
|
||||
#
|
||||
UMASK=0660
|
||||
UMASK_DIR=0770
|
||||
export UMASK UMASK_DIR
|
||||
|
||||
MASTER_RUNNING=0
|
||||
MASTER1_RUNNING=0
|
||||
MASTER_MYPORT=9306
|
||||
|
@ -217,7 +224,7 @@ EXTRA_MASTER_OPT=""
|
|||
EXTRA_MYSQL_TEST_OPT=""
|
||||
EXTRA_MYSQLDUMP_OPT=""
|
||||
EXTRA_MYSQLBINLOG_OPT=""
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
USE_NDBCLUSTER=""
|
||||
USE_RUNNING_NDBCLUSTER=""
|
||||
DO_GCOV=""
|
||||
|
@ -248,7 +255,7 @@ NDBD_EXTRA_OPTS=
|
|||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--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=;;"` ;;
|
||||
--force) FORCE=1 ;;
|
||||
--timer) USE_TIMER=1 ;;
|
||||
|
@ -258,8 +265,8 @@ while test $# -gt 0; do
|
|||
MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
|
||||
--slave-binary=*)
|
||||
SLAVE_MYSQLD=`$ECHO "$1" | $SED -e "s;--slave-binary=;;"` ;;
|
||||
--local) USE_RUNNING_SERVER="" ;;
|
||||
--extern) USE_RUNNING_SERVER="1" ;;
|
||||
--local) USE_RUNNING_SERVER=0 ;;
|
||||
--extern) USE_RUNNING_SERVER=1 ;;
|
||||
--with-ndbcluster)
|
||||
USE_NDBCLUSTER="--ndbcluster" ;;
|
||||
--ndb-connectstring=*)
|
||||
|
@ -296,7 +303,7 @@ while test $# -gt 0; do
|
|||
--no-manager | --skip-manager) USE_MANAGER=0 ;;
|
||||
--manager)
|
||||
USE_MANAGER=1
|
||||
USE_RUNNING_SERVER=
|
||||
USE_RUNNING_SERVER=0
|
||||
;;
|
||||
--start-and-exit)
|
||||
START_AND_EXIT=1
|
||||
|
@ -365,7 +372,7 @@ while test $# -gt 0; do
|
|||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
|
||||
# This needs to be checked properly
|
||||
# USE_MANAGER=1
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
;;
|
||||
--client-gdb )
|
||||
if [ x$BINARY_DIST = x1 ] ; then
|
||||
|
@ -378,7 +385,7 @@ while test $# -gt 0; do
|
|||
--manual-gdb )
|
||||
DO_GDB=1
|
||||
MANUAL_GDB=1
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
|
||||
;;
|
||||
|
@ -387,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"
|
||||
fi
|
||||
DO_DDD=1
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
|
||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
|
||||
;;
|
||||
|
@ -405,7 +412,7 @@ while test $# -gt 0; do
|
|||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
SLEEP_TIME_AFTER_RESTART=10
|
||||
SLEEP_TIME_FOR_DELETE=60
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
if test "$1" = "--valgrind-all"
|
||||
then
|
||||
VALGRIND="$VALGRIND -v --show-reachable=yes"
|
||||
|
@ -474,6 +481,7 @@ export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MA
|
|||
|
||||
NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
|
||||
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS"
|
||||
NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
|
||||
|
||||
if [ x$SOURCE_DIST = x1 ] ; then
|
||||
MY_BASEDIR=$MYSQL_TEST_DIR
|
||||
|
@ -499,13 +507,13 @@ DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c
|
|||
# on binary, use what is installed
|
||||
if [ x$SOURCE_DIST = x1 ] ; then
|
||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
|
||||
if [ -f "$BASEDIR/libmysqld/examples/mysqltest" ] ; then
|
||||
MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest"
|
||||
if [ -f "$BASEDIR/libmysqld/examples/mysqltest_embedded" ] ; then
|
||||
MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest_embedded"
|
||||
else
|
||||
echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2
|
||||
echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
TESTS_BINDIR="$BASEDIR/libmysqld/examples"
|
||||
MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded"
|
||||
else
|
||||
MYSQLD="$VALGRIND $BASEDIR/sql/mysqld"
|
||||
if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
|
||||
|
@ -515,7 +523,7 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
else
|
||||
MYSQL_TEST="$BASEDIR/client/mysqltest"
|
||||
fi
|
||||
TESTS_BINDIR="$BASEDIR/tests"
|
||||
MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test"
|
||||
fi
|
||||
if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
|
||||
MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
|
||||
|
@ -545,6 +553,14 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
|
||||
NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
|
||||
else
|
||||
|
||||
# We have a binary installation. Note that this can be both from
|
||||
# unpacking a MySQL AB binary distribution (created using
|
||||
# "scripts/make_binary_distribution", and from a "make install".
|
||||
# Unfortunately the structure differs a bit, for a "make install"
|
||||
# currently all binaries are in "bin", for a MySQL AB packaging
|
||||
# some are in "tests".
|
||||
|
||||
if test -x "$BASEDIR/libexec/mysqld"
|
||||
then
|
||||
MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld"
|
||||
|
@ -578,7 +594,23 @@ else
|
|||
else
|
||||
LANGUAGE="$BASEDIR/share/english/"
|
||||
CHARSETSDIR="$BASEDIR/share/charsets"
|
||||
fi
|
||||
fi
|
||||
if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
|
||||
if [ -f "$CLIENT_BINDIR/mysqltest_embedded" ] ; then
|
||||
MYSQL_TEST="$VALGRIND $CLIENT_BINDIR/mysqltest_embedded"
|
||||
else
|
||||
echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "$BASEDIR/tests/mysql_client_test_embedded" ] ; then
|
||||
MYSQL_CLIENT_TEST="$TESTS_BINDIR/mysql_client_test_embedded"
|
||||
else
|
||||
MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded"
|
||||
fi
|
||||
else
|
||||
MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
|
||||
MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$MASTER_MYSQLD" ]
|
||||
|
@ -595,9 +627,9 @@ fi
|
|||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
USE_RUNNING_SERVER=""
|
||||
USE_RUNNING_SERVER=0
|
||||
fi
|
||||
if [ -n "$USE_RUNNING_SERVER" ]
|
||||
if [ $USE_RUNNING_SERVER -eq 1 ]
|
||||
then
|
||||
MASTER_MYSOCK=$LOCAL_SOCKET;
|
||||
DBUSER=${DBUSER:-test}
|
||||
|
@ -612,15 +644,16 @@ then
|
|||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
|
||||
fi
|
||||
|
||||
|
||||
MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent"
|
||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
|
||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
|
||||
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
|
||||
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
|
||||
export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR
|
||||
export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
|
||||
export NDB_TOOLS_DIR
|
||||
export NDB_MGM
|
||||
export NDB_BACKUP_DIR
|
||||
|
||||
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
|
||||
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
|
||||
|
@ -739,6 +772,17 @@ skip_test() {
|
|||
$ECHO "$RES$RES_SPACE [ skipped ]"
|
||||
}
|
||||
|
||||
|
||||
disable_test() {
|
||||
USERT=" ...."
|
||||
SYST=" ...."
|
||||
REALT=" ...."
|
||||
pname=`$ECHO "$1 "|$CUT -c 1-24`
|
||||
RES="$pname"
|
||||
skip_inc
|
||||
$ECHO "$RES$RES_SPACE [ disabled ] $2"
|
||||
}
|
||||
|
||||
report_stats () {
|
||||
if [ $TOT_FAIL = 0 ]; then
|
||||
$ECHO "All $TOT_TEST tests were successful."
|
||||
|
@ -757,7 +801,7 @@ report_stats () {
|
|||
$ECHO "http://www.mysql.com/doc/en/MySQL_test_suite.html"
|
||||
fi
|
||||
|
||||
if test -z "$USE_RUNNING_SERVER"
|
||||
if [ $USE_RUNNING_SERVER -eq 0 ]
|
||||
then
|
||||
|
||||
# Report if there was any fatal warnings/errors in the log files
|
||||
|
@ -1385,6 +1429,12 @@ run_testcase ()
|
|||
if [ -n "$RESULT_EXT" -a \( x$RECORD = x1 -o -f "$result_file$RESULT_EXT" \) ] ; then
|
||||
result_file="$result_file$RESULT_EXT"
|
||||
fi
|
||||
if [ -e "$TESTDIR/$tname.disabled" ]
|
||||
then
|
||||
comment=`$CAT $TESTDIR/$tname.disabled`;
|
||||
disable_test $tname "$comment"
|
||||
return
|
||||
fi
|
||||
if [ "$USE_MANAGER" = 1 ] ; then
|
||||
many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
|
||||
fi
|
||||
|
@ -1461,7 +1511,7 @@ run_testcase ()
|
|||
done
|
||||
fi
|
||||
|
||||
if [ -z "$USE_RUNNING_SERVER" ] ;
|
||||
if [ $USE_RUNNING_SERVER -eq 0 ] ;
|
||||
then
|
||||
if [ -f $master_opt_file ] ;
|
||||
then
|
||||
|
@ -1605,7 +1655,7 @@ run_testcase ()
|
|||
if [ x$FORCE != x1 ] ; then
|
||||
$ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'."
|
||||
$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" ]
|
||||
then
|
||||
mysql_stop
|
||||
|
@ -1614,7 +1664,7 @@ run_testcase ()
|
|||
exit 1
|
||||
fi
|
||||
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" ]
|
||||
then
|
||||
mysql_restart
|
||||
|
@ -1633,7 +1683,7 @@ run_testcase ()
|
|||
[ "$DO_GCOV" ] && gcov_prepare
|
||||
[ "$DO_GPROF" ] && gprof_prepare
|
||||
|
||||
if [ -z "$USE_RUNNING_SERVER" ]
|
||||
if [ $USE_RUNNING_SERVER -eq 0 ]
|
||||
then
|
||||
if [ -z "$FAST_START" ]
|
||||
then
|
||||
|
@ -1694,6 +1744,9 @@ fi
|
|||
|
||||
$ECHO "Starting Tests"
|
||||
|
||||
# Some test cases need USE_RUNNING_SERVER
|
||||
export USE_RUNNING_SERVER
|
||||
|
||||
#
|
||||
# This can probably be deleted
|
||||
#
|
||||
|
@ -1766,7 +1819,7 @@ fi
|
|||
$ECHO $DASH72
|
||||
$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
|
||||
mysql_stop
|
||||
fi
|
||||
|
|
|
@ -130,9 +130,9 @@ delete from federated.t1;
|
|||
select * from federated.t1 where id = 5;
|
||||
id name other created
|
||||
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`) );
|
||||
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 ('Second Name', NULL);
|
||||
insert into federated.t1 (name, other) values ('Third Name', 33333);
|
||||
|
@ -162,7 +162,7 @@ id name other
|
|||
7 Seventh Name NULL
|
||||
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 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 = 'Seventh Name';
|
||||
update federated.t1 set name = 'Tenth Name' where other like 'fee fie%';
|
||||
|
@ -181,6 +181,85 @@ id name other
|
|||
9 Ninth Name 99999
|
||||
10 Tenth Name fee fie foe fum
|
||||
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;
|
||||
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';
|
||||
|
@ -550,16 +629,46 @@ delete from federated.t1 where i50=20;
|
|||
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
|
||||
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;
|
||||
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 ('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;
|
||||
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
|
||||
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;
|
||||
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 database if exists federated;
|
||||
drop table if exists federated.t1;
|
||||
|
|
|
@ -148,6 +148,9 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B
|
|||
a b
|
||||
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
|
||||
a b
|
||||
select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE);
|
||||
a b
|
||||
Full-text indexes are called collections
|
||||
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
|
||||
a b
|
||||
select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Variable_name Value
|
||||
have_federated_db YES
|
||||
have_federated_engine YES
|
||||
|
|
|
@ -571,8 +571,11 @@ where table_schema='information_schema' limit 2;
|
|||
TABLE_NAME TABLE_TYPE ENGINE
|
||||
SCHEMATA TEMPORARY MyISAM
|
||||
TABLES TEMPORARY MyISAM
|
||||
show tables from information_schema like "t%";
|
||||
Tables_in_information_schema (t%)
|
||||
show tables from information_schema like "T%";
|
||||
Tables_in_information_schema (T%)
|
||||
TABLES
|
||||
TABLE_PRIVILEGES
|
||||
TABLE_CONSTRAINTS
|
||||
create database information_schema;
|
||||
ERROR HY000: Can't create database 'information_schema'; database exists
|
||||
use information_schema;
|
||||
|
|
|
@ -638,3 +638,15 @@ No Field Count
|
|||
0 1 100
|
||||
0 2 100
|
||||
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;
|
||||
|
|
|
@ -131,3 +131,13 @@ show tables like 't1%';
|
|||
Tables_in_test (t1%)
|
||||
t1
|
||||
drop table t1;
|
||||
create temporary table T1(a int(11), b varchar(8));
|
||||
insert into T1 values (1, 'abc');
|
||||
select * from T1;
|
||||
a b
|
||||
1 abc
|
||||
alter table T1 add index (a);
|
||||
select * from T1;
|
||||
a b
|
||||
1 abc
|
||||
drop table T1;
|
||||
|
|
|
@ -34,13 +34,13 @@ col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
|
|||
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
|
||||
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
|
||||
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;
|
||||
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);
|
||||
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
|
||||
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;
|
||||
col1 col2 col3 col4 col5 col6 to_be_deleted
|
||||
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;
|
||||
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
|
||||
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;
|
||||
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
|
||||
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');
|
||||
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
|
||||
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;
|
||||
col6 col1 col3 fourth col4 col4_5 col5 col7 col8
|
||||
1 0 3 4 5 PENDING 0000-00-00 00:00:00
|
||||
|
|
|
@ -144,8 +144,8 @@ Handler_discover 1
|
|||
flush tables;
|
||||
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
|
||||
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL
|
||||
t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL number_of_replicas: 2
|
||||
t6 MyISAM 9 Fixed 1 260 # # # 0 NULL # # NULL # NULL #
|
||||
t7 ndbcluster 9 Fixed 1 276 # # # 0 NULL # # NULL # NULL #
|
||||
show status like 'handler_discover%';
|
||||
Variable_name Value
|
||||
Handler_discover 2
|
||||
|
|
2
mysql-test/r/ndb_default_cluster.require
Normal file
2
mysql-test/r/ndb_default_cluster.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
Ndb_connected_host localhost
|
|
@ -432,16 +432,16 @@ index(ye),
|
|||
index(ti),
|
||||
index(ts)
|
||||
) engine=ndb;
|
||||
insert into t1 (pk,dt,da,ye,ti) values
|
||||
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'),
|
||||
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'),
|
||||
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'),
|
||||
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'),
|
||||
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'),
|
||||
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'),
|
||||
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'),
|
||||
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'),
|
||||
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59');
|
||||
insert into t1 (pk,dt,da,ye,ti,ts) values
|
||||
(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', '2001-01-01 13:00:59'),
|
||||
(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', '2001-01-01 00:00:00'),
|
||||
(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', '2001-01-01 06:06:06'),
|
||||
(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', '2001-01-01 10:11:11'),
|
||||
(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';
|
||||
count(*)-9
|
||||
0
|
||||
|
@ -529,6 +529,30 @@ count(*)-8
|
|||
select count(*)-9 from t1 use index (ti) where ti <= '23:59:59';
|
||||
count(*)-9
|
||||
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;
|
||||
create table t1(a int primary key, b int not null, index(b));
|
||||
insert into t1 values (1,1), (2,2);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
drop table if exists t1, t2, t3, t4, t5, t6, t7;
|
||||
drop table if exists t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
CREATE TABLE t1 (
|
||||
a int unsigned NOT NULL PRIMARY KEY,
|
||||
b int unsigned not null,
|
||||
|
@ -612,3 +612,17 @@ a b c
|
|||
3 NULL NULL
|
||||
4 4 NULL
|
||||
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;
|
||||
|
|
249
mysql-test/r/ndb_restore.result
Normal file
249
mysql-test/r/ndb_restore.result
Normal file
|
@ -0,0 +1,249 @@
|
|||
use test;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
CREATE TABLE `t1` (
|
||||
`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`goaledatta` char(2) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt');
|
||||
CREATE TABLE `t2` (
|
||||
`capgotod` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`gotod` smallint(5) unsigned NOT NULL default '0',
|
||||
`goaledatta` char(2) default NULL,
|
||||
`maturegarbagefa` varchar(32) default NULL,
|
||||
`descrpooppo` varchar(64) default NULL,
|
||||
`svcutonsa` varchar(64) NOT NULL default '',
|
||||
PRIMARY KEY (`capgotod`),
|
||||
KEY `i_quadaddsvr` (`gotod`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
|
||||
CREATE TABLE `t3` (
|
||||
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
|
||||
`capgotod` smallint(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`capgotod`,`CapGoaledatta`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3);
|
||||
CREATE TABLE `t4` (
|
||||
`capfa` bigint(20) unsigned NOT NULL auto_increment,
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`authpwchap` varchar(32) default NULL,
|
||||
`fa` varchar(32) NOT NULL default '',
|
||||
`payyingatta` tinyint(4) NOT NULL default '0',
|
||||
`status` char(1) default NULL,
|
||||
PRIMARY KEY (`fa`,`realm`),
|
||||
KEY `capfa` (`capfa`),
|
||||
KEY `i_quadentity` (`fa`,`realm`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
|
||||
CREATE TABLE `t5` (
|
||||
`capfa` bigint(20) unsigned NOT NULL default '0',
|
||||
`gotod` smallint(5) unsigned NOT NULL default '0',
|
||||
`orderutonsa` varchar(64) NOT NULL default '',
|
||||
PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,'');
|
||||
CREATE TABLE `t6` (
|
||||
`capfa_parent` bigint(20) unsigned NOT NULL default '0',
|
||||
`capfa_child` bigint(20) unsigned NOT NULL default '0',
|
||||
`relatta` smallint(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
|
||||
CREATE TABLE `t7` (
|
||||
`dardpo` char(15) NOT NULL default '',
|
||||
`dardtestard` tinyint(3) unsigned NOT NULL default '0',
|
||||
`FastFA` char(5) NOT NULL default '',
|
||||
`FastCode` char(6) NOT NULL default '',
|
||||
`Fastca` char(1) NOT NULL default '',
|
||||
`Fastmag` char(1) NOT NULL default '',
|
||||
`Beareratta` char(2) NOT NULL default '',
|
||||
PRIMARY KEY (`dardpo`,`dardtestard`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
|
||||
CREATE TABLE `t8` (
|
||||
`kattjame` varchar(32) NOT NULL default '',
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`realm_entered` varchar(32) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
|
||||
`kattjame_entered` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa` varchar(32) NOT NULL default '',
|
||||
`gest` varchar(16) default NULL,
|
||||
`hassetino` varchar(16) NOT NULL default '',
|
||||
`aaaproxysessfa` varchar(255) default NULL,
|
||||
`autologonallowed` char(1) default NULL,
|
||||
`squardporoot` varchar(15) NOT NULL default '',
|
||||
`naspo` varchar(15) default NULL,
|
||||
`beareratta` char(2) default NULL,
|
||||
`fastCode` varchar(6) default NULL,
|
||||
`fastFA` varchar(5) default NULL,
|
||||
`fastca` char(1) default NULL,
|
||||
`fastmag` char(1) default NULL,
|
||||
`lastupdate` datetime default NULL,
|
||||
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`accthassetitime` int(10) unsigned default NULL,
|
||||
`acctoutputoctets` bigint(20) unsigned default NULL,
|
||||
`acctinputoctets` bigint(20) unsigned default NULL,
|
||||
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
|
||||
KEY `squardporoot` (`squardporoot`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
|
||||
CREATE TABLE `t9` (
|
||||
`kattjame` varchar(32) NOT NULL default '',
|
||||
`kattjame_entered` varchar(32) NOT NULL default '',
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`realm_entered` varchar(32) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
|
||||
`gest` varchar(16) default NULL,
|
||||
`hassetino` varchar(16) NOT NULL default '',
|
||||
`squardporoot` varchar(15) NOT NULL default '',
|
||||
`naspo` varchar(15) default NULL,
|
||||
`beareratta` char(2) default NULL,
|
||||
`fastCode` varchar(6) default NULL,
|
||||
`fastFA` varchar(5) default NULL,
|
||||
`fastca` char(1) default NULL,
|
||||
`fastmag` char(1) default NULL,
|
||||
`lastupdate` datetime default NULL,
|
||||
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`accthassetitime` int(10) unsigned default NULL,
|
||||
`actcoutpuocttets` bigint(20) unsigned default NULL,
|
||||
`actinputocctets` bigint(20) unsigned default NULL,
|
||||
`terminateraste` tinyint(3) unsigned default NULL,
|
||||
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
|
||||
create table t1_c engine=ndbcluster as select * from t1;
|
||||
create table t2_c engine=ndbcluster as select * from t2;
|
||||
create table t3_c engine=ndbcluster as select * from t3;
|
||||
create table t4_c engine=ndbcluster as select * from t4;
|
||||
create table t5_c engine=ndbcluster as select * from t5;
|
||||
create table t6_c engine=ndbcluster as select * from t6;
|
||||
create table t7_c engine=ndbcluster as select * from t7;
|
||||
create table t8_c engine=ndbcluster as select * from t8;
|
||||
create table t9_c engine=ndbcluster as select * from t9;
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
t2
|
||||
t3
|
||||
t4
|
||||
t5
|
||||
t6
|
||||
t7
|
||||
t8
|
||||
t9
|
||||
t8_c
|
||||
t9_c
|
||||
t1_c
|
||||
t7_c
|
||||
t6_c
|
||||
t5_c
|
||||
t4_c
|
||||
t3_c
|
||||
t2_c
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
5
|
||||
select count(*) from t1_c;
|
||||
count(*)
|
||||
5
|
||||
select count(*)
|
||||
from (select * from t1 union
|
||||
select * from t1_c) a;
|
||||
count(*)
|
||||
5
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
6
|
||||
select count(*) from t2_c;
|
||||
count(*)
|
||||
6
|
||||
select count(*)
|
||||
from (select * from t2 union
|
||||
select * from t2_c) a;
|
||||
count(*)
|
||||
6
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
4
|
||||
select count(*) from t3_c;
|
||||
count(*)
|
||||
4
|
||||
select count(*)
|
||||
from (select * from t3 union
|
||||
select * from t3_c) a;
|
||||
count(*)
|
||||
4
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
22
|
||||
select count(*) from t4_c;
|
||||
count(*)
|
||||
22
|
||||
select count(*)
|
||||
from (select * from t4 union
|
||||
select * from t4_c) a;
|
||||
count(*)
|
||||
22
|
||||
select count(*) from t5;
|
||||
count(*)
|
||||
3
|
||||
select count(*) from t5_c;
|
||||
count(*)
|
||||
3
|
||||
select count(*)
|
||||
from (select * from t5 union
|
||||
select * from t5_c) a;
|
||||
count(*)
|
||||
3
|
||||
select count(*) from t6;
|
||||
count(*)
|
||||
8
|
||||
select count(*) from t6_c;
|
||||
count(*)
|
||||
8
|
||||
select count(*)
|
||||
from (select * from t6 union
|
||||
select * from t6_c) a;
|
||||
count(*)
|
||||
8
|
||||
select count(*) from t7;
|
||||
count(*)
|
||||
5
|
||||
select count(*) from t7_c;
|
||||
count(*)
|
||||
5
|
||||
select count(*)
|
||||
from (select * from t7 union
|
||||
select * from t7_c) a;
|
||||
count(*)
|
||||
5
|
||||
select count(*) from t8;
|
||||
count(*)
|
||||
3
|
||||
select count(*) from t8_c;
|
||||
count(*)
|
||||
3
|
||||
select count(*)
|
||||
from (select * from t8 union
|
||||
select * from t8_c) a;
|
||||
count(*)
|
||||
3
|
||||
select count(*) from t9;
|
||||
count(*)
|
||||
3
|
||||
select count(*) from t9_c;
|
||||
count(*)
|
||||
3
|
||||
select count(*)
|
||||
from (select * from t9 union
|
||||
select * from t9_c) a;
|
||||
count(*)
|
||||
3
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
|
@ -778,3 +778,20 @@ sid wnid
|
|||
39560 01019090000
|
||||
37994 01019090000
|
||||
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;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
drop table if exists t1, t2, t3, t4;
|
||||
drop table if exists t1, t2, t3, t4;
|
||||
start slave;
|
||||
ERROR HY000: File 'TESTDIR/var/slave-data/master.info' not found (Errcode: 13)
|
||||
Got one of the listed errors
|
||||
start slave;
|
||||
ERROR HY000: Could not initialize master info structure; more error messages can be found in the MySQL error log
|
||||
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
||||
|
|
2
mysql-test/r/testdb_only.require
Normal file
2
mysql-test/r/testdb_only.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
use extern server NO
|
|
@ -6,6 +6,7 @@ delete from mysql.tables_priv where user like 'mysqltest\_%';
|
|||
delete from mysql.columns_priv where user like 'mysqltest\_%';
|
||||
flush privileges;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
|
||||
flush user_resources;
|
||||
select * from t1;
|
||||
i
|
||||
select * from t1;
|
||||
|
@ -16,6 +17,7 @@ select * from t1;
|
|||
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_questions' resource (current value: 2)
|
||||
drop user mysqltest_1@localhost;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
|
||||
flush user_resources;
|
||||
select * from t1;
|
||||
i
|
||||
select * from t1;
|
||||
|
@ -34,6 +36,7 @@ select * from t1;
|
|||
i
|
||||
drop user mysqltest_1@localhost;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
|
||||
flush user_resources;
|
||||
select * from t1;
|
||||
i
|
||||
select * from t1;
|
||||
|
@ -47,6 +50,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections' resource (cur
|
|||
drop user mysqltest_1@localhost;
|
||||
flush privileges;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
|
||||
flush user_resources;
|
||||
select * from t1;
|
||||
i
|
||||
select * from t1;
|
||||
|
@ -56,6 +60,7 @@ ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource
|
|||
select * from t1;
|
||||
i
|
||||
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
|
||||
flush user_resources;
|
||||
select * from t1;
|
||||
i
|
||||
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
|
||||
2 2
|
||||
grant usage on *.* to mysqltest_1@localhost;
|
||||
flush user_resources;
|
||||
select @@session.max_user_connections, @@global.max_user_connections;
|
||||
@@session.max_user_connections @@global.max_user_connections
|
||||
2 2
|
||||
|
@ -79,6 +85,7 @@ i
|
|||
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
|
||||
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;
|
||||
flush user_resources;
|
||||
select @@session.max_user_connections, @@global.max_user_connections;
|
||||
@@session.max_user_connections @@global.max_user_connections
|
||||
3 2
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#
|
||||
# Simple test for archive example
|
||||
# Taken fromm the select test
|
||||
# Taken from the select test
|
||||
#
|
||||
-- source include/have_archive.inc
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
# Skip when testing the embedded server
|
||||
--source include/not_embedded.inc
|
||||
--disable_result_log
|
||||
--exec $TESTS_BINDIR/client_test --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent
|
0
mysql-test/t/ctype_cp932.test
Executable file → Normal file
0
mysql-test/t/ctype_cp932.test
Executable file → Normal file
0
mysql-test/t/ctype_eucjpms.test
Executable file → Normal file
0
mysql-test/t/ctype_eucjpms.test
Executable file → Normal file
1
mysql-test/t/federated.disabled
Normal file
1
mysql-test/t/federated.disabled
Normal file
|
@ -0,0 +1 @@
|
|||
Patrick Galbraith should fix this
|
|
@ -68,12 +68,14 @@ select * from federated.t1 where id = 5;
|
|||
delete from federated.t1;
|
||||
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;
|
||||
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`) );
|
||||
|
||||
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 ('Second Name', NULL);
|
||||
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 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 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 = 'Seventh Name';
|
||||
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;
|
||||
|
||||
# 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;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
# test NULLs
|
||||
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';
|
||||
# these both should be the same
|
||||
|
@ -452,15 +513,17 @@ select * from federated.t1;
|
|||
|
||||
connection slave;
|
||||
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;
|
||||
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 ('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;
|
||||
drop table if exists federated.t1;
|
||||
select * from federated.t1 where fileguts = 'jimbob';
|
||||
# test blob indexes
|
||||
|
||||
# TODO
|
||||
#
|
||||
|
@ -490,11 +553,36 @@ drop table if exists federated.t1;
|
|||
# drop table if exists federated.t1;
|
||||
#
|
||||
|
||||
# test joins with non-federated table
|
||||
connection slave;
|
||||
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;
|
||||
--disable_warnings
|
||||
drop table if exists federated.t1;
|
||||
drop database if exists federated;
|
||||
--enable_warnings
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
|
|||
|
||||
select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
|
||||
select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
|
||||
select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE);
|
||||
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
|
||||
|
||||
# bug#2708, bug#3870 crash
|
||||
|
|
|
@ -281,7 +281,7 @@ drop view vo;
|
|||
select TABLE_NAME,TABLE_TYPE,ENGINE
|
||||
from information_schema.tables
|
||||
where table_schema='information_schema' limit 2;
|
||||
show tables from information_schema like "t%";
|
||||
show tables from information_schema like "T%";
|
||||
|
||||
--error 1007
|
||||
create database information_schema;
|
||||
|
|
|
@ -180,3 +180,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2
|
|||
select * from 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;
|
||||
|
||||
|
|
|
@ -100,3 +100,14 @@ show tables like 'T1%';
|
|||
alter table t1 add index (A);
|
||||
show tables like 't1%';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #7261: Alter table loses temp table
|
||||
#
|
||||
|
||||
create temporary table T1(a int(11), b varchar(8));
|
||||
insert into T1 values (1, 'abc');
|
||||
select * from T1;
|
||||
alter table T1 add index (a);
|
||||
select * from T1;
|
||||
drop table T1;
|
||||
|
|
3
mysql-test/t/mysql_client_test.test
Normal file
3
mysql-test/t/mysql_client_test.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
# We run with different binaries for normal and --embedded-server
|
||||
--disable_result_log
|
||||
--exec $MYSQL_CLIENT_TEST
|
|
@ -47,10 +47,12 @@ col3 varchar (20) not null,
|
|||
col4 varchar(4) not null,
|
||||
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
|
||||
col6 int not null, to_be_deleted int) ENGINE=ndbcluster;
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
||||
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);
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
select * from t1 order by col1;
|
||||
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,
|
||||
change column col2 fourth varchar(30) not null after col3,
|
||||
modify column col6 int not null first;
|
||||
--replace_column 7 # 8 # 10 # 12 # 13 # 14 # 18 #
|
||||
show table status;
|
||||
select * from t1 order by col1;
|
||||
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;
|
||||
select * from t1 order by col1;
|
||||
delete from t1;
|
||||
|
|
|
@ -176,7 +176,7 @@ show status like 'handler_discover%';
|
|||
flush tables;
|
||||
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 status like 'handler_discover%';
|
||||
|
||||
|
|
|
@ -220,16 +220,16 @@ create table t1 (
|
|||
index(ts)
|
||||
) engine=ndb;
|
||||
|
||||
insert into t1 (pk,dt,da,ye,ti) values
|
||||
(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'),
|
||||
(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'),
|
||||
(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'),
|
||||
(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'),
|
||||
(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'),
|
||||
(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'),
|
||||
(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'),
|
||||
(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'),
|
||||
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59');
|
||||
insert into t1 (pk,dt,da,ye,ti,ts) values
|
||||
(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', '2001-01-01 13:00:59'),
|
||||
(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', '2001-01-01 00:00:00'),
|
||||
(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', '2001-01-01 06:06:06'),
|
||||
(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', '2001-01-01 10:11:11'),
|
||||
(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59');
|
||||
|
||||
# datetime
|
||||
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(*)-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;
|
||||
|
||||
# bug#7798
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
-- source include/have_ndb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2, t3, t4, t5, t6, t7;
|
||||
drop table if exists t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
|
@ -286,3 +286,24 @@ select * from t8 order by a;
|
|||
select * from t1 order by a;
|
||||
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;
|
||||
|
|
210
mysql-test/t/ndb_restore.test
Normal file
210
mysql-test/t/ndb_restore.test
Normal file
|
@ -0,0 +1,210 @@
|
|||
-- source include/have_ndb.inc
|
||||
-- source include/ndb_default_cluster.inc
|
||||
|
||||
--disable_warnings
|
||||
use test;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE `t1` (
|
||||
`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`goaledatta` char(2) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt');
|
||||
|
||||
CREATE TABLE `t2` (
|
||||
`capgotod` smallint(5) unsigned NOT NULL auto_increment,
|
||||
`gotod` smallint(5) unsigned NOT NULL default '0',
|
||||
`goaledatta` char(2) default NULL,
|
||||
`maturegarbagefa` varchar(32) default NULL,
|
||||
`descrpooppo` varchar(64) default NULL,
|
||||
`svcutonsa` varchar(64) NOT NULL default '',
|
||||
PRIMARY KEY (`capgotod`),
|
||||
KEY `i_quadaddsvr` (`gotod`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
|
||||
|
||||
CREATE TABLE `t3` (
|
||||
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
|
||||
`capgotod` smallint(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`capgotod`,`CapGoaledatta`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3);
|
||||
|
||||
CREATE TABLE `t4` (
|
||||
`capfa` bigint(20) unsigned NOT NULL auto_increment,
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`authpwchap` varchar(32) default NULL,
|
||||
`fa` varchar(32) NOT NULL default '',
|
||||
`payyingatta` tinyint(4) NOT NULL default '0',
|
||||
`status` char(1) default NULL,
|
||||
PRIMARY KEY (`fa`,`realm`),
|
||||
KEY `capfa` (`capfa`),
|
||||
KEY `i_quadentity` (`fa`,`realm`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
|
||||
|
||||
CREATE TABLE `t5` (
|
||||
`capfa` bigint(20) unsigned NOT NULL default '0',
|
||||
`gotod` smallint(5) unsigned NOT NULL default '0',
|
||||
`orderutonsa` varchar(64) NOT NULL default '',
|
||||
PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,'');
|
||||
|
||||
CREATE TABLE `t6` (
|
||||
`capfa_parent` bigint(20) unsigned NOT NULL default '0',
|
||||
`capfa_child` bigint(20) unsigned NOT NULL default '0',
|
||||
`relatta` smallint(5) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
|
||||
|
||||
CREATE TABLE `t7` (
|
||||
`dardpo` char(15) NOT NULL default '',
|
||||
`dardtestard` tinyint(3) unsigned NOT NULL default '0',
|
||||
`FastFA` char(5) NOT NULL default '',
|
||||
`FastCode` char(6) NOT NULL default '',
|
||||
`Fastca` char(1) NOT NULL default '',
|
||||
`Fastmag` char(1) NOT NULL default '',
|
||||
`Beareratta` char(2) NOT NULL default '',
|
||||
PRIMARY KEY (`dardpo`,`dardtestard`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
|
||||
|
||||
CREATE TABLE `t8` (
|
||||
`kattjame` varchar(32) NOT NULL default '',
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`realm_entered` varchar(32) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
|
||||
`kattjame_entered` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa` varchar(32) NOT NULL default '',
|
||||
`gest` varchar(16) default NULL,
|
||||
`hassetino` varchar(16) NOT NULL default '',
|
||||
`aaaproxysessfa` varchar(255) default NULL,
|
||||
`autologonallowed` char(1) default NULL,
|
||||
`squardporoot` varchar(15) NOT NULL default '',
|
||||
`naspo` varchar(15) default NULL,
|
||||
`beareratta` char(2) default NULL,
|
||||
`fastCode` varchar(6) default NULL,
|
||||
`fastFA` varchar(5) default NULL,
|
||||
`fastca` char(1) default NULL,
|
||||
`fastmag` char(1) default NULL,
|
||||
`lastupdate` datetime default NULL,
|
||||
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`accthassetitime` int(10) unsigned default NULL,
|
||||
`acctoutputoctets` bigint(20) unsigned default NULL,
|
||||
`acctinputoctets` bigint(20) unsigned default NULL,
|
||||
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
|
||||
KEY `squardporoot` (`squardporoot`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
|
||||
|
||||
CREATE TABLE `t9` (
|
||||
`kattjame` varchar(32) NOT NULL default '',
|
||||
`kattjame_entered` varchar(32) NOT NULL default '',
|
||||
`realm` varchar(32) NOT NULL default '',
|
||||
`realm_entered` varchar(32) NOT NULL default '',
|
||||
`maturegarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa` varchar(32) NOT NULL default '',
|
||||
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
|
||||
`gest` varchar(16) default NULL,
|
||||
`hassetino` varchar(16) NOT NULL default '',
|
||||
`squardporoot` varchar(15) NOT NULL default '',
|
||||
`naspo` varchar(15) default NULL,
|
||||
`beareratta` char(2) default NULL,
|
||||
`fastCode` varchar(6) default NULL,
|
||||
`fastFA` varchar(5) default NULL,
|
||||
`fastca` char(1) default NULL,
|
||||
`fastmag` char(1) default NULL,
|
||||
`lastupdate` datetime default NULL,
|
||||
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`accthassetitime` int(10) unsigned default NULL,
|
||||
`actcoutpuocttets` bigint(20) unsigned default NULL,
|
||||
`actinputocctets` bigint(20) unsigned default NULL,
|
||||
`terminateraste` tinyint(3) unsigned default NULL,
|
||||
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
|
||||
) ENGINE=myisam DEFAULT CHARSET=latin1;
|
||||
INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
|
||||
|
||||
create table t1_c engine=ndbcluster as select * from t1;
|
||||
create table t2_c engine=ndbcluster as select * from t2;
|
||||
create table t3_c engine=ndbcluster as select * from t3;
|
||||
create table t4_c engine=ndbcluster as select * from t4;
|
||||
create table t5_c engine=ndbcluster as select * from t5;
|
||||
create table t6_c engine=ndbcluster as select * from t6;
|
||||
create table t7_c engine=ndbcluster as select * from t7;
|
||||
create table t8_c engine=ndbcluster as select * from t8;
|
||||
create table t9_c engine=ndbcluster as select * from t9;
|
||||
|
||||
|
||||
--exec $NDB_MGM --no-defaults -e "start backup" > /dev/null
|
||||
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out
|
||||
|
||||
show tables;
|
||||
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t1_c;
|
||||
select count(*)
|
||||
from (select * from t1 union
|
||||
select * from t1_c) a;
|
||||
|
||||
select count(*) from t2;
|
||||
select count(*) from t2_c;
|
||||
select count(*)
|
||||
from (select * from t2 union
|
||||
select * from t2_c) a;
|
||||
|
||||
select count(*) from t3;
|
||||
select count(*) from t3_c;
|
||||
select count(*)
|
||||
from (select * from t3 union
|
||||
select * from t3_c) a;
|
||||
|
||||
select count(*) from t4;
|
||||
select count(*) from t4_c;
|
||||
select count(*)
|
||||
from (select * from t4 union
|
||||
select * from t4_c) a;
|
||||
|
||||
select count(*) from t5;
|
||||
select count(*) from t5_c;
|
||||
select count(*)
|
||||
from (select * from t5 union
|
||||
select * from t5_c) a;
|
||||
|
||||
select count(*) from t6;
|
||||
select count(*) from t6_c;
|
||||
select count(*)
|
||||
from (select * from t6 union
|
||||
select * from t6_c) a;
|
||||
|
||||
select count(*) from t7;
|
||||
select count(*) from t7_c;
|
||||
select count(*)
|
||||
from (select * from t7 union
|
||||
select * from t7_c) a;
|
||||
|
||||
select count(*) from t8;
|
||||
select count(*) from t8_c;
|
||||
select count(*)
|
||||
from (select * from t8 union
|
||||
select * from t8_c) a;
|
||||
|
||||
select count(*) from t9;
|
||||
select count(*) from t9_c;
|
||||
select count(*)
|
||||
from (select * from t9 union
|
||||
select * from t9_c) a;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
||||
--enable_warnings
|
|
@ -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;
|
||||
|
||||
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;
|
||||
|
|
|
@ -24,7 +24,7 @@ drop table if exists t1, t2, t3, t4;
|
|||
# START SLAVE will fail because it can't read the file (mode 000)
|
||||
# (system error 13)
|
||||
--replace_result $MYSQL_TEST_DIR TESTDIR
|
||||
--error 1105
|
||||
--error 1105,1105
|
||||
start slave;
|
||||
system chmod 600 var/slave-data/master.info;
|
||||
# It will fail again because the file is empty so the slave cannot get valuable
|
||||
|
|
|
@ -19,6 +19,8 @@ flush privileges;
|
|||
|
||||
# Test of MAX_QUERIES_PER_HOUR limit
|
||||
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,,);
|
||||
connection mqph;
|
||||
select * from t1;
|
||||
|
@ -37,6 +39,7 @@ disconnect mqph2;
|
|||
|
||||
# Test of MAX_UPDATES_PER_HOUR limit
|
||||
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
|
||||
flush user_resources;
|
||||
connect (muph, localhost, mysqltest_1,,);
|
||||
connection muph;
|
||||
select * from t1;
|
||||
|
@ -60,6 +63,7 @@ disconnect muph2;
|
|||
|
||||
# Test of MAX_CONNECTIONS_PER_HOUR limit
|
||||
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
|
||||
flush user_resources;
|
||||
connect (mcph1, localhost, mysqltest_1,,);
|
||||
connection mcph1;
|
||||
select * from t1;
|
||||
|
@ -86,6 +90,7 @@ drop user mysqltest_1@localhost;
|
|||
# We need this to reset internal mqh_used variable
|
||||
flush privileges;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
|
||||
flush user_resources;
|
||||
connect (muc1, localhost, mysqltest_1,,);
|
||||
connection muc1;
|
||||
select * from t1;
|
||||
|
@ -102,6 +107,7 @@ select * from t1;
|
|||
# Changing of limit should also help (and immediately)
|
||||
connection default;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
|
||||
flush user_resources;
|
||||
connect (muc4, localhost, mysqltest_1,,);
|
||||
connection muc4;
|
||||
select * from t1;
|
||||
|
@ -127,6 +133,7 @@ set global max_user_connections= 2;
|
|||
select @@session.max_user_connections, @@global.max_user_connections;
|
||||
# Let us check that global limit works
|
||||
grant usage on *.* to mysqltest_1@localhost;
|
||||
flush user_resources;
|
||||
connect (muca1, localhost, mysqltest_1,,);
|
||||
connection muca1;
|
||||
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
|
||||
connection default;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
|
||||
flush user_resources;
|
||||
connect (muca3, localhost, mysqltest_1,,);
|
||||
connection muca3;
|
||||
select @@session.max_user_connections, @@global.max_user_connections;
|
||||
|
|
|
@ -352,6 +352,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||
MYF(0))))
|
||||
break;
|
||||
my_large_free(keycache->block_mem, MYF(0));
|
||||
keycache->block_mem= 0;
|
||||
}
|
||||
if (blocks < 8)
|
||||
{
|
||||
|
|
|
@ -275,7 +275,11 @@ static void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data)
|
|||
if (entry->data == old_data)
|
||||
{
|
||||
if (new_data == hash->default_value)
|
||||
{
|
||||
if ((*entry->prev= entry->next))
|
||||
entry->next->prev= entry->prev;
|
||||
hash_delete(&hash->hash, (byte*) entry);
|
||||
}
|
||||
else
|
||||
entry->data= new_data;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
|
|||
my_close()
|
||||
fd File sescriptor
|
||||
myf Special Flags
|
||||
|
||||
|
||||
*/
|
||||
|
||||
int my_close(File fd, myf MyFlags)
|
||||
|
@ -79,7 +79,12 @@ int my_close(File fd, myf MyFlags)
|
|||
DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags));
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_open);
|
||||
if ((err = close(fd)))
|
||||
do
|
||||
{
|
||||
err= close(fd);
|
||||
} while (err == -1 && errno == EINTR);
|
||||
|
||||
if (err)
|
||||
{
|
||||
DBUG_PRINT("error",("Got error %d on close",err));
|
||||
my_errno=errno;
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include "my_alarm.h"
|
||||
#endif
|
||||
|
||||
my_bool timed_mutexes= 0;
|
||||
|
||||
/* from my_init */
|
||||
my_string home_dir=0,my_progname=0;
|
||||
char NEAR curr_dir[FN_REFLEN]= {0},
|
||||
|
|
|
@ -40,15 +40,19 @@ int my_sync(File fd, myf my_flags)
|
|||
DBUG_ENTER("my_sync");
|
||||
DBUG_PRINT("my",("Fd: %d my_flags: %d", fd, my_flags));
|
||||
|
||||
do
|
||||
{
|
||||
#if defined(HAVE_FDATASYNC)
|
||||
res= fdatasync(fd);
|
||||
res= fdatasync(fd);
|
||||
#elif defined(HAVE_FSYNC)
|
||||
res=fsync(fd);
|
||||
res= fsync(fd);
|
||||
#elif defined(__WIN__)
|
||||
res= _commit(fd);
|
||||
#else
|
||||
res= 0; /* No sync (strange OS) */
|
||||
res= 0; /* No sync (strange OS) */
|
||||
#endif
|
||||
} while (res == -1 && errno == EINTR);
|
||||
|
||||
if (res)
|
||||
{
|
||||
if (!(my_errno= errno))
|
||||
|
|
|
@ -248,7 +248,7 @@ void thr_end_alarm(thr_alarm_t *alarmed)
|
|||
if (alarm_data->malloced)
|
||||
my_free((gptr) alarm_data,MYF(0));
|
||||
found++;
|
||||
#ifndef DBUG_OFF
|
||||
#ifdef DBUG_OFF
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
SUBDIRS = src tools . include @ndb_opt_subdirs@
|
||||
DIST_SUBDIRS = src tools include test docs
|
||||
EXTRA_DIST = config
|
||||
EXTRA_DIST = config ndbapi-examples
|
||||
|
||||
include $(top_srcdir)/ndb/config/common.mk.am
|
||||
|
||||
dist-hook:
|
||||
-rm -rf `find $(distdir) -type d -name SCCS`
|
||||
-rm -rf `find $(distdir) -type d -name old_files`
|
||||
-rm -rf `find $(distdir)/ndbapi-examples -name '*.o'`
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" != "." -a "$$subdir" != "include"; then \
|
||||
files="`find $$subdir -name '*\.h'` `find $$subdir -name '*\.hpp'`"; \
|
||||
|
|
|
@ -9,7 +9,7 @@ DOXYOUT = .doxyout
|
|||
|
||||
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 $(DOXYTMP) $(DOXYOUT)
|
||||
|
||||
|
@ -48,7 +48,7 @@ ndbapi.html: $(noinst_HEADERS)
|
|||
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
|
||||
mkdir -p $(DOXYTMP) $(DOXYOUT); \
|
||||
@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; \
|
||||
mv footer.html $(DOXYTMP); \
|
||||
(cd $(DOXYTMP) ; @DOXYGEN@ ../$(DOXYDIR)/Doxyfile.ndbapi); \
|
||||
|
|
Binary file not shown.
|
@ -1,104 +0,0 @@
|
|||
/* 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 */
|
||||
|
||||
#include <mysql.h>
|
||||
#include <ndbapi/NdbApi.hpp>
|
||||
#include <mgmapi.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* export LD_LIBRARY_PATH=../../../libmysql_r/.libs:../../../ndb/src/.libs
|
||||
*/
|
||||
|
||||
#define MGMERROR(h) \
|
||||
{ \
|
||||
fprintf(stderr, "code: %d msg: %s\n", \
|
||||
ndb_mgm_get_latest_error(h), \
|
||||
ndb_mgm_get_latest_error_msg(h)); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
#define LOGEVENTERROR(h) \
|
||||
{ \
|
||||
fprintf(stderr, "code: %d msg: %s\n", \
|
||||
ndb_logevent_get_latest_error(h), \
|
||||
ndb_logevent_get_latest_error_msg(h)); \
|
||||
exit(-1); \
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
NdbMgmHandle h;
|
||||
NdbLogEventHandle l;
|
||||
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
|
||||
struct ndb_logevent event;
|
||||
|
||||
ndb_init();
|
||||
|
||||
h= ndb_mgm_create_handle();
|
||||
if ( h == 0)
|
||||
{
|
||||
printf("Unable to create handle\n");
|
||||
exit(-1);
|
||||
}
|
||||
if (ndb_mgm_connect(h,0,0,0)) MGMERROR(h);
|
||||
|
||||
l= ndb_mgm_create_logevent_handle(h, filter);
|
||||
if ( l == 0 ) MGMERROR(h);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int timeout= 5000;
|
||||
int r= ndb_logevent_get_next(l,&event,timeout);
|
||||
if (r == 0)
|
||||
printf("No event within %d milliseconds\n", timeout);
|
||||
else if (r < 0)
|
||||
LOGEVENTERROR(l)
|
||||
else
|
||||
{
|
||||
printf("Event %d from node ID %d\n",
|
||||
event.type,
|
||||
event.source_nodeid);
|
||||
printf("Category %d, severity %d, level %d\n",
|
||||
event.category,
|
||||
event.severity,
|
||||
event.level);
|
||||
switch (event.type) {
|
||||
case NDB_LE_BackupStarted:
|
||||
printf("BackupStartded\n");
|
||||
printf("Starting node ID: %d\n", event.BackupStarted.starting_node);
|
||||
printf("Backup ID: %d\n", event.BackupStarted.backup_id);
|
||||
break;
|
||||
case NDB_LE_BackupCompleted:
|
||||
printf("BackupCompleted\n");
|
||||
printf("Backup ID: %d\n", event.BackupStarted.backup_id);
|
||||
break;
|
||||
case NDB_LE_BackupAborted:
|
||||
break;
|
||||
case NDB_LE_BackupFailedToStart:
|
||||
break;
|
||||
default:
|
||||
printf("Unexpected event\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ndb_mgm_destroy_logevent_handle(&l);
|
||||
ndb_mgm_destroy_handle(&h);
|
||||
ndb_end(0);
|
||||
return 0;
|
||||
}
|
|
@ -9,6 +9,7 @@ ndb_version.h
|
|||
|
||||
ndbapiinclude_HEADERS = \
|
||||
ndbapi/ndbapi_limits.h \
|
||||
ndbapi/ndb_opt_defaults.h \
|
||||
ndbapi/Ndb.hpp \
|
||||
ndbapi/NdbApi.hpp \
|
||||
ndbapi/NdbTransaction.hpp \
|
||||
|
|
|
@ -207,7 +207,7 @@ public:
|
|||
NotUnique = 4251,
|
||||
AllocationError = 4252,
|
||||
CreateIndexTableFailed = 4253,
|
||||
InvalidAttributeOrder = 4255
|
||||
DuplicateAttributes = 4258
|
||||
};
|
||||
|
||||
private:
|
||||
|
|
|
@ -276,7 +276,9 @@ public:
|
|||
ExtBit = NdbSqlUtil::Type::Bit,
|
||||
ExtLongvarchar = NdbSqlUtil::Type::Longvarchar,
|
||||
ExtLongvarbinary = NdbSqlUtil::Type::Longvarbinary,
|
||||
ExtTime = NdbSqlUtil::Type::Time
|
||||
ExtTime = NdbSqlUtil::Type::Time,
|
||||
ExtYear = NdbSqlUtil::Type::Year,
|
||||
ExtTimestamp = NdbSqlUtil::Type::Timestamp
|
||||
};
|
||||
|
||||
// Attribute data interpretation
|
||||
|
@ -389,6 +391,14 @@ public:
|
|||
AttributeSize = DictTabInfo::an8Bit;
|
||||
AttributeArraySize = 3 * AttributeExtLength;
|
||||
break;
|
||||
case DictTabInfo::ExtYear:
|
||||
AttributeSize = DictTabInfo::an8Bit;
|
||||
AttributeArraySize = 1 * AttributeExtLength;
|
||||
break;
|
||||
case DictTabInfo::ExtTimestamp:
|
||||
AttributeSize = DictTabInfo::an8Bit;
|
||||
AttributeArraySize = 4 * AttributeExtLength;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
};
|
||||
|
|
|
@ -121,6 +121,7 @@
|
|||
#define CFG_SHM_CHECKSUM 501
|
||||
#define CFG_SHM_KEY 502
|
||||
#define CFG_SHM_BUFFER_MEM 503
|
||||
#define CFG_SHM_SIGNUM 504
|
||||
|
||||
#define CFG_SCI_HOST1_ID_0 550
|
||||
#define CFG_SCI_HOST1_ID_1 551
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue