Merged from 5.0 (enterprise).
This commit is contained in:
commit
1c73da70ce
@ -169,7 +169,7 @@ check_cpu () {
|
||||
fi
|
||||
|
||||
cc_ver=`$cc --version | sed 1q`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
set -- `echo $cc_verno | tr '.' ' '`
|
||||
cc_major=$1
|
||||
cc_minor=$2
|
||||
|
@ -15,30 +15,49 @@ autoconf
|
||||
(cd bdb/dist && sh s_all)
|
||||
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
|
||||
|
||||
gmake=
|
||||
for x in gmake gnumake make; do
|
||||
if $x --version 2>/dev/null | grep GNU > /dev/null; then
|
||||
gmake=$x
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$gmake" ]; then
|
||||
# Our build may not depend on GNU make, but I wouldn't count on it
|
||||
echo "Please install GNU make, and ensure it is in your path as gnumake, gmake, or make" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Default to gcc for CC and CXX
|
||||
if test -z "$CXX" ; then
|
||||
export CXX=gcc
|
||||
export CXX
|
||||
CXX=gcc
|
||||
# Set some required compile options
|
||||
if test -z "$CXXFLAGS" ; then
|
||||
export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
|
||||
export CXXFLAGS
|
||||
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$CC" ; then
|
||||
export CC=gcc
|
||||
export CC
|
||||
CC=gcc
|
||||
fi
|
||||
|
||||
|
||||
# Use ccache, if available
|
||||
if ccache -V > /dev/null 2>&1
|
||||
then
|
||||
if ! (echo "$CC" | grep "ccache" > /dev/null)
|
||||
if echo "$CC" | grep -v ccache > /dev/null
|
||||
then
|
||||
export CC="ccache $CC"
|
||||
export CC
|
||||
CC="ccache $CC"
|
||||
fi
|
||||
if ! (echo "$CXX" | grep "ccache" > /dev/null)
|
||||
if echo "$CXX" | grep -v ccache > /dev/null
|
||||
then
|
||||
export CXX="ccache $CXX"
|
||||
export CXX
|
||||
CXX="ccache $CXX"
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -50,4 +69,5 @@ fi
|
||||
--enable-thread-safe-client \
|
||||
--with-extra-charsets=complex \
|
||||
--with-ndbcluster
|
||||
make
|
||||
|
||||
$gmake
|
||||
|
@ -82,18 +82,18 @@ SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805")
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805")
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
|
||||
# Disable warnings in Visual Studio 8 and above
|
||||
IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd4996")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4996")
|
||||
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /wd4996")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /wd4996")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4996")
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996")
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8")
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
|
||||
CMAKE_GENERATOR MATCHES "Visual Studio 8")
|
||||
ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
|
||||
# Settings for Visual Studio 7 and above.
|
||||
IF(MSVC)
|
||||
# replace /MDd with /MTd
|
||||
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
|
||||
STRING(REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
|
||||
@ -123,9 +123,7 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
|
||||
IF(NOT tmp_manifest)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
ENDIF(NOT tmp_manifest)
|
||||
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
|
||||
CMAKE_GENERATOR MATCHES "Visual Studio 8")
|
||||
ENDIF(MSVC)
|
||||
|
||||
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
|
||||
|
||||
|
@ -259,6 +259,10 @@ get_one_option(int optid, const struct my_option *opt,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Run a command using the shell, storing its output in the supplied dynamic
|
||||
string.
|
||||
*/
|
||||
static int run_command(char* cmd,
|
||||
DYNAMIC_STRING *ds_res)
|
||||
{
|
||||
@ -331,36 +335,16 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Try to get the full path to this exceutable
|
||||
|
||||
Return 0 if path found
|
||||
|
||||
/**
|
||||
Look for the filename of given tool, with the presumption that it is in the
|
||||
same directory as mysql_upgrade and that the same executable-searching
|
||||
mechanism will be used when we run our sub-shells with popen() later.
|
||||
*/
|
||||
|
||||
static my_bool get_full_path_to_executable(char* path)
|
||||
static void find_tool(char *tool_executable_name, const char *tool_name,
|
||||
const char *self_name)
|
||||
{
|
||||
my_bool ret;
|
||||
DBUG_ENTER("get_full_path_to_executable");
|
||||
#ifdef __WIN__
|
||||
ret= (GetModuleFileName(NULL, path, FN_REFLEN) == 0);
|
||||
#else
|
||||
/* my_readlink returns 0 if a symlink was read */
|
||||
ret= (my_readlink(path, "/proc/self/exe", MYF(0)) != 0);
|
||||
/* Might also want to try with /proc/$$/exe if the above fails */
|
||||
#endif
|
||||
DBUG_PRINT("exit", ("path: %s", path));
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
char *last_fn_libchar;
|
||||
|
||||
|
||||
/*
|
||||
Look for the tool in the same directory as mysql_upgrade.
|
||||
*/
|
||||
|
||||
static void find_tool(char *tool_path, const char *tool_name)
|
||||
{
|
||||
char path[FN_REFLEN];
|
||||
DYNAMIC_STRING ds_tmp;
|
||||
DBUG_ENTER("find_tool");
|
||||
DBUG_PRINT("enter", ("progname: %s", my_progname));
|
||||
@ -368,77 +352,59 @@ static void find_tool(char *tool_path, const char *tool_name)
|
||||
if (init_dynamic_string(&ds_tmp, "", 32, 32))
|
||||
die("Out of memory");
|
||||
|
||||
/* Initialize path with the full path to this program */
|
||||
if (get_full_path_to_executable(path))
|
||||
last_fn_libchar= strrchr(self_name, FN_LIBCHAR);
|
||||
|
||||
if (last_fn_libchar == NULL)
|
||||
{
|
||||
/*
|
||||
Easy way to get full executable path failed, try
|
||||
other methods
|
||||
mysql_upgrade was found by the shell searching the path. A sibling
|
||||
next to us should be found the same way.
|
||||
*/
|
||||
if (my_progname[0] == FN_LIBCHAR)
|
||||
{
|
||||
/* 1. my_progname contains full path */
|
||||
strmake(path, my_progname, FN_REFLEN);
|
||||
}
|
||||
else if (my_progname[0] == '.')
|
||||
{
|
||||
/* 2. my_progname contains relative path, prepend wd */
|
||||
char buf[FN_REFLEN];
|
||||
my_getwd(buf, FN_REFLEN, MYF(0));
|
||||
my_snprintf(path, FN_REFLEN, "%s%s", buf, my_progname);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 3. Just go for it and hope tool is in path */
|
||||
path[0]= 0;
|
||||
}
|
||||
strncpy(tool_executable_name, tool_name, FN_REFLEN);
|
||||
}
|
||||
|
||||
DBUG_PRINT("info", ("path: '%s'", path));
|
||||
|
||||
/* Chop off binary name (i.e mysql-upgrade) from path */
|
||||
dirname_part(path, path);
|
||||
|
||||
/*
|
||||
When running in a not yet installed build and using libtool,
|
||||
the program(mysql_upgrade) will be in .libs/ and executed
|
||||
through a libtool wrapper in order to use the dynamic libraries
|
||||
from this build. The same must be done for the tools(mysql and
|
||||
mysqlcheck). Thus if path ends in .libs/, step up one directory
|
||||
and execute the tools from there
|
||||
*/
|
||||
path[max((strlen(path)-1), 0)]= 0; /* Chop off last / */
|
||||
if (strncmp(path + dirname_length(path), ".libs", 5) == 0)
|
||||
else
|
||||
{
|
||||
DBUG_PRINT("info", ("Chopping off .libs from '%s'", path));
|
||||
int len;
|
||||
|
||||
/* Chop off .libs */
|
||||
dirname_part(path, path);
|
||||
/*
|
||||
mysql_upgrade was run absolutely or relatively. We can find a sibling
|
||||
by replacing our name after the LIBCHAR with the new tool name.
|
||||
*/
|
||||
|
||||
/*
|
||||
When running in a not yet installed build and using libtool,
|
||||
the program(mysql_upgrade) will be in .libs/ and executed
|
||||
through a libtool wrapper in order to use the dynamic libraries
|
||||
from this build. The same must be done for the tools(mysql and
|
||||
mysqlcheck). Thus if path ends in .libs/, step up one directory
|
||||
and execute the tools from there
|
||||
*/
|
||||
if (((last_fn_libchar - 6) >= self_name) &&
|
||||
(strncmp(last_fn_libchar - 5, ".libs", 5) == 0) &&
|
||||
(*(last_fn_libchar - 6) == FN_LIBCHAR))
|
||||
{
|
||||
DBUG_PRINT("info", ("Chopping off \".libs\" from end of path"));
|
||||
last_fn_libchar -= 6;
|
||||
}
|
||||
|
||||
len= last_fn_libchar - self_name;
|
||||
|
||||
my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
|
||||
len, self_name, FN_LIBCHAR, tool_name);
|
||||
}
|
||||
|
||||
|
||||
DBUG_PRINT("info", ("path: '%s'", path));
|
||||
|
||||
/* Format name of the tool to search for */
|
||||
fn_format(tool_path, tool_name,
|
||||
path, "", MYF(MY_REPLACE_DIR));
|
||||
|
||||
verbose("Looking for '%s' in: %s", tool_name, tool_path);
|
||||
|
||||
/* Make sure the tool exists */
|
||||
if (my_access(tool_path, F_OK) != 0)
|
||||
die("Can't find '%s'", tool_path);
|
||||
verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
|
||||
|
||||
/*
|
||||
Make sure it can be executed
|
||||
*/
|
||||
if (run_tool(tool_path,
|
||||
if (run_tool(tool_executable_name,
|
||||
&ds_tmp, /* Get output from command, discard*/
|
||||
"--help",
|
||||
"2>&1",
|
||||
IF_WIN("> NUL", "> /dev/null"),
|
||||
NULL))
|
||||
die("Can't execute '%s'", tool_path);
|
||||
die("Can't execute '%s'", tool_executable_name);
|
||||
|
||||
dynstr_free(&ds_tmp);
|
||||
|
||||
@ -748,11 +714,20 @@ static const char *load_default_groups[]=
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char self_name[FN_REFLEN];
|
||||
|
||||
MY_INIT(argv[0]);
|
||||
#ifdef __NETWARE__
|
||||
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
|
||||
#endif
|
||||
|
||||
#if __WIN__
|
||||
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)
|
||||
#endif
|
||||
{
|
||||
strncpy(self_name, argv[0], FN_REFLEN);
|
||||
}
|
||||
|
||||
if (init_dynamic_string(&ds_args, "", 512, 256))
|
||||
die("Out of memory");
|
||||
|
||||
@ -774,10 +749,10 @@ int main(int argc, char **argv)
|
||||
dynstr_append(&ds_args, " ");
|
||||
|
||||
/* Find mysql */
|
||||
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"));
|
||||
find_tool(mysql_path, IF_WIN("mysql.exe", "mysql"), self_name);
|
||||
|
||||
/* Find mysqlcheck */
|
||||
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"));
|
||||
find_tool(mysqlcheck_path, IF_WIN("mysqlcheck.exe", "mysqlcheck"), self_name);
|
||||
|
||||
/*
|
||||
Read the mysql_upgrade_info file to check if mysql_upgrade
|
||||
|
@ -488,9 +488,14 @@ static int process_all_tables_in_db(char *database)
|
||||
LINT_INIT(res);
|
||||
if (use_db(database))
|
||||
return 1;
|
||||
if (mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") ||
|
||||
!((res= mysql_store_result(sock))))
|
||||
if ((mysql_query(sock, "SHOW /*!50002 FULL*/ TABLES") &&
|
||||
mysql_query(sock, "SHOW TABLES")) ||
|
||||
!(res= mysql_store_result(sock)))
|
||||
{
|
||||
my_printf_error(0, "Error: Couldn't get table list for database %s: %s",
|
||||
MYF(0), database, mysql_error(sock));
|
||||
return 1;
|
||||
}
|
||||
|
||||
num_columns= mysql_num_fields(res);
|
||||
|
||||
|
@ -1836,7 +1836,13 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
||||
fprintf(sql_file, ",\n %s %s",
|
||||
quote_name(row[0], name_buff, 0), row[1]);
|
||||
}
|
||||
fprintf(sql_file, "\n) */;\n");
|
||||
/*
|
||||
Stand-in tables are always MyISAM tables as the default
|
||||
engine might have a column-limit that's lower than the
|
||||
number of columns in the view, and MyISAM support is
|
||||
guaranteed to be in the server anyway.
|
||||
*/
|
||||
fprintf(sql_file, "\n) ENGINE=MyISAM */;\n");
|
||||
check_io(sql_file);
|
||||
}
|
||||
}
|
||||
|
85
configure.in
85
configure.in
@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
|
||||
AC_CANONICAL_SYSTEM
|
||||
# The Docs Makefile.am parses this line!
|
||||
# remember to also change ndb version below and update version.c in ndb
|
||||
AM_INIT_AUTOMAKE(mysql, 5.0.69)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.0.75)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
|
||||
# ndb version
|
||||
NDB_VERSION_MAJOR=5
|
||||
NDB_VERSION_MINOR=0
|
||||
NDB_VERSION_BUILD=69
|
||||
NDB_VERSION_BUILD=75
|
||||
NDB_VERSION_STATUS=""
|
||||
|
||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||
@ -409,7 +409,7 @@ fi
|
||||
MYSQL_PROG_AR
|
||||
|
||||
# libmysqlclient versioning when linked with GNU ld.
|
||||
if $LD --version 2>/dev/null|grep -q GNU; then
|
||||
if $LD --version 2>/dev/null|grep GNU > /dev/null; then
|
||||
LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
|
||||
AC_CONFIG_FILES(libmysql/libmysql.ver)
|
||||
fi
|
||||
@ -437,11 +437,13 @@ dnl Find paths to some shell programs
|
||||
AC_PATH_PROG(LN, ln, ln)
|
||||
# This must be able to take a -f flag like normal unix ln.
|
||||
AC_PATH_PROG(LN_CP_F, ln, ln)
|
||||
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
|
||||
# If ln -f does not exists use -s (AFS systems)
|
||||
if test -n "$LN_CP_F"; then
|
||||
LN_CP_F="$LN_CP_F -s"
|
||||
fi
|
||||
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
|
||||
:
|
||||
else
|
||||
# If ln -f does not exists use -s (AFS systems)
|
||||
if test -n "$LN_CP_F"; then
|
||||
LN_CP_F="$LN_CP_F -s"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(MV, mv, mv)
|
||||
@ -504,46 +506,50 @@ then
|
||||
fi
|
||||
AC_SUBST(ICHECK)
|
||||
|
||||
# Lock for PS
|
||||
# Look for PS usage. We use double dollar-signs in FIND_PROC because this
|
||||
# value is written to a makefile, which interprets away one level of
|
||||
# dollar-signs. So, interpretation stages are m4 and then shell in autoconf,
|
||||
# then Make, then shell. The autoconf substitution uses single quotes, so
|
||||
# no unprotected single quotes should appear in the expression.
|
||||
AC_PATH_PROG(PS, ps, ps)
|
||||
AC_MSG_CHECKING("how to check if pid exists")
|
||||
PS=$ac_cv_path_PS
|
||||
# Linux style
|
||||
if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
|
||||
if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
|
||||
# Solaris
|
||||
elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null
|
||||
elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
|
||||
# BSD style
|
||||
elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null
|
||||
elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
|
||||
# SysV style
|
||||
elif $PS -ef 2> /dev/null | grep $0 > /dev/null
|
||||
elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS -ef | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
|
||||
# Do anybody use this?
|
||||
elif $PS $$ 2> /dev/null | grep $0 > /dev/null
|
||||
elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null
|
||||
then
|
||||
FIND_PROC="$PS \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
|
||||
else
|
||||
case $SYSTEM_TYPE in
|
||||
*freebsd*|*dragonfly*)
|
||||
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
|
||||
FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null"
|
||||
;;
|
||||
*darwin*)
|
||||
FIND_PROC="$PS -uaxww | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
|
||||
;;
|
||||
*cygwin*)
|
||||
FIND_PROC="$PS -e | grep -v grep | grep \$\$MYSQLD | grep \" \$\$PID \" > /dev/null"
|
||||
FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
|
||||
;;
|
||||
*netware*)
|
||||
FIND_PROC=
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
|
||||
AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(FIND_PROC)
|
||||
@ -1949,14 +1955,16 @@ MYSQL_CHECK_IN_ADDR_T
|
||||
# Do the c++ compiler have a bool type
|
||||
MYSQL_CXX_BOOL
|
||||
# Check some common bugs with gcc 2.8.# on sparc
|
||||
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
|
||||
MYSQL_CHECK_LONGLONG_TO_FLOAT
|
||||
if test "$ac_cv_conv_longlong_to_float" != "yes"
|
||||
then
|
||||
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
|
||||
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
|
||||
:
|
||||
else
|
||||
MYSQL_CHECK_LONGLONG_TO_FLOAT
|
||||
if test "$ac_cv_conv_longlong_to_float" != "yes"
|
||||
then
|
||||
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
|
||||
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
|
||||
again])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
|
||||
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
|
||||
@ -2737,8 +2745,10 @@ then
|
||||
AC_SUBST(THREAD_LOBJECTS)
|
||||
fi
|
||||
|
||||
if test "$with_server" != "no"
|
||||
if test "$with_server" = "no"
|
||||
then
|
||||
AM_CONDITIONAL([BUILD_INNODB_TOOLS], [false])
|
||||
else
|
||||
server_scripts="mysqld_safe mysql_install_db"
|
||||
sql_server_dirs="strings mysys dbug extra regex"
|
||||
|
||||
@ -2823,11 +2833,20 @@ EOF
|
||||
AC_CONFIG_SUBDIRS(innobase)
|
||||
fi
|
||||
|
||||
# "innochecksum" is not in the "innobase/" subdirectory, but should be switched
|
||||
AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$have_innodb" = Xyes])
|
||||
|
||||
case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in
|
||||
*solaris*-i?86-no-yes)
|
||||
# ndb fail for whatever strange reason to link Sun Forte/x86
|
||||
# unless using incremental linker
|
||||
CXXFLAGS="$CXXFLAGS -xildon"
|
||||
if $CC -xildon 2>&1 | grep "illegal option" >/dev/null
|
||||
then
|
||||
# This Solaris ld does not support -xildon
|
||||
true
|
||||
else
|
||||
# ndb fail for whatever strange reason to link Sun Forte/x86
|
||||
# unless using incremental linker
|
||||
CXXFLAGS="$CXXFLAGS -xildon"
|
||||
fi
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
|
@ -45,7 +45,12 @@ $(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 innochecksum
|
||||
resolve_stack_dump mysql_waitpid
|
||||
# "innochecksum" should be switched
|
||||
if BUILD_INNODB_TOOLS
|
||||
bin_PROGRAMS += innochecksum
|
||||
endif
|
||||
|
||||
noinst_PROGRAMS = charset2html
|
||||
EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
|
@ -185,11 +185,36 @@ static const char *get_ha_error_msg(int code)
|
||||
}
|
||||
|
||||
|
||||
#if defined(__WIN__)
|
||||
static my_bool print_win_error_msg(DWORD error, my_bool verbose)
|
||||
{
|
||||
LPTSTR s;
|
||||
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, error, 0, (LPTSTR)&s, 0,
|
||||
NULL))
|
||||
{
|
||||
if (verbose)
|
||||
printf("Win32 error code %d: %s", error, s);
|
||||
else
|
||||
puts(s);
|
||||
LocalFree(s);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
int error,code,found;
|
||||
const char *msg;
|
||||
char *unknown_error = 0;
|
||||
#if defined(__WIN__)
|
||||
my_bool skip_win_message= 0;
|
||||
#endif
|
||||
MY_INIT(argv[0]);
|
||||
|
||||
if (get_options(&argc,&argv))
|
||||
@ -286,8 +311,15 @@ int main(int argc,char *argv[])
|
||||
/* Error message still not found, look in handler error codes */
|
||||
if (!(msg=get_ha_error_msg(code)))
|
||||
{
|
||||
fprintf(stderr,"Illegal error code: %d\n",code);
|
||||
error=1;
|
||||
#if defined(__WIN__)
|
||||
if (!(skip_win_message= !print_win_error_msg((DWORD)code, verbose)))
|
||||
{
|
||||
#endif
|
||||
fprintf(stderr,"Illegal error code: %d\n",code);
|
||||
error=1;
|
||||
#if defined(__WIN__)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -298,6 +330,10 @@ int main(int argc,char *argv[])
|
||||
puts(msg);
|
||||
}
|
||||
}
|
||||
#if defined(__WIN__)
|
||||
if (!skip_win_message)
|
||||
print_win_error_msg((DWORD)code, verbose);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,268 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="taocrypt"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\debug_obj"
|
||||
IntermediateDirectory=".\debug_obj"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories="include,mySTL"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
ExceptionHandling="FALSE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\debug_obj/taocrypt.pch"
|
||||
AssemblerListingLocation=".\debug_obj/"
|
||||
ObjectFile=".\debug_obj/"
|
||||
ProgramDataBaseFileName=".\debug_obj/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\debug_obj\taocrypt.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\release_obj"
|
||||
IntermediateDirectory=".\release_obj"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories="include,mySTL"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\release_obj/taocrypt.pch"
|
||||
AssemblerListingLocation=".\release_obj/"
|
||||
ObjectFile=".\release_obj/"
|
||||
ProgramDataBaseFileName=".\release_obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\release_obj\taocrypt.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="src\aes.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\aestables.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\algebra.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\arc4.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\asn.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\coding.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\des.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\dh.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\dsa.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\file.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\hash.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\integer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\md2.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\md4.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\md5.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\misc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\random.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\ripemd.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\rsa.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\sha.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="include\aes.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\algebra.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\arc4.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\asn.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\block.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\coding.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\des.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\dh.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\dsa.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\error.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\file.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\hash.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\hmac.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\integer.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\md2.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\md4.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\md5.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\misc.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\modarith.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\modes.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\random.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\ripemd.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\rsa.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\sha.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,211 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="yassl"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\debug_obj"
|
||||
IntermediateDirectory=".\debug_obj"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,taocrypt\mySTL"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;YASSL_PREFIX"
|
||||
ExceptionHandling="FALSE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\debug_obj/yassl.pch"
|
||||
AssemblerListingLocation=".\debug_obj/"
|
||||
ObjectFile=".\debug_obj/"
|
||||
ProgramDataBaseFileName=".\debug_obj/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\debug_obj\yassl.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\release_obj"
|
||||
IntermediateDirectory=".\release_obj"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="2"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,taocrypt\mySTL"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;YASSL_PREFIX"
|
||||
StringPooling="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\release_obj/yassl.pch"
|
||||
AssemblerListingLocation=".\release_obj/"
|
||||
ObjectFile=".\release_obj/"
|
||||
ProgramDataBaseFileName=".\release_obj/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile=".\release_obj\yassl.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath="src\buffer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\cert_wrapper.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\crypto_wrapper.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\handshake.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\lock.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\log.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\socket_wrapper.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\ssl.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\timer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\yassl_error.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\yassl_imp.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="src\yassl_int.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath="include\buffer.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\cert_wrapper.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\crypto_wrapper.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\factory.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\handshake.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\lock.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\log.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\socket_wrapper.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\timer.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\yassl_error.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\yassl_imp.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\yassl_int.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="include\yassl_types.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -267,6 +267,10 @@ extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
|
||||
extern my_off_t myisam_max_temp_length;
|
||||
extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
|
||||
|
||||
/* usually used to check if a symlink points into the mysql data home */
|
||||
/* which is normally forbidden */
|
||||
extern int (*myisam_test_invalid_symlink)(const char *filename);
|
||||
|
||||
/* Prototypes for myisam-functions */
|
||||
|
||||
extern int mi_close(struct st_myisam_info *file);
|
||||
|
@ -2260,6 +2260,7 @@ buf_print(void)
|
||||
ut_a(buf_validate());
|
||||
}
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/*************************************************************************
|
||||
Returns the number of latched pages in the buffer pool. */
|
||||
|
||||
@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void)
|
||||
mutex_exit(&(buf_pool->mutex));
|
||||
return fixed_pages_number;
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/*************************************************************************
|
||||
Returns the number of pending buf pool ios. */
|
||||
|
@ -3554,7 +3554,7 @@ loop:
|
||||
|
||||
ptr = dict_accept(ptr, "FOREIGN", &success);
|
||||
|
||||
if (!success) {
|
||||
if (!success || !ib_isspace(*ptr)) {
|
||||
|
||||
goto loop;
|
||||
}
|
||||
|
@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */
|
||||
void
|
||||
buf_print(void);
|
||||
/*============*/
|
||||
|
||||
/*************************************************************************
|
||||
Returns the number of latched pages in the buffer pool. */
|
||||
|
||||
ulint
|
||||
buf_get_latched_pages_number(void);
|
||||
/*==============================*/
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
/************************************************************************
|
||||
Prints a page to stderr. */
|
||||
|
||||
@ -503,12 +511,7 @@ void
|
||||
buf_page_print(
|
||||
/*===========*/
|
||||
byte* read_buf); /* in: a database page */
|
||||
/*************************************************************************
|
||||
Returns the number of latched pages in the buffer pool. */
|
||||
|
||||
ulint
|
||||
buf_get_latched_pages_number(void);
|
||||
/*==============================*/
|
||||
/*************************************************************************
|
||||
Returns the number of pending buf pool ios. */
|
||||
|
||||
|
@ -531,7 +531,9 @@ struct export_var_struct{
|
||||
ulint innodb_buffer_pool_pages_dirty;
|
||||
ulint innodb_buffer_pool_pages_misc;
|
||||
ulint innodb_buffer_pool_pages_free;
|
||||
#ifdef UNIV_DEBUG
|
||||
ulint innodb_buffer_pool_pages_latched;
|
||||
#endif /* UNIV_DEBUG */
|
||||
ulint innodb_buffer_pool_read_requests;
|
||||
ulint innodb_buffer_pool_reads;
|
||||
ulint innodb_buffer_pool_wait_free;
|
||||
|
@ -237,6 +237,7 @@ trx_undo_set_state_at_finish(
|
||||
/*=========================*/
|
||||
/* out: undo log segment header page,
|
||||
x-latched */
|
||||
trx_rseg_t* rseg, /* in: rollback segment memory object */
|
||||
trx_t* trx, /* in: transaction */
|
||||
trx_undo_t* undo, /* in: undo log memory copy */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
@ -1803,7 +1803,9 @@ srv_export_innodb_status(void)
|
||||
export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
|
||||
export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
|
||||
export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
|
||||
#ifdef UNIV_DEBUG
|
||||
export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
|
||||
#endif /* UNIV_DEBUG */
|
||||
export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
|
||||
export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
|
||||
UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
|
||||
|
@ -761,8 +761,8 @@ trx_commit_off_kernel(
|
||||
mutex_enter(&(rseg->mutex));
|
||||
|
||||
if (trx->insert_undo != NULL) {
|
||||
trx_undo_set_state_at_finish(trx, trx->insert_undo,
|
||||
&mtr);
|
||||
trx_undo_set_state_at_finish(
|
||||
rseg, trx, trx->insert_undo, &mtr);
|
||||
}
|
||||
|
||||
undo = trx->update_undo;
|
||||
@ -777,8 +777,8 @@ trx_commit_off_kernel(
|
||||
because only a single OS thread is allowed to do the
|
||||
transaction commit for this transaction. */
|
||||
|
||||
update_hdr_page = trx_undo_set_state_at_finish(trx,
|
||||
undo, &mtr);
|
||||
update_hdr_page = trx_undo_set_state_at_finish(
|
||||
rseg, trx, undo, &mtr);
|
||||
|
||||
/* We have to do the cleanup for the update log while
|
||||
holding the rseg mutex because update log headers
|
||||
|
@ -1724,6 +1724,7 @@ trx_undo_set_state_at_finish(
|
||||
/*=========================*/
|
||||
/* out: undo log segment header page,
|
||||
x-latched */
|
||||
trx_rseg_t* rseg, /* in: rollback segment memory object */
|
||||
trx_t* trx __attribute__((unused)), /* in: transaction */
|
||||
trx_undo_t* undo, /* in: undo log memory copy */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
@ -1732,8 +1733,10 @@ trx_undo_set_state_at_finish(
|
||||
trx_upagef_t* page_hdr;
|
||||
page_t* undo_page;
|
||||
ulint state;
|
||||
|
||||
ut_ad(trx && undo && mtr);
|
||||
|
||||
ut_ad(trx);
|
||||
ut_ad(undo);
|
||||
ut_ad(mtr);
|
||||
|
||||
if (undo->id >= TRX_RSEG_N_SLOTS) {
|
||||
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
|
||||
@ -1747,9 +1750,23 @@ trx_undo_set_state_at_finish(
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
||||
if (undo->size == 1 && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
|
||||
< TRX_UNDO_PAGE_REUSE_LIMIT) {
|
||||
state = TRX_UNDO_CACHED;
|
||||
if (undo->size == 1
|
||||
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
|
||||
< TRX_UNDO_PAGE_REUSE_LIMIT) {
|
||||
|
||||
/* This is a heuristic to avoid the problem of all UNDO
|
||||
slots ending up in one of the UNDO lists. Previously if
|
||||
the server crashed with all the slots in one of the lists,
|
||||
transactions that required the slots of a different type
|
||||
would fail for lack of slots. */
|
||||
|
||||
if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
|
||||
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
|
||||
|
||||
state = TRX_UNDO_CACHED;
|
||||
} else {
|
||||
state = TRX_UNDO_TO_FREE;
|
||||
}
|
||||
|
||||
} else if (undo->type == TRX_UNDO_INSERT) {
|
||||
|
||||
@ -1759,7 +1776,7 @@ trx_undo_set_state_at_finish(
|
||||
}
|
||||
|
||||
undo->state = state;
|
||||
|
||||
|
||||
mlog_write_ulint(seg_hdr + TRX_UNDO_STATE, state, MLOG_2BYTES, mtr);
|
||||
|
||||
return(undo_page);
|
||||
|
@ -89,9 +89,20 @@ BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called,
|
||||
UNREFERENCED_PARAMETER(lpReserved);
|
||||
} /* LibMain */
|
||||
|
||||
|
||||
static BOOL do_libmain;
|
||||
int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved)
|
||||
{
|
||||
return LibMain(hInst,ul_reason_being_called,lpReserved);
|
||||
/*
|
||||
Unless environment variable LIBMYSQL_DLLINIT is set, do nothing.
|
||||
The environment variable is checked once, during the first call to DllMain()
|
||||
(in DLL_PROCESS_ATTACH hook).
|
||||
*/
|
||||
if (ul_reason_being_called == DLL_PROCESS_ATTACH)
|
||||
do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL);
|
||||
if (do_libmain)
|
||||
return LibMain(hInst,ul_reason_being_called,lpReserved);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#elif defined(WINDOWS)
|
||||
|
@ -21,5 +21,11 @@ man1_MANS = @man1_files@
|
||||
man8_MANS = @man8_files@
|
||||
EXTRA_DIST = $(man1_MANS) $(man8_MANS)
|
||||
|
||||
# 1) not needed in Unix binary packages,
|
||||
# 2) programs not generated in 5.0:
|
||||
install-data-hook:
|
||||
rm -f $(DESTDIR)$(manlibdir)/man1/make_win_*
|
||||
rm -f $(DESTDIR)$(manlibdir)/man1/ndb_print_*
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -1732,7 +1732,7 @@ err:
|
||||
DATA_TMP_EXT, share->base.raid_chunks,
|
||||
(param->testflag & T_BACKUP_DATA ?
|
||||
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
|
||||
mi_open_datafile(info,share,-1))
|
||||
mi_open_datafile(info,share,name,-1))
|
||||
got_error=1;
|
||||
}
|
||||
}
|
||||
@ -2519,7 +2519,7 @@ err:
|
||||
DATA_TMP_EXT, share->base.raid_chunks,
|
||||
(param->testflag & T_BACKUP_DATA ?
|
||||
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
|
||||
mi_open_datafile(info,share,-1))
|
||||
mi_open_datafile(info,share,name,-1))
|
||||
got_error=1;
|
||||
}
|
||||
}
|
||||
@ -3050,7 +3050,7 @@ err:
|
||||
DATA_TMP_EXT, share->base.raid_chunks,
|
||||
(param->testflag & T_BACKUP_DATA ?
|
||||
MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
|
||||
mi_open_datafile(info,share,-1))
|
||||
mi_open_datafile(info,share,name,-1))
|
||||
got_error=1;
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||
packed=(packed+7)/8;
|
||||
if (pack_reclength != INT_MAX32)
|
||||
pack_reclength+= reclength+packed +
|
||||
test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_PACK_RECORD));
|
||||
test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_OPTION_PACK_RECORD));
|
||||
min_pack_length+=packed;
|
||||
|
||||
if (!ci->data_file_length && ci->max_rows)
|
||||
|
@ -74,7 +74,7 @@ MI_INFO *test_if_reopen(char *filename)
|
||||
|
||||
MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
||||
{
|
||||
int lock_error,kfile,open_mode,save_errno,have_rtree=0;
|
||||
int lock_error,kfile,open_mode,save_errno,have_rtree=0, realpath_err;
|
||||
uint i,j,len,errpos,head_length,base_pos,offset,info_length,keys,
|
||||
key_parts,unique_key_parts,fulltext_keys,uniques;
|
||||
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
|
||||
@ -94,7 +94,16 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
||||
head_length=sizeof(share_buff.state.header);
|
||||
bzero((byte*) &info,sizeof(info));
|
||||
|
||||
my_realpath(name_buff, fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0));
|
||||
realpath_err= my_realpath(name_buff,
|
||||
fn_format(org_name,name,"",MI_NAME_IEXT,4),MYF(0));
|
||||
if (my_is_symlink(org_name) &&
|
||||
(realpath_err || (*myisam_test_invalid_symlink)(name_buff)))
|
||||
{
|
||||
my_errno= HA_WRONG_CREATE_OPTION;
|
||||
DBUG_RETURN (NULL);
|
||||
}
|
||||
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_myisam);
|
||||
if (!(old_info=test_if_reopen(name_buff)))
|
||||
{
|
||||
@ -463,7 +472,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
||||
lock_error=1; /* Database unlocked */
|
||||
}
|
||||
|
||||
if (mi_open_datafile(&info, share, -1))
|
||||
if (mi_open_datafile(&info, share, name, -1))
|
||||
goto err;
|
||||
errpos=5;
|
||||
|
||||
@ -534,7 +543,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
||||
my_errno=EACCES; /* Can't open in write mode */
|
||||
goto err;
|
||||
}
|
||||
if (mi_open_datafile(&info, share, old_info->dfile))
|
||||
if (mi_open_datafile(&info, share, name, old_info->dfile))
|
||||
goto err;
|
||||
errpos=5;
|
||||
have_rtree= old_info->rtree_recursion_state != NULL;
|
||||
@ -1191,12 +1200,30 @@ The argument file_to_dup is here for the future if there would on some OS
|
||||
exist a dup()-like call that would give us two different file descriptors.
|
||||
*************************************************************************/
|
||||
|
||||
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup __attribute__((unused)))
|
||||
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
|
||||
File file_to_dup __attribute__((unused)))
|
||||
{
|
||||
char *data_name= share->data_file_name;
|
||||
char real_data_name[FN_REFLEN];
|
||||
|
||||
if (org_name)
|
||||
{
|
||||
fn_format(real_data_name,org_name,"",MI_NAME_DEXT,4);
|
||||
if (my_is_symlink(real_data_name))
|
||||
{
|
||||
if (my_realpath(real_data_name, real_data_name, MYF(0)) ||
|
||||
(*myisam_test_invalid_symlink)(real_data_name))
|
||||
{
|
||||
my_errno= HA_WRONG_CREATE_OPTION;
|
||||
return 1;
|
||||
}
|
||||
data_name= real_data_name;
|
||||
}
|
||||
}
|
||||
#ifdef USE_RAID
|
||||
if (share->base.raid_type)
|
||||
{
|
||||
info->dfile=my_raid_open(share->data_file_name,
|
||||
info->dfile=my_raid_open(data_name,
|
||||
share->mode | O_SHARE,
|
||||
share->base.raid_type,
|
||||
share->base.raid_chunks,
|
||||
@ -1205,8 +1232,7 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup __attr
|
||||
}
|
||||
else
|
||||
#endif
|
||||
info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
|
||||
MYF(MY_WME));
|
||||
info->dfile=my_open(data_name, share->mode | O_SHARE, MYF(MY_WME));
|
||||
return info->dfile >= 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,15 @@ my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
|
||||
ulong myisam_bulk_insert_tree_size=8192*1024;
|
||||
ulong myisam_data_pointer_size=4;
|
||||
|
||||
|
||||
static int always_valid(const char *filename __attribute__((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int (*myisam_test_invalid_symlink)(const char *filename)= always_valid;
|
||||
|
||||
|
||||
/*
|
||||
read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
|
||||
Position is , == , >= , <= , > , <
|
||||
|
@ -1039,7 +1039,7 @@ static int myisamchk(MI_CHECK *param, my_string filename)
|
||||
error|=change_to_newfile(filename,MI_NAME_DEXT,DATA_TMP_EXT,
|
||||
raid_chunks,
|
||||
MYF(0));
|
||||
if (mi_open_datafile(info,info->s, -1))
|
||||
if (mi_open_datafile(info,info->s, NULL, -1))
|
||||
error=1;
|
||||
param->out_flag&= ~O_NEW_DATA; /* We are using new datafile */
|
||||
param->read_cache.file=info->dfile;
|
||||
|
@ -739,7 +739,9 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
|
||||
|
||||
extern MI_INFO *test_if_reopen(char *filename);
|
||||
my_bool check_table_is_closed(const char *name, const char *where);
|
||||
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
|
||||
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *orn_name,
|
||||
File file_to_dup);
|
||||
|
||||
int mi_open_keyfile(MYISAM_SHARE *share);
|
||||
void mi_setup_functions(register MYISAM_SHARE *share);
|
||||
|
||||
|
@ -389,7 +389,7 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length)
|
||||
info->rtree_recursion_depth = -1;
|
||||
info->buff_used = 1;
|
||||
|
||||
return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0);
|
||||
return rtree_get_req(info, keyinfo, key_length, root, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -436,7 +436,7 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return rtree_get_req(info, &keyinfo[keynr], key_length, root, 0);
|
||||
return rtree_get_req(info, keyinfo, key_length, root, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,12 @@
|
||||
#
|
||||
# Dump all global variables
|
||||
#
|
||||
show global variables;
|
||||
SHOW GLOBAL VARIABLES WHERE variable_name != 'timestamp';
|
||||
|
||||
#
|
||||
# Dump all databases
|
||||
#
|
||||
show databases;
|
||||
SHOW DATABASES;
|
||||
|
||||
#
|
||||
# Dump the "test" database, all it's tables and their data
|
||||
@ -29,23 +29,23 @@ show databases;
|
||||
#
|
||||
--exec $MYSQL_DUMP --skip-comments --no-data mysql
|
||||
use mysql;
|
||||
select * from columns_priv;
|
||||
select * from db order by host, db, user;
|
||||
select * from func;
|
||||
select * from help_category;
|
||||
select * from help_keyword;
|
||||
select * from help_relation;
|
||||
select * from help_relation;
|
||||
select * from host;
|
||||
select * from proc;
|
||||
select * from procs_priv;
|
||||
select * from tables_priv;
|
||||
select * from time_zone;
|
||||
select * from time_zone_leap_second;
|
||||
select * from time_zone_name;
|
||||
select * from time_zone_transition;
|
||||
select * from time_zone_transition_type;
|
||||
select * from user;
|
||||
SELECT * FROM columns_priv;
|
||||
SELECT * FROM db ORDER BY host, db, user;
|
||||
SELECT * FROM func;
|
||||
SELECT * FROM help_category;
|
||||
SELECT * FROM help_keyword;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM help_relation;
|
||||
SELECT * FROM host;
|
||||
SELECT * FROM proc;
|
||||
SELECT * FROM procs_priv;
|
||||
SELECT * FROM tables_priv;
|
||||
SELECT * FROM time_zone;
|
||||
SELECT * FROM time_zone_leap_second;
|
||||
SELECT * FROM time_zone_name;
|
||||
SELECT * FROM time_zone_transition;
|
||||
SELECT * FROM time_zone_transition_type;
|
||||
SELECT * FROM user;
|
||||
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 1 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter > $MYSQLTEST_VARDIR/tmp/tmp.dat
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults $ndb_restore_opts -b $the_backup_id -n 2 $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id $ndb_restore_filter >> $MYSQLTEST_VARDIR/tmp/tmp.dat
|
||||
--exec sort $MYSQLTEST_VARDIR/tmp/tmp.dat
|
||||
--exec rm -f $MYSQLTEST_VARDIR/tmp/tmp.dat
|
||||
--error 0,1
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/tmp.dat
|
||||
--let ndb_restore_opts=
|
||||
--let ndb_restore_filter=
|
||||
|
@ -3505,7 +3505,16 @@ sub run_testcase ($) {
|
||||
{
|
||||
mtr_timer_stop_all($glob_timers);
|
||||
mtr_report("\nServers started, exiting");
|
||||
exit(0);
|
||||
if ($glob_win32_perl)
|
||||
{
|
||||
#ActiveState perl hangs when using normal exit, use POSIX::_exit instead
|
||||
use POSIX qw[ _exit ];
|
||||
POSIX::_exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -582,4 +582,35 @@ master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4
|
||||
master-bin.000001 98 Query 1 219 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
|
||||
master-bin.000001 219 Query 1 343 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
|
||||
master-bin.000001 343 Query 1 419 use `test`; drop table t1
|
||||
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||
USE bug39182;
|
||||
CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
|
||||
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE s1 VARCHAR(255);
|
||||
SET s1= "test";
|
||||
CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
|
||||
SELECT
|
||||
COLLATION(NAME_CONST('s1', _utf8'test')) c1,
|
||||
COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
|
||||
COLLATION(s1) c3,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
|
||||
COERCIBILITY(s1) d3;
|
||||
DROP TEMPORARY TABLE tmp1;
|
||||
END//
|
||||
CALL p1();
|
||||
c1 c2 c3 d1 d2 d3
|
||||
utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
|
||||
SHOW BINLOG EVENTS FROM 1285;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 1285 Query 1 1483 use `bug39182`; CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%")
|
||||
master-bin.000001 1483 Query 1 1575 use `bug39182`; DROP TEMPORARY TABLE tmp1
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
End of 5.0 tests
|
||||
|
@ -1,3 +1,4 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (
|
||||
`a&b` int,
|
||||
`a<b` int,
|
||||
|
@ -90,4 +90,9 @@ Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat(_latin1'0',`test`.`t2`.`a`,_latin1'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a TIMESTAMP);
|
||||
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
|
||||
SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1546,4 +1546,17 @@ SHOW INDEX FROM t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
|
||||
DROP TABLE t1;
|
||||
create user mysqltest_1@'test@test';
|
||||
ERROR HY000: Malformed hostname (illegal symbol: '@')
|
||||
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
|
||||
INSERT IGNORE INTO t1 (b) VALUES (5);
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
ERROR 23000: Duplicate entry '1' for key 1
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -40,6 +40,6 @@ IN ind DECIMAL(10,2))
|
||||
BEGIN
|
||||
INSERT INTO t4 VALUES (ins1, ins2, ind);
|
||||
END
|
||||
master-bin.000001 777 Query 1 988 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
|
||||
master-bin.000001 988 Query 1 1077 use `test`; DROP PROCEDURE bug18293
|
||||
master-bin.000001 1077 Query 1 1156 use `test`; DROP TABLE t4
|
||||
master-bin.000001 777 Query 1 1044 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
|
||||
master-bin.000001 1044 Query 1 1133 use `test`; DROP PROCEDURE bug18293
|
||||
master-bin.000001 1133 Query 1 1212 use `test`; DROP TABLE t4
|
||||
|
11
mysql-test/r/ctype_filesystem.result
Normal file
11
mysql-test/r/ctype_filesystem.result
Normal file
@ -0,0 +1,11 @@
|
||||
SET CHARACTER SET utf8;
|
||||
SHOW VARIABLES like 'character_sets_dir';
|
||||
Variable_name Value
|
||||
character_sets_dir MYSQL_TEST_DIR/ß/
|
||||
SHOW VARIABLES like 'character_set_filesystem';
|
||||
Variable_name Value
|
||||
character_set_filesystem latin1
|
||||
SHOW VARIABLES like 'character_set_client';
|
||||
Variable_name Value
|
||||
character_set_client utf8
|
||||
SET CHARACTER SET default;
|
@ -1813,3 +1813,35 @@ select hex(_utf8 B'001111111111');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
select (_utf8 X'616263FF');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL);
|
||||
INSERT INTO t1 VALUES (70000, 1092), (70001, 1085), (70002, 1065);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70000 1092
|
||||
70001 1085
|
||||
70002 1065
|
||||
ALTER TABLE t1 ADD UNIQUE (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
DROP INDEX b ON t1;
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) FROM t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
ALTER TABLE t1 ADD INDEX (b);
|
||||
SELECT CONVERT(a, CHAR), CONVERT(b, CHAR) from t1 GROUP BY b;
|
||||
CONVERT(a, CHAR) CONVERT(b, CHAR)
|
||||
70002 1065
|
||||
70001 1085
|
||||
70000 1092
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -205,4 +205,19 @@ Warnings:
|
||||
Warning 1364 Field 'id' doesn't have a default value
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table t1 (a int unique);
|
||||
create table t2 (b int default 10);
|
||||
insert into t1 (a) values (1);
|
||||
insert into t2 (b) values (1);
|
||||
insert into t1 (a) select b from t2 on duplicate key update a=default;
|
||||
select * from t1;
|
||||
a
|
||||
NULL
|
||||
insert into t1 (a) values (1);
|
||||
insert into t1 (a) select b from t2 on duplicate key update a=default(b);
|
||||
select * from t1;
|
||||
a
|
||||
NULL
|
||||
10
|
||||
drop table t1, t2;
|
||||
End of 5.0 tests.
|
||||
|
@ -608,6 +608,65 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
SELECT DISTINCT a,a FROM t1 WHERE b < 12 ORDER BY a;
|
||||
a a
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (id INT NOT NULL, fruit_id INT NOT NULL, fruit_name varchar(20)
|
||||
default NULL);
|
||||
INSERT INTO t1 VALUES (1,1,'ORANGE');
|
||||
INSERT INTO t1 VALUES (2,2,'APPLE');
|
||||
INSERT INTO t1 VALUES (3,2,'APPLE');
|
||||
INSERT INTO t1 VALUES (4,3,'PEAR');
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO @v1, @v2 FROM t1 WHERE fruit_name =
|
||||
'APPLE';
|
||||
SELECT @v1, @v2;
|
||||
@v1 @v2
|
||||
2 APPLE
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO @v3, @v4 FROM t1 GROUP BY fruit_id,
|
||||
fruit_name HAVING fruit_name = 'APPLE';
|
||||
SELECT @v3, @v4;
|
||||
@v3 @v4
|
||||
2 APPLE
|
||||
SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
|
||||
fruit_name = 'APPLE';
|
||||
SELECT @v5, @v6, @v7, @v8;
|
||||
@v5 @v6 @v7 @v8
|
||||
3 PEAR 3 PEAR
|
||||
SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
|
||||
WHERE fruit_name = 'APPLE';
|
||||
SELECT @v5, @v6, @v7, @v8, @v9, @v10;
|
||||
@v5 @v6 @v7 @v8 @v9 @v10
|
||||
3 PEAR 3 PEAR 5 PEARAPPLE
|
||||
SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
|
||||
@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
|
||||
SELECT @v11, @v12, @v13, @v14;
|
||||
@v11 @v12 @v13 @v14
|
||||
6 PEARPEAR 6 PEARPEAR
|
||||
SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
|
||||
SELECT @v15, @v16;
|
||||
@v15 @v16
|
||||
6 PEARPEAR
|
||||
SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
|
||||
'APPLE';
|
||||
SELECT @v17, @v18;
|
||||
@v17 @v18
|
||||
4 Bob
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 (fruit_id INT NOT NULL, fruit_name varchar(20)
|
||||
default NULL);
|
||||
SELECT DISTINCT fruit_id, fruit_name INTO OUTFILE
|
||||
'../tmp/data1.tmp' FROM t1 WHERE fruit_name = 'APPLE';
|
||||
LOAD DATA INFILE '../tmp/data1.tmp' INTO TABLE t2;
|
||||
SELECT DISTINCT @v19:= fruit_id, @v20:= fruit_name INTO OUTFILE
|
||||
'../tmp/data2.tmp' FROM t1 WHERE fruit_name = 'APPLE';
|
||||
LOAD DATA INFILE '../tmp/data2.tmp' INTO TABLE t2;
|
||||
SELECT @v19, @v20;
|
||||
@v19 @v20
|
||||
2 APPLE
|
||||
SELECT * FROM t2;
|
||||
fruit_id fruit_name
|
||||
2 APPLE
|
||||
2 APPLE
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t1 (a CHAR(1));
|
||||
INSERT INTO t1 VALUES('A'), (0);
|
||||
SELECT a FROM t1 WHERE a=0;
|
||||
|
@ -9,6 +9,10 @@ DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= 0;
|
||||
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= 0;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
@ -83,7 +87,7 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
|
||||
INSERT INTO federated.t2 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t2 (id, name) VALUES (2, 'fee');
|
||||
SELECT * FROM federated.t2;
|
||||
SELECT * FROM federated.t2 ORDER BY id, name;
|
||||
id name
|
||||
1 foo
|
||||
2 fee
|
||||
@ -108,7 +112,7 @@ ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%';
|
||||
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
|
||||
SELECT * FROM federated.t1;
|
||||
SELECT * FROM federated.t1 ORDER BY id,name;
|
||||
id name
|
||||
1 foo
|
||||
2 fee
|
||||
@ -122,7 +126,7 @@ ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1%';
|
||||
INSERT INTO federated.`t1%` (id, name) VALUES (1, 'foo');
|
||||
INSERT INTO federated.`t1%` (id, name) VALUES (2, 'fee');
|
||||
SELECT * FROM federated.`t1%`;
|
||||
SELECT * FROM federated.`t1%` ORDER BY id, name;
|
||||
id name
|
||||
1 foo
|
||||
2 fee
|
||||
@ -160,6 +164,7 @@ INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
|
||||
SELECT * FROM federated.t1;
|
||||
id name other created
|
||||
1 First Name 11111 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
2 Second Name 22222 2004-04-04 04:04:04
|
||||
3 Third Name 33333 2004-04-04 04:04:04
|
||||
4 Fourth Name 44444 2004-04-04 04:04:04
|
||||
@ -168,7 +173,6 @@ id name other created
|
||||
7 Seventh Name 77777 2004-04-04 04:04:04
|
||||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
id name other created
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
@ -182,6 +186,7 @@ SELECT * FROM federated.t1 WHERE name = 'Sixth Name' AND other = 44444;
|
||||
id name other created
|
||||
SELECT * FROM federated.t1 WHERE name like '%th%';
|
||||
id name other created
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
3 Third Name 33333 2004-04-04 04:04:04
|
||||
4 Fourth Name 44444 2004-04-04 04:04:04
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
@ -189,7 +194,6 @@ id name other created
|
||||
7 Seventh Name 77777 2004-04-04 04:04:04
|
||||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
|
||||
SELECT * FROM federated.t1 WHERE name = '3rd name';
|
||||
id name other created
|
||||
@ -310,6 +314,7 @@ VALUES ('Tenth Name', 101010, '2005-03-12 12:00:01');
|
||||
SELECT * FROM federated.t1;
|
||||
id name other created
|
||||
1 First Name 11111 2004-01-01 01:01:01
|
||||
10 Tenth Name 101010 2005-03-12 12:00:01
|
||||
2 Second Name 22222 2004-01-23 02:43:00
|
||||
3 Third Name 33333 2004-02-14 02:14:00
|
||||
4 Fourth Name 44444 2003-04-05 00:00:00
|
||||
@ -318,7 +323,6 @@ id name other created
|
||||
7 Seventh Name 77777 2003-12-12 18:32:00
|
||||
8 Eigth Name 88888 2005-03-12 11:00:00
|
||||
9 Ninth Name 99999 2005-03-12 11:00:01
|
||||
10 Tenth Name 101010 2005-03-12 12:00:01
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
id name other created
|
||||
5 Fifth Name 55555 2001-02-02 02:02:02
|
||||
@ -330,6 +334,7 @@ id name other created
|
||||
4 Fourth Name 44444 2003-04-05 00:00:00
|
||||
SELECT * FROM federated.t1 WHERE name like '%th%';
|
||||
id name other created
|
||||
10 Tenth Name 101010 2005-03-12 12:00:01
|
||||
3 Third Name 33333 2004-02-14 02:14:00
|
||||
4 Fourth Name 44444 2003-04-05 00:00:00
|
||||
5 Fifth Name 55555 2001-02-02 02:02:02
|
||||
@ -337,7 +342,6 @@ id name other created
|
||||
7 Seventh Name 77777 2003-12-12 18:32:00
|
||||
8 Eigth Name 88888 2005-03-12 11:00:00
|
||||
9 Ninth Name 99999 2005-03-12 11:00:01
|
||||
10 Tenth Name 101010 2005-03-12 12:00:01
|
||||
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
|
||||
SELECT * FROM federated.t1 WHERE name = '3rd name';
|
||||
id name other created
|
||||
@ -444,17 +448,17 @@ id name other
|
||||
7 Seventh Name NULL
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL;
|
||||
id name other
|
||||
4 NULL NULL
|
||||
10 NULL fee fie foe fum
|
||||
4 NULL NULL
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
|
||||
id name other
|
||||
4 NULL NULL
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
|
||||
id name other
|
||||
10 NULL fee fie foe fum
|
||||
2 Second Name NULL
|
||||
4 NULL NULL
|
||||
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;
|
||||
@ -466,6 +470,7 @@ id name other
|
||||
SELECT * FROM federated.t1;
|
||||
id name other
|
||||
1 First Name 11111
|
||||
10 Tenth Name fee fie foe fum
|
||||
2 Second Name two two two two
|
||||
3 Third Name 33333
|
||||
4 Fourth Name four four four
|
||||
@ -474,7 +479,6 @@ id name other
|
||||
7 Seventh Name seven seven
|
||||
8 Eigth Name 88888
|
||||
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,
|
||||
@ -655,8 +659,8 @@ id col1 col2 col3 col4
|
||||
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'five 5 five five 5')
|
||||
OR (col2 = 'three Three' AND col3 = 33);
|
||||
id col1 col2 col3 col4
|
||||
5 5 five 5 five five 5 5 55555
|
||||
3 3 three Three 33 33333
|
||||
5 5 five 5 five five 5 5 55555
|
||||
SELECT * FROM federated.t1 WHERE (id = 5 AND col2 = 'Two two')
|
||||
OR (col2 = 444 AND col3 = 4444444);
|
||||
id col1 col2 col3 col4
|
||||
@ -667,25 +671,25 @@ OR col3 = 33
|
||||
OR col4 = 4444444;
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
3 3 three Three 33 33333
|
||||
4 4 fourfourfour 444 4444444
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE id > 5;
|
||||
id col1 col2 col3 col4
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE id >= 5;
|
||||
id col1 col2 col3 col4
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
5 5 five 5 five five 5 5 55555
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE id < 5;
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
@ -702,6 +706,7 @@ id col1 col2 col3 col4
|
||||
SELECT * FROM federated.t1 WHERE id != 5;
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
3 3 three Three 33 33333
|
||||
4 4 fourfourfour 444 4444444
|
||||
@ -709,7 +714,6 @@ id col1 col2 col3 col4
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE id > 3 AND id < 7;
|
||||
id col1 col2 col3 col4
|
||||
4 4 fourfourfour 444 4444444
|
||||
@ -737,25 +741,25 @@ id col1 col2 col3 col4
|
||||
SELECT * FROM federated.t1 WHERE id < 3 OR id > 7;
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE col2 = 'three Three';
|
||||
id col1 col2 col3 col4
|
||||
3 3 three Three 33 33333
|
||||
SELECT * FROM federated.t1 WHERE col2 > 'one';
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
3 3 three Three 33 33333
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE col2 LIKE 's%';
|
||||
id col1 col2 col3 col4
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
SELECT * FROM federated.t1 WHERE col2 LIKE 'si%';
|
||||
id col1 col2 col3 col4
|
||||
6 6 six six Sixsix 6666 6
|
||||
@ -765,6 +769,7 @@ id col1 col2 col3 col4
|
||||
SELECT * FROM federated.t1 WHERE col2 NOT LIKE 'e%';
|
||||
id col1 col2 col3 col4
|
||||
1 1 one One 11 1111
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
3 3 three Three 33 33333
|
||||
4 4 fourfourfour 444 4444444
|
||||
@ -772,18 +777,17 @@ id col1 col2 col3 col4
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
SELECT * FROM federated.t1 WHERE col2 <> 'one One';
|
||||
id col1 col2 col3 col4
|
||||
4 4 fourfourfour 444 4444444
|
||||
5 5 five 5 five five 5 5 55555
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
2 2 Two two 22 2222
|
||||
3 3 three Three 33 33333
|
||||
4 4 fourfourfour 444 4444444
|
||||
5 5 five 5 five five 5 5 55555
|
||||
6 6 six six Sixsix 6666 6
|
||||
7 7 seven Sevenseven 77777 7777
|
||||
10 10 Tenth ten TEN 1010101 1010
|
||||
8 8 eight eight eight 88888 88
|
||||
9 9 nine Nine 999999 999999
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`col1` varchar(8) NOT NULL DEFAULT '',
|
||||
@ -950,11 +954,11 @@ INSERT INTO federated.t1 (name, floatval, other)
|
||||
VALUES (0, 00.3333, NULL);
|
||||
SELECT * FROM federated.t1;
|
||||
id name floatval other
|
||||
NULL NULL NULL NULL
|
||||
NULL NULL NULL NULL
|
||||
1 NULL NULL NULL
|
||||
NULL foo 33.3333 NULL
|
||||
NULL 0 0.3333 NULL
|
||||
NULL NULL NULL NULL
|
||||
NULL NULL NULL NULL
|
||||
NULL foo 33.3333 NULL
|
||||
SELECT count(*) FROM federated.t1
|
||||
WHERE id IS NULL
|
||||
AND name IS NULL
|
||||
@ -983,13 +987,13 @@ Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
|
||||
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
|
||||
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
|
||||
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
|
||||
INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:");
|
||||
INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:");
|
||||
SELECT * FROM federated.t1;
|
||||
blurb_id blurb
|
||||
1 MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.
|
||||
2 All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.
|
||||
3 A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined.
|
||||
4 Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:
|
||||
4 Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`a` int NOT NULL,
|
||||
@ -1741,20 +1745,20 @@ create trigger federated.t1_bi before insert on federated.t1 for each row set ne
|
||||
create table federated.t2 (a int, b int);
|
||||
insert into federated.t2 values (13, 17), (19, 23);
|
||||
insert into federated.t1 (a, b) values (1, 2), (3, 5), (7, 11);
|
||||
select * from federated.t1;
|
||||
select * from federated.t1 order by a;
|
||||
a b c
|
||||
1 2 2
|
||||
3 5 15
|
||||
7 11 77
|
||||
delete from federated.t1;
|
||||
insert into federated.t1 (a, b) select * from federated.t2;
|
||||
select * from federated.t1;
|
||||
select * from federated.t1 order by a;
|
||||
a b c
|
||||
13 17 221
|
||||
19 23 437
|
||||
delete from federated.t1;
|
||||
load data infile '../std_data_ln/loaddata5.dat' into table federated.t1 fields terminated by '' enclosed by '' ignore 1 lines (a, b);
|
||||
select * from federated.t1;
|
||||
select * from federated.t1 order by a;
|
||||
a b c
|
||||
3 4 12
|
||||
5 6 30
|
||||
@ -2071,6 +2075,28 @@ DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
|
||||
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
|
||||
CREATE TABLE t1
|
||||
(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
CHECKSUM TABLE t1;
|
||||
Table Checksum
|
||||
test.t1 2465757603
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
|
||||
INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
|
||||
CREATE TABLE t1
|
||||
(a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
|
||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
||||
SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
|
||||
a
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
|
@ -9,6 +9,10 @@ DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= 0;
|
||||
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= 0;
|
||||
DROP TABLE IF EXISTS federated.bug_13118_table;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int auto_increment primary key,
|
||||
@ -49,7 +53,9 @@ id value
|
||||
7 54
|
||||
8 55
|
||||
DROP TABLE federated.t1;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
|
||||
DROP TABLE federated.t1;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
|
@ -469,3 +469,31 @@ SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
|
||||
a
|
||||
aaaaa aaaa
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
|
||||
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
|
||||
('test', 1),('test', 2),('test', 3),('test', 4);
|
||||
EXPLAIN SELECT * FROM t1
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext b,a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 fulltext a a 0 1 Using where
|
||||
EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
EXPLAIN SELECT * FROM t1 USE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
|
||||
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref b b 5 const 4 Using where
|
||||
DROP TABLE t1;
|
||||
|
@ -1425,4 +1425,27 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
|
||||
AVG(a) CAST(AVG(a) AS DECIMAL)
|
||||
15 15
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (1,1), (1,2), (1,3);
|
||||
SET SQL_MODE='ONLY_FULL_GROUP_BY';
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
3
|
||||
SELECT COUNT(*) FROM t1 where a=1;
|
||||
COUNT(*)
|
||||
3
|
||||
SELECT COUNT(*),a FROM t1;
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 b ON a.a= b.a;
|
||||
COUNT(*)
|
||||
9
|
||||
SELECT COUNT(*), (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a)
|
||||
FROM t1 outr;
|
||||
ERROR 42000: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
|
||||
SELECT COUNT(*) FROM t1 a JOIN t1 outr
|
||||
ON a.a= (SELECT count(*) FROM t1 inr WHERE inr.a = outr.a);
|
||||
COUNT(*)
|
||||
0
|
||||
SET SQL_MODE=default;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -131,3 +131,49 @@ drop table t1;
|
||||
select if(0, 18446744073709551610, 18446744073709551610);
|
||||
if(0, 18446744073709551610, 18446744073709551610)
|
||||
18446744073709551610
|
||||
CREATE TABLE t1(a DECIMAL(10,3));
|
||||
SELECT t1.a,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,0)))))))))))))))))))))))))))))) + 1
|
||||
FROM t1;
|
||||
a IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((ROUND(t1.a,2)=1), 2,
|
||||
IF((R
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -305,4 +305,18 @@ drop table t1;
|
||||
SELECT NAME_CONST('var', 'value') COLLATE latin1_general_cs;
|
||||
NAME_CONST('var', 'value') COLLATE latin1_general_cs
|
||||
value
|
||||
select @@session.time_zone into @save_tz;
|
||||
set @@session.time_zone='UTC';
|
||||
select uuid() into @my_uuid;
|
||||
select mid(@my_uuid,15,1);
|
||||
mid(@my_uuid,15,1)
|
||||
1
|
||||
select 24 * 60 * 60 * 1000 * 1000 * 10 into @my_uuid_one_day;
|
||||
select concat('0',mid(@my_uuid,16,3),mid(@my_uuid,10,4),left(@my_uuid,8)) into @my_uuidate;
|
||||
select floor(conv(@my_uuidate,16,10)/@my_uuid_one_day) into @my_uuid_date;
|
||||
select 141427 + datediff(curdate(),'1970-01-01') into @my_uuid_synthetic;
|
||||
select @my_uuid_date - @my_uuid_synthetic;
|
||||
@my_uuid_date - @my_uuid_synthetic
|
||||
0
|
||||
set @@session.time_zone=@save_tz;
|
||||
End of 5.0 tests
|
||||
|
@ -114,4 +114,16 @@ End of 4.1 tests
|
||||
SELECT 1 REGEXP NULL;
|
||||
1 REGEXP NULL
|
||||
NULL
|
||||
SELECT '' REGEXP BINARY NULL;
|
||||
'' REGEXP BINARY NULL
|
||||
NULL
|
||||
SELECT NULL REGEXP BINARY NULL;
|
||||
NULL REGEXP BINARY NULL
|
||||
NULL
|
||||
SELECT 'A' REGEXP BINARY NULL;
|
||||
'A' REGEXP BINARY NULL
|
||||
NULL
|
||||
SELECT "ABC" REGEXP BINARY NULL;
|
||||
"ABC" REGEXP BINARY NULL
|
||||
NULL
|
||||
End of 5.0 tests
|
||||
|
@ -256,3 +256,15 @@ a
|
||||
select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
|
||||
str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f")
|
||||
2003-01-02 10:11:12.001200
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10') time('00:00:00')
|
||||
-24:00:00 00:00:00
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00')
|
||||
0
|
||||
select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00');
|
||||
timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00')
|
||||
1
|
||||
SELECT CAST(time('-73:42:12') AS DECIMAL);
|
||||
CAST(time('-73:42:12') AS DECIMAL)
|
||||
-734212
|
||||
|
@ -1359,4 +1359,34 @@ tt
|
||||
41
|
||||
SET sql_mode=@save_sql_mode;
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# BUG#38072: Wrong result: HAVING not observed in a query with aggregate
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
pk int(11) NOT NULL AUTO_INCREMENT,
|
||||
int_nokey int(11) NOT NULL,
|
||||
int_key int(11) NOT NULL,
|
||||
varchar_key varchar(1) NOT NULL,
|
||||
varchar_nokey varchar(1) NOT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY int_key (int_key),
|
||||
KEY varchar_key (varchar_key)
|
||||
);
|
||||
INSERT INTO t1 VALUES
|
||||
(1,5,5, 'h','h'),
|
||||
(2,1,1, '{','{'),
|
||||
(3,1,1, 'z','z'),
|
||||
(4,8,8, 'x','x'),
|
||||
(5,7,7, 'o','o'),
|
||||
(6,3,3, 'p','p'),
|
||||
(7,9,9, 'c','c'),
|
||||
(8,0,0, 'k','k'),
|
||||
(9,6,6, 't','t'),
|
||||
(10,0,0,'c','c');
|
||||
explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
|
||||
SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
|
||||
X
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -2353,3 +2353,79 @@ a MIN(b) MAX(b) AVG(b)
|
||||
2 1 3 2.0000
|
||||
1 1 3 2.0000
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
|
||||
insert into t1 (a,b) values
|
||||
(0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),
|
||||
(0,7),(0,8),(0,9),(0,10),(0,11),(0,12),(0,13),
|
||||
(1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),
|
||||
(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),
|
||||
(2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),
|
||||
(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(2,13),
|
||||
(3,0),(3,1),(3,2),(3,3),(3,4),(3,5),(3,6),
|
||||
(3,7),(3,8),(3,9),(3,10),(3,11),(3,12),(3,13);
|
||||
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
|
||||
select * from t1;
|
||||
a b
|
||||
0 0
|
||||
0 1
|
||||
0 2
|
||||
0 3
|
||||
0 4
|
||||
0 5
|
||||
0 6
|
||||
0 7
|
||||
0 8
|
||||
0 9
|
||||
0 10
|
||||
0 11
|
||||
0 12
|
||||
0 13
|
||||
0 14
|
||||
1 0
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
1 4
|
||||
1 5
|
||||
1 6
|
||||
1 7
|
||||
1 8
|
||||
1 9
|
||||
1 10
|
||||
1 11
|
||||
1 12
|
||||
1 13
|
||||
2 0
|
||||
2 1
|
||||
2 2
|
||||
2 3
|
||||
2 4
|
||||
2 5
|
||||
2 6
|
||||
2 7
|
||||
2 8
|
||||
2 9
|
||||
2 10
|
||||
2 11
|
||||
2 12
|
||||
2 13
|
||||
3 0
|
||||
3 1
|
||||
3 2
|
||||
3 3
|
||||
3 4
|
||||
3 5
|
||||
3 6
|
||||
3 7
|
||||
3 8
|
||||
3 9
|
||||
3 10
|
||||
3 11
|
||||
3 12
|
||||
3 13
|
||||
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 3 Using where; Using index for group-by; Using temporary
|
||||
Warnings:
|
||||
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
|
||||
drop table t1;
|
||||
|
@ -518,3 +518,13 @@ a filler b
|
||||
4 zz 4
|
||||
5 qq 4
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (a varchar(8), b set('a','b','c','d','e','f','g','h'),
|
||||
KEY b(b), KEY a(a));
|
||||
INSERT INTO t1 VALUES ('y',''), ('z','');
|
||||
SELECT b,a from t1 WHERE (b!='c' AND b!='f' && b!='h') OR
|
||||
(a='pure-S') OR (a='DE80337a') OR (a='DE80799');
|
||||
b a
|
||||
y
|
||||
z
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -210,3 +210,24 @@ drop view testdb_1.v1, v2, testdb_1.v3, v4;
|
||||
drop database testdb_1;
|
||||
drop user testdb_1@localhost;
|
||||
drop user testdb_2@localhost;
|
||||
create database testdb_1;
|
||||
create table testdb_1.t1 (a int);
|
||||
create view testdb_1.v1 as select * from testdb_1.t1;
|
||||
grant show view on testdb_1.* to mysqltest_1@localhost;
|
||||
grant select on testdb_1.v1 to mysqltest_1@localhost;
|
||||
select table_schema, table_name, view_definition from information_schema.views
|
||||
where table_name='v1';
|
||||
table_schema table_name view_definition
|
||||
testdb_1 v1 /* ALGORITHM=UNDEFINED */ select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1`
|
||||
show create view testdb_1.v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v1` AS select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1`
|
||||
revoke select on testdb_1.v1 from mysqltest_1@localhost;
|
||||
select table_schema, table_name, view_definition from information_schema.views
|
||||
where table_name='v1';
|
||||
table_schema table_name view_definition
|
||||
testdb_1 v1
|
||||
show create view testdb_1.v1;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1'
|
||||
drop user mysqltest_1@localhost;
|
||||
drop database testdb_1;
|
||||
|
6
mysql-test/r/innodb-autoinc-optimize.result
Normal file
6
mysql-test/r/innodb-autoinc-optimize.result
Normal file
@ -0,0 +1,6 @@
|
||||
drop table if exists t1;
|
||||
create table t1(a int not null auto_increment primary key) engine=innodb;
|
||||
insert into t1 set a = -1;
|
||||
optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
1
mysql-test/r/innodb_bug35220.result
Normal file
1
mysql-test/r/innodb_bug35220.result
Normal file
@ -0,0 +1 @@
|
||||
SET storage_engine=InnoDB;
|
@ -1246,4 +1246,25 @@ set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
|
||||
set @my_innodb_commit_concurrency=@@global.innodb_commit_concurrency;
|
||||
set global innodb_commit_concurrency=0;
|
||||
set global innodb_commit_concurrency=@my_innodb_commit_concurrency;
|
||||
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
|
||||
ENGINE=InnoDB;
|
||||
INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
|
||||
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
|
||||
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range t1_b t1_b 5 NULL 4 Using where
|
||||
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
|
||||
a b c
|
||||
8 1 1
|
||||
7 1 1
|
||||
6 1 1
|
||||
5 1 1
|
||||
4 1 1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a char(50)) ENGINE=InnoDB;
|
||||
CREATE INDEX i1 on t1 (a(3));
|
||||
SELECT * FROM t1 WHERE a = 'abcde';
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -747,11 +747,13 @@ select t1.b from v1a;
|
||||
ERROR 42S22: Unknown column 't1.b' in 'field list'
|
||||
select * from v1a join v1b on t1.b = t2.b;
|
||||
ERROR 42S22: Unknown column 't1.b' in 'on clause'
|
||||
select * from information_schema.statistics join information_schema.columns
|
||||
using(table_name,column_name) where table_name='user';
|
||||
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL NULL BTREE NULL mysql 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI #
|
||||
user User NULL mysql 0 mysql PRIMARY 2 A 3 NULL NULL BTREE NULL mysql 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI #
|
||||
select
|
||||
statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statistics.TABLE_SCHEMA, statistics.NON_UNIQUE, statistics.INDEX_SCHEMA, statistics.INDEX_NAME, statistics.SEQ_IN_INDEX, statistics.COLLATION, statistics.SUB_PART, statistics.PACKED, statistics.NULLABLE, statistics.INDEX_TYPE, statistics.COMMENT,
|
||||
columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
|
||||
from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
|
||||
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA COLUMN_COMMENT
|
||||
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL BTREE NULL mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
user User NULL mysql 0 mysql PRIMARY 2 A NULL NULL BTREE NULL mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
@ -111,3 +111,6 @@ set @a=-14632475938453979136;
|
||||
execute s using @a, @a;
|
||||
ERROR HY000: Incorrect arguments to EXECUTE
|
||||
End of 5.0 tests
|
||||
select 1 as a limit 4294967296,10;
|
||||
a
|
||||
End of 5.1 tests
|
||||
|
@ -328,3 +328,123 @@ DROP VIEW v2;
|
||||
DROP VIEW v3;
|
||||
|
||||
# -- End of Bug#35469.
|
||||
Bug#37114
|
||||
SET SESSION character_set_client=latin1;
|
||||
SET SESSION character_set_server=latin1;
|
||||
SET SESSION character_set_connection=latin1;
|
||||
SET @OLD_SQL_MODE=@@SESSION.SQL_MODE;
|
||||
test LOAD DATA INFILE
|
||||
SET sql_mode = '';
|
||||
SELECT '1 \\aa\n' INTO DUMPFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt';
|
||||
CREATE TABLE t1 (id INT, val1 CHAR(3)) ENGINE=MyISAM;
|
||||
SET sql_mode = 'NO_BACKSLASH_ESCAPES';
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' REPLACE INTO TABLE t1 FIELDS TERMINATED BY ' ';
|
||||
SELECT * FROM t1;
|
||||
id val1
|
||||
1 \aa
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1;
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114_out.txt' FIELDS TERMINATED BY ' ' FROM t1;
|
||||
INSERT INTO t1 (id, val1) VALUES (1, '\aa');
|
||||
SELECT * FROM t1;
|
||||
id val1
|
||||
1 \aa
|
||||
1 \aa
|
||||
SET sql_mode='';
|
||||
INSERT INTO t1 (id, val1) VALUES (1, '\aa');
|
||||
SELECT * FROM t1;
|
||||
id val1
|
||||
1 \aa
|
||||
1 \aa
|
||||
1 aa
|
||||
DROP TABLE t1;
|
||||
test SELECT INTO OUTFILE
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, val1 CHAR(4));
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
SET sql_mode = '';
|
||||
INSERT INTO t1 (id, val1) VALUES (5, '\ttab');
|
||||
INSERT INTO t1 (id, val1) VALUES (4, '\\r');
|
||||
SET sql_mode = 'NO_BACKSLASH_ESCAPES';
|
||||
INSERT INTO t1 (id, val1) VALUES (3, '\tx');
|
||||
1.1 NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' ';
|
||||
SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
|
||||
SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
|
||||
t id val1 hex(val1)
|
||||
before 3 \tx 5C7478
|
||||
after 3 \tx 5C7478
|
||||
before 4 \r 5C72
|
||||
after 4 \r 5C72
|
||||
before 5 tab 09746162
|
||||
after 5 tab 09746162
|
||||
TRUNCATE t2;
|
||||
SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
|
||||
LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
|
||||
3 \tx
|
||||
4 \r
|
||||
5 tab
|
||||
|
||||
1.2 NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '\' TERMINATED BY ' ' FROM t1 ORDER BY id;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '\' TERMINATED BY ' ';
|
||||
SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
|
||||
SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
|
||||
t id val1 hex(val1)
|
||||
before 3 \tx 5C7478
|
||||
after 3 \tx 5C7478
|
||||
before 4 \r 5C72
|
||||
after 4 \r 5C72
|
||||
before 5 tab 09746162
|
||||
after 5 tab 09746162
|
||||
TRUNCATE t2;
|
||||
SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
|
||||
LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
|
||||
3 \\tx
|
||||
4 \\r
|
||||
5 tab
|
||||
|
||||
SET sql_mode = '';
|
||||
2.1 !NO_BACKSLASH_ESCAPES, use defaults for ESCAPED BY
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS TERMINATED BY ' ' FROM t1 ORDER BY id;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS TERMINATED BY ' ';
|
||||
SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
|
||||
SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
|
||||
t id val1 hex(val1)
|
||||
before 3 \tx 5C7478
|
||||
after 3 \tx 5C7478
|
||||
before 4 \r 5C72
|
||||
after 4 \r 5C72
|
||||
before 5 tab 09746162
|
||||
after 5 tab 09746162
|
||||
TRUNCATE t2;
|
||||
SET sql_mode = 'NO_BACKSLASH_ESCAPES';
|
||||
SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
|
||||
LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
|
||||
3 \\tx
|
||||
4 \\r
|
||||
5 tab
|
||||
|
||||
SET sql_mode = '';
|
||||
2.2 !NO_BACKSLASH_ESCAPES, override defaults for ESCAPED BY
|
||||
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' FIELDS ESCAPED BY '' TERMINATED BY ' ' FROM t1 ORDER BY id;
|
||||
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug37114.txt' INTO TABLE t2 FIELDS ESCAPED BY '' TERMINATED BY ' ';
|
||||
SELECT 'before' AS t, id, val1, hex(val1) FROM t1 UNION
|
||||
SELECT 'after' AS t, id, val1, hex(val1) FROM t2 ORDER BY id,t DESC;
|
||||
t id val1 hex(val1)
|
||||
before 3 \tx 5C7478
|
||||
after 3 \tx 5C7478
|
||||
before 4 \r 5C72
|
||||
after 4 \r 5C72
|
||||
before 5 tab 09746162
|
||||
after 5 tab 09746162
|
||||
TRUNCATE t2;
|
||||
SET sql_mode = 'NO_BACKSLASH_ESCAPES';
|
||||
SELECT LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt");
|
||||
LOAD_FILE("MYSQLTEST_VARDIR/tmp/bug37114.txt")
|
||||
3 \tx
|
||||
4 \r
|
||||
5 tab
|
||||
|
||||
set session sql_mode=@OLD_SQL_MODE;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests
|
||||
|
@ -99,3 +99,37 @@ kill query
|
||||
ERROR 70100: Query execution was interrupted
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
a int(11) unsigned default NULL,
|
||||
b varchar(255) default NULL,
|
||||
UNIQUE KEY a (a),
|
||||
KEY b (b)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3);
|
||||
CREATE TABLE t2 SELECT * FROM t1;
|
||||
CREATE TABLE t3 SELECT * FROM t1;
|
||||
# test altering of columns that multiupdate doesn't use
|
||||
# normal mode
|
||||
# PS mode
|
||||
# test altering of columns that multiupdate uses
|
||||
# normal mode
|
||||
# PS mode
|
||||
DROP TABLE t1, t2, t3;
|
||||
CREATE TABLE t1( a INT, b INT );
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
|
||||
# 1. test regular tables
|
||||
# 1.1. test altering of columns that multiupdate doesn't use
|
||||
# 1.1.1. normal mode
|
||||
# 1.1.2. PS mode
|
||||
# 1.2. test altering of columns that multiupdate uses
|
||||
# 1.2.1. normal mode
|
||||
# 1.2.2. PS mode
|
||||
ALTER TABLE t1 ADD COLUMN a INT;
|
||||
# 2. test UNIONs
|
||||
# 2.1. test altering of columns that multiupdate doesn't use
|
||||
# 2.1.1. normal mode
|
||||
# 2.1.2. PS mode
|
||||
# 2.2. test altering of columns that multiupdate uses
|
||||
# 2.2.1. normal mode
|
||||
# 2.2.2. PS mode
|
||||
DROP TABLE t1;
|
||||
|
@ -108,11 +108,11 @@ id
|
||||
1
|
||||
select * from v1 group by id limit 0;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t1 v1 id id 3 10 0 Y 32768 0 63
|
||||
def test v1 v1 id id 3 10 0 Y 32768 0 63
|
||||
id
|
||||
select * from v1 where id=1000 group by id;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t1 v1 id id 3 10 0 Y 32768 0 63
|
||||
def test v1 v1 id id 3 10 0 Y 32768 0 63
|
||||
id
|
||||
select * from v1 where id=1 group by id;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
@ -126,7 +126,7 @@ renamed
|
||||
1
|
||||
select * from v3 where renamed=1 group by renamed;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def v3 renamed 8 12 0 Y 32896 0 63
|
||||
def v3 v3 renamed renamed 8 12 0 Y 32896 0 63
|
||||
renamed
|
||||
drop table t1;
|
||||
drop view v1,v2,v3;
|
||||
@ -156,8 +156,8 @@ c1
|
||||
3
|
||||
SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t1 v1 c1 c1 254 1 1 Y 0 0 8
|
||||
def test t2 v2 c2 c2 254 1 1 Y 0 0 8
|
||||
def test v1 v1 c1 c1 254 1 1 Y 0 0 8
|
||||
def test v2 v2 c2 c2 254 1 1 Y 0 0 8
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
@ -181,4 +181,21 @@ c1 c2
|
||||
3 3
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (i INT, d DATE);
|
||||
INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03');
|
||||
SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
|
||||
CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d)
|
||||
FROM t1 ORDER BY RAND();
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01
|
||||
2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02
|
||||
2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03
|
||||
COALESCE(d, d) IFNULL(d, d) IF(i, d, d) CASE i WHEN i THEN d ELSE d END GREATEST(d, d) LEAST(d, d)
|
||||
def CASE i WHEN i THEN d ELSE d END CASE i WHEN i THEN d ELSE d END 10 10 10 Y 128 0 63
|
||||
def COALESCE(d, d) COALESCE(d, d) 10 10 10 Y 128 0 63
|
||||
def GREATEST(d, d) GREATEST(d, d) 10 10 10 Y 128 0 63
|
||||
def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63
|
||||
def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
|
||||
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -378,29 +378,6 @@ where 0=1;
|
||||
delete t1, t2 from t2,t1
|
||||
where t1.id1=t2.id2 and 0=1;
|
||||
drop table t1,t2;
|
||||
create table t1 ( a int not null, b int not null) ;
|
||||
alter table t1 add index i1(a);
|
||||
delete from t1 where a > 2000000;
|
||||
create table t2 like t1;
|
||||
insert into t2 select * from t1;
|
||||
select 't2 rows before small delete', count(*) from t1;
|
||||
t2 rows before small delete count(*)
|
||||
t2 rows before small delete 2000000
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
|
||||
select 't2 rows after small delete', count(*) from t2;
|
||||
t2 rows after small delete count(*)
|
||||
t2 rows after small delete 1999999
|
||||
select 't1 rows after small delete', count(*) from t1;
|
||||
t1 rows after small delete count(*)
|
||||
t1 rows after small delete 1999999
|
||||
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
|
||||
select 't2 rows after big delete', count(*) from t2;
|
||||
t2 rows after big delete count(*)
|
||||
t2 rows after big delete 1900001
|
||||
select 't1 rows after big delete', count(*) from t1;
|
||||
t1 rows after big delete count(*)
|
||||
t1 rows after big delete 1900001
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( a int );
|
||||
CREATE TABLE t2 ( a int );
|
||||
DELETE t1 FROM t1, t2 AS t3;
|
||||
|
25
mysql-test/r/multi_update2.result
Normal file
25
mysql-test/r/multi_update2.result
Normal file
@ -0,0 +1,25 @@
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL) ;
|
||||
# The protocolling of many inserts into t1 is suppressed.
|
||||
ALTER TABLE t1 ADD INDEX i1(a);
|
||||
DELETE FROM t1 WHERE a > 2000000;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 SELECT * FROM t1;
|
||||
SELECT 't2 rows before small delete', COUNT(*) FROM t1;
|
||||
t2 rows before small delete COUNT(*)
|
||||
t2 rows before small delete 2000000
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 2;
|
||||
SELECT 't2 rows after small delete', COUNT(*) FROM t2;
|
||||
t2 rows after small delete COUNT(*)
|
||||
t2 rows after small delete 1999999
|
||||
SELECT 't1 rows after small delete', COUNT(*) FROM t1;
|
||||
t1 rows after small delete COUNT(*)
|
||||
t1 rows after small delete 1999999
|
||||
DELETE t1,t2 FROM t1,t2 WHERE t1.b=t2.a AND t1.a < 100*1000;
|
||||
SELECT 't2 rows after big delete', COUNT(*) FROM t2;
|
||||
t2 rows after big delete COUNT(*)
|
||||
t2 rows after big delete 1900001
|
||||
SELECT 't1 rows after big delete', COUNT(*) FROM t1;
|
||||
t1 rows after big delete COUNT(*)
|
||||
t1 rows after big delete 1900001
|
||||
DROP TABLE t1,t2;
|
@ -1861,4 +1861,26 @@ id ref
|
||||
3 2
|
||||
4 5
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM CHECKSUM=1 ROW_FORMAT=DYNAMIC;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
UPDATE t1 SET a=1;
|
||||
SELECT a FROM t1;
|
||||
a
|
||||
1
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
INSERT INTO t1 VALUES (0), (5), (4), (2);
|
||||
UPDATE t1 SET a=2;
|
||||
SELECT a FROM t1;
|
||||
a
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
2
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -57,4 +57,17 @@ drop view v_bug25347;
|
||||
drop table t_bug25347;
|
||||
drop database d_bug25347;
|
||||
use test;
|
||||
create view v1 as select * from information_schema.routines;
|
||||
check table v1, information_schema.routines;
|
||||
Table Op Msg_type Msg_text
|
||||
test.v1 check status OK
|
||||
information_schema.routines check note The storage engine for the table doesn't support check
|
||||
drop view v1;
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(a INT);
|
||||
test.t1
|
||||
Error : Incorrect information in file: './test/t1.frm'
|
||||
error : Corrupt
|
||||
test.t2 OK
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -1,3 +1,8 @@
|
||||
Bug#37938 - Test "mysqldump" lacks various insert statements
|
||||
Turn off concurrent inserts to avoid random errors
|
||||
NOTE: We reset the variable back to saved value at the end of test
|
||||
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
|
||||
SET @@GLOBAL.CONCURRENT_INSERT = 0;
|
||||
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
|
||||
drop database if exists mysqldump_test_db;
|
||||
drop database if exists db1;
|
||||
@ -1996,7 +2001,7 @@ DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
@ -2078,7 +2083,7 @@ DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`a` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
@ -2140,7 +2145,7 @@ DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
@ -2244,19 +2249,19 @@ DROP TABLE IF EXISTS `v1`;
|
||||
`a` int(11),
|
||||
`b` int(11),
|
||||
`c` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
DROP TABLE IF EXISTS `v3`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
/*!50001 CREATE TABLE `v3` (
|
||||
`a` int(11),
|
||||
`b` int(11),
|
||||
`c` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
@ -2860,21 +2865,21 @@ DROP TABLE IF EXISTS `v0`;
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
|
||||
USE `test`;
|
||||
/*!50001 DROP TABLE `v0`*/;
|
||||
@ -3198,7 +3203,7 @@ DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`id` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
|
||||
USE `mysqldump_test_db`;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
@ -3246,7 +3251,7 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_views` /*!40100 DEFAULT CHAR
|
||||
USE `mysqldump_views`;
|
||||
/*!50001 CREATE TABLE `nasishnasifu` (
|
||||
`id` bigint(20) unsigned
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
|
||||
USE `mysqldump_tables`;
|
||||
|
||||
@ -3565,6 +3570,7 @@ DROP TABLE t1,t2;
|
||||
|
||||
|
||||
-- Dump completed on DATE
|
||||
SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
|
||||
#
|
||||
# End of 5.0 tests
|
||||
#
|
||||
|
@ -1076,3 +1076,19 @@ set session max_sort_length= 2180;
|
||||
select * from t1 order by b;
|
||||
ERROR HY001: Out of sort memory; increase server sort buffer size
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #39844: Query Crash Mysql Server 5.0.67
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
|
||||
CREATE TABLE t3 (c INT);
|
||||
INSERT INTO t1 (a) VALUES (1), (2);
|
||||
INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
|
||||
INSERT INTO t3 (c) VALUES (1), (2);
|
||||
SELECT
|
||||
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
|
||||
FROM t3;
|
||||
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
|
||||
2
|
||||
NULL
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
306
mysql-test/r/parser_stack.result
Normal file
306
mysql-test/r/parser_stack.result
Normal file
@ -0,0 +1,306 @@
|
||||
use test;
|
||||
SELECT
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
1
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
;
|
||||
1
|
||||
1
|
||||
prepare stmt from
|
||||
"
|
||||
SELECT
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
1
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
"
|
||||
;
|
||||
execute stmt;
|
||||
1
|
||||
1
|
||||
drop view if exists view_overflow;
|
||||
CREATE VIEW view_overflow AS
|
||||
SELECT
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
|
||||
1
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
;
|
||||
SELECT * from view_overflow;
|
||||
1
|
||||
1
|
||||
drop view view_overflow;
|
||||
drop procedure if exists proc_overflow;
|
||||
CREATE PROCEDURE proc_overflow()
|
||||
BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
select 1;
|
||||
select 2;
|
||||
select 3;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END $$
|
||||
call proc_overflow();
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
drop procedure proc_overflow;
|
||||
drop function if exists func_overflow;
|
||||
create function func_overflow() returns int
|
||||
BEGIN
|
||||
DECLARE x int default 0;
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
SET x=x+1;
|
||||
SET x=x+2;
|
||||
SET x=x+3;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
return x;
|
||||
END $$
|
||||
select func_overflow();
|
||||
func_overflow()
|
||||
6
|
||||
drop function func_overflow;
|
||||
drop table if exists table_overflow;
|
||||
create table table_overflow(a int, b int);
|
||||
create trigger trigger_overflow before insert on table_overflow
|
||||
for each row
|
||||
BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN BEGIN
|
||||
SET NEW.b := NEW.a;
|
||||
SET NEW.b := NEW.b + 1;
|
||||
SET NEW.b := NEW.b + 2;
|
||||
SET NEW.b := NEW.b + 3;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END; END; END; END; END; END; END; END; END; END; END; END;
|
||||
END $$
|
||||
insert into table_overflow set a=10;
|
||||
insert into table_overflow set a=20;
|
||||
select * from table_overflow;
|
||||
a b
|
||||
10 16
|
||||
20 26
|
||||
drop table table_overflow;
|
||||
drop procedure if exists proc_35577;
|
||||
CREATE PROCEDURE proc_35577()
|
||||
BEGIN
|
||||
DECLARE z_done INT DEFAULT 0;
|
||||
DECLARE t_done VARCHAR(5000);
|
||||
outer_loop: LOOP
|
||||
IF t_done=1 THEN
|
||||
LEAVE outer_loop;
|
||||
END IF;
|
||||
inner_block:BEGIN
|
||||
DECLARE z_done INT DEFAULT 0;
|
||||
SET z_done = 0;
|
||||
inner_loop: LOOP
|
||||
IF z_done=1 THEN
|
||||
LEAVE inner_loop;
|
||||
END IF;
|
||||
IF (t_done = 'a') THEN
|
||||
IF (t_done <> 0) THEN
|
||||
IF ( t_done > 0) THEN
|
||||
IF (t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF (t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
ELSEIF(t_done = 'a') THEN
|
||||
SET t_done = 'a';
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
END LOOP inner_loop;
|
||||
END inner_block;
|
||||
END LOOP outer_loop;
|
||||
END $$
|
||||
drop procedure proc_35577;
|
||||
drop procedure if exists p_37269;
|
||||
create procedure p_37269()
|
||||
begin
|
||||
declare done int default 0;
|
||||
declare varb int default 0;
|
||||
declare vara int default 0;
|
||||
repeat
|
||||
select now();
|
||||
until done end repeat;
|
||||
while varb do
|
||||
select now();
|
||||
begin
|
||||
select now();
|
||||
repeat
|
||||
select now();
|
||||
until done end repeat;
|
||||
if vara then
|
||||
select now();
|
||||
repeat
|
||||
select now();
|
||||
loop
|
||||
select now();
|
||||
end loop;
|
||||
repeat
|
||||
select now();
|
||||
label1: while varb do
|
||||
select now();
|
||||
end while label1;
|
||||
if vara then
|
||||
select now();
|
||||
repeat
|
||||
select now();
|
||||
until done end repeat;
|
||||
begin
|
||||
select now();
|
||||
while varb do
|
||||
select now();
|
||||
label1: while varb do
|
||||
select now();
|
||||
end while label1;
|
||||
if vara then
|
||||
select now();
|
||||
while varb do
|
||||
select now();
|
||||
loop
|
||||
select now();
|
||||
end loop;
|
||||
repeat
|
||||
select now();
|
||||
loop
|
||||
select now();
|
||||
while varb do
|
||||
select now();
|
||||
end while;
|
||||
repeat
|
||||
select now();
|
||||
label1: loop
|
||||
select now();
|
||||
if vara then
|
||||
select now();
|
||||
end if;
|
||||
end loop label1;
|
||||
until done end repeat;
|
||||
end loop;
|
||||
until done end repeat;
|
||||
end while;
|
||||
end if;
|
||||
end while;
|
||||
end;
|
||||
end if;
|
||||
until done end repeat;
|
||||
until done end repeat;
|
||||
end if;
|
||||
end;
|
||||
end while;
|
||||
end $$
|
||||
drop procedure p_37269;
|
||||
drop procedure if exists p_37228;
|
||||
create procedure p_37228 ()
|
||||
BEGIN
|
||||
DECLARE v INT DEFAULT 123;
|
||||
IF (v > 1) THEN SET v = 1;
|
||||
ELSEIF (v < 10) THEN SET v = 10;
|
||||
ELSEIF (v < 11) THEN SET v = 11;
|
||||
ELSEIF (v < 12) THEN SET v = 12;
|
||||
ELSEIF (v < 13) THEN SET v = 13;
|
||||
ELSEIF (v < 14) THEN SET v = 14;
|
||||
ELSEIF (v < 15) THEN SET v = 15;
|
||||
ELSEIF (v < 16) THEN SET v = 16;
|
||||
ELSEIF (v < 17) THEN SET v = 17;
|
||||
ELSEIF (v < 18) THEN SET v = 18;
|
||||
ELSEIF (v < 19) THEN SET v = 19;
|
||||
ELSEIF (v < 20) THEN SET v = 20;
|
||||
ELSEIF (v < 21) THEN SET v = 21;
|
||||
ELSEIF (v < 22) THEN SET v = 22;
|
||||
ELSEIF (v < 23) THEN SET v = 23;
|
||||
ELSEIF (v < 24) THEN SET v = 24;
|
||||
ELSEIF (v < 25) THEN SET v = 25;
|
||||
ELSEIF (v < 26) THEN SET v = 26;
|
||||
ELSEIF (v < 27) THEN SET v = 27;
|
||||
ELSEIF (v < 28) THEN SET v = 28;
|
||||
ELSEIF (v < 29) THEN SET v = 29;
|
||||
ELSEIF (v < 30) THEN SET v = 30;
|
||||
ELSEIF (v < 31) THEN SET v = 31;
|
||||
ELSEIF (v < 32) THEN SET v = 32;
|
||||
ELSEIF (v < 33) THEN SET v = 33;
|
||||
ELSEIF (v < 34) THEN SET v = 34;
|
||||
ELSEIF (v < 35) THEN SET v = 35;
|
||||
ELSEIF (v < 36) THEN SET v = 36;
|
||||
ELSEIF (v < 37) THEN SET v = 37;
|
||||
ELSEIF (v < 38) THEN SET v = 38;
|
||||
ELSEIF (v < 39) THEN SET v = 39;
|
||||
END IF;
|
||||
END $$
|
||||
drop procedure p_37228;
|
6
mysql-test/r/perror-win.result
Normal file
6
mysql-test/r/perror-win.result
Normal file
@ -0,0 +1,6 @@
|
||||
MySQL error code 150: Foreign key constraint is incorrectly formed
|
||||
Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
|
||||
OS error code 23: Too many open files in system
|
||||
Win32 error code 23: Data error (cyclic redundancy check).
|
||||
Win32 error code 1062: The service has not been started.
|
||||
Illegal error code: 30000
|
@ -468,7 +468,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 14 N 1 31 8
|
||||
@ -484,7 +484,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 5 Y 0 31 8
|
||||
def possible_keys 253 4096 7 Y 0 31 8
|
||||
def key 253 64 7 Y 0 31 8
|
||||
def key_len 253 1365 1 Y 0 31 8
|
||||
def key_len 253 4096 1 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 27 N 1 31 8
|
||||
|
@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
@ -1159,7 +1159,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
@ -1201,7 +1201,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
@ -4223,7 +4223,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8
|
||||
def type 253 10 3 Y 0 31 8
|
||||
def possible_keys 253 4096 0 Y 0 31 8
|
||||
def key 253 64 0 Y 0 31 8
|
||||
def key_len 253 1365 0 Y 0 31 8
|
||||
def key_len 253 4096 0 Y 0 31 8
|
||||
def ref 253 1024 0 Y 0 31 8
|
||||
def rows 8 10 1 Y 32928 0 63
|
||||
def Extra 253 255 0 N 1 31 8
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -20,5 +20,36 @@ master_password='',master_port=SLAVE_PORT;
|
||||
start slave;
|
||||
flush logs;
|
||||
show slave status;
|
||||
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
|
||||
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 208 # # slave-bin.000001 Yes Yes 0 0 208 # None 0 No #
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File master-bin.000001
|
||||
Read_Master_Log_Pos 98
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running Yes
|
||||
Slave_SQL_Running Yes
|
||||
Replicate_Do_DB
|
||||
Replicate_Ignore_DB
|
||||
Replicate_Do_Table
|
||||
Replicate_Ignore_Table #
|
||||
Replicate_Wild_Do_Table
|
||||
Replicate_Wild_Ignore_Table
|
||||
Last_Errno 0
|
||||
Last_Error
|
||||
Skip_Counter 0
|
||||
Exec_Master_Log_Pos 98
|
||||
Relay_Log_Space #
|
||||
Until_Condition None
|
||||
Until_Log_File
|
||||
Until_Log_Pos 0
|
||||
Master_SSL_Allowed No
|
||||
Master_SSL_CA_File
|
||||
Master_SSL_CA_Path
|
||||
Master_SSL_Cert
|
||||
Master_SSL_Cipher
|
||||
Master_SSL_Key
|
||||
Seconds_Behind_Master #
|
||||
|
@ -12,18 +12,18 @@ user host
|
||||
dummy localhost
|
||||
dummy1 localhost
|
||||
dummy2 localhost
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
|
||||
COUNT(*)
|
||||
6
|
||||
3
|
||||
**** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||
user host
|
||||
dummy localhost
|
||||
dummy1 localhost
|
||||
dummy2 localhost
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
|
||||
COUNT(*)
|
||||
6
|
||||
3
|
||||
**** On Master ****
|
||||
DROP USER nonexisting@localhost;
|
||||
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
|
||||
@ -32,15 +32,15 @@ ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
|
||||
DROP USER dummy1@localhost, dummy2@localhost;
|
||||
SELECT user, host FROM mysql.user WHERE user != 'root';
|
||||
user host
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
|
||||
COUNT(*)
|
||||
3
|
||||
0
|
||||
**** On Slave ****
|
||||
SELECT user,host FROM mysql.user WHERE user != 'root';
|
||||
user host
|
||||
SELECT COUNT(*) FROM mysql.user;
|
||||
SELECT COUNT(*) FROM mysql.user WHERE user != 'root' or (host != 'localhost' and host != @hostname);
|
||||
COUNT(*)
|
||||
3
|
||||
0
|
||||
SHOW SLAVE STATUS;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
|
@ -7,7 +7,7 @@ start slave;
|
||||
stop slave;
|
||||
reset master;
|
||||
reset slave;
|
||||
reset master;
|
||||
start slave;
|
||||
create table t1(n int not null auto_increment primary key);
|
||||
insert into t1 values (NULL);
|
||||
drop table t1;
|
||||
@ -25,8 +25,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1
|
||||
master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 338 Query 1 414 use `test`; drop table t1
|
||||
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
|
||||
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
|
||||
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
|
||||
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=#
|
||||
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
|
||||
show binlog events from 98 limit 1;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
@ -41,7 +41,6 @@ master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
flush logs;
|
||||
create table t5 (a int);
|
||||
drop table t5;
|
||||
start slave;
|
||||
flush logs;
|
||||
stop slave;
|
||||
create table t1 (n int);
|
||||
@ -55,8 +54,8 @@ master-bin.000001 219 Intvar 1 247 INSERT_ID=1
|
||||
master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
master-bin.000001 338 Query 1 414 use `test`; drop table t1
|
||||
master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
|
||||
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
|
||||
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
|
||||
master-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
|
||||
master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile 'words.dat' into table t1 ignore 1 lines ;file_id=#
|
||||
master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
|
||||
master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4
|
||||
show binlog events in 'master-bin.000002';
|
||||
@ -84,8 +83,8 @@ slave-bin.000001 219 Intvar 1 247 INSERT_ID=1
|
||||
slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
|
||||
slave-bin.000001 338 Query 1 414 use `test`; drop table t1
|
||||
slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
|
||||
slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
|
||||
slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
|
||||
slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=#;block_len=#
|
||||
slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE 'words.dat' INTO table t1 ignore 1 lines ;file_id=#
|
||||
slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1
|
||||
slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int)
|
||||
slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5
|
||||
|
@ -502,7 +502,7 @@ master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(col VARCHAR(10))
|
||||
master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
|
||||
INSERT INTO t1 VALUES(arg)
|
||||
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
|
||||
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
|
||||
master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE p1
|
||||
master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
||||
SET @a = 1
|
||||
@ -841,7 +841,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10))
|
||||
INSERT INTO t1 VALUES(arg)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=t/*!*/;
|
||||
INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test'))
|
||||
INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci'))
|
||||
/*!*/;
|
||||
SET TIMESTAMP=t/*!*/;
|
||||
DROP PROCEDURE p1
|
||||
|
@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
|
||||
-- after Bug#29394 is implemented.
|
||||
check table t1 fast;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 27 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 27 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status Table is already up to date
|
||||
check table t1 fast;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 27 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 27 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status Table is already up to date
|
||||
check table t1 changed;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
insert into t1 values (5,5,5);
|
||||
check table t1 changed;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
check table t1 medium;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
check table t1 extended;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 5 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 5 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
show index from t1;
|
||||
@ -84,10 +84,10 @@ ERROR 23000: Duplicate entry '5' for key 1
|
||||
-- after Bug#29394 is implemented.
|
||||
optimize table t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 8 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 8 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
optimize table t1;
|
||||
@ -154,10 +154,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0
|
||||
-- after Bug#29394 is implemented.
|
||||
analyze table t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 7 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 7 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show index from t1;
|
||||
@ -171,10 +171,10 @@ t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE
|
||||
-- after Bug#29394 is implemented.
|
||||
repair table t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 42 7 Y 0 31 8
|
||||
def Op 253 3 6 Y 0 31 8
|
||||
def Msg_type 253 3 6 Y 0 31 8
|
||||
def Msg_text 253 85 2 Y 0 31 8
|
||||
def Table 253 128 7 Y 0 31 8
|
||||
def Op 253 10 6 Y 0 31 8
|
||||
def Msg_type 253 10 6 Y 0 31 8
|
||||
def Msg_text 253 255 2 Y 0 31 8
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
show index from t1;
|
||||
@ -788,8 +788,8 @@ latin1_bin latin1 47 Yes 1
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE DATABASE mysqltest1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Database 253 63 10 N 1 31 33
|
||||
def Create Database 253 1023 69 N 1 31 33
|
||||
def Database 253 192 10 N 1 31 33
|
||||
def Create Database 253 3072 69 N 1 31 33
|
||||
Database Create Database
|
||||
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
----------------------------------------------------------------
|
||||
@ -801,8 +801,8 @@ mysqltest1
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE TABLE t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 63 2 N 1 31 33
|
||||
def Create Table 253 1023 103 N 1 31 33
|
||||
def Table 253 192 2 N 1 31 33
|
||||
def Create Table 253 3072 103 N 1 31 33
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` int(11) NOT NULL,
|
||||
@ -959,8 +959,8 @@ NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE VIEW v1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def View 253 63 2 N 1 31 33
|
||||
def Create View 253 1023 103 N 1 31 33
|
||||
def View 253 192 2 N 1 31 33
|
||||
def Create View 253 3072 103 N 1 31 33
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`
|
||||
----------------------------------------------------------------
|
||||
@ -981,9 +981,9 @@ NULL test v1 /* ALGORITHM=UNDEFINED */ select 1 AS `1` NONE NO root@localhost DE
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE PROCEDURE p1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Procedure 253 63 2 N 1 31 33
|
||||
def Procedure 253 192 2 N 1 31 33
|
||||
def sql_mode 253 0 0 N 1 31 33
|
||||
def Create Procedure 253 2046 59 Y 0 31 33
|
||||
def Create Procedure 253 6144 59 Y 0 31 33
|
||||
Procedure sql_mode Create Procedure
|
||||
p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
||||
SELECT 1
|
||||
@ -1033,9 +1033,9 @@ p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL D
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE FUNCTION f1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Function 253 63 2 N 1 31 33
|
||||
def Function 253 192 2 N 1 31 33
|
||||
def sql_mode 253 0 0 N 1 31 33
|
||||
def Create Function 253 2046 74 Y 0 31 33
|
||||
def Create Function 253 6144 74 Y 0 31 33
|
||||
Function sql_mode Create Function
|
||||
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
|
||||
RETURN 1
|
||||
@ -1141,4 +1141,34 @@ Slow_queries 2
|
||||
show variables like 'myisam_recover_options';
|
||||
Variable_name Value
|
||||
myisam_recover_options OFF
|
||||
CREATE TABLE t1 (
|
||||
Codigo int(10) unsigned NOT NULL auto_increment,
|
||||
Nombre varchar(255) default NULL,
|
||||
Telefono varchar(255) default NULL,
|
||||
Observaciones longtext,
|
||||
Direccion varchar(255) default NULL,
|
||||
Dni varchar(255) default NULL,
|
||||
CP int(11) default NULL,
|
||||
Provincia varchar(255) default NULL,
|
||||
Poblacion varchar(255) default NULL,
|
||||
PRIMARY KEY (Codigo)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
|
||||
show create table t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def Table 253 64 2 N 1 31 7
|
||||
def Create Table 253 1024 446 N 1 31 7
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`Codigo` int(10) unsigned NOT NULL auto_increment,
|
||||
`Nombre` varchar(255) default NULL,
|
||||
`Telefono` varchar(255) default NULL,
|
||||
`Observaciones` longtext,
|
||||
`Direccion` varchar(255) default NULL,
|
||||
`Dni` varchar(255) default NULL,
|
||||
`CP` int(11) default NULL,
|
||||
`Provincia` varchar(255) default NULL,
|
||||
`Poblacion` varchar(255) default NULL,
|
||||
PRIMARY KEY (`Codigo`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
@ -1513,3 +1513,10 @@ end loop label1;
|
||||
end loop;
|
||||
end|
|
||||
ERROR 42000: End-label label1 without match
|
||||
CREATE TABLE t1 (a INT)|
|
||||
INSERT INTO t1 VALUES (1),(2)|
|
||||
CREATE PROCEDURE p1(a INT) BEGIN END|
|
||||
CALL p1((SELECT * FROM t1))|
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
DROP PROCEDURE IF EXISTS p1|
|
||||
DROP TABLE t1|
|
||||
|
@ -6646,6 +6646,63 @@ ttt
|
||||
2
|
||||
drop function func30787;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4);
|
||||
CREATE PROCEDURE test_sp()
|
||||
SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
|
||||
CALL test_sp();
|
||||
id
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
CALL test_sp();
|
||||
id
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
DROP PROCEDURE test_sp;
|
||||
DROP TABLE t1;
|
||||
create table t1(c1 INT);
|
||||
create function f1(p1 int) returns varchar(32)
|
||||
return 'aaa';
|
||||
create view v1 as select f1(c1) as parent_control_name from t1;
|
||||
create procedure p1()
|
||||
begin
|
||||
select parent_control_name as c1 from v1;
|
||||
end //
|
||||
call p1();
|
||||
c1
|
||||
call p1();
|
||||
c1
|
||||
drop procedure p1;
|
||||
drop function f1;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop procedure if exists `p2` $
|
||||
create procedure `p2`(in `a` text charset utf8)
|
||||
begin
|
||||
declare `pos` int default 1;
|
||||
declare `str` text charset utf8;
|
||||
set `str` := `a`;
|
||||
select substr(`str`, `pos`+ 1 ) into `str`;
|
||||
end $
|
||||
call `p2`('s s s s s s');
|
||||
drop procedure `p2`;
|
||||
drop table if exists t1;
|
||||
drop procedure if exists p1;
|
||||
create procedure p1() begin select * from t1; end$
|
||||
call p1$
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
create table t1 (a integer)$
|
||||
call p1$
|
||||
a
|
||||
alter table t1 add b integer;
|
||||
call p1$
|
||||
a
|
||||
drop table t1;
|
||||
drop procedure p1;
|
||||
# ------------------------------------------------------------------
|
||||
# -- End of 5.0 tests
|
||||
# ------------------------------------------------------------------
|
||||
|
64
mysql-test/r/status2.result
Normal file
64
mysql-test/r/status2.result
Normal file
@ -0,0 +1,64 @@
|
||||
#
|
||||
# Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
|
||||
#
|
||||
FLUSH STATUS;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
CREATE FUNCTION f1() RETURNS INTEGER
|
||||
BEGIN
|
||||
DECLARE foo INTEGER;
|
||||
DECLARE bar INTEGER;
|
||||
SET foo=1;
|
||||
SET bar=2;
|
||||
RETURN foo;
|
||||
END $$
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
SELECT 1;
|
||||
END $$
|
||||
CREATE TABLE t1 (c1 INT);
|
||||
CREATE TABLE t2 (c1 INT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
Assert Questions == 9
|
||||
SHOW STATUS LIKE 'Questions';
|
||||
Variable_name Value
|
||||
Questions 9
|
||||
SELECT f1();
|
||||
f1()
|
||||
1
|
||||
Assert Questions == 11
|
||||
SHOW STATUS LIKE 'Questions';
|
||||
Variable_name Value
|
||||
Questions 11
|
||||
CALL p1();
|
||||
1
|
||||
1
|
||||
Assert Questions == 13
|
||||
SHOW STATUS LIKE 'Questions';
|
||||
Variable_name Value
|
||||
Questions 13
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
Assert Questions == 15
|
||||
SHOW STATUS LIKE 'Questions';
|
||||
Variable_name Value
|
||||
Questions 15
|
||||
FLUSH STATUS;
|
||||
SELECT 1;
|
||||
1
|
||||
1
|
||||
Assert Questions == 16
|
||||
SHOW STATUS LIKE 'Questions';
|
||||
Variable_name Value
|
||||
Questions 16
|
||||
Global status updated; Assert diff == 4
|
||||
FLUSH STATUS;
|
||||
SELECT 4;
|
||||
4
|
||||
4
|
||||
DROP TABLE t1,t2;
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
End of 6.0 tests
|
@ -4396,4 +4396,60 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
Warnings:
|
||||
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a));
|
||||
INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
|
||||
CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a));
|
||||
INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
|
||||
SELECT * FROM t1
|
||||
WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
|
||||
pk a
|
||||
1 10
|
||||
3 30
|
||||
2 20
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (s1 char(1));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
|
||||
s1
|
||||
a
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(id BIGINT);
|
||||
CREATE TABLE t2(id1 BIGINT, id2 BIGINT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
INSERT INTO t2 VALUES (2,1),(3,1);
|
||||
SELECT * FROM t1 i WHERE 1 IN (SELECT l.id2 FROM t2 l WHERE i.id=l.id1);
|
||||
id
|
||||
2
|
||||
3
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (id int);
|
||||
CREATE TABLE t2 (id int, c int);
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
INSERT INTO t1 (id) VALUES (1);
|
||||
INSERT INTO t2 (id) VALUES (1);
|
||||
CREATE VIEW v1 AS
|
||||
SELECT t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
UPDATE v1 SET c=1;
|
||||
CREATE VIEW v2 (a,b) AS
|
||||
SELECT t2.id, t2.c AS c FROM t1, t2
|
||||
WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
INSERT INTO v2(a,b) VALUES (2,2);
|
||||
ERROR HY000: CHECK OPTION failed 'test.v2'
|
||||
INSERT INTO v2(a,b) VALUES (1,2);
|
||||
SELECT * FROM v1;
|
||||
c
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
CREATE VIEW v3 AS
|
||||
SELECT t2.c AS c FROM t2
|
||||
WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION;
|
||||
DELETE FROM v3;
|
||||
DROP VIEW v1,v2,v3;
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests.
|
||||
|
@ -779,4 +779,20 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
|
||||
1
|
||||
1
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
pk INT PRIMARY KEY,
|
||||
int_key INT,
|
||||
varchar_key VARCHAR(5) UNIQUE,
|
||||
varchar_nokey VARCHAR(5)
|
||||
);
|
||||
INSERT INTO t1 VALUES (9, 7,NULL,NULL), (10,8,'p' ,'p');
|
||||
SELECT varchar_nokey
|
||||
FROM t1
|
||||
WHERE NULL NOT IN (
|
||||
SELECT INNR.pk FROM t1 AS INNR2
|
||||
LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key )
|
||||
WHERE INNR.varchar_key > 'n{'
|
||||
);
|
||||
varchar_nokey
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -57,8 +57,6 @@ t9 CREATE TABLE `t9` (
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
Got one of the listed errors
|
||||
alter table t9 rename mysqltest.t9;
|
||||
select count(*) from mysqltest.t9;
|
||||
count(*)
|
||||
|
@ -110,7 +110,7 @@ i ts
|
||||
362793610 1981-07-01 04:00:00
|
||||
select from_unixtime(362793609);
|
||||
from_unixtime(362793609)
|
||||
1981-07-01 03:59:60
|
||||
1981-07-01 03:59:59
|
||||
drop table t1;
|
||||
create table t1 (ts timestamp);
|
||||
set time_zone='UTC';
|
||||
|
@ -17,6 +17,9 @@ insert into t1 values
|
||||
insert into t1 values
|
||||
(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'),
|
||||
(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00');
|
||||
insert into t1 values
|
||||
(unix_timestamp('2009-01-01 02:59:59'),'2009-01-01 02:59:59'),
|
||||
(unix_timestamp('2009-01-01 03:00:00'),'2009-01-01 03:00:00');
|
||||
select i, from_unixtime(i), c from t1;
|
||||
i from_unixtime(i) c
|
||||
1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00
|
||||
@ -31,6 +34,8 @@ i from_unixtime(i) c
|
||||
1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59
|
||||
362793608 1981-07-01 03:59:59 1981-07-01 03:59:59
|
||||
362793610 1981-07-01 04:00:00 1981-07-01 04:00:00
|
||||
1230768022 2009-01-01 02:59:59 2009-01-01 02:59:59
|
||||
1230768024 2009-01-01 03:00:00 2009-01-01 03:00:00
|
||||
drop table t1;
|
||||
create table t1 (ts timestamp);
|
||||
insert into t1 values (19730101235900), (20040101235900);
|
||||
@ -39,3 +44,6 @@ ts
|
||||
1973-01-01 23:59:00
|
||||
2004-01-01 23:59:00
|
||||
drop table t1;
|
||||
SELECT FROM_UNIXTIME(1230768022), FROM_UNIXTIME(1230768023), FROM_UNIXTIME(1230768024);
|
||||
FROM_UNIXTIME(1230768022) FROM_UNIXTIME(1230768023) FROM_UNIXTIME(1230768024)
|
||||
2009-01-01 02:59:59 2009-01-01 02:59:59 2009-01-01 03:00:00
|
||||
|
@ -684,4 +684,28 @@ SELECT 1 FROM t1 GROUP BY a;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (b BIT NOT NULL, i2 INTEGER NOT NULL, s VARCHAR(255) NOT NULL);
|
||||
INSERT INTO t1 VALUES(0x01,100,''), (0x00,300,''), (0x01,200,''), (0x00,100,'');
|
||||
SELECT HEX(b), i2 FROM t1 WHERE (i2>=100 AND i2<201) AND b=TRUE;
|
||||
HEX(b) i2
|
||||
1 100
|
||||
1 200
|
||||
CREATE TABLE t2 (b1 BIT NOT NULL, b2 BIT NOT NULL, i2 INTEGER NOT NULL,
|
||||
s VARCHAR(255) NOT NULL);
|
||||
INSERT INTO t2 VALUES (0x01,0x00,100,''), (0x00,0x01,300,''),
|
||||
(0x01,0x00,200,''), (0x00,0x01,100,'');
|
||||
SELECT HEX(b1), i2 FROM t2 WHERE (i2>=100 AND i2<201) AND b1=TRUE;
|
||||
HEX(b1) i2
|
||||
1 100
|
||||
1 200
|
||||
SELECT HEX(b2), i2 FROM t2 WHERE (i2>=100 AND i2<201) AND b2=FALSE;
|
||||
HEX(b2) i2
|
||||
0 100
|
||||
0 200
|
||||
SELECT HEX(b1), HEX(b2), i2 FROM t2
|
||||
WHERE (i2>=100 AND i2<201) AND b1=TRUE AND b2=FALSE;
|
||||
HEX(b1) HEX(b2) i2
|
||||
1 0 100
|
||||
1 0 200
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests
|
||||
|
@ -560,4 +560,27 @@ select * from t2
|
||||
where id in (select id from t2 as x1 where (t2.cur_date is null));
|
||||
id cur_date
|
||||
drop table t1,t2;
|
||||
SELECT
|
||||
CAST('NULL' AS DATE) <=> CAST('2008-01-01' AS DATE) n1,
|
||||
CAST('2008-01-01' AS DATE) <=> CAST('NULL' AS DATE) n2,
|
||||
CAST('NULL' AS DATE) <=> CAST('NULL' AS DATE) n3,
|
||||
CAST('NULL' AS DATE) <> CAST('2008-01-01' AS DATE) n4,
|
||||
CAST('2008-01-01' AS DATE) <> CAST('NULL' AS DATE) n5,
|
||||
CAST('NULL' AS DATE) <> CAST('NULL' AS DATE) n6,
|
||||
CAST('NULL' AS DATE) < CAST('2008-01-01' AS DATE) n7,
|
||||
CAST('2008-01-01' AS DATE) < CAST('NULL' AS DATE) n8,
|
||||
CAST('NULL' AS DATE) < CAST('NULL' AS DATE) n9;
|
||||
n1 n2 n3 n4 n5 n6 n7 n8 n9
|
||||
0 0 1 NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
Warning 1292 Truncated incorrect datetime value: 'NULL'
|
||||
End of 5.0 tests
|
||||
|
@ -1519,4 +1519,24 @@ SELECT f1 FROM t1;
|
||||
f1
|
||||
99999999999999999999999999999.999999999999999999999999999999
|
||||
DROP TABLE t1;
|
||||
select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
|
||||
1.01500000 * 1.01500000 * 0.99500000);
|
||||
(1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 *
|
||||
1.01500000 * 1.01500000 * 0.99500000)
|
||||
0.812988073953673124592306939480
|
||||
create table t1 as select 5.05 / 0.014;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Note 1265 Data truncated for column '5.05 / 0.014' at row 1
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`5.05 / 0.014` decimal(10,6) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
select * from t1;
|
||||
5.05 / 0.014
|
||||
360.714286
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -625,7 +625,7 @@ drop table t1;
|
||||
create table t1 (a int, b int);
|
||||
create view v1 as select a, sum(b) from t1 group by a;
|
||||
select b from v1 use index (some_index) where b=1;
|
||||
ERROR HY000: Incorrect usage of USE INDEX and VIEW
|
||||
ERROR HY000: Key 'some_index' doesn't exist in table 'v1'
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table t1 (col1 char(5),col2 char(5));
|
||||
@ -3567,11 +3567,11 @@ CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM v1 USE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of USE INDEX and VIEW
|
||||
ERROR HY000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of FORCE INDEX and VIEW
|
||||
ERROR HY000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE KEY(non_existant);
|
||||
ERROR HY000: Incorrect usage of IGNORE INDEX and VIEW
|
||||
ERROR HY000: Key 'non_existant' doesn't exist in table 'v1'
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0,
|
||||
@ -3677,6 +3677,33 @@ DROP VIEW v1;
|
||||
|
||||
# -- End of test case for Bug#35193.
|
||||
|
||||
CREATE VIEW v1 AS SELECT 1;
|
||||
DROP VIEW v1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2));
|
||||
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
|
||||
SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
c1 c2
|
||||
2 2
|
||||
SELECT * FROM t1 USE INDEX (c2) WHERE c2=2;
|
||||
c1 c2
|
||||
2 2
|
||||
CREATE VIEW v1 AS SELECT c1, c2 FROM t1;
|
||||
SHOW INDEX FROM v1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2;
|
||||
ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 USE INDEX (c2) WHERE c2=2;
|
||||
ERROR HY000: Key 'c2' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2;
|
||||
ERROR HY000: Key 'c2' doesn't exist in table 'v1'
|
||||
SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
|
||||
ERROR HY000: Key 'c2' doesn't exist in table 'v1'
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
# -----------------------------------------------------------------
|
||||
# -- End of 5.0 tests.
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -18,4 +18,5 @@ EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
@ -55,3 +55,23 @@ select * from t1;
|
||||
a
|
||||
20
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
|
||||
insert into t1 values(1, 1, 'a');
|
||||
insert into t1 values(2, 2, 'b');
|
||||
xa start 'a','b';
|
||||
update t1 set c = 'aa' where a = 1;
|
||||
xa start 'a','c';
|
||||
update t1 set c = 'bb' where a = 2;
|
||||
update t1 set c = 'bb' where a = 2;
|
||||
update t1 set c = 'aa' where a = 1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2
|
||||
xa end 'a','c';
|
||||
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
|
||||
xa rollback 'a','c';
|
||||
xa start 'a','c';
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
Binary file not shown.
@ -157,10 +157,16 @@ DROP VIEW IF EXISTS v1;
|
||||
|
||||
--disable_query_log
|
||||
# Storage for the SELECTs to be used for the VIEW definition
|
||||
# Attention: my_select must be no too small because a statement like
|
||||
# SELECT LOAD_FILE(< file in MYSQLTEST_VARDIR >)
|
||||
# AS my_col,
|
||||
# id FROM t1_values';
|
||||
# might be a very long
|
||||
# Bug#38427 "Data too long" ... tests "<ENGINE>_func_view" fail
|
||||
CREATE TABLE t1_selects
|
||||
(
|
||||
id BIGINT AUTO_INCREMENT,
|
||||
my_select VARCHAR(200) NOT NULL,
|
||||
my_select VARCHAR(1000) NOT NULL,
|
||||
disable_result ENUM('Yes','No') NOT NULL default 'No',
|
||||
PRIMARY KEY(id),
|
||||
UNIQUE (my_select)
|
||||
|
@ -1,14 +1,96 @@
|
||||
#################################################################################
|
||||
# Author: Serge Kozlov #
|
||||
# Date: 09/21/2005 #
|
||||
# Purpose: used by ../t/*_charset.test #
|
||||
# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling #
|
||||
# Author: Serge Kozlov #
|
||||
# Date: 2005-09-21 #
|
||||
# Purpose: used by ../t/*_charset.test #
|
||||
# Require: set $engine_type= [NDB,MyISAM,InnoDB,etc] before calling #
|
||||
# #
|
||||
# Last modification: Matthias Leich #
|
||||
# Date: 2008-07-02 #
|
||||
# Purpose: Fix Bug#37160 funcs_2: The tests do not check if optional character #
|
||||
# sets exist. #
|
||||
# Add checking of prerequisites + minor cleanup #
|
||||
#################################################################################
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
# Check that all character sets needed are available
|
||||
# Note(mleich):
|
||||
# It is intentional that the common solution with
|
||||
# "--source include/have_<character set>.inc"
|
||||
# is not applied.
|
||||
# - We currently do not have such a prerequisite test for every character set
|
||||
# /collation needed.
|
||||
# - There is also no real value in mentioning the first missing character set
|
||||
# /collation within the "skip message" because it is most probably only
|
||||
# one of many.
|
||||
#
|
||||
# Hint: 5 character_set_names per source line if possible
|
||||
if (`SELECT COUNT(*) <> 36 FROM information_schema.character_sets
|
||||
WHERE CHARACTER_SET_NAME IN (
|
||||
'armscii8', 'ascii' , 'big5' , 'binary' , 'cp1250',
|
||||
'cp1251' , 'cp1256' , 'cp1257' , 'cp850' , 'cp852' ,
|
||||
'cp866' , 'cp932' , 'dec8' , 'eucjpms', 'euckr' ,
|
||||
'gb2312' , 'gbk' , 'geostd8', 'greek' , 'hebrew',
|
||||
'hp8' , 'keybcs2', 'koi8r' , 'koi8u' , 'latin1',
|
||||
'latin2' , 'latin5' , 'latin7' , 'macce' , 'macroman',
|
||||
'sjis' , 'swe7' , 'tis620' , 'ucs2' , 'ujis',
|
||||
'utf8'
|
||||
)`)
|
||||
{
|
||||
--skip Not all character sets required for this test are present
|
||||
}
|
||||
# Check that all collations needed are available
|
||||
# Hint: 4 collation_names per source line if possible
|
||||
if (`SELECT COUNT(*) <> 123 FROM information_schema.collations
|
||||
WHERE collation_name IN (
|
||||
'armscii8_bin', 'armscii8_general_ci', 'ascii_bin', 'ascii_general_ci',
|
||||
'big5_bin', 'big5_chinese_ci', 'cp1250_bin', 'cp1250_croatian_ci',
|
||||
'cp1250_czech_cs', 'cp1250_general_ci', 'cp1251_bin', 'cp1251_bulgarian_ci',
|
||||
'cp1251_general_ci', 'cp1251_general_cs', 'cp1251_ukrainian_ci', 'cp1256_bin',
|
||||
'cp1256_general_ci', 'cp1257_bin', 'cp1257_general_ci', 'cp1257_lithuanian_ci',
|
||||
'cp850_bin', 'cp850_general_ci', 'cp852_bin', 'cp852_general_ci',
|
||||
'cp866_bin', 'cp866_general_ci', 'cp932_bin', 'cp932_japanese_ci',
|
||||
'dec8_bin', 'dec8_swedish_ci', 'eucjpms_bin', 'eucjpms_japanese_ci',
|
||||
'euckr_bin', 'euckr_korean_ci', 'gb2312_bin', 'gb2312_chinese_ci',
|
||||
'gbk_bin', 'gbk_chinese_ci', 'geostd8_bin', 'geostd8_general_ci',
|
||||
'greek_bin', 'greek_general_ci', 'hebrew_bin', 'hebrew_general_ci',
|
||||
'hp8_bin', 'hp8_english_ci', 'keybcs2_bin', 'keybcs2_general_ci',
|
||||
'koi8r_bin', 'koi8r_general_ci', 'koi8u_bin', 'koi8u_general_ci',
|
||||
'latin1_bin', 'latin1_danish_ci', 'latin1_general_ci', 'latin1_general_cs',
|
||||
'latin1_german1_ci', 'latin1_german2_ci', 'latin1_spanish_ci', 'latin1_swedish_ci',
|
||||
'latin2_bin', 'latin2_croatian_ci', 'latin2_czech_cs', 'latin2_general_ci',
|
||||
'latin2_hungarian_ci', 'latin5_bin', 'latin5_turkish_ci', 'latin7_bin',
|
||||
'latin7_estonian_cs', 'latin7_general_ci', 'latin7_general_cs', 'macce_bin',
|
||||
'macce_general_ci', 'macroman_bin', 'macroman_general_ci', 'sjis_bin',
|
||||
'sjis_japanese_ci', 'swe7_bin', 'swe7_swedish_ci', 'tis620_bin',
|
||||
'tis620_thai_ci', 'ucs2_bin', 'ucs2_czech_ci', 'ucs2_danish_ci',
|
||||
'ucs2_estonian_ci', 'ucs2_general_ci', 'ucs2_hungarian_ci', 'ucs2_icelandic_ci',
|
||||
'ucs2_latvian_ci', 'ucs2_lithuanian_ci', 'ucs2_persian_ci', 'ucs2_polish_ci',
|
||||
'ucs2_roman_ci', 'ucs2_romanian_ci', 'ucs2_slovak_ci', 'ucs2_slovenian_ci',
|
||||
'ucs2_spanish2_ci', 'ucs2_spanish_ci', 'ucs2_swedish_ci', 'ucs2_turkish_ci',
|
||||
'ucs2_unicode_ci', 'ujis_bin', 'ujis_japanese_ci', 'utf8_bin',
|
||||
'utf8_czech_ci', 'utf8_danish_ci', 'utf8_estonian_ci', 'utf8_general_ci',
|
||||
'utf8_hungarian_ci', 'utf8_icelandic_ci', 'utf8_latvian_ci', 'utf8_lithuanian_ci',
|
||||
'utf8_persian_ci', 'utf8_polish_ci', 'utf8_roman_ci', 'utf8_romanian_ci',
|
||||
'utf8_slovak_ci', 'utf8_slovenian_ci', 'utf8_spanish2_ci', 'utf8_spanish_ci',
|
||||
'utf8_swedish_ci', 'utf8_turkish_ci', 'utf8_unicode_ci'
|
||||
)`)
|
||||
{
|
||||
--skip Not all collations required for this test are present
|
||||
}
|
||||
|
||||
################################
|
||||
let $check_std_csets= 1;
|
||||
let $check_ucs2_csets= 1;
|
||||
let $check_utf8_csets= 1;
|
||||
|
||||
#
|
||||
# Check all charsets/collation combinations
|
||||
#
|
||||
|
||||
################################
|
||||
let $check_std_csets= 1;
|
||||
let $check_ucs2_csets= 1;
|
||||
let $check_utf8_csets= 1;
|
||||
|
@ -1,8 +1,10 @@
|
||||
#################################################################################
|
||||
# Author: Serge Kozlov #
|
||||
# Date: 09/21/2005 #
|
||||
# Purpose: Testing the charsets for InnoDB engine #
|
||||
#################################################################################
|
||||
################################################################################
|
||||
# Author: Serge Kozlov #
|
||||
# Date: 2005-09-21 #
|
||||
# Purpose: Testing the charsets for InnoDB engine #
|
||||
# #
|
||||
# Checking of other prerequisites is in charset_master.test #
|
||||
################################################################################
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user