Auto-merge from mysql-next-mr.
This commit is contained in:
commit
a5cdaab3eb
@ -1303,7 +1303,11 @@ set_linux_configs()
|
||||
compiler_flags="$compiler_flags -m32"
|
||||
fi
|
||||
if test "x$fast_flag" != "xno" ; then
|
||||
compiler_flags="$compiler_flags -O2"
|
||||
if test "x$fast_flag" = "xyes" ; then
|
||||
compiler_flags="$compiler_flags -O3"
|
||||
else
|
||||
compiler_flags="$compiler_flags -O2"
|
||||
fi
|
||||
else
|
||||
compiler_flags="$compiler_flags -O0"
|
||||
fi
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2001-2006 MySQL AB
|
||||
/* Copyright (C) 2001-2006 MySQL AB, 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -87,3 +87,24 @@ enum options_client
|
||||
OPT_INIT_COMMAND,
|
||||
OPT_MAX_CLIENT_OPTION
|
||||
};
|
||||
|
||||
/**
|
||||
First mysql version supporting the information schema.
|
||||
*/
|
||||
#define FIRST_INFORMATION_SCHEMA_VERSION 50003
|
||||
|
||||
/**
|
||||
Name of the information schema database.
|
||||
*/
|
||||
#define INFORMATION_SCHEMA_DB_NAME "information_schema"
|
||||
|
||||
/**
|
||||
First mysql version supporting the performance schema.
|
||||
*/
|
||||
#define FIRST_PERFORMANCE_SCHEMA_VERSION 50600
|
||||
|
||||
/**
|
||||
Name of the performance schema database.
|
||||
*/
|
||||
#define PERFORMANCE_SCHEMA_DB_NAME "performance_schema"
|
||||
|
||||
|
@ -783,6 +783,10 @@ static int run_sql_fix_privilege_tables(void)
|
||||
found_real_errors++;
|
||||
print_line(line);
|
||||
}
|
||||
else if (strncmp(line, "WARNING", 7) == 0)
|
||||
{
|
||||
print_line(line);
|
||||
}
|
||||
} while ((line= get_line(line)) && *line);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -643,8 +643,11 @@ static int process_one_db(char *database)
|
||||
|
||||
static int use_db(char *database)
|
||||
{
|
||||
if (mysql_get_server_version(sock) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, database, "information_schema"))
|
||||
if (mysql_get_server_version(sock) >= FIRST_INFORMATION_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, database, INFORMATION_SCHEMA_DB_NAME))
|
||||
return 1;
|
||||
if (mysql_get_server_version(sock) >= FIRST_PERFORMANCE_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, database, PERFORMANCE_SCHEMA_DB_NAME))
|
||||
return 1;
|
||||
if (mysql_select_db(sock, database))
|
||||
{
|
||||
|
@ -3837,8 +3837,12 @@ static int dump_all_databases()
|
||||
return 1;
|
||||
while ((row= mysql_fetch_row(tableres)))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
|
||||
if (mysql_get_server_version(mysql) >= FIRST_INFORMATION_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], INFORMATION_SCHEMA_DB_NAME))
|
||||
continue;
|
||||
|
||||
if (mysql_get_server_version(mysql) >= FIRST_PERFORMANCE_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], PERFORMANCE_SCHEMA_DB_NAME))
|
||||
continue;
|
||||
|
||||
if (dump_all_tables_in_db(row[0]))
|
||||
@ -3855,8 +3859,12 @@ static int dump_all_databases()
|
||||
}
|
||||
while ((row= mysql_fetch_row(tableres)))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
|
||||
if (mysql_get_server_version(mysql) >= FIRST_INFORMATION_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], INFORMATION_SCHEMA_DB_NAME))
|
||||
continue;
|
||||
|
||||
if (mysql_get_server_version(mysql) >= FIRST_PERFORMANCE_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], PERFORMANCE_SCHEMA_DB_NAME))
|
||||
continue;
|
||||
|
||||
if (dump_all_views_in_db(row[0]))
|
||||
@ -4257,10 +4265,12 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
}
|
||||
end= pos;
|
||||
|
||||
/* Can't LOCK TABLES in INFORMATION_SCHEMA, so don't try. */
|
||||
/* Can't LOCK TABLES in I_S / P_S, so don't try. */
|
||||
if (lock_tables &&
|
||||
!(mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, db, "information_schema")))
|
||||
!(mysql_get_server_version(mysql) >= FIRST_INFORMATION_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, db, INFORMATION_SCHEMA_DB_NAME)) &&
|
||||
!(mysql_get_server_version(mysql) >= FIRST_PERFORMANCE_SCHEMA_VERSION &&
|
||||
!my_strcasecmp(&my_charset_latin1, db, PERFORMANCE_SCHEMA_DB_NAME)))
|
||||
{
|
||||
if (mysql_real_query(mysql, lock_tables_query.str,
|
||||
lock_tables_query.length-1))
|
||||
|
93
configure.in
93
configure.in
@ -880,10 +880,74 @@ AC_CHECK_DECLS(MHA_MAPSIZE_VA,
|
||||
#include <sys/mman.h>
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
fi
|
||||
|
||||
dnl Use of ALARMs to wakeup on timeout on sockets
|
||||
dnl
|
||||
dnl This feature makes use of a mutex and is a scalability hog we
|
||||
dnl try to avoid using. However we need support for SO_SNDTIMEO and
|
||||
dnl SO_RCVTIMEO socket options for this to work. So we will check
|
||||
dnl if this feature is supported by a simple AC_RUN_IFELSE macro. However
|
||||
dnl on some OS's there is support for setting those variables but
|
||||
dnl they are silently ignored. For those OS's we will not attempt
|
||||
dnl o use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work.
|
||||
dnl See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX.
|
||||
dnl To use alarm is simple, simply avoid setting anything.
|
||||
|
||||
|
||||
AC_CACHE_CHECK([whether SO_SNDTIMEO and SO_RCVTIMEO work],
|
||||
[mysql_cv_socket_timeout],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
]],[[
|
||||
int fd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
struct timeval tv;
|
||||
int ret= 0;
|
||||
tv.tv_sec= 2;
|
||||
tv.tv_usec= 0;
|
||||
ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||
ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||
return !!ret;
|
||||
]])],
|
||||
[mysql_cv_socket_timeout=yes],
|
||||
[mysql_cv_socket_timeout=no],
|
||||
[mysql_cv_socket_timeout=no
|
||||
AC_MSG_WARN([Socket timeout options disabled due to cross-compiling])])
|
||||
])
|
||||
|
||||
use_alarm=yes
|
||||
|
||||
if test "$mysql_cv_socket_timeout" = yes; then
|
||||
case $SYSTEM_TYPE in
|
||||
dnl We trust the result from the following systems
|
||||
*solaris*) use_alarm=no ;;
|
||||
*freebsd*) use_alarm=no ;;
|
||||
*darwin*) use_alarm=no ;;
|
||||
*)
|
||||
dnl We trust the result from Linux also
|
||||
if test "$TARGET_LINUX" = "true"; then
|
||||
use_alarm=no
|
||||
fi
|
||||
dnl We trust no one else for the moment
|
||||
dnl (Windows is hardcoded to not use alarms)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(alarm,
|
||||
AS_HELP_STRING([--with-alarm], [Use alarm to implement socket timeout.]),
|
||||
[use_alarm=$withval], [])
|
||||
|
||||
AC_MSG_CHECKING(whether to use alarms to implement socket timeout)
|
||||
if test "$use_alarm" = no ; then
|
||||
AC_DEFINE([NO_ALARM], [1], [No need to use alarm for socket timeout])
|
||||
AC_DEFINE([SIGNAL_WITH_VIO_CLOSE], [1], [Need to use vio close for kill connection])
|
||||
fi
|
||||
AC_MSG_RESULT($use_alarm)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Check for IPv6 support
|
||||
#--------------------------------------------------------------------
|
||||
@ -1825,6 +1889,7 @@ AC_CACHE_CHECK([whether the compiler provides atomic builtins],
|
||||
],
|
||||
[[
|
||||
int foo= -10; int bar= 10;
|
||||
long long int foo64= -10; long long int bar64= 10;
|
||||
if (!__sync_fetch_and_add(&foo, bar) || foo)
|
||||
return -1;
|
||||
bar= __sync_lock_test_and_set(&foo, bar);
|
||||
@ -1833,6 +1898,14 @@ AC_CACHE_CHECK([whether the compiler provides atomic builtins],
|
||||
bar= __sync_val_compare_and_swap(&bar, foo, 15);
|
||||
if (bar)
|
||||
return -1;
|
||||
if (!__sync_fetch_and_add(&foo64, bar64) || foo64)
|
||||
return -1;
|
||||
bar64= __sync_lock_test_and_set(&foo64, bar64);
|
||||
if (bar64 || foo64 != 10)
|
||||
return -1;
|
||||
bar64= __sync_val_compare_and_swap(&bar64, foo, 15);
|
||||
if (bar64)
|
||||
return -1;
|
||||
return 0;
|
||||
]]
|
||||
)],
|
||||
@ -1849,11 +1922,12 @@ AC_CACHE_CHECK([whether the OS provides atomic_* functions like Solaris],
|
||||
[mysql_cv_solaris_atomic],
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[
|
||||
[[
|
||||
#include <atomic.h>
|
||||
]
|
||||
]],
|
||||
[[
|
||||
int foo = -10; int bar = 10;
|
||||
int64_t foo64 = -10; int64_t bar64 = 10;
|
||||
if (atomic_add_int_nv((uint_t *)&foo, bar) || foo)
|
||||
return -1;
|
||||
bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar);
|
||||
@ -1862,6 +1936,15 @@ AC_CACHE_CHECK([whether the OS provides atomic_* functions like Solaris],
|
||||
bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15);
|
||||
if (bar)
|
||||
return -1;
|
||||
if (atomic_add_64_nv((volatile uint64_t *)&foo64, bar64) || foo64)
|
||||
return -1;
|
||||
bar64 = atomic_swap_64((volatile uint64_t *)&foo64, (uint64_t)bar64);
|
||||
if (bar64 || foo64 != 10)
|
||||
return -1;
|
||||
bar64 = atomic_cas_64((volatile uint64_t *)&bar64, (uint_t)foo64, 15);
|
||||
if (bar64)
|
||||
return -1;
|
||||
atomic_or_64((volatile uint64_t *)&bar64, 0);
|
||||
return 0;
|
||||
]]
|
||||
)],
|
||||
@ -2166,7 +2249,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
|
||||
sighold sigset sigthreadmask port_create sleep thr_yield \
|
||||
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
|
||||
strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
|
||||
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
|
||||
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack)
|
||||
|
||||
#
|
||||
#
|
||||
|
@ -23,6 +23,7 @@
|
||||
*/
|
||||
#undef MY_ATOMIC_HAS_8_16
|
||||
|
||||
#include <windows.h>
|
||||
/*
|
||||
x86 compilers (both VS2003 or VS2005) never use instrinsics, but generate
|
||||
function calls to kernel32 instead, even in the optimized build.
|
||||
@ -36,19 +37,17 @@
|
||||
#else
|
||||
C_MODE_START
|
||||
/*Visual Studio 2003 and earlier do not have prototypes for atomic intrinsics*/
|
||||
LONG _InterlockedExchange (LONG volatile *Target,LONG Value);
|
||||
LONG _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp);
|
||||
LONG _InterlockedExchangeAdd (LONG volatile *Addend, LONG Value);
|
||||
LONGLONG _InterlockedCompareExchange64 (LONGLONG volatile *Target,
|
||||
LONGLONG Value, LONGLONG Comp);
|
||||
C_MODE_END
|
||||
|
||||
#pragma intrinsic(_InterlockedExchangeAdd)
|
||||
#pragma intrinsic(_InterlockedCompareExchange)
|
||||
#pragma intrinsic(_InterlockedExchange)
|
||||
#pragma intrinsic(_InterlockedCompareExchange64)
|
||||
#endif
|
||||
|
||||
#define InterlockedExchange _InterlockedExchange
|
||||
#define InterlockedExchangeAdd _InterlockedExchangeAdd
|
||||
#define InterlockedCompareExchange _InterlockedCompareExchange
|
||||
#define InterlockedCompareExchange64 _InterlockedCompareExchange64
|
||||
/*
|
||||
No need to do something special for InterlockedCompareExchangePointer
|
||||
as it is a #define to InterlockedCompareExchange. The same applies to
|
||||
@ -57,23 +56,39 @@ C_MODE_END
|
||||
#endif /*_M_IX86*/
|
||||
|
||||
#define MY_ATOMIC_MODE "msvc-intrinsics"
|
||||
#define IL_EXCHG_ADD32(X,Y) InterlockedExchangeAdd((volatile LONG *)(X),(Y))
|
||||
#define IL_COMP_EXCHG32(X,Y,Z) InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z))
|
||||
/* Implement using CAS on WIN32 */
|
||||
#define IL_COMP_EXCHG32(X,Y,Z) \
|
||||
InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z))
|
||||
#define IL_COMP_EXCHG64(X,Y,Z) \
|
||||
InterlockedCompareExchange64((volatile LONGLONG *)(X), \
|
||||
(LONGLONG)(Y),(LONGLONG)(Z))
|
||||
#define IL_COMP_EXCHGptr InterlockedCompareExchangePointer
|
||||
#define IL_EXCHG32(X,Y) InterlockedExchange((volatile LONG *)(X),(Y))
|
||||
#define IL_EXCHGptr InterlockedExchangePointer
|
||||
#define make_atomic_add_body(S) \
|
||||
v= IL_EXCHG_ADD ## S (a, v)
|
||||
|
||||
#define make_atomic_cas_body(S) \
|
||||
int ## S initial_cmp= *cmp; \
|
||||
int ## S initial_a= IL_COMP_EXCHG ## S (a, set, initial_cmp); \
|
||||
if (!(ret= (initial_a == initial_cmp))) *cmp= initial_a;
|
||||
|
||||
#ifndef _M_IX86
|
||||
/* Use full set of optimised functions on WIN64 */
|
||||
#define IL_EXCHG_ADD32(X,Y) \
|
||||
InterlockedExchangeAdd((volatile LONG *)(X),(Y))
|
||||
#define IL_EXCHG_ADD64(X,Y) \
|
||||
InterlockedExchangeAdd64((volatile LONGLONG *)(X),(LONGLONG)(Y))
|
||||
#define IL_EXCHG32(X,Y) \
|
||||
InterlockedExchange((volatile LONG *)(X),(Y))
|
||||
#define IL_EXCHG64(X,Y) \
|
||||
InterlockedExchange64((volatile LONGLONG *)(X),(LONGLONG)(Y))
|
||||
#define IL_EXCHGptr InterlockedExchangePointer
|
||||
|
||||
#define make_atomic_add_body(S) \
|
||||
v= IL_EXCHG_ADD ## S (a, v)
|
||||
#define make_atomic_swap_body(S) \
|
||||
v= IL_EXCHG ## S (a, v)
|
||||
#define make_atomic_load_body(S) \
|
||||
ret= 0; /* avoid compiler warning */ \
|
||||
ret= IL_COMP_EXCHG ## S (a, ret, ret);
|
||||
|
||||
#endif
|
||||
/*
|
||||
my_yield_processor (equivalent of x86 PAUSE instruction) should be used
|
||||
to improve performance on hyperthreaded CPUs. Intel recommends to use it in
|
||||
@ -108,9 +123,12 @@ static __inline int my_yield_processor()
|
||||
#else /* cleanup */
|
||||
|
||||
#undef IL_EXCHG_ADD32
|
||||
#undef IL_EXCHG_ADD64
|
||||
#undef IL_COMP_EXCHG32
|
||||
#undef IL_COMP_EXCHG64
|
||||
#undef IL_COMP_EXCHGptr
|
||||
#undef IL_EXCHG32
|
||||
#undef IL_EXCHG64
|
||||
#undef IL_EXCHGptr
|
||||
|
||||
#endif
|
||||
|
@ -17,23 +17,37 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#if defined(__i386__) || defined(_MSC_VER) || defined(__x86_64__) \
|
||||
|| defined(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
|| defined(HAVE_GCC_ATOMIC_BUILTINS) \
|
||||
|| defined(HAVE_SOLARIS_ATOMIC)
|
||||
|
||||
# ifdef MY_ATOMIC_MODE_DUMMY
|
||||
# define LOCK_prefix ""
|
||||
# else
|
||||
# define LOCK_prefix "lock"
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_GCC_ATOMIC_BUILTINS
|
||||
# include "gcc_builtins.h"
|
||||
# elif __GNUC__
|
||||
# include "x86-gcc.h"
|
||||
# elif defined(_MSC_VER)
|
||||
/*
|
||||
We choose implementation as follows:
|
||||
------------------------------------
|
||||
On Windows using Visual C++ the native implementation should be
|
||||
preferrable. When using gcc we prefer the native x86 implementation,
|
||||
we prefer the Solaris implementation before the gcc because of
|
||||
stability preference, we choose gcc implementation if nothing else
|
||||
works on gcc. If neither Visual C++ or gcc we still choose the
|
||||
Solaris implementation on Solaris (mainly for SunStudio compiles.
|
||||
*/
|
||||
# if defined(_MSV_VER)
|
||||
# include "generic-msvc.h"
|
||||
# elif __GNUC__
|
||||
# if defined(__i386__) || defined(__x86_64__)
|
||||
# include "x86-gcc.h"
|
||||
# elif defined(HAVE_SOLARIS_ATOMIC)
|
||||
# include "solaris.h"
|
||||
# elif defined(HAVE_GCC_ATOMIC_BUILTINS)
|
||||
# include "gcc_builtins.h"
|
||||
# endif
|
||||
# elif defined(HAVE_SOLARIS_ATOMIC)
|
||||
# include "solaris.h"
|
||||
# endif
|
||||
#elif defined(HAVE_SOLARIS_ATOMIC)
|
||||
#include "solaris.h"
|
||||
#endif
|
||||
|
||||
#if defined(make_atomic_cas_body) || defined(MY_ATOMICS_MADE)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2008 MySQL AB
|
||||
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -60,6 +60,18 @@ my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set)
|
||||
return ret;
|
||||
}
|
||||
|
||||
STATIC_INLINE int
|
||||
my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set)
|
||||
{
|
||||
int ret;
|
||||
int64 sav;
|
||||
sav = (int64) atomic_cas_64((volatile uint64_t *)a, (uint64_t)*cmp,
|
||||
(uint64_t)set);
|
||||
if (! (ret = (sav == *cmp)))
|
||||
*cmp = sav;
|
||||
return ret;
|
||||
}
|
||||
|
||||
STATIC_INLINE int
|
||||
my_atomic_casptr(void * volatile *a, void **cmp, void *set)
|
||||
{
|
||||
@ -97,6 +109,14 @@ my_atomic_add32(int32 volatile *a, int32 v)
|
||||
return (nv - v);
|
||||
}
|
||||
|
||||
STATIC_INLINE int64
|
||||
my_atomic_add64(int64 volatile *a, int64 v)
|
||||
{
|
||||
int64 nv;
|
||||
nv = atomic_add_64_nv((volatile uint64_t *)a, v);
|
||||
return (nv - v);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
#ifdef MY_ATOMIC_MODE_DUMMY
|
||||
@ -110,6 +130,9 @@ my_atomic_load16(int16 volatile *a) { return (*a); }
|
||||
STATIC_INLINE int32
|
||||
my_atomic_load32(int32 volatile *a) { return (*a); }
|
||||
|
||||
STATIC_INLINE int64
|
||||
my_atomic_load64(int64 volatile *a) { return (*a); }
|
||||
|
||||
STATIC_INLINE void *
|
||||
my_atomic_loadptr(void * volatile *a) { return (*a); }
|
||||
|
||||
@ -124,6 +147,9 @@ my_atomic_store16(int16 volatile *a, int16 v) { *a = v; }
|
||||
STATIC_INLINE void
|
||||
my_atomic_store32(int32 volatile *a, int32 v) { *a = v; }
|
||||
|
||||
STATIC_INLINE void
|
||||
my_atomic_store64(int64 volatile *a, int64 v) { *a = v; }
|
||||
|
||||
STATIC_INLINE void
|
||||
my_atomic_storeptr(void * volatile *a, void *v) { *a = v; }
|
||||
|
||||
@ -149,6 +175,12 @@ my_atomic_load32(int32 volatile *a)
|
||||
return ((int32) atomic_or_32_nv((volatile uint32_t *)a, 0));
|
||||
}
|
||||
|
||||
STATIC_INLINE int64
|
||||
my_atomic_load64(int64 volatile *a)
|
||||
{
|
||||
return ((int64) atomic_or_64_nv((volatile uint64_t *)a, 0));
|
||||
}
|
||||
|
||||
STATIC_INLINE void *
|
||||
my_atomic_loadptr(void * volatile *a)
|
||||
{
|
||||
@ -175,6 +207,12 @@ my_atomic_store32(int32 volatile *a, int32 v)
|
||||
(void) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v);
|
||||
}
|
||||
|
||||
STATIC_INLINE void
|
||||
my_atomic_store64(int64 volatile *a, int64 v)
|
||||
{
|
||||
(void) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v);
|
||||
}
|
||||
|
||||
STATIC_INLINE void
|
||||
my_atomic_storeptr(void * volatile *a, void *v)
|
||||
{
|
||||
@ -203,6 +241,12 @@ my_atomic_fas32(int32 volatile *a, int32 v)
|
||||
return ((int32) atomic_swap_32((volatile uint32_t *)a, (uint32_t)v));
|
||||
}
|
||||
|
||||
STATIC_INLINE int64
|
||||
my_atomic_fas64(int64 volatile *a, int64 v)
|
||||
{
|
||||
return ((int64) atomic_swap_64((volatile uint64_t *)a, (uint64_t)v));
|
||||
}
|
||||
|
||||
STATIC_INLINE void *
|
||||
my_atomic_fasptr(void * volatile *a, void *v)
|
||||
{
|
||||
|
@ -22,6 +22,12 @@
|
||||
architectures support double-word (128-bit) cas.
|
||||
*/
|
||||
|
||||
/*
|
||||
No special support of 8 and 16 bit operations are implemented here
|
||||
currently.
|
||||
*/
|
||||
#undef MY_ATOMIC_HAS_8_AND_16
|
||||
|
||||
#ifdef __x86_64__
|
||||
# ifdef MY_ATOMIC_NO_XADD
|
||||
# define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix "-no-xadd"
|
||||
@ -42,29 +48,79 @@
|
||||
#endif
|
||||
|
||||
#ifndef MY_ATOMIC_NO_XADD
|
||||
#define make_atomic_add_body(S) \
|
||||
asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a))
|
||||
#define make_atomic_add_body(S) make_atomic_add_body ## S
|
||||
#define make_atomic_cas_body(S) make_atomic_cas_body ## S
|
||||
#endif
|
||||
#define make_atomic_fas_body(S) \
|
||||
asm volatile ("xchg %0, %1;" : "+q" (v) , "+m" (*a))
|
||||
#define make_atomic_cas_body(S) \
|
||||
|
||||
#define make_atomic_add_body32 \
|
||||
asm volatile (LOCK_prefix "; xadd %0, %1;" : "+r" (v) , "+m" (*a))
|
||||
|
||||
#define make_atomic_cas_body32 \
|
||||
asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \
|
||||
: "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))
|
||||
|
||||
#ifdef MY_ATOMIC_MODE_DUMMY
|
||||
#define make_atomic_load_body(S) ret=*a
|
||||
#define make_atomic_store_body(S) *a=v
|
||||
#else
|
||||
#ifdef __x86_64__
|
||||
#define make_atomic_add_body64 make_atomic_add_body32
|
||||
#define make_atomic_cas_body64 make_atomic_cas_body32
|
||||
|
||||
#define make_atomic_fas_body(S) \
|
||||
asm volatile ("xchg %0, %1;" : "+r" (v) , "+m" (*a))
|
||||
|
||||
/*
|
||||
Actually 32-bit reads/writes are always atomic on x86
|
||||
But we add LOCK_prefix here anyway to force memory barriers
|
||||
*/
|
||||
#define make_atomic_load_body(S) \
|
||||
ret=0; \
|
||||
asm volatile (LOCK_prefix "; cmpxchg %2, %0" \
|
||||
: "+m" (*a), "+a" (ret): "r" (ret))
|
||||
#define make_atomic_store_body(S) \
|
||||
#define make_atomic_load_body(S) \
|
||||
ret=0; \
|
||||
asm volatile (LOCK_prefix "; cmpxchg %2, %0" \
|
||||
: "+m" (*a), "+a" (ret): "r" (ret))
|
||||
#define make_atomic_store_body(S) \
|
||||
asm volatile ("; xchg %0, %1;" : "+m" (*a), "+r" (v))
|
||||
|
||||
#else
|
||||
/*
|
||||
Use default implementations of 64-bit operations since we solved
|
||||
the 64-bit problem on 32-bit platforms for CAS, no need to solve it
|
||||
once more for ADD, LOAD, STORE and FAS as well.
|
||||
Since we already added add32 support, we need to define add64
|
||||
here, but we haven't defined fas, load and store at all, so
|
||||
we can fallback on default implementations.
|
||||
*/
|
||||
#define make_atomic_add_body64 \
|
||||
int64 tmp=*a; \
|
||||
while (!my_atomic_cas64(a, &tmp, tmp+v)); \
|
||||
v=tmp;
|
||||
|
||||
/*
|
||||
On some platforms (e.g. Mac OS X and Solaris) the ebx register
|
||||
is held as a pointer to the global offset table. Thus we're not
|
||||
allowed to use the b-register on those platforms when compiling
|
||||
PIC code, to avoid this we push ebx and pop ebx and add a movl
|
||||
instruction to avoid having ebx in the interface of the assembler
|
||||
instruction.
|
||||
|
||||
cmpxchg8b works on both 32-bit platforms and 64-bit platforms but
|
||||
the code here is only used on 32-bit platforms, on 64-bit
|
||||
platforms the much simpler make_atomic_cas_body32 will work
|
||||
fine.
|
||||
*/
|
||||
#define make_atomic_cas_body64 \
|
||||
int32 ebx=(set & 0xFFFFFFFF), ecx=(set >> 32); \
|
||||
asm volatile ("push %%ebx; movl %3, %%ebx;" \
|
||||
LOCK_prefix "; cmpxchg8b %0; setz %2; pop %%ebx"\
|
||||
: "+m" (*a), "+A" (*cmp), "=q" (ret) \
|
||||
:"m" (ebx), "c" (ecx))
|
||||
#endif
|
||||
|
||||
/*
|
||||
The implementation of make_atomic_cas_body32 is adaptable to
|
||||
the OS word size, so on 64-bit platforms it will automatically
|
||||
adapt to 64-bits and so it will work also on 64-bit platforms
|
||||
*/
|
||||
#define make_atomic_cas_bodyptr make_atomic_cas_body32
|
||||
|
||||
#ifdef MY_ATOMIC_MODE_DUMMY
|
||||
#define make_atomic_load_body(S) ret=*a
|
||||
#define make_atomic_store_body(S) *a=v
|
||||
#endif
|
||||
#endif /* ATOMIC_X86_GCC_INCLUDED */
|
||||
|
@ -30,6 +30,7 @@ extern "C" {
|
||||
/* flags for hash_init */
|
||||
#define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */
|
||||
|
||||
typedef uint my_hash_value_type;
|
||||
typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool);
|
||||
typedef void (*my_hash_free_key)(void *);
|
||||
|
||||
@ -60,8 +61,18 @@ void my_hash_free(HASH *tree);
|
||||
void my_hash_reset(HASH *hash);
|
||||
uchar *my_hash_element(HASH *hash, ulong idx);
|
||||
uchar *my_hash_search(const HASH *info, const uchar *key, size_t length);
|
||||
uchar *my_hash_search_using_hash_value(const HASH *info,
|
||||
my_hash_value_type hash_value,
|
||||
const uchar *key, size_t length);
|
||||
my_hash_value_type my_calc_hash(const HASH *info,
|
||||
const uchar *key, size_t length);
|
||||
uchar *my_hash_first(const HASH *info, const uchar *key, size_t length,
|
||||
HASH_SEARCH_STATE *state);
|
||||
uchar *my_hash_first_from_hash_value(const HASH *info,
|
||||
my_hash_value_type hash_value,
|
||||
const uchar *key,
|
||||
size_t length,
|
||||
HASH_SEARCH_STATE *state);
|
||||
uchar *my_hash_next(const HASH *info, const uchar *key, size_t length,
|
||||
HASH_SEARCH_STATE *state);
|
||||
my_bool my_hash_insert(HASH *info, const uchar *data);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2003 MySQL AB
|
||||
/* Copyright (C) 2003 MySQL AB, 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -70,7 +70,7 @@ typedef struct st_key_cache
|
||||
uchar HUGE_PTR *block_mem; /* memory for block buffers */
|
||||
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
|
||||
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
|
||||
pthread_mutex_t cache_lock; /* to lock access to the cache structure */
|
||||
mysql_mutex_t cache_lock; /* to lock access to the cache structure */
|
||||
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
|
||||
/*
|
||||
Waiting for a zero resize count. Using a queue for symmetry though
|
||||
|
@ -37,7 +37,7 @@
|
||||
my_atomic_store#(&var, what)
|
||||
store 'what' in *var
|
||||
|
||||
'#' is substituted by a size suffix - 8, 16, 32, or ptr
|
||||
'#' is substituted by a size suffix - 8, 16, 32, 64, or ptr
|
||||
(e.g. my_atomic_add8, my_atomic_fas32, my_atomic_casptr).
|
||||
|
||||
NOTE This operations are not always atomic, so they always must be
|
||||
@ -49,18 +49,17 @@
|
||||
On architectures where these operations are really atomic, rwlocks will
|
||||
be optimized away.
|
||||
8- and 16-bit atomics aren't implemented for windows (see generic-msvc.h),
|
||||
but can be added, if necessary.
|
||||
but can be added, if necessary.
|
||||
*/
|
||||
|
||||
#ifndef my_atomic_rwlock_init
|
||||
|
||||
#define intptr void *
|
||||
/**
|
||||
On most platforms we implement 8-bit, 16-bit, 32-bit and "pointer"
|
||||
operations. Thus the symbol below is defined by default; platforms
|
||||
where we leave out 8-bit or 16-bit operations should undefine it.
|
||||
Currently we don't support 8-bit and 16-bit operations.
|
||||
It can be added later if needed.
|
||||
*/
|
||||
#define MY_ATOMIC_HAS_8_16 1
|
||||
#undef MY_ATOMIC_HAS_8_16
|
||||
|
||||
#ifndef MY_ATOMIC_MODE_RWLOCKS
|
||||
/*
|
||||
@ -129,6 +128,7 @@
|
||||
make_transparent_unions(8)
|
||||
make_transparent_unions(16)
|
||||
make_transparent_unions(32)
|
||||
make_transparent_unions(64)
|
||||
make_transparent_unions(ptr)
|
||||
#undef uintptr
|
||||
#undef make_transparent_unions
|
||||
@ -140,10 +140,12 @@ make_transparent_unions(ptr)
|
||||
#define U_8 int8
|
||||
#define U_16 int16
|
||||
#define U_32 int32
|
||||
#define U_64 int64
|
||||
#define U_ptr intptr
|
||||
#define Uv_8 int8
|
||||
#define Uv_16 int16
|
||||
#define Uv_32 int32
|
||||
#define Uv_64 int64
|
||||
#define Uv_ptr intptr
|
||||
#define U_a volatile *a
|
||||
#define U_cmp *cmp
|
||||
@ -217,6 +219,7 @@ make_atomic_cas(8)
|
||||
make_atomic_cas(16)
|
||||
#endif
|
||||
make_atomic_cas(32)
|
||||
make_atomic_cas(64)
|
||||
make_atomic_cas(ptr)
|
||||
|
||||
#ifdef MY_ATOMIC_HAS_8_16
|
||||
@ -224,12 +227,14 @@ make_atomic_add(8)
|
||||
make_atomic_add(16)
|
||||
#endif
|
||||
make_atomic_add(32)
|
||||
make_atomic_add(64)
|
||||
|
||||
#ifdef MY_ATOMIC_HAS_8_16
|
||||
make_atomic_load(8)
|
||||
make_atomic_load(16)
|
||||
#endif
|
||||
make_atomic_load(32)
|
||||
make_atomic_load(64)
|
||||
make_atomic_load(ptr)
|
||||
|
||||
#ifdef MY_ATOMIC_HAS_8_16
|
||||
@ -237,6 +242,7 @@ make_atomic_fas(8)
|
||||
make_atomic_fas(16)
|
||||
#endif
|
||||
make_atomic_fas(32)
|
||||
make_atomic_fas(64)
|
||||
make_atomic_fas(ptr)
|
||||
|
||||
#ifdef MY_ATOMIC_HAS_8_16
|
||||
@ -244,6 +250,7 @@ make_atomic_store(8)
|
||||
make_atomic_store(16)
|
||||
#endif
|
||||
make_atomic_store(32)
|
||||
make_atomic_store(64)
|
||||
make_atomic_store(ptr)
|
||||
|
||||
#ifdef _atomic_h_cleanup_
|
||||
@ -254,10 +261,12 @@ make_atomic_store(ptr)
|
||||
#undef U_8
|
||||
#undef U_16
|
||||
#undef U_32
|
||||
#undef U_64
|
||||
#undef U_ptr
|
||||
#undef Uv_8
|
||||
#undef Uv_16
|
||||
#undef Uv_32
|
||||
#undef Uv_64
|
||||
#undef Uv_ptr
|
||||
#undef a
|
||||
#undef cmp
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -34,7 +34,7 @@ typedef struct st_bitmap
|
||||
acquiring the mutex
|
||||
*/
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t *mutex;
|
||||
mysql_mutex_t *mutex;
|
||||
#endif
|
||||
} MY_BITMAP;
|
||||
|
||||
|
@ -876,6 +876,8 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||
#endif
|
||||
#endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/
|
||||
|
||||
#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
|
||||
#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL
|
||||
#define INT_MIN32 (~0x7FFFFFFFL)
|
||||
#define INT_MAX32 0x7FFFFFFFL
|
||||
#define UINT_MAX32 0xFFFFFFFFL
|
||||
@ -899,7 +901,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||
#define FLT_MAX ((float)3.40282346638528860e+38)
|
||||
#endif
|
||||
#ifndef SIZE_T_MAX
|
||||
#define SIZE_T_MAX ~((size_t) 0)
|
||||
#define SIZE_T_MAX (~((size_t) 0))
|
||||
#endif
|
||||
|
||||
#ifndef isfinite
|
||||
|
@ -59,5 +59,13 @@
|
||||
#define mysql_rwlock_unlock(A) do {} while (0)
|
||||
#define mysql_rwlock_destroy(A) do {} while (0)
|
||||
|
||||
typedef int my_pthread_once_t;
|
||||
#define MY_PTHREAD_ONCE_INIT 0
|
||||
#define MY_PTHREAD_ONCE_DONE 1
|
||||
|
||||
#define my_pthread_once(C,F) do { \
|
||||
if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
#endif /* MY_NO_PTHREAD_INCLUDED */
|
||||
|
@ -67,6 +67,11 @@ typedef int pthread_mutexattr_t;
|
||||
#define pthread_handler_t EXTERNC void * __cdecl
|
||||
typedef void * (__cdecl *pthread_handler)(void *);
|
||||
|
||||
typedef volatile LONG my_pthread_once_t;
|
||||
#define MY_PTHREAD_ONCE_INIT 0
|
||||
#define MY_PTHREAD_ONCE_INPROGRESS 1
|
||||
#define MY_PTHREAD_ONCE_DONE 2
|
||||
|
||||
/*
|
||||
Struct and macros to be used in combination with the
|
||||
windows implementation of pthread_cond_timedwait
|
||||
@ -110,6 +115,7 @@ int pthread_cond_destroy(pthread_cond_t *cond);
|
||||
int pthread_attr_init(pthread_attr_t *connect_att);
|
||||
int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack);
|
||||
int pthread_attr_destroy(pthread_attr_t *connect_att);
|
||||
int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void));
|
||||
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
|
||||
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
|
||||
|
||||
@ -148,8 +154,6 @@ int pthread_join(pthread_t thread, void **value_ptr);
|
||||
#define pthread_detach_this_thread()
|
||||
#define pthread_condattr_init(A)
|
||||
#define pthread_condattr_destroy(A)
|
||||
#define pthread_yield() SwitchToThread()
|
||||
|
||||
/* per the platform's documentation */
|
||||
#define pthread_yield() Sleep(0)
|
||||
|
||||
@ -186,6 +190,10 @@ void my_pthread_exit(void *status);
|
||||
#define pthread_handler_t EXTERNC void *
|
||||
typedef void *(* pthread_handler)(void *);
|
||||
|
||||
#define my_pthread_once_t pthread_once_t
|
||||
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
|
||||
#define my_pthread_once(C,F) pthread_once(C,F)
|
||||
|
||||
/* Test first for RTS or FSU threads */
|
||||
|
||||
#if defined(PTHREAD_SCOPE_GLOBAL) && !defined(PTHREAD_SCOPE_SYSTEM)
|
||||
@ -607,6 +615,8 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr;
|
||||
typedef ulong my_thread_id;
|
||||
|
||||
extern my_bool my_thread_global_init(void);
|
||||
extern my_bool my_thread_basic_global_init(void);
|
||||
extern void my_thread_basic_global_reinit(void);
|
||||
extern void my_thread_global_end(void);
|
||||
extern my_bool my_thread_init(void);
|
||||
extern void my_thread_end(void);
|
||||
@ -637,10 +647,10 @@ extern int pthread_dummy(int);
|
||||
struct st_my_thread_var
|
||||
{
|
||||
int thr_errno;
|
||||
pthread_cond_t suspend;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_mutex_t * volatile current_mutex;
|
||||
pthread_cond_t * volatile current_cond;
|
||||
mysql_cond_t suspend;
|
||||
mysql_mutex_t mutex;
|
||||
mysql_mutex_t * volatile current_mutex;
|
||||
mysql_cond_t * volatile current_cond;
|
||||
pthread_t pthread_self;
|
||||
my_thread_id id;
|
||||
int cmp_length;
|
||||
@ -692,16 +702,16 @@ extern uint thd_lib_detected;
|
||||
#ifdef THREAD
|
||||
#ifndef thread_safe_increment
|
||||
#define thread_safe_increment(V,L) \
|
||||
(pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L)))
|
||||
(mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L)))
|
||||
#define thread_safe_decrement(V,L) \
|
||||
(pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L)))
|
||||
(mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L)))
|
||||
#endif
|
||||
|
||||
#ifndef thread_safe_add
|
||||
#define thread_safe_add(V,C,L) \
|
||||
(pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
|
||||
(mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L)))
|
||||
#define thread_safe_sub(V,C,L) \
|
||||
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
|
||||
(mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
(defined(__alpha__) && defined(__GNUC__))
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
#elif defined(__WIN__)
|
||||
#elif defined(__WIN__) || defined(__sun)
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
|
||||
|
@ -338,7 +338,7 @@ struct st_my_file_info
|
||||
#endif
|
||||
enum file_type type;
|
||||
#if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32)
|
||||
pthread_mutex_t mutex;
|
||||
mysql_mutex_t mutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -358,7 +358,7 @@ typedef struct st_my_tmpdir
|
||||
char **list;
|
||||
uint cur, max;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t mutex;
|
||||
mysql_mutex_t mutex;
|
||||
#endif
|
||||
} MY_TMPDIR;
|
||||
|
||||
@ -374,9 +374,9 @@ typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*);
|
||||
#ifdef THREAD
|
||||
typedef struct st_io_cache_share
|
||||
{
|
||||
pthread_mutex_t mutex; /* To sync on reads into buffer. */
|
||||
pthread_cond_t cond; /* To wait for signals. */
|
||||
pthread_cond_t cond_writer; /* For a synchronized writer. */
|
||||
mysql_mutex_t mutex; /* To sync on reads into buffer. */
|
||||
mysql_cond_t cond; /* To wait for signals. */
|
||||
mysql_cond_t cond_writer; /* For a synchronized writer. */
|
||||
/* Offset in file corresponding to the first byte of buffer. */
|
||||
my_off_t pos_in_file;
|
||||
/* If a synchronized write cache is the source of the data. */
|
||||
@ -437,7 +437,7 @@ typedef struct st_io_cache /* Used when cacheing files */
|
||||
The lock is for append buffer used in SEQ_READ_APPEND cache
|
||||
need mutex copying from append buffer to read buffer.
|
||||
*/
|
||||
pthread_mutex_t append_buffer_lock;
|
||||
mysql_mutex_t append_buffer_lock;
|
||||
/*
|
||||
The following is used when several threads are reading the
|
||||
same file in parallel. They are synchronized on disk
|
||||
@ -691,6 +691,7 @@ extern const char **my_error_unregister(int first, int last);
|
||||
extern void my_message(uint my_err, const char *str,myf MyFlags);
|
||||
extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
|
||||
extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
|
||||
extern my_bool my_basic_init(void);
|
||||
extern my_bool my_init(void);
|
||||
extern void my_end(int infoflag);
|
||||
extern int my_redel(const char *from, const char *to, int MyFlags);
|
||||
@ -978,7 +979,6 @@ extern my_bool resolve_collation(const char *cl_name,
|
||||
CHARSET_INFO *default_cl,
|
||||
CHARSET_INFO **cl);
|
||||
|
||||
extern void free_charsets(void);
|
||||
extern char *get_charsets_dir(char *buf);
|
||||
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
|
||||
extern my_bool init_compiled_charsets(myf flags);
|
||||
|
@ -259,6 +259,8 @@ 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);
|
||||
extern ulonglong myisam_mmap_size, myisam_mmap_used;
|
||||
extern pthread_mutex_t THR_LOCK_myisam_mmap;
|
||||
|
||||
/* Prototypes for myisam-functions */
|
||||
|
||||
@ -304,6 +306,7 @@ extern int mi_delete_all_rows(struct st_myisam_info *info);
|
||||
extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
|
||||
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
|
||||
|
||||
#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */
|
||||
/* this is used to pass to mysql_myisamchk_table */
|
||||
|
||||
#define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
|
||||
/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -115,10 +115,11 @@ typedef struct st_thr_lock_data {
|
||||
THR_LOCK_OWNER *owner;
|
||||
struct st_thr_lock_data *next,**prev;
|
||||
struct st_thr_lock *lock;
|
||||
pthread_cond_t *cond;
|
||||
mysql_cond_t *cond;
|
||||
enum thr_lock_type type;
|
||||
void *status_param; /* Param to status functions */
|
||||
void *debug_print_param;
|
||||
struct PSI_table *m_psi;
|
||||
} THR_LOCK_DATA;
|
||||
|
||||
struct st_lock_list {
|
||||
@ -127,7 +128,7 @@ struct st_lock_list {
|
||||
|
||||
typedef struct st_thr_lock {
|
||||
LIST list;
|
||||
pthread_mutex_t mutex;
|
||||
mysql_mutex_t mutex;
|
||||
struct st_lock_list read_wait;
|
||||
struct st_lock_list read;
|
||||
struct st_lock_list write_wait;
|
||||
@ -144,7 +145,7 @@ typedef struct st_thr_lock {
|
||||
|
||||
|
||||
extern LIST *thr_lock_thread_list;
|
||||
extern pthread_mutex_t THR_LOCK_lock;
|
||||
extern mysql_mutex_t THR_LOCK_lock;
|
||||
|
||||
my_bool init_thr_lock(void); /* Must be called once/thread */
|
||||
#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg)
|
||||
|
@ -211,7 +211,6 @@ void STDCALL mysql_server_end()
|
||||
}
|
||||
else
|
||||
{
|
||||
free_charsets();
|
||||
mysql_thread_end();
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ main.log_tables # Bug#47924 2009-10-08 alik main.log_ta
|
||||
main.plugin # Bug#47146 Linking problem with example plugin when dtrace enabled
|
||||
main.plugin_load # Bug#47146
|
||||
|
||||
rpl.rpl_cross_version* # Bug#48340 2009-12-01 Daogang rpl_cross_version: Found warnings/errors in server log file!
|
||||
rpl.rpl_get_master_version_and_clock* # Bug#49191 2009-12-01 Daogang rpl_get_master_version_and_clock failed on PB2: COM_REGISTER_SLAVE failed
|
||||
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
|
||||
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
|
||||
|
@ -21,14 +21,26 @@ connection slave;
|
||||
reset master;
|
||||
connection master;
|
||||
|
||||
# MTR is not case-sensitive.
|
||||
let $lower_stmt_head= load data;
|
||||
let $UPPER_STMT_HEAD= LOAD DATA;
|
||||
if (`SELECT '$lock_option' <> ''`)
|
||||
{
|
||||
#if $lock_option is null, an extra blank is added into the statement,
|
||||
#this will change the result of rpl_loaddata test case. so $lock_option
|
||||
#is set only when it is not null.
|
||||
let $lower_stmt_head= load data $lock_option;
|
||||
let $UPPER_STMT_HEAD= LOAD DATA $lock_option;
|
||||
}
|
||||
|
||||
select last_insert_id();
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
|
||||
select last_insert_id();
|
||||
|
||||
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
|
||||
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
insert into t3 select * from t2;
|
||||
@ -56,7 +68,7 @@ sync_with_master;
|
||||
insert into t1 values(1,10);
|
||||
|
||||
connection master;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
@ -70,9 +82,11 @@ connection slave;
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
|
||||
echo Last_SQL_Errno=$last_error;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
echo Last_SQL_Error;
|
||||
echo $last_error;
|
||||
|
||||
# Trigger error again to test CHANGE MASTER
|
||||
|
||||
@ -80,7 +94,7 @@ connection master;
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
@ -92,9 +106,11 @@ connection slave;
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
|
||||
echo Last_SQL_Errno=$last_error;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
echo Last_SQL_Error;
|
||||
echo $last_error;
|
||||
|
||||
# Trigger error again to test RESET SLAVE
|
||||
|
||||
@ -105,7 +121,7 @@ connection master;
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# The SQL slave thread should be stopped now.
|
||||
@ -114,9 +130,11 @@ connection slave;
|
||||
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
|
||||
stop slave;
|
||||
reset slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
|
||||
--query_vertical show slave status;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
|
||||
echo Last_SQL_Errno=$last_error;
|
||||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
echo Last_SQL_Error;
|
||||
echo $last_error;
|
||||
|
||||
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
|
||||
|
||||
@ -125,7 +143,7 @@ reset master;
|
||||
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
|
||||
unique(day)) engine=$engine_type; # no transactions
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
select * from t2;
|
||||
@ -141,7 +159,7 @@ alter table t2 drop key day;
|
||||
connection master;
|
||||
delete from t2;
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
connection slave;
|
||||
@ -154,7 +172,7 @@ drop table t1, t2;
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
eval $UPPER_STMT_HEAD INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
@ -182,17 +200,17 @@ DROP TABLE IF EXISTS t1;
|
||||
|
||||
-- echo ### assertion: works with cross-referenced database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- eval use $db1
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- echo ### assertion: works with fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
|
||||
-- echo ### assertion: works without fully qualified name on current database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
|
||||
|
||||
-- echo ### create connection without default database
|
||||
-- echo ### connect (conn2,localhost,root,,*NO-ONE*);
|
||||
@ -200,7 +218,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
|
||||
-- connection conn2
|
||||
-- echo ### assertion: works without stating the default database
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
|
||||
-- echo ### disconnect and switch back to master connection
|
||||
-- disconnect conn2
|
||||
-- connection master
|
||||
|
@ -52,7 +52,7 @@ if (`SELECT '$debug_lock' != ''`)
|
||||
|
||||
# reap the result of the waiting query
|
||||
connection $connection_name;
|
||||
error 0, 1317, 1307, 1306, 1334, 1305;
|
||||
error 0, 1317, 1307, 1306, 1334, 1305, 1034;
|
||||
reap;
|
||||
|
||||
connection master;
|
||||
|
@ -116,6 +116,26 @@ select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
|
||||
binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
|
||||
1 1 1
|
||||
SET CHARACTER SET koi8r;
|
||||
create table t1 (a varchar(2) character set ucs2 collate ucs2_bin, key(a));
|
||||
insert into t1 values ('A'),('A'),('B'),('C'),('D'),('A\t');
|
||||
insert into t1 values ('A\0'),('A\0'),('A\0'),('A\0'),('AZ');
|
||||
select hex(a) from t1 where a like 'A_' order by a;
|
||||
hex(a)
|
||||
00410000
|
||||
00410000
|
||||
00410000
|
||||
00410000
|
||||
00410009
|
||||
0041005A
|
||||
select hex(a) from t1 ignore key(a) where a like 'A_' order by a;
|
||||
hex(a)
|
||||
00410000
|
||||
00410000
|
||||
00410000
|
||||
00410000
|
||||
00410009
|
||||
0041005A
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2, word2 CHAR(64) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (_koi8r'ò',_koi8r'ò'), (X'2004',X'2004');
|
||||
SELECT hex(word) FROM t1 ORDER BY word;
|
||||
|
@ -1848,6 +1848,24 @@ select hex(_utf8 B'001111111111');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
select (_utf8 X'616263FF');
|
||||
ERROR HY000: Invalid utf8 character string: 'FF'
|
||||
#
|
||||
# Bug#44131 Binary-mode "order by" returns records in incorrect order for UTF-8 strings
|
||||
#
|
||||
CREATE TABLE t1 (id int not null primary key, name varchar(10)) character set utf8;
|
||||
INSERT INTO t1 VALUES
|
||||
(2,'一二三01'),(3,'一二三09'),(4,'一二三02'),(5,'一二三08'),
|
||||
(6,'一二三11'),(7,'一二三91'),(8,'一二三21'),(9,'一二三81');
|
||||
SELECT * FROM t1 ORDER BY BINARY(name);
|
||||
id name
|
||||
2 一二三01
|
||||
4 一二三02
|
||||
5 一二三08
|
||||
3 一二三09
|
||||
6 一二三11
|
||||
8 一二三21
|
||||
9 一二三81
|
||||
7 一二三91
|
||||
DROP TABLE t1;
|
||||
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;
|
||||
|
@ -560,6 +560,20 @@ MATCH (col) AGAINST('findme')
|
||||
DEALLOCATE PREPARE s;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49250 : spatial btree index corruption and crash
|
||||
# Part two : fulltext syntax check
|
||||
#
|
||||
CREATE TABLE t1(col1 TEXT,
|
||||
FULLTEXT INDEX USING BTREE (col1));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1))' at line 2
|
||||
CREATE TABLE t2(col1 TEXT);
|
||||
CREATE FULLTEXT INDEX USING BTREE ON t2(col);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ON t2(col)' at line 1
|
||||
ALTER TABLE t2 ADD FULLTEXT INDEX USING BTREE (col1);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1)' at line 1
|
||||
DROP TABLE t2;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug #47930: MATCH IN BOOLEAN MODE returns too many results
|
||||
# inside subquery
|
||||
#
|
||||
|
@ -2561,6 +2561,35 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
drop table t1;
|
||||
#
|
||||
# Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0
|
||||
#
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (a VARCHAR(20), b INT);
|
||||
CREATE TABLE t2 (a VARCHAR(20), b INT);
|
||||
INSERT INTO t1 VALUES ('ABC', 1);
|
||||
INSERT INTO t2 VALUES ('ABC', 1);
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
secret
|
||||
SELECT DECODE((SELECT ENCODE('secret', 'ABC') FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
DECODE((SELECT ENCODE('secret', 'ABC') FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
secret
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), 'ABC')
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), 'ABC')
|
||||
secret
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
INSERT INTO t1 VALUES ('EDF', 3), ('BCD', 2), ('ABC', 1);
|
||||
INSERT INTO t2 VALUES ('EDF', 3), ('BCD', 2), ('ABC', 1);
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a)
|
||||
FROM t2 WHERE t2.b = 1 GROUP BY t2.b;
|
||||
DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a)
|
||||
secret
|
||||
DROP TABLE t1, t2;
|
||||
Start of 5.4 tests
|
||||
SELECT format(12345678901234567890.123, 3);
|
||||
format(12345678901234567890.123, 3)
|
||||
|
@ -984,6 +984,19 @@ GEOMFROMTEXT(
|
||||
SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49250 : spatial btree index corruption and crash
|
||||
# Part one : spatial syntax check
|
||||
#
|
||||
CREATE TABLE t1(col1 MULTIPOLYGON NOT NULL,
|
||||
SPATIAL INDEX USING BTREE (col1));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1))' at line 2
|
||||
CREATE TABLE t2(col1 MULTIPOLYGON NOT NULL);
|
||||
CREATE SPATIAL INDEX USING BTREE ON t2(col);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE ON t2(col)' at line 1
|
||||
ALTER TABLE t2 ADD SPATIAL INDEX USING BTREE (col1);
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE (col1)' at line 1
|
||||
DROP TABLE t2;
|
||||
End of 5.0 tests
|
||||
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
|
||||
create view v1 as select * from t1;
|
||||
|
@ -1258,3 +1258,38 @@ SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
|
||||
c e d
|
||||
1 0 NULL
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug#47650: using group by with rollup without indexes returns incorrect
|
||||
# results with where
|
||||
#
|
||||
CREATE TABLE t1 ( a INT );
|
||||
INSERT INTO t1 VALUES (1);
|
||||
CREATE TABLE t2 ( a INT, b INT );
|
||||
INSERT INTO t2 VALUES (1, 1),(1, 2),(1, 3),(2, 4),(2, 5);
|
||||
EXPLAIN
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 LEFT JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary; Using filesort
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 5
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 LEFT JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
a COUNT( t2.b ) SUM( t2.b ) MAX( t2.b )
|
||||
1 3 6 3
|
||||
NULL 3 6 3
|
||||
EXPLAIN
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 Using filesort
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using where
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
a COUNT( t2.b ) SUM( t2.b ) MAX( t2.b )
|
||||
1 3 6 3
|
||||
NULL 3 6 3
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -1855,6 +1855,21 @@ CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug #49465: valgrind warnings and incorrect live checksum...
|
||||
#
|
||||
CREATE TABLE t1(
|
||||
a VARCHAR(1), b VARCHAR(1), c VARCHAR(1),
|
||||
f VARCHAR(1), g VARCHAR(1), h VARCHAR(1),
|
||||
i VARCHAR(1), j VARCHAR(1), k VARCHAR(1)) CHECKSUM=1;
|
||||
INSERT INTO t1 VALUES('', '', '', '', '', '', '', '', '');
|
||||
CHECKSUM TABLE t1 QUICK;
|
||||
Table Checksum
|
||||
test.t1 467455460
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
Table Checksum
|
||||
test.t1 467455460
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1 (a int not null, key `a` (a) key_block_size=1024);
|
||||
show create table t1;
|
||||
|
@ -127,4 +127,46 @@ mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
set GLOBAL sql_mode=default;
|
||||
#
|
||||
# Bug #41569 mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table
|
||||
# but does not set values.
|
||||
#
|
||||
CREATE PROCEDURE testproc() BEGIN END;
|
||||
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
|
||||
mtr.global_suppressions OK
|
||||
mtr.test_suppressions OK
|
||||
mysql.columns_priv OK
|
||||
mysql.db OK
|
||||
mysql.event OK
|
||||
mysql.func OK
|
||||
mysql.general_log
|
||||
Error : You can't use locks with log tables.
|
||||
status : OK
|
||||
mysql.help_category OK
|
||||
mysql.help_keyword OK
|
||||
mysql.help_relation OK
|
||||
mysql.help_topic OK
|
||||
mysql.host OK
|
||||
mysql.ndb_binlog_index OK
|
||||
mysql.plugin OK
|
||||
mysql.proc OK
|
||||
mysql.procs_priv OK
|
||||
mysql.servers OK
|
||||
mysql.slow_log
|
||||
Error : You can't use locks with log tables.
|
||||
status : OK
|
||||
mysql.tables_priv OK
|
||||
mysql.time_zone OK
|
||||
mysql.time_zone_leap_second OK
|
||||
mysql.time_zone_name OK
|
||||
mysql.time_zone_transition OK
|
||||
mysql.time_zone_transition_type OK
|
||||
mysql.user OK
|
||||
CALL testproc();
|
||||
DROP PROCEDURE testproc;
|
||||
WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
|
||||
WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
|
||||
WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
|
||||
The --upgrade-system-tables option was used, databases won't be touched.
|
||||
|
@ -1463,6 +1463,15 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
|
||||
col
|
||||
1
|
||||
# Must use ref-or-null on the a_c index
|
||||
EXPLAIN
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x x ref_or_null a_c,a x x x x x
|
||||
# Must return 1 row
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
col
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE t2 (a varchar(32), b int(11), c float, d double,
|
||||
|
@ -24,8 +24,8 @@ a timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
b varchar(10),
|
||||
PRIMARY KEY (a)
|
||||
)
|
||||
PARTITION BY RANGE (to_days(a)) (
|
||||
PARTITION p1 VALUES LESS THAN (733407),
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
|
||||
PARTITION p1 VALUES LESS THAN (1199134800),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE
|
||||
);
|
||||
INSERT INTO t1 VALUES ('2007-07-30 17:35:48', 'p1');
|
||||
@ -37,7 +37,7 @@ a b
|
||||
2009-07-14 17:35:55 pmax
|
||||
2009-09-21 17:31:42 pmax
|
||||
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
|
||||
PARTITION p3 VALUES LESS THAN (733969),
|
||||
PARTITION p3 VALUES LESS THAN (1247688000),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
@ -51,9 +51,9 @@ t1 CREATE TABLE `t1` (
|
||||
`b` varchar(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE (to_days(a))
|
||||
(PARTITION p1 VALUES LESS THAN (733407) ENGINE = MyISAM,
|
||||
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
|
||||
/*!50100 PARTITION BY RANGE (UNIX_TIMESTAMP(a))
|
||||
(PARTITION p1 VALUES LESS THAN (1199134800) ENGINE = MyISAM,
|
||||
PARTITION p3 VALUES LESS THAN (1247688000) ENGINE = MyISAM,
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int NOT NULL, b varchar(5) NOT NULL)
|
||||
|
@ -126,7 +126,7 @@ ERROR HY000: This partition function is not allowed
|
||||
create table t1 (col1 date)
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (10), partition p1 values less than (30));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
create table t1 (col1 datetime)
|
||||
partition by range(week(col1))
|
||||
(partition p0 values less than (10), partition p1 values less than (30));
|
||||
|
@ -138,7 +138,7 @@ primary key(a,b))
|
||||
partition by hash (rand(a))
|
||||
partitions 2
|
||||
(partition x1, partition x2);
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
|
||||
partitions 2
|
||||
(partition x1, partition x2)' at line 6
|
||||
CREATE TABLE t1 (
|
||||
@ -149,7 +149,7 @@ primary key(a,b))
|
||||
partition by range (rand(a))
|
||||
partitions 2
|
||||
(partition x1 values less than (0), partition x2 values less than (2));
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
|
||||
partitions 2
|
||||
(partition x1 values less than (0), partition x2 values less than' at line 6
|
||||
CREATE TABLE t1 (
|
||||
@ -160,7 +160,7 @@ primary key(a,b))
|
||||
partition by list (rand(a))
|
||||
partitions 2
|
||||
(partition x1 values in (1), partition x2 values in (2));
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
|
||||
partitions 2
|
||||
(partition x1 values in (1), partition x2 values in (2))' at line 6
|
||||
CREATE TABLE t1 (
|
||||
@ -275,7 +275,7 @@ c int not null,
|
||||
primary key (a,b))
|
||||
partition by key (a)
|
||||
subpartition by hash (rand(a+b));
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 7
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 7
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@ -371,7 +371,7 @@ partition by range (3+4)
|
||||
partitions 2
|
||||
(partition x1 values less than (4) tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2);
|
||||
ERROR HY000: Constant/Random expression in (sub)partitioning function is not allowed
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@ -540,7 +540,7 @@ partition by list (3+4)
|
||||
partitions 2
|
||||
(partition x1 values in (4) tablespace ts1,
|
||||
partition x2 values in (8) tablespace ts2);
|
||||
ERROR HY000: Constant/Random expression in (sub)partitioning function is not allowed
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@ -631,13 +631,13 @@ partition by range (ascii(v))
|
||||
ERROR HY000: This partition function is not allowed
|
||||
create table t1 (a int)
|
||||
partition by hash (rand(a));
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash(CURTIME() + a);
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash (NOW()+a);
|
||||
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
|
||||
ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
|
||||
create table t1 (a int)
|
||||
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
@ -648,3 +648,295 @@ ERROR HY000: This partition function is not allowed
|
||||
create table t1 (a char(10))
|
||||
partition by hash (extractvalue(a,'a'));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
#
|
||||
# Bug #42849: innodb crash with varying time_zone on partitioned
|
||||
# timestamp primary key
|
||||
#
|
||||
CREATE TABLE old (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: The PARTITION function returns the wrong type
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: The PARTITION function returns the wrong type
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a+0) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a+0) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a % 2) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a % 2) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (ABS(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (ABS(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (CEILING(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (CEILING(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (FLOOR(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (FLOOR(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TO_DAYS(a)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (231),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (231),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (19),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (19),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (MONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (8),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (MONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (8),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (HOUR(a)) (
|
||||
PARTITION p VALUES LESS THAN (17),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (HOUR(a)) (
|
||||
PARTITION p VALUES LESS THAN (17),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (MINUTE(a)) (
|
||||
PARTITION p VALUES LESS THAN (55),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (MINUTE(a)) (
|
||||
PARTITION p VALUES LESS THAN (55),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (QUARTER(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (QUARTER(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (SECOND(a)) (
|
||||
PARTITION p VALUES LESS THAN (7),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (SECOND(a)) (
|
||||
PARTITION p VALUES LESS THAN (7),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEARWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (200833),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEARWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (200833),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (WEEKDAY(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (WEEKDAY(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
||||
PARTITION p VALUES LESS THAN (64507),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
||||
PARTITION p VALUES LESS THAN (64507),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL, b TIMESTAMP NOT NULL, PRIMARY KEY(a,b))
|
||||
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a + 0)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + 0)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old ADD COLUMN b DATE;
|
||||
CREATE TABLE new (a TIMESTAMP, b DATE)
|
||||
PARTITION BY RANGE (YEAR(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP, b DATE)
|
||||
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP, b date)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
CREATE TABLE new (a TIMESTAMP, b TIMESTAMP)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
ALTER TABLE old MODIFY b TIMESTAMP;
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
|
||||
DROP TABLE old;
|
||||
End of 5.1 tests
|
||||
|
@ -1917,6 +1917,31 @@ execute stmt using @arg;
|
||||
?
|
||||
-12345.5432100000
|
||||
deallocate prepare stmt;
|
||||
#
|
||||
# Bug#48508: Crash on prepared statement re-execution.
|
||||
#
|
||||
create table t1(b int);
|
||||
insert into t1 values (0);
|
||||
create view v1 AS select 1 as a from t1 where b;
|
||||
prepare stmt from "select * from v1 where a";
|
||||
execute stmt;
|
||||
a
|
||||
execute stmt;
|
||||
a
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
create table t1(a bigint);
|
||||
create table t2(b tinyint);
|
||||
insert into t2 values (null);
|
||||
prepare stmt from "select 1 from t1 join t2 on a xor b where b > 1 and a =1";
|
||||
execute stmt;
|
||||
1
|
||||
execute stmt;
|
||||
1
|
||||
deallocate prepare stmt;
|
||||
drop table t1,t2;
|
||||
#
|
||||
End of 5.0 tests.
|
||||
create procedure proc_1() reset query cache;
|
||||
call proc_1();
|
||||
@ -2926,6 +2951,25 @@ execute stmt;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
drop table t1;
|
||||
deallocate prepare stmt;
|
||||
#
|
||||
# Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0
|
||||
#
|
||||
prepare encode from "select encode(?, ?) into @ciphertext";
|
||||
prepare decode from "select decode(?, ?) into @plaintext";
|
||||
set @str="abc", @key="cba";
|
||||
execute encode using @str, @key;
|
||||
execute decode using @ciphertext, @key;
|
||||
select @plaintext;
|
||||
@plaintext
|
||||
abc
|
||||
set @str="bcd", @key="dcb";
|
||||
execute encode using @str, @key;
|
||||
execute decode using @ciphertext, @key;
|
||||
select @plaintext;
|
||||
@plaintext
|
||||
bcd
|
||||
deallocate prepare encode;
|
||||
deallocate prepare decode;
|
||||
|
||||
End of 5.1 tests.
|
||||
|
||||
|
@ -4446,6 +4446,91 @@ SELECT 1 FROM t2 JOIN t1 ON 1=1
|
||||
WHERE a != '1' AND NOT a >= b OR NOT ROW(b,a )<> ROW(a,a);
|
||||
1
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug #49199: Optimizer handles incorrectly:
|
||||
# field='const1' AND field='const2' in some cases
|
||||
|
||||
CREATE TABLE t1(a DATETIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
a
|
||||
2001-01-01 00:00:00
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
a
|
||||
2001-01-01
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01' AS `a` from dual where 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a TIMESTAMP NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
a
|
||||
2001-01-01 00:00:00
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
a b
|
||||
2001-01-01 00:00:00 2001-01-01
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
a b
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 0
|
||||
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
|
||||
a b
|
||||
2001-01-01 00:00:00 2001-01-01
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT x.a, y.a, z.a FROM t1 x
|
||||
JOIN t1 y ON x.a=y.a
|
||||
JOIN t1 z ON y.a=z.a
|
||||
WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00';
|
||||
a a a
|
||||
2001-01-01 00:00:00 2001-01-01 00:00:00 2001-01-01 00:00:00
|
||||
EXPLAIN EXTENDED SELECT x.a, y.a, z.a FROM t1 x
|
||||
JOIN t1 y ON x.a=y.a
|
||||
JOIN t1 z ON y.a=z.a
|
||||
WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE x system NULL NULL NULL NULL 1 100.00
|
||||
1 SIMPLE y system NULL NULL NULL NULL 1 100.00
|
||||
1 SIMPLE z system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
create table t1(a INT, KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
@ -4680,4 +4765,29 @@ HAVING v <= 't'
|
||||
ORDER BY pk;
|
||||
v
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#49489 Uninitialized cache led to a wrong result.
|
||||
#
|
||||
CREATE TABLE t1(c1 DOUBLE(5,4));
|
||||
INSERT INTO t1 VALUES (9.1234);
|
||||
SELECT * FROM t1 WHERE c1 < 9.12345;
|
||||
c1
|
||||
9.1234
|
||||
DROP TABLE t1;
|
||||
# End of test for bug#49489.
|
||||
#
|
||||
# Bug #49517: Inconsistent behavior while using
|
||||
# NULLable BIGINT and INT columns in comparison
|
||||
#
|
||||
CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL);
|
||||
INSERT INTO t1 VALUES(105, NULL, NULL);
|
||||
SELECT * FROM t1 WHERE b < 102;
|
||||
a b c
|
||||
SELECT * FROM t1 WHERE c < 102;
|
||||
a b c
|
||||
SELECT * FROM t1 WHERE 102 < b;
|
||||
a b c
|
||||
SELECT * FROM t1 WHERE 102 < c;
|
||||
a b c
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -1437,4 +1437,10 @@ GRANT PROCESS ON *.* TO test_u@localhost;
|
||||
SHOW ENGINE MYISAM MUTEX;
|
||||
SHOW ENGINE MYISAM STATUS;
|
||||
DROP USER test_u@localhost;
|
||||
#
|
||||
# Bug #48985: show create table crashes if previous access to the table
|
||||
# was killed
|
||||
#
|
||||
SHOW CREATE TABLE non_existent;
|
||||
ERROR 70100: Query execution was interrupted
|
||||
End of 5.1 tests
|
||||
|
@ -120,3 +120,29 @@ DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci;
|
||||
RETURN 'str';
|
||||
END|
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
|
||||
SET NAMES utf8;
|
||||
DROP FUNCTION IF EXISTS bug48766;
|
||||
CREATE FUNCTION bug48766 ()
|
||||
RETURNS ENUM( 'w' ) CHARACTER SET ucs2
|
||||
RETURN 0;
|
||||
SHOW CREATE FUNCTION bug48766;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('w') CHARSET ucs2
|
||||
RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
|
||||
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_NAME='bug48766';
|
||||
DTD_IDENTIFIER
|
||||
enum('w') CHARSET ucs2
|
||||
DROP FUNCTION bug48766;
|
||||
CREATE FUNCTION bug48766 ()
|
||||
RETURNS ENUM('а','б','в','г') CHARACTER SET ucs2
|
||||
RETURN 0;
|
||||
SHOW CREATE FUNCTION bug48766;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
bug48766 CREATE DEFINER=`root`@`localhost` FUNCTION `bug48766`() RETURNS enum('а','б','в','г') CHARSET ucs2
|
||||
RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
|
||||
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_NAME='bug48766';
|
||||
DTD_IDENTIFIER
|
||||
enum('а','б','в','г') CHARSET ucs2
|
||||
DROP FUNCTION bug48766;
|
||||
|
@ -4419,6 +4419,31 @@ WHERE a = 230;
|
||||
MAX(b) (SELECT COUNT(*) FROM st1,st2 WHERE st2.b <= t1.b)
|
||||
NULL 0
|
||||
DROP TABLE t1, st1, st2;
|
||||
#
|
||||
# Bug #48709: Assertion failed in sql_select.cc:11782:
|
||||
# int join_read_key(JOIN_TAB*)
|
||||
#
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, int_key int);
|
||||
INSERT INTO t1 VALUES (10,1), (14,1);
|
||||
CREATE TABLE t2 (pk int PRIMARY KEY, int_key int);
|
||||
INSERT INTO t2 VALUES (3,3), (5,NULL), (7,3);
|
||||
# should have eq_ref for t1
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 outr
|
||||
WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2)
|
||||
ORDER BY outr.pk;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
x x outr ALL x x x x x x
|
||||
x x t1 eq_ref x x x x x x
|
||||
x x t2 index x x x x x x
|
||||
# should not crash on debug binaries
|
||||
SELECT * FROM t2 outr
|
||||
WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2)
|
||||
ORDER BY outr.pk;
|
||||
pk int_key
|
||||
3 3
|
||||
7 3
|
||||
DROP TABLE t1,t2;
|
||||
End of 5.0 tests.
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
|
||||
|
@ -46,3 +46,267 @@ a
|
||||
2001
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug #49480: WHERE using YEAR columns returns unexpected results
|
||||
#
|
||||
CREATE TABLE t2(yy YEAR(2), c2 CHAR(4));
|
||||
CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4));
|
||||
INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069);
|
||||
INSERT INTO t4 (c4) SELECT c2 FROM t2;
|
||||
UPDATE t2 SET yy = c2;
|
||||
UPDATE t4 SET yyyy = c4;
|
||||
SELECT * FROM t2;
|
||||
yy c2
|
||||
NULL NULL
|
||||
70 1970
|
||||
99 1999
|
||||
00 2000
|
||||
01 2001
|
||||
69 2069
|
||||
SELECT * FROM t4;
|
||||
yyyy c4
|
||||
NULL NULL
|
||||
1970 1970
|
||||
1999 1999
|
||||
2000 2000
|
||||
2001 2001
|
||||
2069 2069
|
||||
# Comparison of YEAR(2) with YEAR(4)
|
||||
SELECT * FROM t2, t4 WHERE yy = yyyy;
|
||||
yy c2 yyyy c4
|
||||
70 1970 1970 1970
|
||||
99 1999 1999 1999
|
||||
00 2000 2000 2000
|
||||
01 2001 2001 2001
|
||||
69 2069 2069 2069
|
||||
SELECT * FROM t2, t4 WHERE yy <=> yyyy;
|
||||
yy c2 yyyy c4
|
||||
NULL NULL NULL NULL
|
||||
70 1970 1970 1970
|
||||
99 1999 1999 1999
|
||||
00 2000 2000 2000
|
||||
01 2001 2001 2001
|
||||
69 2069 2069 2069
|
||||
SELECT * FROM t2, t4 WHERE yy < yyyy;
|
||||
yy c2 yyyy c4
|
||||
70 1970 1999 1999
|
||||
70 1970 2000 2000
|
||||
99 1999 2000 2000
|
||||
70 1970 2001 2001
|
||||
99 1999 2001 2001
|
||||
00 2000 2001 2001
|
||||
70 1970 2069 2069
|
||||
99 1999 2069 2069
|
||||
00 2000 2069 2069
|
||||
01 2001 2069 2069
|
||||
SELECT * FROM t2, t4 WHERE yy > yyyy;
|
||||
yy c2 yyyy c4
|
||||
99 1999 1970 1970
|
||||
00 2000 1970 1970
|
||||
01 2001 1970 1970
|
||||
69 2069 1970 1970
|
||||
00 2000 1999 1999
|
||||
01 2001 1999 1999
|
||||
69 2069 1999 1999
|
||||
01 2001 2000 2000
|
||||
69 2069 2000 2000
|
||||
69 2069 2001 2001
|
||||
# Comparison of YEAR(2) with YEAR(2)
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy = b.yy;
|
||||
yy c2 yy c2
|
||||
70 1970 70 1970
|
||||
99 1999 99 1999
|
||||
00 2000 00 2000
|
||||
01 2001 01 2001
|
||||
69 2069 69 2069
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy <=> b.yy;
|
||||
yy c2 yy c2
|
||||
NULL NULL NULL NULL
|
||||
70 1970 70 1970
|
||||
99 1999 99 1999
|
||||
00 2000 00 2000
|
||||
01 2001 01 2001
|
||||
69 2069 69 2069
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy < b.yy;
|
||||
yy c2 yy c2
|
||||
70 1970 99 1999
|
||||
70 1970 00 2000
|
||||
99 1999 00 2000
|
||||
70 1970 01 2001
|
||||
99 1999 01 2001
|
||||
00 2000 01 2001
|
||||
70 1970 69 2069
|
||||
99 1999 69 2069
|
||||
00 2000 69 2069
|
||||
01 2001 69 2069
|
||||
# Comparison of YEAR(4) with YEAR(4)
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy = b.yyyy;
|
||||
yyyy c4 yyyy c4
|
||||
1970 1970 1970 1970
|
||||
1999 1999 1999 1999
|
||||
2000 2000 2000 2000
|
||||
2001 2001 2001 2001
|
||||
2069 2069 2069 2069
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy <=> b.yyyy;
|
||||
yyyy c4 yyyy c4
|
||||
NULL NULL NULL NULL
|
||||
1970 1970 1970 1970
|
||||
1999 1999 1999 1999
|
||||
2000 2000 2000 2000
|
||||
2001 2001 2001 2001
|
||||
2069 2069 2069 2069
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy < b.yyyy;
|
||||
yyyy c4 yyyy c4
|
||||
1970 1970 1999 1999
|
||||
1970 1970 2000 2000
|
||||
1999 1999 2000 2000
|
||||
1970 1970 2001 2001
|
||||
1999 1999 2001 2001
|
||||
2000 2000 2001 2001
|
||||
1970 1970 2069 2069
|
||||
1999 1999 2069 2069
|
||||
2000 2000 2069 2069
|
||||
2001 2001 2069 2069
|
||||
# Comparison with constants:
|
||||
SELECT * FROM t2 WHERE yy = NULL;
|
||||
yy c2
|
||||
SELECT * FROM t4 WHERE yyyy = NULL;
|
||||
yyyy c4
|
||||
SELECT * FROM t2 WHERE yy <=> NULL;
|
||||
yy c2
|
||||
NULL NULL
|
||||
SELECT * FROM t4 WHERE yyyy <=> NULL;
|
||||
yyyy c4
|
||||
NULL NULL
|
||||
SELECT * FROM t2 WHERE yy < NULL;
|
||||
yy c2
|
||||
SELECT * FROM t2 WHERE yy > NULL;
|
||||
yy c2
|
||||
SELECT * FROM t2 WHERE yy = NOW();
|
||||
yy c2
|
||||
SELECT * FROM t4 WHERE yyyy = NOW();
|
||||
yyyy c4
|
||||
SELECT * FROM t2 WHERE yy = 99;
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t2 WHERE 99 = yy;
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t4 WHERE yyyy = 99;
|
||||
yyyy c4
|
||||
1999 1999
|
||||
SELECT * FROM t2 WHERE yy = 'test';
|
||||
yy c2
|
||||
00 2000
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'test'
|
||||
SELECT * FROM t4 WHERE yyyy = 'test';
|
||||
yyyy c4
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'test'
|
||||
SELECT * FROM t2 WHERE yy = '1999';
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t4 WHERE yyyy = '1999';
|
||||
yyyy c4
|
||||
1999 1999
|
||||
SELECT * FROM t2 WHERE yy = 1999;
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t4 WHERE yyyy = 1999;
|
||||
yyyy c4
|
||||
1999 1999
|
||||
SELECT * FROM t2 WHERE yy = 1999.1;
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t4 WHERE yyyy = 1999.1;
|
||||
yyyy c4
|
||||
1999 1999
|
||||
SELECT * FROM t2 WHERE yy = 1998.9;
|
||||
yy c2
|
||||
99 1999
|
||||
SELECT * FROM t4 WHERE yyyy = 1998.9;
|
||||
yyyy c4
|
||||
1999 1999
|
||||
# Coverage tests for YEAR with zero/2000 constants:
|
||||
SELECT * FROM t2 WHERE yy = 0;
|
||||
yy c2
|
||||
00 2000
|
||||
SELECT * FROM t2 WHERE yy = '0';
|
||||
yy c2
|
||||
00 2000
|
||||
SELECT * FROM t2 WHERE yy = '0000';
|
||||
yy c2
|
||||
00 2000
|
||||
SELECT * FROM t2 WHERE yy = '2000';
|
||||
yy c2
|
||||
00 2000
|
||||
SELECT * FROM t2 WHERE yy = 2000;
|
||||
yy c2
|
||||
00 2000
|
||||
SELECT * FROM t4 WHERE yyyy = 0;
|
||||
yyyy c4
|
||||
SELECT * FROM t4 WHERE yyyy = '0';
|
||||
yyyy c4
|
||||
2000 2000
|
||||
SELECT * FROM t4 WHERE yyyy = '0000';
|
||||
yyyy c4
|
||||
SELECT * FROM t4 WHERE yyyy = '2000';
|
||||
yyyy c4
|
||||
2000 2000
|
||||
SELECT * FROM t4 WHERE yyyy = 2000;
|
||||
yyyy c4
|
||||
2000 2000
|
||||
# Comparison with constants those are out of YEAR range
|
||||
# (coverage test for backward compatibility)
|
||||
SELECT COUNT(yy) FROM t2;
|
||||
COUNT(yy)
|
||||
5
|
||||
SELECT COUNT(yyyy) FROM t4;
|
||||
COUNT(yyyy)
|
||||
5
|
||||
SELECT COUNT(*) FROM t2 WHERE yy = -1;
|
||||
COUNT(*)
|
||||
0
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy > -1;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t2 WHERE yy > -1000000000000000000;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy > -1000000000000000000;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t2 WHERE yy < 2156;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy < 2156;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t2 WHERE yy < 1000000000000000000;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy < 1000000000000000000;
|
||||
COUNT(*)
|
||||
5
|
||||
SELECT * FROM t2 WHERE yy < 123;
|
||||
yy c2
|
||||
70 1970
|
||||
99 1999
|
||||
00 2000
|
||||
01 2001
|
||||
69 2069
|
||||
SELECT * FROM t2 WHERE yy > 123;
|
||||
yy c2
|
||||
SELECT * FROM t4 WHERE yyyy < 123;
|
||||
yyyy c4
|
||||
SELECT * FROM t4 WHERE yyyy > 123;
|
||||
yyyy c4
|
||||
1970 1970
|
||||
1999 1999
|
||||
2000 2000
|
||||
2001 2001
|
||||
2069 2069
|
||||
DROP TABLE t2, t4;
|
||||
#
|
||||
End of 5.1 tests
|
||||
|
@ -1018,6 +1018,12 @@ ERROR HY000: Variable 'hostname' is a read only variable
|
||||
show variables like 'hostname';
|
||||
Variable_name Value
|
||||
hostname #
|
||||
#
|
||||
# BUG#37408 - Compressed MyISAM files should not require/use mmap()
|
||||
#
|
||||
# Test 'myisam_mmap_size' option is not dynamic
|
||||
SET @@myisam_mmap_size= 500M;
|
||||
ERROR HY000: Variable 'myisam_mmap_size' is a read only variable
|
||||
End of 5.0 tests
|
||||
set join_buffer_size=1;
|
||||
Warnings:
|
||||
|
@ -18,6 +18,13 @@
|
||||
</rules>
|
||||
</collation>
|
||||
|
||||
<collation name="utf8_hugeid_ci" id="2047000000">
|
||||
<rules>
|
||||
<reset>a</reset>
|
||||
<s>b</s>
|
||||
</rules>
|
||||
</collation>
|
||||
|
||||
<collation name="utf8_maxuserid_ci" id="2047">
|
||||
<rules>
|
||||
<reset>a</reset>
|
||||
|
@ -1,3 +1,8 @@
|
||||
call mtr.add_suppression('Attempting backtrace');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
|
||||
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
|
||||
flush logs;
|
||||
flush logs;
|
||||
flush logs;
|
||||
@ -21,7 +26,6 @@ flush logs;
|
||||
*** must be a warning master-bin.000001 was not found ***
|
||||
Warnings:
|
||||
Warning 1612 Being purged log master-bin.000001 was not found
|
||||
Warning 1612 Being purged log master-bin.000001 was not found
|
||||
*** must show one record, of the active binlog, left in the index file after PURGE ***
|
||||
show binary logs;
|
||||
Log_name File_size
|
||||
@ -37,4 +41,111 @@ Level Code Message
|
||||
Warning 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files
|
||||
Error 1377 Fatal error during log purge
|
||||
reset master;
|
||||
# crash_purge_before_update_index
|
||||
flush logs;
|
||||
SET SESSION debug="+d,crash_purge_before_update_index";
|
||||
purge binary logs TO 'master-bin.000002';
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000001
|
||||
master-bin.000002
|
||||
master-bin.000003
|
||||
|
||||
# crash_purge_non_critical_after_update_index
|
||||
flush logs;
|
||||
SET SESSION debug="+d,crash_purge_non_critical_after_update_index";
|
||||
purge binary logs TO 'master-bin.000004';
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000004
|
||||
master-bin.000005
|
||||
|
||||
# crash_purge_critical_after_update_index
|
||||
flush logs;
|
||||
SET SESSION debug="+d,crash_purge_critical_after_update_index";
|
||||
purge binary logs TO 'master-bin.000006';
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
|
||||
# crash_create_non_critical_before_update_index
|
||||
SET SESSION debug="+d,crash_create_non_critical_before_update_index";
|
||||
flush logs;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
master-bin.000008
|
||||
|
||||
# crash_create_critical_before_update_index
|
||||
SET SESSION debug="+d,crash_create_critical_before_update_index";
|
||||
flush logs;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
master-bin.000008
|
||||
master-bin.000009
|
||||
|
||||
# crash_create_after_update_index
|
||||
SET SESSION debug="+d,crash_create_after_update_index";
|
||||
flush logs;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
master-bin.000008
|
||||
master-bin.000009
|
||||
master-bin.000010
|
||||
master-bin.000011
|
||||
|
||||
#
|
||||
# This should put the server in unsafe state and stop
|
||||
# accepting any command. If we inject a fault at this
|
||||
# point and continue the execution the server crashes.
|
||||
# Besides the flush command does not report an error.
|
||||
#
|
||||
# fault_injection_registering_index
|
||||
SET SESSION debug="+d,fault_injection_registering_index";
|
||||
flush logs;
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
master-bin.000008
|
||||
master-bin.000009
|
||||
master-bin.000010
|
||||
master-bin.000011
|
||||
master-bin.000012
|
||||
|
||||
# fault_injection_updating_index
|
||||
SET SESSION debug="+d,fault_injection_updating_index";
|
||||
flush logs;
|
||||
SET @index=LOAD_FILE('MYSQLTEST_VARDIR/mysqld.1/data//master-bin.index');
|
||||
SELECT @index;
|
||||
@index
|
||||
master-bin.000006
|
||||
master-bin.000007
|
||||
master-bin.000008
|
||||
master-bin.000009
|
||||
master-bin.000010
|
||||
master-bin.000011
|
||||
master-bin.000012
|
||||
master-bin.000013
|
||||
|
||||
SET SESSION debug="";
|
||||
End of tests
|
||||
|
@ -3,6 +3,18 @@
|
||||
#
|
||||
source include/have_log_bin.inc;
|
||||
source include/not_embedded.inc;
|
||||
# Don't test this under valgrind, memory leaks will occur
|
||||
--source include/not_valgrind.inc
|
||||
source include/have_debug.inc;
|
||||
call mtr.add_suppression('Attempting backtrace');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
|
||||
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
|
||||
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
|
||||
let $old=`select @@debug`;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
let $INDEX=$MYSQLD_DATADIR/master-bin.index;
|
||||
|
||||
#
|
||||
# testing purge binary logs TO
|
||||
@ -13,7 +25,6 @@ flush logs;
|
||||
flush logs;
|
||||
|
||||
source include/show_binary_logs.inc;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/master-bin.000001;
|
||||
|
||||
# there must be a warning with file names
|
||||
@ -66,4 +77,159 @@ rmdir $MYSQLD_DATADIR/master-bin.000001;
|
||||
--disable_warnings
|
||||
reset master;
|
||||
--enable_warnings
|
||||
|
||||
--echo # crash_purge_before_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_purge_before_update_index";
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000002';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000001;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000002;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000003;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_purge_non_critical_after_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_purge_non_critical_after_update_index";
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000004';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000001;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000002;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000003;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_purge_critical_after_update_index
|
||||
flush logs;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_purge_critical_after_update_index";
|
||||
--error 2013
|
||||
purge binary logs TO 'master-bin.000006';
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000004;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000005;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000006;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000007;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000008;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_non_critical_before_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_create_non_critical_before_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000008;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000009;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_critical_before_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_create_critical_before_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000009;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000010;
|
||||
--error 1
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000011;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # crash_create_after_update_index
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
SET SESSION debug="+d,crash_create_after_update_index";
|
||||
--error 2013
|
||||
flush logs;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000010;
|
||||
file_exists $MYSQLD_DATADIR/master-bin.000011;
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo #
|
||||
--echo # This should put the server in unsafe state and stop
|
||||
--echo # accepting any command. If we inject a fault at this
|
||||
--echo # point and continue the execution the server crashes.
|
||||
--echo # Besides the flush command does not report an error.
|
||||
--echo #
|
||||
|
||||
--echo # fault_injection_registering_index
|
||||
SET SESSION debug="+d,fault_injection_registering_index";
|
||||
flush logs;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
--echo # fault_injection_updating_index
|
||||
SET SESSION debug="+d,fault_injection_updating_index";
|
||||
flush logs;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--chmod 0644 $INDEX
|
||||
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
-- eval SET @index=LOAD_FILE('$index')
|
||||
-- replace_regex /\.[\\\/]master/master/
|
||||
SELECT @index;
|
||||
|
||||
eval SET SESSION debug="$old";
|
||||
|
||||
--echo End of tests
|
||||
|
9
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
Normal file
9
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_49329.result
Normal file
@ -0,0 +1,9 @@
|
||||
create table ABC (i int) engine=ibmdb2i;
|
||||
insert into ABC values(1);
|
||||
create table abc (i int) engine=ibmdb2i;
|
||||
insert into abc values (2);
|
||||
select * from ABC;
|
||||
i
|
||||
1
|
||||
drop table ABC;
|
||||
drop table abc;
|
10
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
Normal file
10
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_49329.test
Normal file
@ -0,0 +1,10 @@
|
||||
source suite/ibmdb2i/include/have_ibmdb2i.inc;
|
||||
source include/have_case_sensitive_file_system.inc;
|
||||
|
||||
create table ABC (i int) engine=ibmdb2i;
|
||||
insert into ABC values(1);
|
||||
create table abc (i int) engine=ibmdb2i;
|
||||
insert into abc values (2);
|
||||
select * from ABC;
|
||||
drop table ABC;
|
||||
drop table abc;
|
@ -152,10 +152,16 @@ let $valsqlfunc = timestampdiff(YEAR,'2002-05-01','2001-01-01');
|
||||
let $coltype = datetime;
|
||||
--source suite/parts/inc/partition_blocked_sql_funcs.inc
|
||||
|
||||
let $sqlfunc = unix_timestamp(col1);
|
||||
let $valsqlfunc = unix_timestamp ('2002-05-01');
|
||||
let $coltype = date;
|
||||
--source suite/parts/inc/partition_blocked_sql_funcs.inc
|
||||
################################################################################
|
||||
# After the fix for bug #42849 the server behavior does not fit into this test's
|
||||
# architecture: for UNIX_TIMESTAMP() some of the queries in
|
||||
# suite/parts/inc/partition_blocked_sql_funcs.inc will fail with a different
|
||||
# error (ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR) and some will succeed where
|
||||
################################################################################
|
||||
#let $sqlfunc = unix_timestamp(col1);
|
||||
#let $valsqlfunc = unix_timestamp ('2002-05-01');
|
||||
#let $coltype = date;
|
||||
#--source suite/parts/inc/partition_blocked_sql_funcs.inc
|
||||
|
||||
let $sqlfunc = week(col1);
|
||||
let $valsqlfunc = week('2002-05-01');
|
||||
|
@ -33,42 +33,48 @@ select count(*) from t2;
|
||||
select * from t2;
|
||||
drop table t2;
|
||||
|
||||
eval create table t3 (a timestamp not null, primary key(a)) engine=$engine
|
||||
partition by range (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values less than (4),
|
||||
partition quarter2 values less than (7),
|
||||
partition quarter3 values less than (10),
|
||||
partition quarter4 values less than (13)
|
||||
);
|
||||
show create table t3;
|
||||
let $count=12;
|
||||
--echo $count inserts;
|
||||
while ($count)
|
||||
{
|
||||
eval insert into t3 values (date_add('1970-01-01 00:00:00',interval $count-1 month));
|
||||
dec $count;
|
||||
}
|
||||
select count(*) from t3;
|
||||
select * from t3;
|
||||
drop table t3;
|
||||
################################################################################
|
||||
# The following 2 tests are no longer valid after bug #42849 has been fixed:
|
||||
# it is not possible to use a timezone-dependent (such as month(timestamp_col)
|
||||
# or just a timestamp_col in a numeric context) anymore.
|
||||
################################################################################
|
||||
|
||||
eval create table t4 (a timestamp not null, primary key(a)) engine=$engine
|
||||
partition by list (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values in (0,1,2,3),
|
||||
partition quarter2 values in (4,5,6),
|
||||
partition quarter3 values in (7,8,9),
|
||||
partition quarter4 values in (10,11,12)
|
||||
);
|
||||
show create table t4;
|
||||
let $count=12;
|
||||
--echo $count inserts;
|
||||
while ($count)
|
||||
{
|
||||
eval insert into t4 values (date_add('1970-01-01 00:00:00',interval $count-1 month));
|
||||
dec $count;
|
||||
}
|
||||
select count(*) from t4;
|
||||
select * from t4;
|
||||
drop table t4;
|
||||
# eval create table t3 (a timestamp not null, primary key(a)) engine=$engine
|
||||
# partition by range (month(a)) subpartition by key (a)
|
||||
# subpartitions 3 (
|
||||
# partition quarter1 values less than (4),
|
||||
# partition quarter2 values less than (7),
|
||||
# partition quarter3 values less than (10),
|
||||
# partition quarter4 values less than (13)
|
||||
# );
|
||||
# show create table t3;
|
||||
# let $count=12;
|
||||
# --echo $count inserts;
|
||||
# while ($count)
|
||||
# {
|
||||
# eval insert into t3 values (date_add('1970-01-01 00:00:00',interval $count-1 month));
|
||||
# dec $count;
|
||||
# }
|
||||
# select count(*) from t3;
|
||||
# select * from t3;
|
||||
# drop table t3;
|
||||
|
||||
# eval create table t4 (a timestamp not null, primary key(a)) engine=$engine
|
||||
# partition by list (month(a)) subpartition by key (a)
|
||||
# subpartitions 3 (
|
||||
# partition quarter1 values in (0,1,2,3),
|
||||
# partition quarter2 values in (4,5,6),
|
||||
# partition quarter3 values in (7,8,9),
|
||||
# partition quarter4 values in (10,11,12)
|
||||
# );
|
||||
# show create table t4;
|
||||
# let $count=12;
|
||||
# --echo $count inserts;
|
||||
# while ($count)
|
||||
# {
|
||||
# eval insert into t4 values (date_add('1970-01-01 00:00:00',interval $count-1 month));
|
||||
# dec $count;
|
||||
# }
|
||||
# select count(*) from t4;
|
||||
# select * from t4;
|
||||
# drop table t4;
|
||||
|
@ -2942,104 +2942,6 @@ drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
-------------------------------------------------------------------------
|
||||
--- unix_timestamp(col1) in partition with coltype date
|
||||
-------------------------------------------------------------------------
|
||||
must all fail!
|
||||
drop table if exists t1 ;
|
||||
drop table if exists t2 ;
|
||||
drop table if exists t3 ;
|
||||
drop table if exists t4 ;
|
||||
drop table if exists t5 ;
|
||||
drop table if exists t6 ;
|
||||
create table t1 (col1 date) engine='INNODB'
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
create table t2 (col1 date) engine='INNODB'
|
||||
partition by list(unix_timestamp(col1))
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
create table t3 (col1 date) engine='INNODB'
|
||||
partition by hash(unix_timestamp(col1));
|
||||
Got one of the listed errors
|
||||
create table t4 (colint int, col1 date) engine='INNODB'
|
||||
partition by range(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
create table t5 (colint int, col1 date) engine='INNODB'
|
||||
partition by list(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
create table t6 (colint int, col1 date) engine='INNODB'
|
||||
partition by range(colint)
|
||||
(partition p0 values less than (unix_timestamp ('2002-05-01')),
|
||||
partition p1 values less than maxvalue);
|
||||
Got one of the listed errors
|
||||
drop table if exists t11 ;
|
||||
drop table if exists t22 ;
|
||||
drop table if exists t33 ;
|
||||
drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
create table t11 (col1 date) engine='INNODB' ;
|
||||
create table t22 (col1 date) engine='INNODB' ;
|
||||
create table t33 (col1 date) engine='INNODB' ;
|
||||
create table t44 (colint int, col1 date) engine='INNODB' ;
|
||||
create table t55 (colint int, col1 date) engine='INNODB' ;
|
||||
create table t66 (colint int, col1 date) engine='INNODB' ;
|
||||
alter table t11
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
alter table t22
|
||||
partition by list(unix_timestamp(col1))
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
alter table t33
|
||||
partition by hash(unix_timestamp(col1));
|
||||
Got one of the listed errors
|
||||
alter table t44
|
||||
partition by range(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
alter table t55
|
||||
partition by list(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
alter table t66
|
||||
partition by range(colint)
|
||||
(partition p0 values less than (unix_timestamp ('2002-05-01')),
|
||||
partition p1 values less than maxvalue);
|
||||
Got one of the listed errors
|
||||
drop table if exists t1 ;
|
||||
drop table if exists t2 ;
|
||||
drop table if exists t3 ;
|
||||
drop table if exists t4 ;
|
||||
drop table if exists t5 ;
|
||||
drop table if exists t6 ;
|
||||
drop table if exists t11 ;
|
||||
drop table if exists t22 ;
|
||||
drop table if exists t33 ;
|
||||
drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
-------------------------------------------------------------------------
|
||||
--- week(col1) in partition with coltype datetime
|
||||
-------------------------------------------------------------------------
|
||||
must all fail!
|
||||
|
@ -2942,104 +2942,6 @@ drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
-------------------------------------------------------------------------
|
||||
--- unix_timestamp(col1) in partition with coltype date
|
||||
-------------------------------------------------------------------------
|
||||
must all fail!
|
||||
drop table if exists t1 ;
|
||||
drop table if exists t2 ;
|
||||
drop table if exists t3 ;
|
||||
drop table if exists t4 ;
|
||||
drop table if exists t5 ;
|
||||
drop table if exists t6 ;
|
||||
create table t1 (col1 date) engine='MYISAM'
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
create table t2 (col1 date) engine='MYISAM'
|
||||
partition by list(unix_timestamp(col1))
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
create table t3 (col1 date) engine='MYISAM'
|
||||
partition by hash(unix_timestamp(col1));
|
||||
Got one of the listed errors
|
||||
create table t4 (colint int, col1 date) engine='MYISAM'
|
||||
partition by range(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
create table t5 (colint int, col1 date) engine='MYISAM'
|
||||
partition by list(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
create table t6 (colint int, col1 date) engine='MYISAM'
|
||||
partition by range(colint)
|
||||
(partition p0 values less than (unix_timestamp ('2002-05-01')),
|
||||
partition p1 values less than maxvalue);
|
||||
Got one of the listed errors
|
||||
drop table if exists t11 ;
|
||||
drop table if exists t22 ;
|
||||
drop table if exists t33 ;
|
||||
drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
create table t11 (col1 date) engine='MYISAM' ;
|
||||
create table t22 (col1 date) engine='MYISAM' ;
|
||||
create table t33 (col1 date) engine='MYISAM' ;
|
||||
create table t44 (colint int, col1 date) engine='MYISAM' ;
|
||||
create table t55 (colint int, col1 date) engine='MYISAM' ;
|
||||
create table t66 (colint int, col1 date) engine='MYISAM' ;
|
||||
alter table t11
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
alter table t22
|
||||
partition by list(unix_timestamp(col1))
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
alter table t33
|
||||
partition by hash(unix_timestamp(col1));
|
||||
Got one of the listed errors
|
||||
alter table t44
|
||||
partition by range(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values less than (15),
|
||||
partition p1 values less than (31));
|
||||
Got one of the listed errors
|
||||
alter table t55
|
||||
partition by list(colint)
|
||||
subpartition by hash(unix_timestamp(col1)) subpartitions 2
|
||||
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
|
||||
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
|
||||
partition p2 values in (21,22,23,24,25,26,27,28,29,30));
|
||||
Got one of the listed errors
|
||||
alter table t66
|
||||
partition by range(colint)
|
||||
(partition p0 values less than (unix_timestamp ('2002-05-01')),
|
||||
partition p1 values less than maxvalue);
|
||||
Got one of the listed errors
|
||||
drop table if exists t1 ;
|
||||
drop table if exists t2 ;
|
||||
drop table if exists t3 ;
|
||||
drop table if exists t4 ;
|
||||
drop table if exists t5 ;
|
||||
drop table if exists t6 ;
|
||||
drop table if exists t11 ;
|
||||
drop table if exists t22 ;
|
||||
drop table if exists t33 ;
|
||||
drop table if exists t44 ;
|
||||
drop table if exists t55 ;
|
||||
drop table if exists t66 ;
|
||||
-------------------------------------------------------------------------
|
||||
--- week(col1) in partition with coltype datetime
|
||||
-------------------------------------------------------------------------
|
||||
must all fail!
|
||||
|
@ -184,114 +184,6 @@ a
|
||||
1971-01-01 00:00:58
|
||||
1971-01-01 00:00:59
|
||||
drop table t2;
|
||||
create table t3 (a timestamp not null, primary key(a)) engine='InnoDB'
|
||||
partition by range (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values less than (4),
|
||||
partition quarter2 values less than (7),
|
||||
partition quarter3 values less than (10),
|
||||
partition quarter4 values less than (13)
|
||||
);
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE (month(a))
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 3
|
||||
(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = InnoDB,
|
||||
PARTITION quarter2 VALUES LESS THAN (7) ENGINE = InnoDB,
|
||||
PARTITION quarter3 VALUES LESS THAN (10) ENGINE = InnoDB,
|
||||
PARTITION quarter4 VALUES LESS THAN (13) ENGINE = InnoDB) */
|
||||
12 inserts;
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 10-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 9-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 8-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 7-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 6-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 5-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 4-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 3-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 2-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 1-1 month));
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
12
|
||||
select * from t3;
|
||||
a
|
||||
0000-00-00 00:00:00
|
||||
1970-02-01 00:00:00
|
||||
1970-03-01 00:00:00
|
||||
1970-04-01 00:00:00
|
||||
1970-05-01 00:00:00
|
||||
1970-06-01 00:00:00
|
||||
1970-07-01 00:00:00
|
||||
1970-08-01 00:00:00
|
||||
1970-09-01 00:00:00
|
||||
1970-10-01 00:00:00
|
||||
1970-11-01 00:00:00
|
||||
1970-12-01 00:00:00
|
||||
drop table t3;
|
||||
create table t4 (a timestamp not null, primary key(a)) engine='InnoDB'
|
||||
partition by list (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values in (0,1,2,3),
|
||||
partition quarter2 values in (4,5,6),
|
||||
partition quarter3 values in (7,8,9),
|
||||
partition quarter4 values in (10,11,12)
|
||||
);
|
||||
show create table t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST (month(a))
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 3
|
||||
(PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = InnoDB,
|
||||
PARTITION quarter2 VALUES IN (4,5,6) ENGINE = InnoDB,
|
||||
PARTITION quarter3 VALUES IN (7,8,9) ENGINE = InnoDB,
|
||||
PARTITION quarter4 VALUES IN (10,11,12) ENGINE = InnoDB) */
|
||||
12 inserts;
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 10-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 9-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 8-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 7-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 6-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 5-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 4-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 3-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 2-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 1-1 month));
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
12
|
||||
select * from t4;
|
||||
a
|
||||
0000-00-00 00:00:00
|
||||
1970-02-01 00:00:00
|
||||
1970-03-01 00:00:00
|
||||
1970-04-01 00:00:00
|
||||
1970-05-01 00:00:00
|
||||
1970-06-01 00:00:00
|
||||
1970-07-01 00:00:00
|
||||
1970-08-01 00:00:00
|
||||
1970-09-01 00:00:00
|
||||
1970-10-01 00:00:00
|
||||
1970-11-01 00:00:00
|
||||
1970-12-01 00:00:00
|
||||
drop table t4;
|
||||
create table t1 (a date not null, primary key(a)) engine='InnoDB'
|
||||
partition by key (a) (
|
||||
partition pa1 max_rows=20 min_rows=2,
|
||||
|
@ -184,114 +184,6 @@ a
|
||||
1971-01-01 00:00:58
|
||||
1971-01-01 00:00:59
|
||||
drop table t2;
|
||||
create table t3 (a timestamp not null, primary key(a)) engine='MyISAM'
|
||||
partition by range (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values less than (4),
|
||||
partition quarter2 values less than (7),
|
||||
partition quarter3 values less than (10),
|
||||
partition quarter4 values less than (13)
|
||||
);
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE (month(a))
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 3
|
||||
(PARTITION quarter1 VALUES LESS THAN (4) ENGINE = MyISAM,
|
||||
PARTITION quarter2 VALUES LESS THAN (7) ENGINE = MyISAM,
|
||||
PARTITION quarter3 VALUES LESS THAN (10) ENGINE = MyISAM,
|
||||
PARTITION quarter4 VALUES LESS THAN (13) ENGINE = MyISAM) */
|
||||
12 inserts;
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 10-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 9-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 8-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 7-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 6-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 5-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 4-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 3-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 2-1 month));
|
||||
insert into t3 values (date_add('1970-01-01 00:00:00',interval 1-1 month));
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
12
|
||||
select * from t3;
|
||||
a
|
||||
0000-00-00 00:00:00
|
||||
1970-02-01 00:00:00
|
||||
1970-03-01 00:00:00
|
||||
1970-04-01 00:00:00
|
||||
1970-05-01 00:00:00
|
||||
1970-06-01 00:00:00
|
||||
1970-07-01 00:00:00
|
||||
1970-08-01 00:00:00
|
||||
1970-09-01 00:00:00
|
||||
1970-10-01 00:00:00
|
||||
1970-11-01 00:00:00
|
||||
1970-12-01 00:00:00
|
||||
drop table t3;
|
||||
create table t4 (a timestamp not null, primary key(a)) engine='MyISAM'
|
||||
partition by list (month(a)) subpartition by key (a)
|
||||
subpartitions 3 (
|
||||
partition quarter1 values in (0,1,2,3),
|
||||
partition quarter2 values in (4,5,6),
|
||||
partition quarter3 values in (7,8,9),
|
||||
partition quarter4 values in (10,11,12)
|
||||
);
|
||||
show create table t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
`a` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST (month(a))
|
||||
SUBPARTITION BY KEY (a)
|
||||
SUBPARTITIONS 3
|
||||
(PARTITION quarter1 VALUES IN (0,1,2,3) ENGINE = MyISAM,
|
||||
PARTITION quarter2 VALUES IN (4,5,6) ENGINE = MyISAM,
|
||||
PARTITION quarter3 VALUES IN (7,8,9) ENGINE = MyISAM,
|
||||
PARTITION quarter4 VALUES IN (10,11,12) ENGINE = MyISAM) */
|
||||
12 inserts;
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 12-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 11-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 10-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 9-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 8-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 7-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 6-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 5-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 4-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 3-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 2-1 month));
|
||||
insert into t4 values (date_add('1970-01-01 00:00:00',interval 1-1 month));
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'a' at row 1
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
12
|
||||
select * from t4;
|
||||
a
|
||||
0000-00-00 00:00:00
|
||||
1970-02-01 00:00:00
|
||||
1970-03-01 00:00:00
|
||||
1970-04-01 00:00:00
|
||||
1970-05-01 00:00:00
|
||||
1970-06-01 00:00:00
|
||||
1970-07-01 00:00:00
|
||||
1970-08-01 00:00:00
|
||||
1970-09-01 00:00:00
|
||||
1970-10-01 00:00:00
|
||||
1970-11-01 00:00:00
|
||||
1970-12-01 00:00:00
|
||||
drop table t4;
|
||||
create table t1 (a date not null, primary key(a)) engine='MyISAM'
|
||||
partition by key (a) (
|
||||
partition pa1 max_rows=20 min_rows=2,
|
||||
|
@ -169,4 +169,77 @@ DROP USER 'create_rout_db'@'localhost';
|
||||
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
|
||||
USE mtr;
|
||||
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
|
||||
######## BUG#49119 #######
|
||||
### i) test case from the 'how to repeat section'
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1(c1 INT);
|
||||
CREATE PROCEDURE p1() SELECT * FROM t1 |
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
|
||||
ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1'
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
### ii) Test case in which REVOKE partially succeeds
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1(c1 INT);
|
||||
CREATE PROCEDURE p1() SELECT * FROM t1 |
|
||||
CREATE USER 'user49119'@'localhost';
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost';
|
||||
##############################################################
|
||||
### Showing grants for both users: root and user49119 (master)
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
Grants for user49119@localhost
|
||||
GRANT USAGE ON *.* TO 'user49119'@'localhost'
|
||||
GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
##############################################################
|
||||
##############################################################
|
||||
### Showing grants for both users: root and user49119 (master)
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
Grants for user49119@localhost
|
||||
GRANT USAGE ON *.* TO 'user49119'@'localhost'
|
||||
GRANT EXECUTE ON PROCEDURE `test`.`p1` TO 'user49119'@'localhost'
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
##############################################################
|
||||
## This statement will make the revoke fail because root has no
|
||||
## execute grant. However, it will still revoke the grant for
|
||||
## user49119.
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 'user49119'@'localhost', 'root'@'localhost';
|
||||
ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1'
|
||||
##############################################################
|
||||
### Showing grants for both users: root and user49119 (master)
|
||||
### after revoke statement failure
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
Grants for user49119@localhost
|
||||
GRANT USAGE ON *.* TO 'user49119'@'localhost'
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
##############################################################
|
||||
#############################################################
|
||||
### Showing grants for both users: root and user49119 (slave)
|
||||
### after revoke statement failure (should match
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
Grants for user49119@localhost
|
||||
GRANT USAGE ON *.* TO 'user49119'@'localhost'
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
Grants for root@localhost
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
|
||||
##############################################################
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP USER 'user49119'@'localhost';
|
||||
"End of test"
|
||||
|
@ -63,7 +63,7 @@ source include/diff_master_slave.inc;
|
||||
DROP DATABASE d1;
|
||||
source include/kill_query.inc;
|
||||
source include/diff_master_slave.inc;
|
||||
DROP DATABASE d2;
|
||||
DROP DATABASE IF EXISTS d2;
|
||||
source include/kill_query.inc;
|
||||
source include/diff_master_slave.inc;
|
||||
CREATE EVENT e2
|
||||
@ -115,6 +115,7 @@ source include/diff_master_slave.inc;
|
||||
DROP INDEX i1 on t1;
|
||||
source include/kill_query.inc;
|
||||
source include/diff_master_slave.inc;
|
||||
CREATE TABLE IF NOT EXISTS t4 (a int);
|
||||
CREATE TRIGGER tr2 BEFORE INSERT ON t4
|
||||
FOR EACH ROW BEGIN
|
||||
DELETE FROM t1 WHERE a=NEW.a;
|
||||
|
@ -34,47 +34,9 @@ insert into t1 values(1,10);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
show slave status;;
|
||||
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 2010
|
||||
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 2010
|
||||
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 #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Replicate_Ignore_Server_Ids
|
||||
Master_Server_Id 1
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
@ -82,47 +44,9 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
show slave status;;
|
||||
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 2045
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File master-bin.000001
|
||||
Slave_IO_Running No
|
||||
Slave_SQL_Running No
|
||||
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 2045
|
||||
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 #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Replicate_Ignore_Server_Ids
|
||||
Master_Server_Id 1
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
@ -131,47 +55,9 @@ set sql_log_bin=1;
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
reset slave;
|
||||
show slave status;;
|
||||
Slave_IO_State #
|
||||
Master_Host 127.0.0.1
|
||||
Master_User root
|
||||
Master_Port MASTER_PORT
|
||||
Connect_Retry 1
|
||||
Master_Log_File
|
||||
Read_Master_Log_Pos 4
|
||||
Relay_Log_File #
|
||||
Relay_Log_Pos #
|
||||
Relay_Master_Log_File
|
||||
Slave_IO_Running No
|
||||
Slave_SQL_Running No
|
||||
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 0
|
||||
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 #
|
||||
Master_SSL_Verify_Server_Cert No
|
||||
Last_IO_Errno 0
|
||||
Last_IO_Error
|
||||
Last_SQL_Errno 0
|
||||
Last_SQL_Error
|
||||
Replicate_Ignore_Server_Ids
|
||||
Master_Server_Id 1
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
reset master;
|
||||
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
|
||||
unique(day)) engine=MyISAM;
|
||||
|
128
mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result
Normal file
128
mysql-test/suite/rpl/r/rpl_loaddata_concurrent.result
Normal file
@ -0,0 +1,128 @@
|
||||
CREATE TABLE t1 (c1 char(50));
|
||||
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
|
||||
LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE t1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (c1 char(50))
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (c1) ;file_id=#
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
|
||||
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (c1) ;file_id=#
|
||||
DROP TABLE t1;
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
reset master;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
0
|
||||
create table t1(a int not null auto_increment, b int, primary key(a) );
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
1
|
||||
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
||||
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
||||
insert into t3 select * from t2;
|
||||
select * from t1;
|
||||
a b
|
||||
1 10
|
||||
2 15
|
||||
select * from t3;
|
||||
day id category name
|
||||
2003-02-22 2461 b a a a @ % ' " a
|
||||
2003-03-22 2161 c asdf
|
||||
2003-03-22 2416 a bbbbb
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
create table t1(a int, b int, unique(b));
|
||||
insert into t1 values(1,10);
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
change master to master_user='test';
|
||||
change master to master_user='root';
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
set global sql_slave_skip_counter=1;
|
||||
start slave;
|
||||
set sql_log_bin=0;
|
||||
delete from t1;
|
||||
set sql_log_bin=1;
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
stop slave;
|
||||
reset slave;
|
||||
Last_SQL_Errno=0
|
||||
Last_SQL_Error
|
||||
|
||||
reset master;
|
||||
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
|
||||
unique(day)) engine=MyISAM;
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
|
||||
select * from t2;
|
||||
day id category name
|
||||
2003-02-22 2461 b a a a @ % ' " a
|
||||
2003-03-22 2161 c asdf
|
||||
start slave;
|
||||
select * from t2;
|
||||
day id category name
|
||||
2003-02-22 2461 b a a a @ % ' " a
|
||||
2003-03-22 2161 c asdf
|
||||
alter table t2 drop key day;
|
||||
delete from t2;
|
||||
load data CONCURRENT infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
|
||||
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
|
||||
'\n##\n' starting by '>' ignore 1 lines;
|
||||
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
|
||||
drop table t1, t2;
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
|
||||
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
|
||||
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
drop database if exists b48297_db1;
|
||||
drop database if exists b42897_db2;
|
||||
create database b48297_db1;
|
||||
create database b42897_db2;
|
||||
use b48297_db1;
|
||||
CREATE TABLE t1 (c1 VARCHAR(256)) engine=MyISAM;;
|
||||
use b42897_db2;
|
||||
### assertion: works with cross-referenced database
|
||||
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
|
||||
use b48297_db1;
|
||||
### assertion: works with fully qualified name on current database
|
||||
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
|
||||
### assertion: works without fully qualified name on current database
|
||||
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
|
||||
### create connection without default database
|
||||
### connect (conn2,localhost,root,,*NO-ONE*);
|
||||
### assertion: works without stating the default database
|
||||
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
|
||||
### disconnect and switch back to master connection
|
||||
use b48297_db1;
|
||||
Comparing tables master:b48297_db1.t1 and slave:b48297_db1.t1
|
||||
DROP DATABASE b48297_db1;
|
||||
DROP DATABASE b42897_db2;
|
@ -220,3 +220,31 @@ start slave sql_thread;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=776;
|
||||
Warnings:
|
||||
Note 1254 Slave is already running
|
||||
include/stop_slave.inc
|
||||
drop table if exists t1;
|
||||
reset slave;
|
||||
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
|
||||
drop table if exists t1;
|
||||
reset master;
|
||||
create table t1 (a int primary key auto_increment);
|
||||
start slave;
|
||||
include/stop_slave.inc
|
||||
master and slave are in sync now
|
||||
select 0 as zero;
|
||||
zero
|
||||
0
|
||||
insert into t1 set a=null;
|
||||
insert into t1 set a=null;
|
||||
select count(*) as two from t1;
|
||||
two
|
||||
2
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos= UNTIL_POS;;
|
||||
slave stopped at the prescribed position
|
||||
select 0 as zero;
|
||||
zero
|
||||
0
|
||||
select count(*) as one from t1;
|
||||
one
|
||||
1
|
||||
drop table t1;
|
||||
start slave;
|
||||
|
@ -36,8 +36,10 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
|
||||
SELECT @@session.sql_select_limit = @save_select_limit;
|
||||
@@session.sql_select_limit = @save_select_limit
|
||||
1
|
||||
SET @save_conn_id= connection_id();
|
||||
SET @@session.pseudo_thread_id=100;
|
||||
SET @@session.pseudo_thread_id=connection_id();
|
||||
SET @@session.pseudo_thread_id=@save_conn_id;
|
||||
SET @@session.sql_log_bin=0;
|
||||
SET @@session.sql_log_bin=1;
|
||||
drop table if exists t1,t2;
|
||||
|
@ -52,10 +52,10 @@ purge binary logs to 'master-bin.000001';
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("Failed to locate old binlog or relay log files");
|
||||
call mtr.add_suppression("MYSQL_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
|
||||
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
|
||||
connection slave;
|
||||
call mtr.add_suppression("Failed to locate old binlog or relay log files");
|
||||
call mtr.add_suppression("MYSQL_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
|
||||
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ./master-bin.000001 not listed in the index");
|
||||
--enable_query_log
|
||||
|
||||
--echo End of the tests
|
||||
|
@ -236,16 +236,7 @@ COMMIT;
|
||||
--connection master_a
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--let $wait_condition= SELECT COUNT(*)=400 FROM t2 WHERE c = 1
|
||||
--connection master_a
|
||||
--source include/wait_condition.inc
|
||||
--connection master_b
|
||||
--source include/wait_condition.inc
|
||||
--connection master_c
|
||||
--source include/wait_condition.inc
|
||||
--connection master_d
|
||||
--source include/wait_condition.inc
|
||||
--source include/circular_rpl_for_4_hosts_sync.inc
|
||||
|
||||
--connection master_a
|
||||
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
|
||||
@ -285,15 +276,7 @@ ROLLBACK;
|
||||
--connection master_a
|
||||
--enable_query_log
|
||||
|
||||
--let $wait_condition= SELECT COUNT(*)=200 FROM t2 WHERE c = 2
|
||||
--connection master_a
|
||||
--source include/wait_condition.inc
|
||||
--connection master_b
|
||||
--source include/wait_condition.inc
|
||||
--connection master_c
|
||||
--source include/wait_condition.inc
|
||||
--connection master_d
|
||||
--source include/wait_condition.inc
|
||||
--source include/circular_rpl_for_4_hosts_sync.inc
|
||||
|
||||
--connection master_a
|
||||
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
|
||||
|
@ -208,4 +208,104 @@ connection slave;
|
||||
USE mtr;
|
||||
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' Error_code: 1396");
|
||||
|
||||
# BUG#49119: Master crashes when executing 'REVOKE ... ON
|
||||
# {PROCEDURE|FUNCTION} FROM ...'
|
||||
#
|
||||
# The tests are divided into two test cases:
|
||||
#
|
||||
# i) a test case that mimics the one in the bug report.
|
||||
#
|
||||
# - We show that, despite the fact, that a revoke command fails
|
||||
# when binlogging is active, the master will not hit an
|
||||
# assertion.
|
||||
#
|
||||
# ii) a test case that partially succeeds on the master will also
|
||||
# partially succeed on the slave.
|
||||
#
|
||||
# - The revoke statement that partially succeeds tries to revoke
|
||||
# an EXECUTE grant for two users, and only one of the user has
|
||||
# the specific grant. This will cause mysql to drop one of the
|
||||
# grants and report error for the statement. The slave should
|
||||
# also drop the grants that the master succeed and the SQL
|
||||
# thread should not stop on statement failure.
|
||||
|
||||
-- echo ######## BUG#49119 #######
|
||||
-- echo ### i) test case from the 'how to repeat section'
|
||||
-- source include/master-slave-reset.inc
|
||||
-- connection master
|
||||
|
||||
CREATE TABLE t1(c1 INT);
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1() SELECT * FROM t1 |
|
||||
DELIMITER ;|
|
||||
-- error ER_NONEXISTING_PROC_GRANT
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- connection master
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- echo ### ii) Test case in which REVOKE partially succeeds
|
||||
|
||||
-- connection master
|
||||
-- source include/master-slave-reset.inc
|
||||
-- connection master
|
||||
|
||||
CREATE TABLE t1(c1 INT);
|
||||
DELIMITER |;
|
||||
CREATE PROCEDURE p1() SELECT * FROM t1 |
|
||||
DELIMITER ;|
|
||||
|
||||
CREATE USER 'user49119'@'localhost';
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO 'user49119'@'localhost';
|
||||
|
||||
-- echo ##############################################################
|
||||
-- echo ### Showing grants for both users: root and user49119 (master)
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
-- echo ##############################################################
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- echo ##############################################################
|
||||
-- echo ### Showing grants for both users: root and user49119 (master)
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
-- echo ##############################################################
|
||||
|
||||
-- connection master
|
||||
|
||||
-- echo ## This statement will make the revoke fail because root has no
|
||||
-- echo ## execute grant. However, it will still revoke the grant for
|
||||
-- echo ## user49119.
|
||||
-- error ER_NONEXISTING_PROC_GRANT
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 'user49119'@'localhost', 'root'@'localhost';
|
||||
|
||||
-- echo ##############################################################
|
||||
-- echo ### Showing grants for both users: root and user49119 (master)
|
||||
-- echo ### after revoke statement failure
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
-- echo ##############################################################
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
-- echo #############################################################
|
||||
-- echo ### Showing grants for both users: root and user49119 (slave)
|
||||
-- echo ### after revoke statement failure (should match
|
||||
SHOW GRANTS FOR 'user49119'@'localhost';
|
||||
SHOW GRANTS FOR CURRENT_USER;
|
||||
-- echo ##############################################################
|
||||
|
||||
-- connection master
|
||||
DROP TABLE t1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP USER 'user49119'@'localhost';
|
||||
|
||||
-- sync_slave_with_master
|
||||
|
||||
--echo "End of test"
|
||||
|
@ -153,7 +153,7 @@ source include/kill_query_and_diff_master_slave.inc;
|
||||
send DROP DATABASE d1;
|
||||
source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
send DROP DATABASE d2;
|
||||
send DROP DATABASE IF EXISTS d2;
|
||||
source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
######## EVENT ########
|
||||
@ -226,7 +226,7 @@ source include/kill_query_and_diff_master_slave.inc;
|
||||
send DROP PROCEDURE p1;
|
||||
source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
# Temporarily disabled, see comment above for DROP FUNCTION IF EXISTS
|
||||
# Temporarily disabled because of bug#43353, see comment above for DROP FUNCTION IF EXISTS
|
||||
#send DROP PROCEDURE IF EXISTS p2;
|
||||
#source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
@ -277,6 +277,11 @@ source include/kill_query_and_diff_master_slave.inc;
|
||||
|
||||
######## TRIGGER ########
|
||||
|
||||
# Make sure table t4 exists
|
||||
connection master;
|
||||
CREATE TABLE IF NOT EXISTS t4 (a int);
|
||||
connection master1;
|
||||
|
||||
let $diff_statement= SHOW TRIGGERS LIKE 'v%';
|
||||
|
||||
DELIMITER //;
|
||||
|
13
mysql-test/suite/rpl/t/rpl_loaddata_concurrent.test
Normal file
13
mysql-test/suite/rpl/t/rpl_loaddata_concurrent.test
Normal file
@ -0,0 +1,13 @@
|
||||
-- source include/not_ndb_default.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
CREATE TABLE t1 (c1 char(50));
|
||||
LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1;
|
||||
LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE t1;
|
||||
-- source include/show_binlog_events.inc
|
||||
DROP TABLE t1;
|
||||
|
||||
let $lock_option= CONCURRENT;
|
||||
let $engine_type=MyISAM;
|
||||
-- source extra/rpl_tests/rpl_loaddata.test
|
@ -101,3 +101,67 @@ start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
|
||||
start slave sql_thread;
|
||||
start slave until master_log_file='master-bin.000001', master_log_pos=776;
|
||||
|
||||
#
|
||||
# bug#47210 first execution of "start slave until" stops too early
|
||||
#
|
||||
# testing that a slave rotate event that is caused by stopping the slave
|
||||
# does not intervene anymore in UNTIL condition.
|
||||
#
|
||||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
reset slave;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
create table t1 (a int primary key auto_increment);
|
||||
save_master_pos;
|
||||
let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
|
||||
connection slave;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
|
||||
# at this point slave will close the relay log stamping it with its own
|
||||
# Rotate log event. This event won't be examined on matter of the master
|
||||
# UNTIL pos anymore.
|
||||
source include/stop_slave.inc;
|
||||
let $slave_exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
|
||||
|
||||
--echo master and slave are in sync now
|
||||
let $diff_pos= `select $master_pos - $slave_exec_pos`;
|
||||
eval select $diff_pos as zero;
|
||||
|
||||
connection master;
|
||||
insert into t1 set a=null;
|
||||
let $until_pos= query_get_value(SHOW MASTER STATUS, Position, 1);
|
||||
insert into t1 set a=null;
|
||||
select count(*) as two from t1;
|
||||
|
||||
connection slave;
|
||||
--replace_result $until_pos UNTIL_POS;
|
||||
eval start slave until master_log_file='master-bin.000001', master_log_pos= $until_pos;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
let $slave_exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1);
|
||||
--echo slave stopped at the prescribed position
|
||||
let $diff_pos= `select $until_pos - $slave_exec_pos`;
|
||||
eval select $diff_pos as zero;
|
||||
select count(*) as one from t1;
|
||||
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
|
||||
connection slave;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
|
||||
# End of tests
|
||||
|
@ -115,8 +115,10 @@ SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
|
||||
SELECT @@session.sql_select_limit = @save_select_limit; #shouldn't have changed
|
||||
# Now as root, to be sure it works
|
||||
connection con2;
|
||||
SET @save_conn_id= connection_id();
|
||||
SET @@session.pseudo_thread_id=100;
|
||||
SET @@session.pseudo_thread_id=connection_id();
|
||||
SET @@session.pseudo_thread_id=@save_conn_id;
|
||||
SET @@session.sql_log_bin=0;
|
||||
SET @@session.sql_log_bin=1;
|
||||
|
||||
|
@ -179,8 +179,11 @@ insert into t1 values('2008-12-23 19:39:39',1);
|
||||
--connection master1
|
||||
SET @@session.time_zone='+02:00';
|
||||
insert delayed into t1 values ('2008-12-23 19:39:39',2);
|
||||
# Forces table t1 to be closed and flushes the query cache.
|
||||
# This makes sure that 'delayed insert' is executed before next statement.
|
||||
|
||||
# wait for the delayed insert to be executed
|
||||
let $wait_condition= SELECT date FROM t1 WHERE a=2;
|
||||
--source include/wait_condition.inc
|
||||
|
||||
flush table t1;
|
||||
flush logs;
|
||||
select * from t1;
|
||||
|
@ -14,6 +14,16 @@ SET character_set_connection=ucs2;
|
||||
|
||||
SET CHARACTER SET koi8r;
|
||||
|
||||
#
|
||||
# BUG#49028, error in LIKE with ucs2
|
||||
#
|
||||
create table t1 (a varchar(2) character set ucs2 collate ucs2_bin, key(a));
|
||||
insert into t1 values ('A'),('A'),('B'),('C'),('D'),('A\t');
|
||||
insert into t1 values ('A\0'),('A\0'),('A\0'),('A\0'),('AZ');
|
||||
select hex(a) from t1 where a like 'A_' order by a;
|
||||
select hex(a) from t1 ignore key(a) where a like 'A_' order by a;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Check that 0x20 is only trimmed when it is
|
||||
# a part of real SPACE character, not just a part
|
||||
|
@ -1411,6 +1411,16 @@ select hex(_utf8 B'001111111111');
|
||||
--error ER_INVALID_CHARACTER_STRING
|
||||
select (_utf8 X'616263FF');
|
||||
|
||||
--echo #
|
||||
--echo # Bug#44131 Binary-mode "order by" returns records in incorrect order for UTF-8 strings
|
||||
--echo #
|
||||
CREATE TABLE t1 (id int not null primary key, name varchar(10)) character set utf8;
|
||||
INSERT INTO t1 VALUES
|
||||
(2,'一二三01'),(3,'一二三09'),(4,'一二三02'),(5,'一二三08'),
|
||||
(6,'一二三11'),(7,'一二三91'),(8,'一二三21'),(9,'一二三81');
|
||||
SELECT * FROM t1 ORDER BY BINARY(name);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #36772: When using UTF8, CONVERT with GROUP BY returns truncated results
|
||||
#
|
||||
|
@ -10,7 +10,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
|
||||
rpl_killed_ddl : Bug#45520: rpl_killed_ddl fails sporadically in pb2
|
||||
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadicallyr
|
||||
innodb-autoinc : Bug#49267 2009-12-02 test fails on windows because of different case mode
|
||||
innodb : Bug#49396 2009-12-03 test fails in embedded mode
|
||||
|
@ -494,6 +494,27 @@ EXECUTE s;
|
||||
DEALLOCATE PREPARE s;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49250 : spatial btree index corruption and crash
|
||||
--echo # Part two : fulltext syntax check
|
||||
--echo #
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t1(col1 TEXT,
|
||||
FULLTEXT INDEX USING BTREE (col1));
|
||||
CREATE TABLE t2(col1 TEXT);
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE FULLTEXT INDEX USING BTREE ON t2(col);
|
||||
--error ER_PARSE_ERROR
|
||||
ALTER TABLE t2 ADD FULLTEXT INDEX USING BTREE (col1);
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #47930: MATCH IN BOOLEAN MODE returns too many results
|
||||
--echo # inside subquery
|
||||
|
@ -1320,6 +1320,39 @@ explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a;
|
||||
drop table t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (a VARCHAR(20), b INT);
|
||||
CREATE TABLE t2 (a VARCHAR(20), b INT);
|
||||
|
||||
INSERT INTO t1 VALUES ('ABC', 1);
|
||||
INSERT INTO t2 VALUES ('ABC', 1);
|
||||
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
|
||||
SELECT DECODE((SELECT ENCODE('secret', 'ABC') FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), t2.a)
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b), 'ABC')
|
||||
FROM t1,t2 WHERE t1.b = t1.b > 0 GROUP BY t2.b;
|
||||
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
|
||||
INSERT INTO t1 VALUES ('EDF', 3), ('BCD', 2), ('ABC', 1);
|
||||
INSERT INTO t2 VALUES ('EDF', 3), ('BCD', 2), ('ABC', 1);
|
||||
|
||||
SELECT DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a)
|
||||
FROM t2 WHERE t2.b = 1 GROUP BY t2.b;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo Start of 5.4 tests
|
||||
#
|
||||
|
@ -670,6 +670,21 @@ SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49250 : spatial btree index corruption and crash
|
||||
--echo # Part one : spatial syntax check
|
||||
--echo #
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t1(col1 MULTIPOLYGON NOT NULL,
|
||||
SPATIAL INDEX USING BTREE (col1));
|
||||
CREATE TABLE t2(col1 MULTIPOLYGON NOT NULL);
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE SPATIAL INDEX USING BTREE ON t2(col);
|
||||
--error ER_PARSE_ERROR
|
||||
ALTER TABLE t2 ADD SPATIAL INDEX USING BTREE (col1);
|
||||
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
@ -867,3 +867,32 @@ SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#47650: using group by with rollup without indexes returns incorrect
|
||||
--echo # results with where
|
||||
--echo #
|
||||
CREATE TABLE t1 ( a INT );
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
CREATE TABLE t2 ( a INT, b INT );
|
||||
INSERT INTO t2 VALUES (1, 1),(1, 2),(1, 3),(2, 4),(2, 5);
|
||||
|
||||
EXPLAIN
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 LEFT JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 LEFT JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
|
||||
EXPLAIN
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
|
||||
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
|
||||
FROM t1 JOIN t2 USING( a )
|
||||
GROUP BY t1.a WITH ROLLUP;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
@ -625,9 +625,11 @@ let $wait_condition=
|
||||
--source include/wait_condition.inc
|
||||
let $tlwb= `show status like 'Table_locks_waited'`;
|
||||
unlock tables;
|
||||
connection waiter;
|
||||
--reap
|
||||
connection default;
|
||||
drop table t1;
|
||||
disconnect waiter;
|
||||
connection default;
|
||||
--disable_query_log
|
||||
eval SET @tlwa= SUBSTRING_INDEX('$tlwa', ' ', -1);
|
||||
eval SET @tlwb= SUBSTRING_INDEX('$tlwb', ' ', -1);
|
||||
|
@ -1186,6 +1186,20 @@ SELECT a FROM t1;
|
||||
CHECK TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49465: valgrind warnings and incorrect live checksum...
|
||||
--echo #
|
||||
CREATE TABLE t1(
|
||||
a VARCHAR(1), b VARCHAR(1), c VARCHAR(1),
|
||||
f VARCHAR(1), g VARCHAR(1), h VARCHAR(1),
|
||||
i VARCHAR(1), j VARCHAR(1), k VARCHAR(1)) CHECKSUM=1;
|
||||
INSERT INTO t1 VALUES('', '', '', '', '', '', '', '', '');
|
||||
CHECKSUM TABLE t1 QUICK;
|
||||
CHECKSUM TABLE t1 EXTENDED;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
||||
|
@ -90,6 +90,24 @@ set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
|
||||
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
|
||||
eval set GLOBAL sql_mode=default;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #41569 mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table
|
||||
--echo # but does not set values.
|
||||
--echo #
|
||||
|
||||
# Create a stored procedure and set the fields in question to null.
|
||||
# When running mysql_upgrade, a warning should be written.
|
||||
|
||||
CREATE PROCEDURE testproc() BEGIN END;
|
||||
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
|
||||
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
|
||||
--exec $MYSQL_UPGRADE --skip-verbose --force 2> $MYSQLTEST_VARDIR/tmp/41569.txt
|
||||
CALL testproc();
|
||||
DROP PROCEDURE testproc;
|
||||
--cat_file $MYSQLTEST_VARDIR/tmp/41569.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/41569.txt
|
||||
|
||||
#
|
||||
# Test the --upgrade-system-tables option
|
||||
#
|
||||
|
@ -886,6 +886,15 @@ SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
|
||||
--echo # Must return 1 row
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
|
||||
|
||||
# part 2 of the problem : DESC test cases
|
||||
--echo # Must use ref-or-null on the a_c index
|
||||
--replace_column 1 x 2 x 3 x 6 x 7 x 8 x 9 x 10 x
|
||||
EXPLAIN
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
--echo # Must return 1 row
|
||||
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC;
|
||||
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
|
@ -53,8 +53,8 @@ CREATE TABLE t1 (
|
||||
b varchar(10),
|
||||
PRIMARY KEY (a)
|
||||
)
|
||||
PARTITION BY RANGE (to_days(a)) (
|
||||
PARTITION p1 VALUES LESS THAN (733407),
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
|
||||
PARTITION p1 VALUES LESS THAN (1199134800),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE
|
||||
);
|
||||
|
||||
@ -64,7 +64,7 @@ INSERT INTO t1 VALUES ('2009-09-21 17:31:42', 'pmax');
|
||||
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 REORGANIZE PARTITION pmax INTO (
|
||||
PARTITION p3 VALUES LESS THAN (733969),
|
||||
PARTITION p3 VALUES LESS THAN (1247688000),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
@ -158,7 +158,7 @@ create table t1 (col1 datetime)
|
||||
partition by range(timestampdiff(day,5,col1))
|
||||
(partition p0 values less than (10), partition p1 values less than (30));
|
||||
|
||||
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
||||
-- error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
create table t1 (col1 date)
|
||||
partition by range(unix_timestamp(col1))
|
||||
(partition p0 values less than (10), partition p1 values less than (30));
|
||||
|
@ -466,7 +466,7 @@ partitions 2
|
||||
#
|
||||
# Partition by range, constant partition function not allowed
|
||||
#
|
||||
--error ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@ -681,7 +681,7 @@ partition by list (a);
|
||||
#
|
||||
# Partition by list, constant partition function not allowed
|
||||
#
|
||||
--error ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
@ -840,4 +840,364 @@ partition by range (a + (select count(*) from t1))
|
||||
create table t1 (a char(10))
|
||||
partition by hash (extractvalue(a,'a'));
|
||||
|
||||
--echo #
|
||||
--echo # Bug #42849: innodb crash with varying time_zone on partitioned
|
||||
--echo # timestamp primary key
|
||||
--echo #
|
||||
|
||||
# A correctly partitioned table to test that trying to repartition it using
|
||||
# timezone-dependent expression will throw an error.
|
||||
CREATE TABLE old (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
# Check that allowed arithmetic/math functions involving TIMESTAMP values result
|
||||
# in ER_PARTITION_FUNC_NOT_ALLOWED_ERROR when used as a partitioning function
|
||||
|
||||
--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a+0) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a+0) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (a % 2) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (a % 2) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (ABS(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (ABS(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (CEILING(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (CEILING(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (FLOOR(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (FLOOR(a)) (
|
||||
PARTITION p VALUES LESS THAN (20080819),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
# Check that allowed date/time functions involving TIMESTAMP values result
|
||||
# in ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR when used as a partitioning function
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TO_DAYS(a)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (231),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFYEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (231),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (19),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFMONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (19),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DAYOFWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (MONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (8),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (MONTH(a)) (
|
||||
PARTITION p VALUES LESS THAN (8),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (HOUR(a)) (
|
||||
PARTITION p VALUES LESS THAN (17),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (HOUR(a)) (
|
||||
PARTITION p VALUES LESS THAN (17),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (MINUTE(a)) (
|
||||
PARTITION p VALUES LESS THAN (55),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (MINUTE(a)) (
|
||||
PARTITION p VALUES LESS THAN (55),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (QUARTER(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (QUARTER(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (SECOND(a)) (
|
||||
PARTITION p VALUES LESS THAN (7),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (SECOND(a)) (
|
||||
PARTITION p VALUES LESS THAN (7),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEARWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (200833),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEARWEEK(a)) (
|
||||
PARTITION p VALUES LESS THAN (200833),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (WEEKDAY(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (WEEKDAY(a)) (
|
||||
PARTITION p VALUES LESS THAN (3),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
||||
PARTITION p VALUES LESS THAN (64507),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TIME_TO_SEC(a)) (
|
||||
PARTITION p VALUES LESS THAN (64507),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL, b TIMESTAMP NOT NULL, PRIMARY KEY(a,b))
|
||||
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (DATEDIFF(a, a)) (
|
||||
PARTITION p VALUES LESS THAN (18),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a + 0)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + 0)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
|
||||
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
ALTER TABLE old ADD COLUMN b DATE;
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP, b DATE)
|
||||
PARTITION BY RANGE (YEAR(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (YEAR(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (2008),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP, b DATE)
|
||||
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (TO_DAYS(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (733638),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP, b date)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
CREATE TABLE new (a TIMESTAMP, b TIMESTAMP)
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
ALTER TABLE old MODIFY b TIMESTAMP;
|
||||
|
||||
--error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
|
||||
ALTER TABLE old
|
||||
PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
|
||||
PARTITION p VALUES LESS THAN (1219089600),
|
||||
PARTITION pmax VALUES LESS THAN MAXVALUE);
|
||||
|
||||
DROP TABLE old;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -1991,6 +1991,29 @@ select @arg;
|
||||
execute stmt using @arg;
|
||||
deallocate prepare stmt;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#48508: Crash on prepared statement re-execution.
|
||||
--echo #
|
||||
create table t1(b int);
|
||||
insert into t1 values (0);
|
||||
create view v1 AS select 1 as a from t1 where b;
|
||||
prepare stmt from "select * from v1 where a";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
drop view v1;
|
||||
|
||||
create table t1(a bigint);
|
||||
create table t2(b tinyint);
|
||||
insert into t2 values (null);
|
||||
prepare stmt from "select 1 from t1 join t2 on a xor b where b > 1 and a =1";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
drop table t1,t2;
|
||||
--echo #
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
@ -3009,6 +3032,23 @@ execute stmt;
|
||||
drop table t1;
|
||||
deallocate prepare stmt;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0
|
||||
--echo #
|
||||
|
||||
prepare encode from "select encode(?, ?) into @ciphertext";
|
||||
prepare decode from "select decode(?, ?) into @plaintext";
|
||||
set @str="abc", @key="cba";
|
||||
execute encode using @str, @key;
|
||||
execute decode using @ciphertext, @key;
|
||||
select @plaintext;
|
||||
set @str="bcd", @key="dcb";
|
||||
execute encode using @str, @key;
|
||||
execute decode using @ciphertext, @key;
|
||||
select @plaintext;
|
||||
deallocate prepare encode;
|
||||
deallocate prepare decode;
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo
|
||||
|
@ -3791,6 +3791,56 @@ SELECT 1 FROM t2 JOIN t1 ON 1=1
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49199: Optimizer handles incorrectly:
|
||||
--echo # field='const1' AND field='const2' in some cases
|
||||
--echo
|
||||
CREATE TABLE t1(a DATETIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a TIMESTAMP NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:00';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01 00:00:00';
|
||||
|
||||
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
|
||||
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
|
||||
SELECT x.a, y.a, z.a FROM t1 x
|
||||
JOIN t1 y ON x.a=y.a
|
||||
JOIN t1 z ON y.a=z.a
|
||||
WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00';
|
||||
EXPLAIN EXTENDED SELECT x.a, y.a, z.a FROM t1 x
|
||||
JOIN t1 y ON x.a=y.a
|
||||
JOIN t1 z ON y.a=z.a
|
||||
WHERE x.a='2001-01-01' AND z.a='2001-01-01 00:00:00';
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
@ -4002,4 +4052,27 @@ ORDER BY pk;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#49489 Uninitialized cache led to a wrong result.
|
||||
--echo #
|
||||
CREATE TABLE t1(c1 DOUBLE(5,4));
|
||||
INSERT INTO t1 VALUES (9.1234);
|
||||
SELECT * FROM t1 WHERE c1 < 9.12345;
|
||||
DROP TABLE t1;
|
||||
--echo # End of test for bug#49489.
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49517: Inconsistent behavior while using
|
||||
--echo # NULLable BIGINT and INT columns in comparison
|
||||
--echo #
|
||||
CREATE TABLE t1(a BIGINT UNSIGNED NOT NULL, b BIGINT NULL, c INT NULL);
|
||||
INSERT INTO t1 VALUES(105, NULL, NULL);
|
||||
SELECT * FROM t1 WHERE b < 102;
|
||||
SELECT * FROM t1 WHERE c < 102;
|
||||
SELECT * FROM t1 WHERE 102 < b;
|
||||
SELECT * FROM t1 WHERE 102 < c;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -1188,6 +1188,28 @@ connection default;
|
||||
DROP USER test_u@localhost;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #48985: show create table crashes if previous access to the table
|
||||
--echo # was killed
|
||||
--echo #
|
||||
|
||||
connect(con1,localhost,root,,);
|
||||
CONNECTION con1;
|
||||
LET $ID= `SELECT connection_id()`;
|
||||
|
||||
CONNECTION default;
|
||||
--disable_query_log
|
||||
eval KILL QUERY $ID;
|
||||
--enable_query_log
|
||||
|
||||
CONNECTION con1;
|
||||
--error ER_QUERY_INTERRUPTED
|
||||
SHOW CREATE TABLE non_existent;
|
||||
|
||||
CONNECTION default;
|
||||
DISCONNECT con1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
# Wait till all disconnects are completed
|
||||
|
@ -146,3 +146,32 @@ END|
|
||||
|
||||
|
||||
delimiter ;|
|
||||
|
||||
#
|
||||
# Bug#48766 SHOW CREATE FUNCTION returns extra data in return clause
|
||||
#
|
||||
SET NAMES utf8;
|
||||
--disable_warnings
|
||||
DROP FUNCTION IF EXISTS bug48766;
|
||||
--enable_warnings
|
||||
#
|
||||
# Test that Latin letters are not prepended with extra '\0'.
|
||||
#
|
||||
CREATE FUNCTION bug48766 ()
|
||||
RETURNS ENUM( 'w' ) CHARACTER SET ucs2
|
||||
RETURN 0;
|
||||
SHOW CREATE FUNCTION bug48766;
|
||||
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_NAME='bug48766';
|
||||
DROP FUNCTION bug48766;
|
||||
#
|
||||
# Test non-Latin characters
|
||||
#
|
||||
CREATE FUNCTION bug48766 ()
|
||||
RETURNS ENUM('а','б','в','г') CHARACTER SET ucs2
|
||||
RETURN 0;
|
||||
SHOW CREATE FUNCTION bug48766;
|
||||
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_NAME='bug48766';
|
||||
|
||||
DROP FUNCTION bug48766;
|
||||
|
@ -3362,6 +3362,32 @@ WHERE a = 230;
|
||||
|
||||
DROP TABLE t1, st1, st2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #48709: Assertion failed in sql_select.cc:11782:
|
||||
--echo # int join_read_key(JOIN_TAB*)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, int_key int);
|
||||
INSERT INTO t1 VALUES (10,1), (14,1);
|
||||
|
||||
CREATE TABLE t2 (pk int PRIMARY KEY, int_key int);
|
||||
INSERT INTO t2 VALUES (3,3), (5,NULL), (7,3);
|
||||
|
||||
--echo # should have eq_ref for t1
|
||||
--replace_column 1 x 2 x 5 x 6 x 7 x 8 x 9 x 10 x
|
||||
EXPLAIN
|
||||
SELECT * FROM t2 outr
|
||||
WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2)
|
||||
ORDER BY outr.pk;
|
||||
|
||||
--echo # should not crash on debug binaries
|
||||
SELECT * FROM t2 outr
|
||||
WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2)
|
||||
ORDER BY outr.pk;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
||||
#
|
||||
|
@ -30,3 +30,109 @@ select * from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug #49480: WHERE using YEAR columns returns unexpected results
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t2(yy YEAR(2), c2 CHAR(4));
|
||||
CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4));
|
||||
|
||||
INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069);
|
||||
INSERT INTO t4 (c4) SELECT c2 FROM t2;
|
||||
UPDATE t2 SET yy = c2;
|
||||
UPDATE t4 SET yyyy = c4;
|
||||
|
||||
SELECT * FROM t2;
|
||||
SELECT * FROM t4;
|
||||
|
||||
--echo # Comparison of YEAR(2) with YEAR(4)
|
||||
|
||||
SELECT * FROM t2, t4 WHERE yy = yyyy;
|
||||
SELECT * FROM t2, t4 WHERE yy <=> yyyy;
|
||||
SELECT * FROM t2, t4 WHERE yy < yyyy;
|
||||
SELECT * FROM t2, t4 WHERE yy > yyyy;
|
||||
|
||||
--echo # Comparison of YEAR(2) with YEAR(2)
|
||||
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy = b.yy;
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy <=> b.yy;
|
||||
SELECT * FROM t2 a, t2 b WHERE a.yy < b.yy;
|
||||
|
||||
--echo # Comparison of YEAR(4) with YEAR(4)
|
||||
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy = b.yyyy;
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy <=> b.yyyy;
|
||||
SELECT * FROM t4 a, t4 b WHERE a.yyyy < b.yyyy;
|
||||
|
||||
--echo # Comparison with constants:
|
||||
|
||||
SELECT * FROM t2 WHERE yy = NULL;
|
||||
SELECT * FROM t4 WHERE yyyy = NULL;
|
||||
SELECT * FROM t2 WHERE yy <=> NULL;
|
||||
SELECT * FROM t4 WHERE yyyy <=> NULL;
|
||||
SELECT * FROM t2 WHERE yy < NULL;
|
||||
SELECT * FROM t2 WHERE yy > NULL;
|
||||
|
||||
SELECT * FROM t2 WHERE yy = NOW();
|
||||
SELECT * FROM t4 WHERE yyyy = NOW();
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 99;
|
||||
SELECT * FROM t2 WHERE 99 = yy;
|
||||
SELECT * FROM t4 WHERE yyyy = 99;
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 'test';
|
||||
SELECT * FROM t4 WHERE yyyy = 'test';
|
||||
|
||||
SELECT * FROM t2 WHERE yy = '1999';
|
||||
SELECT * FROM t4 WHERE yyyy = '1999';
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 1999;
|
||||
SELECT * FROM t4 WHERE yyyy = 1999;
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 1999.1;
|
||||
SELECT * FROM t4 WHERE yyyy = 1999.1;
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 1998.9;
|
||||
SELECT * FROM t4 WHERE yyyy = 1998.9;
|
||||
|
||||
--echo # Coverage tests for YEAR with zero/2000 constants:
|
||||
|
||||
SELECT * FROM t2 WHERE yy = 0;
|
||||
SELECT * FROM t2 WHERE yy = '0';
|
||||
SELECT * FROM t2 WHERE yy = '0000';
|
||||
SELECT * FROM t2 WHERE yy = '2000';
|
||||
SELECT * FROM t2 WHERE yy = 2000;
|
||||
|
||||
SELECT * FROM t4 WHERE yyyy = 0;
|
||||
SELECT * FROM t4 WHERE yyyy = '0';
|
||||
SELECT * FROM t4 WHERE yyyy = '0000';
|
||||
SELECT * FROM t4 WHERE yyyy = '2000';
|
||||
SELECT * FROM t4 WHERE yyyy = 2000;
|
||||
|
||||
--echo # Comparison with constants those are out of YEAR range
|
||||
--echo # (coverage test for backward compatibility)
|
||||
|
||||
SELECT COUNT(yy) FROM t2;
|
||||
SELECT COUNT(yyyy) FROM t4;
|
||||
|
||||
SELECT COUNT(*) FROM t2 WHERE yy = -1;
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy > -1;
|
||||
SELECT COUNT(*) FROM t2 WHERE yy > -1000000000000000000;
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy > -1000000000000000000;
|
||||
|
||||
SELECT COUNT(*) FROM t2 WHERE yy < 2156;
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy < 2156;
|
||||
SELECT COUNT(*) FROM t2 WHERE yy < 1000000000000000000;
|
||||
SELECT COUNT(*) FROM t4 WHERE yyyy < 1000000000000000000;
|
||||
|
||||
SELECT * FROM t2 WHERE yy < 123;
|
||||
SELECT * FROM t2 WHERE yy > 123;
|
||||
SELECT * FROM t4 WHERE yyyy < 123;
|
||||
SELECT * FROM t4 WHERE yyyy > 123;
|
||||
|
||||
DROP TABLE t2, t4;
|
||||
|
||||
--echo #
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -779,6 +779,12 @@ set @@hostname= "anothername";
|
||||
--replace_column 2 #
|
||||
show variables like 'hostname';
|
||||
|
||||
--echo #
|
||||
--echo # BUG#37408 - Compressed MyISAM files should not require/use mmap()
|
||||
--echo #
|
||||
--echo # Test 'myisam_mmap_size' option is not dynamic
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SET @@myisam_mmap_size= 500M;
|
||||
--echo End of 5.0 tests
|
||||
|
||||
#
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -220,7 +220,8 @@ copy_uca_collation(CHARSET_INFO *to, CHARSET_INFO *from)
|
||||
static int add_collation(CHARSET_INFO *cs)
|
||||
{
|
||||
if (cs->name && (cs->number ||
|
||||
(cs->number=get_collation_number_internal(cs->name))))
|
||||
(cs->number=get_collation_number_internal(cs->name))) &&
|
||||
cs->number < array_elements(all_charsets))
|
||||
{
|
||||
if (!all_charsets[cs->number])
|
||||
{
|
||||
@ -327,7 +328,6 @@ static int add_collation(CHARSET_INFO *cs)
|
||||
#define MY_CHARSET_INDEX "Index.xml"
|
||||
|
||||
const char *charsets_dir= NULL;
|
||||
static int charset_initialized=0;
|
||||
|
||||
|
||||
static my_bool my_read_charset_file(const char *filename, myf myflags)
|
||||
@ -342,10 +342,10 @@ static my_bool my_read_charset_file(const char *filename, myf myflags)
|
||||
!(buf= (uchar*) my_malloc(len,myflags)))
|
||||
return TRUE;
|
||||
|
||||
if ((fd=my_open(filename,O_RDONLY,myflags)) < 0)
|
||||
if ((fd= mysql_file_open(key_file_charset, filename, O_RDONLY, myflags)) < 0)
|
||||
goto error;
|
||||
tmp_len=my_read(fd, buf, len, myflags);
|
||||
my_close(fd,myflags);
|
||||
tmp_len= mysql_file_read(fd, buf, len, myflags);
|
||||
mysql_file_close(fd, myflags);
|
||||
if (tmp_len != len)
|
||||
goto error;
|
||||
|
||||
@ -405,63 +405,37 @@ static void *cs_alloc(size_t size)
|
||||
}
|
||||
|
||||
|
||||
#ifdef __NETWARE__
|
||||
my_bool STDCALL init_available_charsets(myf myflags)
|
||||
#else
|
||||
static my_bool init_available_charsets(myf myflags)
|
||||
#endif
|
||||
static my_pthread_once_t charsets_initialized= MY_PTHREAD_ONCE_INIT;
|
||||
|
||||
static void init_available_charsets(void)
|
||||
{
|
||||
char fname[FN_REFLEN + sizeof(MY_CHARSET_INDEX)];
|
||||
my_bool error=FALSE;
|
||||
/*
|
||||
We have to use charset_initialized to not lock on THR_LOCK_charset
|
||||
inside get_internal_charset...
|
||||
*/
|
||||
if (!charset_initialized)
|
||||
CHARSET_INFO **cs;
|
||||
|
||||
bzero(&all_charsets,sizeof(all_charsets));
|
||||
init_compiled_charsets(MYF(0));
|
||||
|
||||
/* Copy compiled charsets */
|
||||
for (cs=all_charsets;
|
||||
cs < all_charsets+array_elements(all_charsets)-1 ;
|
||||
cs++)
|
||||
{
|
||||
CHARSET_INFO **cs;
|
||||
/*
|
||||
To make things thread safe we are not allowing other threads to interfere
|
||||
while we may changing the cs_info_table
|
||||
*/
|
||||
pthread_mutex_lock(&THR_LOCK_charset);
|
||||
if (!charset_initialized)
|
||||
if (*cs)
|
||||
{
|
||||
bzero(&all_charsets,sizeof(all_charsets));
|
||||
init_compiled_charsets(myflags);
|
||||
|
||||
/* Copy compiled charsets */
|
||||
for (cs=all_charsets;
|
||||
cs < all_charsets + array_elements(all_charsets);
|
||||
cs++)
|
||||
{
|
||||
if (*cs)
|
||||
{
|
||||
if (cs[0]->ctype)
|
||||
if (init_state_maps(*cs))
|
||||
*cs= NULL;
|
||||
}
|
||||
}
|
||||
|
||||
strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
|
||||
error= my_read_charset_file(fname,myflags);
|
||||
charset_initialized=1;
|
||||
if (cs[0]->ctype)
|
||||
if (init_state_maps(*cs))
|
||||
*cs= NULL;
|
||||
}
|
||||
pthread_mutex_unlock(&THR_LOCK_charset);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
void free_charsets(void)
|
||||
{
|
||||
charset_initialized=0;
|
||||
strmov(get_charsets_dir(fname), MY_CHARSET_INDEX);
|
||||
my_read_charset_file(fname, MYF(0));
|
||||
}
|
||||
|
||||
|
||||
uint get_collation_number(const char *name)
|
||||
{
|
||||
init_available_charsets(MYF(0));
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
return get_collation_number_internal(name);
|
||||
}
|
||||
|
||||
@ -469,7 +443,7 @@ uint get_collation_number(const char *name)
|
||||
uint get_charset_number(const char *charset_name, uint cs_flags)
|
||||
{
|
||||
CHARSET_INFO **cs;
|
||||
init_available_charsets(MYF(0));
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
||||
for (cs= all_charsets;
|
||||
cs < all_charsets + array_elements(all_charsets);
|
||||
@ -486,7 +460,7 @@ uint get_charset_number(const char *charset_name, uint cs_flags)
|
||||
const char *get_charset_name(uint charset_number)
|
||||
{
|
||||
CHARSET_INFO *cs;
|
||||
init_available_charsets(MYF(0));
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
||||
cs=all_charsets[charset_number];
|
||||
if (cs && (cs->number == charset_number) && cs->name )
|
||||
@ -510,7 +484,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
|
||||
To make things thread safe we are not allowing other threads to interfere
|
||||
while we may changing the cs_info_table
|
||||
*/
|
||||
pthread_mutex_lock(&THR_LOCK_charset);
|
||||
mysql_mutex_lock(&THR_LOCK_charset);
|
||||
|
||||
if (!(cs->state & (MY_CS_COMPILED|MY_CS_LOADED))) /* if CS is not in memory */
|
||||
{
|
||||
@ -532,7 +506,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
|
||||
else
|
||||
cs= NULL;
|
||||
|
||||
pthread_mutex_unlock(&THR_LOCK_charset);
|
||||
mysql_mutex_unlock(&THR_LOCK_charset);
|
||||
}
|
||||
return cs;
|
||||
}
|
||||
@ -544,7 +518,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags)
|
||||
if (cs_number == default_charset_info->number)
|
||||
return default_charset_info;
|
||||
|
||||
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
||||
if (!cs_number || cs_number > array_elements(all_charsets))
|
||||
return NULL;
|
||||
@ -566,7 +540,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags)
|
||||
{
|
||||
uint cs_number;
|
||||
CHARSET_INFO *cs;
|
||||
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
||||
cs_number=get_collation_number(cs_name);
|
||||
cs= cs_number ? get_internal_charset(cs_number,flags) : NULL;
|
||||
@ -591,7 +565,7 @@ CHARSET_INFO *get_charset_by_csname(const char *cs_name,
|
||||
DBUG_ENTER("get_charset_by_csname");
|
||||
DBUG_PRINT("enter",("name: '%s'", cs_name));
|
||||
|
||||
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
|
||||
my_pthread_once(&charsets_initialized, init_available_charsets);
|
||||
|
||||
cs_number= get_charset_number(cs_name, cs_flags);
|
||||
cs= cs_number ? get_internal_charset(cs_number, flags) : NULL;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -687,7 +687,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
|
||||
static const char includedir_keyword[]= "includedir";
|
||||
static const char include_keyword[]= "include";
|
||||
const int max_recursion_level= 10;
|
||||
FILE *fp;
|
||||
MYSQL_FILE *fp;
|
||||
uint line=0;
|
||||
my_bool found_group=0;
|
||||
uint i;
|
||||
@ -727,10 +727,10 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!(fp= my_fopen(name, O_RDONLY, MYF(0))))
|
||||
if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0))))
|
||||
return 1; /* Ignore wrong files */
|
||||
|
||||
while (fgets(buff, sizeof(buff) - 1, fp))
|
||||
while (mysql_file_fgets(buff, sizeof(buff) - 1, fp))
|
||||
{
|
||||
line++;
|
||||
/* Ignore comment and empty lines */
|
||||
@ -920,11 +920,11 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
my_fclose(fp,MYF(0));
|
||||
mysql_file_fclose(fp, MYF(0));
|
||||
return(0);
|
||||
|
||||
err:
|
||||
my_fclose(fp,MYF(0));
|
||||
mysql_file_fclose(fp, MYF(0));
|
||||
return -1; /* Fatal error */
|
||||
}
|
||||
|
||||
|
49
mysys/hash.c
49
mysys/hash.c
@ -33,16 +33,18 @@ typedef struct st_hash_info {
|
||||
uchar *data; /* data for current entry */
|
||||
} HASH_LINK;
|
||||
|
||||
static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength);
|
||||
static uint my_hash_mask(my_hash_value_type hashnr,
|
||||
size_t buffmax, size_t maxlength);
|
||||
static void movelink(HASH_LINK *array,uint pos,uint next_link,uint newlink);
|
||||
static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
|
||||
size_t length);
|
||||
|
||||
static uint calc_hash(const HASH *hash, const uchar *key, size_t length)
|
||||
static my_hash_value_type calc_hash(const HASH *hash,
|
||||
const uchar *key, size_t length)
|
||||
{
|
||||
ulong nr1=1, nr2=4;
|
||||
hash->charset->coll->hash_sort(hash->charset,(uchar*) key,length,&nr1,&nr2);
|
||||
return nr1;
|
||||
return (my_hash_value_type)nr1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -179,7 +181,8 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length,
|
||||
|
||||
/* Calculate pos according to keys */
|
||||
|
||||
static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength)
|
||||
static uint my_hash_mask(my_hash_value_type hashnr, size_t buffmax,
|
||||
size_t maxlength)
|
||||
{
|
||||
if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1));
|
||||
return (hashnr & ((buffmax >> 1) -1));
|
||||
@ -200,7 +203,7 @@ static
|
||||
#if !defined(__USLC__) && !defined(__sgi)
|
||||
inline
|
||||
#endif
|
||||
unsigned int rec_hashnr(HASH *hash,const uchar *record)
|
||||
my_hash_value_type rec_hashnr(HASH *hash,const uchar *record)
|
||||
{
|
||||
size_t length;
|
||||
uchar *key= (uchar*) my_hash_key(hash, record, &length, 0);
|
||||
@ -214,6 +217,21 @@ uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length)
|
||||
return my_hash_first(hash, key, length, &state);
|
||||
}
|
||||
|
||||
uchar* my_hash_search_using_hash_value(const HASH *hash,
|
||||
my_hash_value_type hash_value,
|
||||
const uchar *key,
|
||||
size_t length)
|
||||
{
|
||||
HASH_SEARCH_STATE state;
|
||||
return my_hash_first_from_hash_value(hash, hash_value,
|
||||
key, length, &state);
|
||||
}
|
||||
|
||||
my_hash_value_type my_calc_hash(const HASH *hash,
|
||||
const uchar *key, size_t length)
|
||||
{
|
||||
return calc_hash(hash, key, length ? length : hash->key_length);
|
||||
}
|
||||
/*
|
||||
Search after a record based on a key
|
||||
|
||||
@ -223,15 +241,26 @@ uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length)
|
||||
|
||||
uchar* my_hash_first(const HASH *hash, const uchar *key, size_t length,
|
||||
HASH_SEARCH_STATE *current_record)
|
||||
{
|
||||
return my_hash_first_from_hash_value(hash,
|
||||
calc_hash(hash, key, length ? length : hash->key_length),
|
||||
key, length, current_record);
|
||||
}
|
||||
|
||||
uchar* my_hash_first_from_hash_value(const HASH *hash,
|
||||
my_hash_value_type hash_value,
|
||||
const uchar *key,
|
||||
size_t length,
|
||||
HASH_SEARCH_STATE *current_record)
|
||||
{
|
||||
HASH_LINK *pos;
|
||||
uint flag,idx;
|
||||
DBUG_ENTER("my_hash_first");
|
||||
DBUG_ENTER("my_hash_first_from_hash_value");
|
||||
|
||||
flag=1;
|
||||
if (hash->records)
|
||||
{
|
||||
idx= my_hash_mask(calc_hash(hash, key, length ? length : hash->key_length),
|
||||
idx= my_hash_mask(hash_value,
|
||||
hash->blength, hash->records);
|
||||
do
|
||||
{
|
||||
@ -331,7 +360,8 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key,
|
||||
my_bool my_hash_insert(HASH *info, const uchar *record)
|
||||
{
|
||||
int flag;
|
||||
size_t idx,halfbuff,hash_nr,first_index;
|
||||
size_t idx,halfbuff,first_index;
|
||||
my_hash_value_type hash_nr;
|
||||
uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2);
|
||||
HASH_LINK *data,*empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos;
|
||||
|
||||
@ -467,7 +497,8 @@ my_bool my_hash_insert(HASH *info, const uchar *record)
|
||||
|
||||
my_bool my_hash_delete(HASH *hash, uchar *record)
|
||||
{
|
||||
uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index;
|
||||
uint blength,pos2,idx,empty_index;
|
||||
my_hash_value_type pos_hashnr, lastpos_hashnr;
|
||||
HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty;
|
||||
DBUG_ENTER("my_hash_delete");
|
||||
if (!hash->records)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -58,9 +58,9 @@ static void my_aiowait(my_aio_result *result);
|
||||
|
||||
#ifdef THREAD
|
||||
#define lock_append_buffer(info) \
|
||||
pthread_mutex_lock(&(info)->append_buffer_lock)
|
||||
mysql_mutex_lock(&(info)->append_buffer_lock)
|
||||
#define unlock_append_buffer(info) \
|
||||
pthread_mutex_unlock(&(info)->append_buffer_lock)
|
||||
mysql_mutex_unlock(&(info)->append_buffer_lock)
|
||||
#else
|
||||
#define lock_append_buffer(info)
|
||||
#define unlock_append_buffer(info)
|
||||
@ -265,7 +265,8 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
|
||||
info->append_read_pos = info->write_pos = info->write_buffer;
|
||||
info->write_end = info->write_buffer + info->buffer_length;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_init(&info->append_buffer_lock,MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_IO_CACHE_append_buffer_lock,
|
||||
&info->append_buffer_lock, MY_MUTEX_INIT_FAST);
|
||||
#endif
|
||||
}
|
||||
#if defined(SAFE_MUTEX) && defined(THREAD)
|
||||
@ -639,9 +640,10 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
|
||||
DBUG_ASSERT(read_cache->type == READ_CACHE);
|
||||
DBUG_ASSERT(!write_cache || (write_cache->type == WRITE_CACHE));
|
||||
|
||||
pthread_mutex_init(&cshare->mutex, MY_MUTEX_INIT_FAST);
|
||||
pthread_cond_init(&cshare->cond, 0);
|
||||
pthread_cond_init(&cshare->cond_writer, 0);
|
||||
mysql_mutex_init(key_IO_CACHE_SHARE_mutex,
|
||||
&cshare->mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_cond_init(key_IO_CACHE_SHARE_cond, &cshare->cond, 0);
|
||||
mysql_cond_init(key_IO_CACHE_SHARE_cond_writer, &cshare->cond_writer, 0);
|
||||
|
||||
cshare->running_threads= num_threads;
|
||||
cshare->total_threads= num_threads;
|
||||
@ -692,7 +694,7 @@ void remove_io_thread(IO_CACHE *cache)
|
||||
if (cache == cshare->source_cache)
|
||||
flush_io_cache(cache);
|
||||
|
||||
pthread_mutex_lock(&cshare->mutex);
|
||||
mysql_mutex_lock(&cshare->mutex);
|
||||
DBUG_PRINT("io_cache_share", ("%s: 0x%lx",
|
||||
(cache == cshare->source_cache) ?
|
||||
"writer" : "reader", (long) cache));
|
||||
@ -715,18 +717,18 @@ void remove_io_thread(IO_CACHE *cache)
|
||||
if (!--cshare->running_threads)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("the last running thread leaves, wake all"));
|
||||
pthread_cond_signal(&cshare->cond_writer);
|
||||
pthread_cond_broadcast(&cshare->cond);
|
||||
mysql_cond_signal(&cshare->cond_writer);
|
||||
mysql_cond_broadcast(&cshare->cond);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&cshare->mutex);
|
||||
mysql_mutex_unlock(&cshare->mutex);
|
||||
|
||||
if (!total)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("last thread removed, destroy share"));
|
||||
pthread_cond_destroy (&cshare->cond_writer);
|
||||
pthread_cond_destroy (&cshare->cond);
|
||||
pthread_mutex_destroy(&cshare->mutex);
|
||||
mysql_cond_destroy (&cshare->cond_writer);
|
||||
mysql_cond_destroy (&cshare->cond);
|
||||
mysql_mutex_destroy(&cshare->mutex);
|
||||
}
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
@ -767,7 +769,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
DBUG_ENTER("lock_io_cache");
|
||||
|
||||
/* Enter the lock. */
|
||||
pthread_mutex_lock(&cshare->mutex);
|
||||
mysql_mutex_lock(&cshare->mutex);
|
||||
cshare->running_threads--;
|
||||
DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
|
||||
(cache == cshare->source_cache) ?
|
||||
@ -784,7 +786,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
while (cshare->running_threads)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("writer waits in lock"));
|
||||
pthread_cond_wait(&cshare->cond_writer, &cshare->mutex);
|
||||
mysql_cond_wait(&cshare->cond_writer, &cshare->mutex);
|
||||
}
|
||||
DBUG_PRINT("io_cache_share", ("writer awoke, going to copy"));
|
||||
|
||||
@ -796,7 +798,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
if (!cshare->running_threads)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("waking writer"));
|
||||
pthread_cond_signal(&cshare->cond_writer);
|
||||
mysql_cond_signal(&cshare->cond_writer);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -808,7 +810,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
cshare->source_cache)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("reader waits in lock"));
|
||||
pthread_cond_wait(&cshare->cond, &cshare->mutex);
|
||||
mysql_cond_wait(&cshare->cond, &cshare->mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -850,7 +852,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
cshare->running_threads)
|
||||
{
|
||||
DBUG_PRINT("io_cache_share", ("reader waits in lock"));
|
||||
pthread_cond_wait(&cshare->cond, &cshare->mutex);
|
||||
mysql_cond_wait(&cshare->cond, &cshare->mutex);
|
||||
}
|
||||
|
||||
/* If the block is not yet read, continue with a locked cache and read. */
|
||||
@ -872,7 +874,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
|
||||
Leave the lock. Do not call unlock_io_cache() later. The thread that
|
||||
filled the buffer did this and marked all threads as running.
|
||||
*/
|
||||
pthread_mutex_unlock(&cshare->mutex);
|
||||
mysql_mutex_unlock(&cshare->mutex);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -915,8 +917,8 @@ static void unlock_io_cache(IO_CACHE *cache)
|
||||
cshare->total_threads));
|
||||
|
||||
cshare->running_threads= cshare->total_threads;
|
||||
pthread_cond_broadcast(&cshare->cond);
|
||||
pthread_mutex_unlock(&cshare->mutex);
|
||||
mysql_cond_broadcast(&cshare->cond);
|
||||
mysql_mutex_unlock(&cshare->mutex);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -1837,7 +1839,7 @@ int end_io_cache(IO_CACHE *info)
|
||||
/* Destroy allocated mutex */
|
||||
info->type= TYPE_NOT_SET;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_destroy(&info->append_buffer_lock);
|
||||
mysql_mutex_destroy(&info->append_buffer_lock);
|
||||
#endif
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -82,7 +82,7 @@ my_off_t my_b_append_tell(IO_CACHE* info)
|
||||
answer to the question.
|
||||
*/
|
||||
#ifdef THREAD
|
||||
pthread_mutex_lock(&info->append_buffer_lock);
|
||||
mysql_mutex_lock(&info->append_buffer_lock);
|
||||
#endif
|
||||
#ifndef DBUG_OFF
|
||||
/*
|
||||
@ -104,7 +104,7 @@ my_off_t my_b_append_tell(IO_CACHE* info)
|
||||
#endif
|
||||
res = info->end_of_file + (info->write_pos-info->append_read_pos);
|
||||
#ifdef THREAD
|
||||
pthread_mutex_unlock(&info->append_buffer_lock);
|
||||
mysql_mutex_unlock(&info->append_buffer_lock);
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -59,13 +59,13 @@
|
||||
time only.
|
||||
|
||||
Before starting to wait on its condition variable with
|
||||
pthread_cond_wait(), the thread enters itself to a specific wait queue
|
||||
mysql_cond_wait(), the thread enters itself to a specific wait queue
|
||||
with link_into_queue() (double linked with '*next' + '**prev') or
|
||||
wait_on_queue() (single linked with '*next').
|
||||
|
||||
Another thread, when releasing a resource, looks up the waiting thread
|
||||
in the related wait queue. It sends a signal with
|
||||
pthread_cond_signal() to the waiting thread.
|
||||
mysql_cond_signal() to the waiting thread.
|
||||
|
||||
NOTE: Depending on the particular wait situation, either the sending
|
||||
thread removes the waiting thread from the wait queue with
|
||||
@ -128,8 +128,8 @@
|
||||
accessing it;
|
||||
to set this number equal to <N> add
|
||||
#define MAX_THREADS <N>
|
||||
- to substitute calls of pthread_cond_wait for calls of
|
||||
pthread_cond_timedwait (wait with timeout set up);
|
||||
- to substitute calls of mysql_cond_wait for calls of
|
||||
mysql_cond_timedwait (wait with timeout set up);
|
||||
this setting should be used only when you want to trap a deadlock
|
||||
situation, which theoretically should not happen;
|
||||
to set timeout equal to <T> seconds add
|
||||
@ -160,7 +160,7 @@
|
||||
#define COND_FOR_SAVED 1
|
||||
#define COND_FOR_READERS 2
|
||||
|
||||
typedef pthread_cond_t KEYCACHE_CONDVAR;
|
||||
typedef mysql_cond_t KEYCACHE_CONDVAR;
|
||||
|
||||
/* descriptor of the page in the key cache block buffer */
|
||||
struct st_keycache_page
|
||||
@ -227,7 +227,7 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
|
||||
static int flush_all_key_blocks(KEY_CACHE *keycache);
|
||||
#ifdef THREAD
|
||||
static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
|
||||
pthread_mutex_t *mutex);
|
||||
mysql_mutex_t *mutex);
|
||||
static void release_whole_queue(KEYCACHE_WQUEUE *wqueue);
|
||||
#else
|
||||
#define wait_on_queue(wqueue, mutex) do {} while (0)
|
||||
@ -314,20 +314,20 @@ static long keycache_thread_id;
|
||||
((uint) (((char*)(h)-(char *) keycache->hash_link_root)/sizeof(HASH_LINK)))
|
||||
|
||||
#if (defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)) || defined(KEYCACHE_DEBUG)
|
||||
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex);
|
||||
static int keycache_pthread_cond_wait(mysql_cond_t *cond,
|
||||
mysql_mutex_t *mutex);
|
||||
#else
|
||||
#define keycache_pthread_cond_wait pthread_cond_wait
|
||||
#define keycache_pthread_cond_wait(C, M) mysql_cond_wait(C, M)
|
||||
#endif
|
||||
|
||||
#if defined(KEYCACHE_DEBUG)
|
||||
static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex);
|
||||
static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex);
|
||||
static int keycache_pthread_cond_signal(pthread_cond_t *cond);
|
||||
static int keycache_pthread_mutex_lock(mysql_mutex_t *mutex);
|
||||
static void keycache_pthread_mutex_unlock(mysql_mutex_t *mutex);
|
||||
static int keycache_pthread_cond_signal(mysql_cond_t *cond);
|
||||
#else
|
||||
#define keycache_pthread_mutex_lock pthread_mutex_lock
|
||||
#define keycache_pthread_mutex_unlock pthread_mutex_unlock
|
||||
#define keycache_pthread_cond_signal pthread_cond_signal
|
||||
#define keycache_pthread_mutex_lock(M) mysql_mutex_lock(M)
|
||||
#define keycache_pthread_mutex_unlock(M) mysql_mutex_unlock(M)
|
||||
#define keycache_pthread_cond_signal(C) mysql_cond_signal(C)
|
||||
#endif /* defined(KEYCACHE_DEBUG) */
|
||||
|
||||
#if !defined(DBUG_OFF)
|
||||
@ -403,7 +403,8 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
||||
keycache->cnt_for_resize_op= 0;
|
||||
keycache->waiting_for_resize_cnt.last_thread= NULL;
|
||||
keycache->in_init= 0;
|
||||
pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_KEY_CACHE_cache_lock,
|
||||
&keycache->cache_lock, MY_MUTEX_INIT_FAST);
|
||||
keycache->resize_queue.last_thread= NULL;
|
||||
}
|
||||
|
||||
@ -773,7 +774,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
|
||||
|
||||
if (cleanup)
|
||||
{
|
||||
pthread_mutex_destroy(&keycache->cache_lock);
|
||||
mysql_mutex_destroy(&keycache->cache_lock);
|
||||
keycache->key_cache_inited= keycache->can_be_used= 0;
|
||||
KEYCACHE_DEBUG_CLOSE;
|
||||
}
|
||||
@ -888,7 +889,7 @@ static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
||||
*/
|
||||
|
||||
static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
|
||||
pthread_mutex_t *mutex)
|
||||
mysql_mutex_t *mutex)
|
||||
{
|
||||
struct st_my_thread_var *last;
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
@ -4166,7 +4167,7 @@ static int flush_all_key_blocks(KEY_CACHE *keycache)
|
||||
|
||||
do
|
||||
{
|
||||
safe_mutex_assert_owner(&keycache->cache_lock);
|
||||
mysql_mutex_assert_owner(&keycache->cache_lock);
|
||||
total_found= 0;
|
||||
|
||||
/*
|
||||
@ -4407,8 +4408,8 @@ static void keycache_dump(KEY_CACHE *keycache)
|
||||
#if defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)
|
||||
|
||||
|
||||
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
static int keycache_pthread_cond_wait(mysql_cond_t *cond,
|
||||
mysql_mutex_t *mutex)
|
||||
{
|
||||
int rc;
|
||||
struct timeval now; /* time when we started waiting */
|
||||
@ -4435,7 +4436,7 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
fprintf(keycache_debug_log, "waiting...\n");
|
||||
fflush(keycache_debug_log);
|
||||
#endif
|
||||
rc= pthread_cond_timedwait(cond, mutex, &timeout);
|
||||
rc= mysql_cond_timedwait(cond, mutex, &timeout);
|
||||
KEYCACHE_THREAD_TRACE_BEGIN("finished waiting");
|
||||
if (rc == ETIMEDOUT || rc == ETIME)
|
||||
{
|
||||
@ -4456,12 +4457,12 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
}
|
||||
#else
|
||||
#if defined(KEYCACHE_DEBUG)
|
||||
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex)
|
||||
static int keycache_pthread_cond_wait(mysql_cond_t *cond,
|
||||
mysql_mutex_t *mutex)
|
||||
{
|
||||
int rc;
|
||||
KEYCACHE_THREAD_TRACE_END("started waiting");
|
||||
rc= pthread_cond_wait(cond, mutex);
|
||||
rc= mysql_cond_wait(cond, mutex);
|
||||
KEYCACHE_THREAD_TRACE_BEGIN("finished waiting");
|
||||
return rc;
|
||||
}
|
||||
@ -4471,27 +4472,27 @@ static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
||||
#if defined(KEYCACHE_DEBUG)
|
||||
|
||||
|
||||
static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||
static int keycache_pthread_mutex_lock(mysql_mutex_t *mutex)
|
||||
{
|
||||
int rc;
|
||||
rc= pthread_mutex_lock(mutex);
|
||||
rc= mysql_mutex_lock(mutex);
|
||||
KEYCACHE_THREAD_TRACE_BEGIN("");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex)
|
||||
static void keycache_pthread_mutex_unlock(mysql_mutex_t *mutex)
|
||||
{
|
||||
KEYCACHE_THREAD_TRACE_END("");
|
||||
pthread_mutex_unlock(mutex);
|
||||
mysql_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
|
||||
static int keycache_pthread_cond_signal(pthread_cond_t *cond)
|
||||
static int keycache_pthread_cond_signal(mysql_cond_t *cond)
|
||||
{
|
||||
int rc;
|
||||
KEYCACHE_THREAD_TRACE("signal");
|
||||
rc= pthread_cond_signal(cond);
|
||||
rc= mysql_cond_signal(cond);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -29,7 +29,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
|
||||
DBUG_ENTER("init_tmpdir");
|
||||
DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL"));
|
||||
|
||||
pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST);
|
||||
mysql_mutex_init(key_TMPDIR_mutex, &tmpdir->mutex, MY_MUTEX_INIT_FAST);
|
||||
if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5))
|
||||
goto err;
|
||||
if (!pathlist || !pathlist[0])
|
||||
@ -65,7 +65,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
|
||||
|
||||
err:
|
||||
delete_dynamic(&tmpdir->full_list); /* Safe to free */
|
||||
pthread_mutex_destroy(&tmpdir->mutex);
|
||||
mysql_mutex_destroy(&tmpdir->mutex);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
@ -75,10 +75,10 @@ char *my_tmpdir(MY_TMPDIR *tmpdir)
|
||||
char *dir;
|
||||
if (!tmpdir->max)
|
||||
return tmpdir->list[0];
|
||||
pthread_mutex_lock(&tmpdir->mutex);
|
||||
mysql_mutex_lock(&tmpdir->mutex);
|
||||
dir=tmpdir->list[tmpdir->cur];
|
||||
tmpdir->cur= (tmpdir->cur == tmpdir->max) ? 0 : tmpdir->cur+1;
|
||||
pthread_mutex_unlock(&tmpdir->mutex);
|
||||
mysql_mutex_unlock(&tmpdir->mutex);
|
||||
return dir;
|
||||
}
|
||||
|
||||
@ -90,6 +90,6 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
|
||||
for (i=0; i<=tmpdir->max; i++)
|
||||
my_free(tmpdir->list[i], MYF(0));
|
||||
delete_dynamic(&tmpdir->full_list);
|
||||
pthread_mutex_destroy(&tmpdir->mutex);
|
||||
mysql_mutex_destroy(&tmpdir->mutex);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -87,7 +87,7 @@ static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
|
||||
{
|
||||
#ifdef THREAD
|
||||
if (map->mutex)
|
||||
pthread_mutex_lock(map->mutex);
|
||||
mysql_mutex_lock(map->mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
|
||||
{
|
||||
#ifdef THREAD
|
||||
if (map->mutex)
|
||||
pthread_mutex_unlock(map->mutex);
|
||||
mysql_mutex_unlock(map->mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
|
||||
if (thread_safe)
|
||||
{
|
||||
size_in_bytes= ALIGN_SIZE(size_in_bytes);
|
||||
extra= sizeof(pthread_mutex_t);
|
||||
extra= sizeof(mysql_mutex_t);
|
||||
}
|
||||
map->mutex= 0;
|
||||
#endif
|
||||
@ -121,8 +121,8 @@ my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
|
||||
#ifdef THREAD
|
||||
if (thread_safe)
|
||||
{
|
||||
map->mutex= (pthread_mutex_t *) ((char*) buf + size_in_bytes);
|
||||
pthread_mutex_init(map->mutex, MY_MUTEX_INIT_FAST);
|
||||
map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes);
|
||||
mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -148,7 +148,7 @@ void bitmap_free(MY_BITMAP *map)
|
||||
{
|
||||
#ifdef THREAD
|
||||
if (map->mutex)
|
||||
pthread_mutex_destroy(map->mutex);
|
||||
mysql_mutex_destroy(map->mutex);
|
||||
#endif
|
||||
my_free((char*) map->bitmap, MYF(0));
|
||||
map->bitmap=0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -63,18 +63,18 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
|
||||
thread_safe_increment(my_stream_opened,&THR_LOCK_open);
|
||||
DBUG_RETURN(fd); /* safeguard */
|
||||
}
|
||||
pthread_mutex_lock(&THR_LOCK_open);
|
||||
mysql_mutex_lock(&THR_LOCK_open);
|
||||
if ((my_file_info[filedesc].name= (char*)
|
||||
my_strdup(filename,MyFlags)))
|
||||
{
|
||||
my_stream_opened++;
|
||||
my_file_total_opened++;
|
||||
my_file_info[filedesc].type= STREAM_BY_FOPEN;
|
||||
pthread_mutex_unlock(&THR_LOCK_open);
|
||||
mysql_mutex_unlock(&THR_LOCK_open);
|
||||
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
|
||||
DBUG_RETURN(fd);
|
||||
}
|
||||
pthread_mutex_unlock(&THR_LOCK_open);
|
||||
mysql_mutex_unlock(&THR_LOCK_open);
|
||||
(void) my_fclose(fd,MyFlags);
|
||||
my_errno=ENOMEM;
|
||||
}
|
||||
@ -98,7 +98,7 @@ int my_fclose(FILE *fd, myf MyFlags)
|
||||
DBUG_ENTER("my_fclose");
|
||||
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags));
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_open);
|
||||
mysql_mutex_lock(&THR_LOCK_open);
|
||||
file= my_fileno(fd);
|
||||
#ifndef _WIN32
|
||||
err= fclose(fd);
|
||||
@ -119,7 +119,7 @@ int my_fclose(FILE *fd, myf MyFlags)
|
||||
my_file_info[file].type = UNOPEN;
|
||||
my_free(my_file_info[file].name, MYF(MY_ALLOW_ZERO_PTR));
|
||||
}
|
||||
pthread_mutex_unlock(&THR_LOCK_open);
|
||||
mysql_mutex_unlock(&THR_LOCK_open);
|
||||
DBUG_RETURN(err);
|
||||
} /* my_fclose */
|
||||
|
||||
@ -149,7 +149,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
|
||||
}
|
||||
else
|
||||
{
|
||||
pthread_mutex_lock(&THR_LOCK_open);
|
||||
mysql_mutex_lock(&THR_LOCK_open);
|
||||
my_stream_opened++;
|
||||
if ((uint) Filedes < (uint) my_file_limit)
|
||||
{
|
||||
@ -163,7 +163,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
|
||||
}
|
||||
my_file_info[Filedes].type = STREAM_BY_FDOPEN;
|
||||
}
|
||||
pthread_mutex_unlock(&THR_LOCK_open);
|
||||
mysql_mutex_unlock(&THR_LOCK_open);
|
||||
}
|
||||
|
||||
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2002, 2004 MySQL AB
|
||||
/* Copyright (C) 2002, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
@ -79,7 +79,7 @@ struct hostent *my_gethostbyname_r(const char *name,
|
||||
#else /* !HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
#ifdef THREAD
|
||||
extern pthread_mutex_t LOCK_gethostbyname_r;
|
||||
extern mysql_mutex_t LOCK_gethostbyname_r;
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -96,7 +96,7 @@ struct hostent *my_gethostbyname_r(const char *name,
|
||||
int buflen, int *h_errnop)
|
||||
{
|
||||
struct hostent *hp;
|
||||
pthread_mutex_lock(&LOCK_gethostbyname_r);
|
||||
mysql_mutex_lock(&LOCK_gethostbyname_r);
|
||||
hp= gethostbyname(name);
|
||||
*h_errnop= h_errno;
|
||||
return hp;
|
||||
@ -104,7 +104,7 @@ struct hostent *my_gethostbyname_r(const char *name,
|
||||
|
||||
void my_gethostbyname_r_free()
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_gethostbyname_r);
|
||||
mysql_mutex_unlock(&LOCK_gethostbyname_r);
|
||||
}
|
||||
|
||||
#endif /* !HAVE_GETHOSTBYNAME_R */
|
||||
|
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