Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb

into mysql.com:/space/pekka/ndb/version/my41-tux
This commit is contained in:
pekka@mysql.com 2004-07-28 12:53:23 +02:00
commit aa9c8e9ebf
219 changed files with 6880 additions and 17619 deletions

View file

@ -38,6 +38,7 @@ EXTRA_DIST = FINISH.sh \
compile-solaris-sparc \
compile-solaris-sparc-debug \
compile-irix-mips64-mipspro \
compile-hpux11-parisc2-aCC \
compile-solaris-sparc-forte \
compile-solaris-sparc-purify

View file

@ -0,0 +1,80 @@
#!/bin/sh
if [ ! -f "sql/mysqld.cc" ]; then
echo "You must run this script from the MySQL top-level directory."
exit 1
fi
# -fast Expand into a set of compiler options to result in
# improved application run-time. Options include: +O3,
# +Onolooptransform, +Olibcalls, +FPD, +Oentryschedule,
# +Ofastaccess.
# +O4 Perform level 3 as well as doing link time optimizations.
# Also sends +Oprocelim and +Ofastaccess to the linker
# (see ld(1)).
release_flags="-fast +O4"
# -z Do not bind anything to address zero. This option
# allows runtime detection of null pointers. See the
# note on pointers below.
cflags="-g -z +O0"
cxxflags="-g0 -z +O0"
debug_conigure_options="--with-debug"
while [ "$#" != 0 ]; do
case "$1" in
--help)
echo "Usage: $0 [options]"
echo "Options:"
echo "--help print this message"
echo "--debug build debug binary [default] "
echo "--release build optimised binary"
echo "-32 build 32 bit binary [default]"
echo "-64 build 64 bit binary"
exit 0
;;
--debug)
echo "Building debug binary"
;;
--release)
echo "Building release binary"
cflags="$release_flags"
cxxflags="$release_flags"
debug_configure_options=""
;;
-32)
echo "Building 32-bit binary"
;;
-64)
echo "Building 64-bit binary"
cflags="$cflags +DA2.0W +DD64"
cxxflags="$cxxflags +DA2.0W +DD64"
;;
*)
echo "$0: invalid option '$1'; use --help to show usage"
exit 1
;;
esac
shift
done
set -x
make distclean
aclocal
autoheader
libtoolize --automake --force
automake --force --add-missing
autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
CC=cc CXX=aCC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \
./configure --prefix=/usr/local/mysql --disable-shared \
--with-extra-charsets=complex --enable-thread-safe-client \
--without-extra-tools $debug_configure_options \
--disable-dependency-tracking
gmake

View file

@ -171,6 +171,17 @@ info("PATH is $ENV{PATH}");
log_timestamp();
$md5_result= safe_system("perl $ENV{HOME}/my_md5sum -c ${opt_distribution}.md5");
if ($md5_result != 0)
{
abort("MD5 check failed for $opt_distribution!");
}
else
{
info("SUCCESS: MD5 checks for $opt_distribution");
}
if (-x "$host/bin/mysqladmin")
{
log_system("$host/bin/mysqladmin $mysqladmin_args -S $mysql_unix_port -s shutdown");
@ -204,17 +215,6 @@ if ($opt_stage == 0)
safe_cd($host);
if ($opt_stage == 0 && ! $opt_use_old_distribution)
{
$md5_result= safe_system("./my_md5sum -c ${opt_distribution}.md5");
if ($md5_result != 0)
{
abort("MD5 failed for $opt_distribution!");
}
else
{
info("SUCCESS: MD5 checks for $opt_distribution");
}
safe_system("gunzip < $opt_distribution | $tar xf -");
# Fix file times; This is needed because the time for files may be
@ -343,7 +343,9 @@ $tar_file=<$pwd/$host/mysql*.t*gz>;
abort ("Could not find tarball!") unless ($tar_file);
# Generate the MD5 for the binary distribution
safe_system("./my_md5sum $tar_file > ${tar_file}.md5}");
$tar_file=~ /(mysql[^\/]*)\.(tar\.gz|tgz)/;
$tar_file_lite= "$1.$2";
system("cd $pwd/$host; perl $ENV{HOME}/my_md5sum $tar_file_lite > ${tar_file_lite}.md5");
#
# Unpack the binary distribution

View file

@ -122,6 +122,10 @@ SOURCE=.\crc32.c
# End Source File
# Begin Source File
SOURCE=.\crc32.h
# End Source File
# Begin Source File
SOURCE=.\deflate.c
# End Source File
# Begin Source File
@ -134,19 +138,7 @@ SOURCE=.\gzio.c
# End Source File
# Begin Source File
SOURCE=.\infblock.c
# End Source File
# Begin Source File
SOURCE=.\infblock.h
# End Source File
# Begin Source File
SOURCE=.\infcodes.c
# End Source File
# Begin Source File
SOURCE=.\infcodes.h
SOURCE=.\infback.c
# End Source File
# Begin Source File
@ -166,7 +158,7 @@ SOURCE=.\inflate.c
# End Source File
# Begin Source File
SOURCE=.\inftrees.c
SOURCE=.\inflate.h
# End Source File
# Begin Source File
@ -174,11 +166,11 @@ SOURCE=.\inftrees.h
# End Source File
# Begin Source File
SOURCE=.\infutil.c
SOURCE=.\inftrees.c
# End Source File
# Begin Source File
SOURCE=.\infutil.h
SOURCE=.\inftrees.h
# End Source File
# Begin Source File

View file

@ -1,372 +0,0 @@
/* acconfig.h
This file is in the public domain.
Descriptive text for the C preprocessor macros that
the distributed Autoconf macros can define.
No software package will use all of them; autoheader copies the ones
your configure.in uses into your configuration header file templates.
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). Although this order
can split up related entries, it makes it easier to check whether
a given entry is in the file.
Leave the following blank line there!! Autoheader needs it. */
#undef C_ALLOCA
#undef CRAY_STACKSEG_END
/* Define the default charset name */
#undef MYSQL_DEFAULT_CHARSET_NAME
/* Define the default charset name */
#undef MYSQL_DEFAULT_COLLATION_NAME
/* Version of .frm files */
#undef DOT_FRM_VERSION
/* If LOAD DATA LOCAL INFILE should be enabled by default */
#undef ENABLED_LOCAL_INFILE
/* READLINE: */
#undef FIONREAD_IN_SYS_IOCTL
/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
#undef GWINSZ_IN_SYS_IOCTL
/* Handing of large files on Solaris 2.6 */
#undef _FILE_OFFSET_BITS
/* Do we have FIONREAD */
#undef FIONREAD_IN_SYS_IOCTL
/* Do we need to define _GNU_SOURCE */
#undef _GNU_SOURCE
/* atomic_add() from <asm/atomic.h> (Linux only) */
#undef HAVE_ATOMIC_ADD
/* atomic_sub() from <asm/atomic.h> (Linux only) */
#undef HAVE_ATOMIC_SUB
/* If we have a working alloca() implementation */
#undef HAVE_ALLOCA
/* bool is not defined by all C++ compilators */
#undef HAVE_BOOL
/* Have berkeley db installed */
#undef HAVE_BERKELEY_DB
/* DSB style signals ? */
#undef HAVE_BSD_SIGNALS
/* Can netinet be included */
#undef HAVE_BROKEN_NETINET_INCLUDES
/* READLINE: */
#undef HAVE_BSD_SIGNALS
/* Define charsets you want */
#undef HAVE_CHARSET_armscii8
#undef HAVE_CHARSET_ascii
#undef HAVE_CHARSET_big5
#undef HAVE_CHARSET_cp1250
#undef HAVE_CHARSET_cp1251
#undef HAVE_CHARSET_cp1256
#undef HAVE_CHARSET_cp1257
#undef HAVE_CHARSET_cp850
#undef HAVE_CHARSET_cp852
#undef HAVE_CHARSET_cp866
#undef HAVE_CHARSET_dec8
#undef HAVE_CHARSET_euckr
#undef HAVE_CHARSET_gb2312
#undef HAVE_CHARSET_gbk
#undef HAVE_CHARSET_geostd8
#undef HAVE_CHARSET_greek
#undef HAVE_CHARSET_hebrew
#undef HAVE_CHARSET_hp8
#undef HAVE_CHARSET_keybcs2
#undef HAVE_CHARSET_koi8r
#undef HAVE_CHARSET_koi8u
#undef HAVE_CHARSET_latin1
#undef HAVE_CHARSET_latin2
#undef HAVE_CHARSET_latin5
#undef HAVE_CHARSET_latin7
#undef HAVE_CHARSET_macce
#undef HAVE_CHARSET_macroman
#undef HAVE_CHARSET_sjis
#undef HAVE_CHARSET_swe7
#undef HAVE_CHARSET_tis620
#undef HAVE_CHARSET_ucs2
#undef HAVE_CHARSET_ujis
#undef HAVE_CHARSET_utf8
/* ZLIB and compress: */
#undef HAVE_COMPRESS
/* Define if we are using OSF1 DEC threads */
#undef HAVE_DEC_THREADS
/* Define if we are using OSF1 DEC threads on 3.2 */
#undef HAVE_DEC_3_2_THREADS
/* Builds Example DB */
#undef HAVE_EXAMPLE_DB
/* Builds Archive Storage Engine */
#undef HAVE_ARCHIVE_DB
/* fp_except from ieeefp.h */
#undef HAVE_FP_EXCEPT
/* READLINE: */
#undef HAVE_GETPW_DECLS
/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
this with 6 arguments */
#undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE
/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
#undef HAVE_GETHOSTBYNAME_R_RETURN_INT
/* Define if int8, int16 and int32 types exist */
#undef HAVE_INT_8_16_32
/* Using Innobase DB */
#undef HAVE_INNOBASE_DB
/* Using old ISAM tables */
#undef HAVE_ISAM
/* Define if we have GNU readline */
#undef HAVE_LIBREADLINE
/* Define if have -lwrap */
#undef HAVE_LIBWRAP
/* Define if we are using Xavier Leroy's LinuxThreads */
#undef HAVE_LINUXTHREADS
/* Do we have lstat */
#undef HAVE_LSTAT
/* Do we use user level threads */
#undef HAVE_mit_thread
/* Using Ndb Cluster DB */
#undef HAVE_NDBCLUSTER_DB
/* Including Ndb Cluster DB shared memory transporter */
#undef NDB_SHM_TRANSPORTER
/* Including Ndb Cluster DB sci transporter */
#undef NDB_SCI_TRANSPORTER
/* For some non posix threads */
#undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC
/* For some non posix threads */
#undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
/* READLINE: */
#undef HAVE_POSIX_SIGNALS
/* Well.. */
#undef HAVE_POSIX_SIGSETJMP
/* sigwait with one argument */
#undef HAVE_NONPOSIX_SIGWAIT
/* ORBIT */
#undef HAVE_ORBIT
/* pthread_attr_setscope */
#undef HAVE_PTHREAD_ATTR_SETSCOPE
/* pthread_yield that doesn't take any arguments */
#undef HAVE_PTHREAD_YIELD_ZERO_ARG
/* pthread_yield function with one argument */
#undef HAVE_PTHREAD_YIELD_ONE_ARG
/* POSIX readdir_r */
#undef HAVE_READDIR_R
/* Have Gemini db installed */
#undef HAVE_GEMINI_DB
/* POSIX sigwait */
#undef HAVE_SIGWAIT
/* crypt */
#undef HAVE_CRYPT
/* If we want to have query cache */
#undef HAVE_QUERY_CACHE
/* Spatial extentions */
#undef HAVE_SPATIAL
/* RTree keys */
#undef HAVE_RTREE_KEYS
/* Access checks in embedded library */
#undef HAVE_EMBEDDED_PRIVILEGE_CONTROL
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
this with 8 arguments */
#undef HAVE_SOLARIS_STYLE_GETHOST
/* MIT pthreads does not support connecting with unix sockets */
#undef HAVE_THREADS_WITHOUT_SOCKETS
/* Timespec has a ts_sec instead of tv_sev */
#undef HAVE_TIMESPEC_TS_SEC
/* Have the tzname variable */
#undef HAVE_TZNAME
/* Define if the system files define uchar */
#undef HAVE_UCHAR
/* Define if the system files define uint */
#undef HAVE_UINT
/* Define if the system files define ulong */
#undef HAVE_ULONG
/* Define if the system files define in_addr_t */
#undef HAVE_IN_ADDR_T
/* UNIXWARE7 threads are not posix */
#undef HAVE_UNIXWARE7_THREADS
/* new UNIXWARE7 threads that are not yet posix */
#undef HAVE_UNIXWARE7_POSIX
/* OpenSSL */
#undef HAVE_OPENSSL
/* READLINE: */
#undef HAVE_USG_SIGHOLD
/* Virtual IO */
#undef HAVE_VIO
/* Handling of large files on Solaris 2.6 */
#undef _LARGEFILE_SOURCE
/* Handling of large files on Solaris 2.6 */
#undef _LARGEFILE64_SOURCE
/* Define if want -lwrap */
#undef LIBWRAP
/* Define to machine type name eg sun10 */
#undef MACHINE_TYPE
#undef MUST_REINSTALL_SIGHANDLERS
/* Defined to used character set */
#undef MY_CHARSET_CURRENT
/* READLINE: no sys file*/
#undef NO_SYS_FILE
/* Program name */
#undef PACKAGE
/* mysql client protocoll version */
#undef PROTOCOL_VERSION
/* ndb version */
#undef NDB_VERSION_MAJOR
#undef NDB_VERSION_MINOR
#undef NDB_VERSION_BUILD
#undef NDB_VERSION_STATUS
/* Define if qsort returns void */
#undef QSORT_TYPE_IS_VOID
/* Define as the return type of qsort (int or void). */
#undef RETQSORTTYPE
/* Size of off_t */
#undef SIZEOF_OFF_T
/* Define as the base type of the last arg to accept */
#undef SOCKET_SIZE_TYPE
/* Last argument to get/setsockopt */
#undef SOCKOPT_OPTLEN_TYPE
#undef SPEED_T_IN_SYS_TYPES
#undef SPRINTF_RETURNS_PTR
#undef SPRINTF_RETURNS_INT
#undef SPRINTF_RETURNS_GARBAGE
/* Needed to get large file support on HPUX 10.20 */
#undef __STDC_EXT__
#undef STACK_DIRECTION
#undef STRCOLL_BROKEN
#undef STRUCT_DIRENT_HAS_D_FILENO
#undef STRUCT_DIRENT_HAS_D_INO
#undef STRUCT_WINSIZE_IN_SYS_IOCTL
#undef STRUCT_WINSIZE_IN_TERMIOS
/* Define to name of system eg solaris*/
#undef SYSTEM_TYPE
/* Define if you want to have threaded code. This may be undef on client code */
#undef THREAD
/* Should be client be thread safe */
#undef THREAD_SAFE_CLIENT
/* READLINE: */
#undef TIOCSTAT_IN_SYS_IOCTL
/* Use multi-byte character routines */
#undef USE_MB
#undef USE_MB_IDENT
/* the pstack backtrace library */
#undef USE_PSTACK
/* Use MySQL RAID */
#undef USE_RAID
/* Program version */
#undef VERSION
/* READLINE: */
#undef VOID_SIGHANDLER
/* used libedit interface (can we dereference result of rl_completion_entry_function?) */
#undef USE_LIBEDIT_INTERFACE
/* used new readline interface (does rl_completion_func_t and rl_compentry_func_t defined?) */
#undef USE_NEW_READLINE_INTERFACE
/* macro for libedit */
#undef HAVE_VIS_H
#undef HAVE_FGETLN
#undef HAVE_ISSETUGID
#undef HAVE_STRLCPY
#undef HAVE_GETLINE
#undef HAVE_FLOCKFILE
#undef HAVE_SYS_TYPES_H
#undef HAVE_SYS_CDEFS_H
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
The entries are in sort -df order: alphabetical, case insensitive,
ignoring punctuation (such as underscores). */

View file

@ -13,7 +13,8 @@ AC_DEFUN(MYSQL_CHECK_LIBEDIT_INTERFACE,[
],
[
mysql_cv_libedit_interface=yes
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
AC_DEFINE_UNQUOTED([USE_LIBEDIT_INTERFACE], [1],
[used libedit interface (can we dereference result of rl_completion_entry_function)])
],
[mysql_cv_libedit_interface=no]
)
@ -33,7 +34,8 @@ AC_DEFUN(MYSQL_CHECK_NEW_RL_INTERFACE,[
],
[
mysql_cv_new_rl_interface=yes
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE)
AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1],
[used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)])
],
[mysql_cv_new_rl_interface=no]
)
@ -65,7 +67,7 @@ main()
exit(0);
}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [ ])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])
@ -105,7 +107,8 @@ if test "$mysql_cv_btype_last_arg_accept" = "none"; then
mysql_cv_btype_last_arg_accept=int
fi)
AC_LANG_RESTORE
AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $mysql_cv_btype_last_arg_accept)
AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept],
[The base type of the last arg to accept])
CXXFLAGS="$ac_save_CXXFLAGS"
])
#---END:
@ -121,10 +124,11 @@ void qsort(void *base, size_t nel, size_t width,
int (*compar) (const void *, const void *));
],
[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)])
AC_DEFINE_UNQUOTED(RETQSORTTYPE, $mysql_cv_type_qsort)
AC_DEFINE_UNQUOTED([RETQSORTTYPE], [$mysql_cv_type_qsort],
[The return type of qsort (int or void).])
if test "$mysql_cv_type_qsort" = "void"
then
AC_DEFINE_UNQUOTED(QSORT_TYPE_IS_VOID, 1)
AC_DEFINE_UNQUOTED([QSORT_TYPE_IS_VOID], [1], [qsort returns void])
fi
])
@ -142,7 +146,8 @@ abstime.ts_nsec = 0;
], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)])
if test "$mysql_cv_timespec_ts" = "yes"
then
AC_DEFINE(HAVE_TIMESPEC_TS_SEC)
AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1],
[Timespec has a ts_sec instead of tv_sev])
fi
])
@ -158,7 +163,7 @@ extern "C"
], mysql_cv_tzname=yes, mysql_cv_tzname=no)])
if test "$mysql_cv_tzname" = "yes"
then
AC_DEFINE(HAVE_TZNAME)
AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable])
fi
])
@ -182,7 +187,7 @@ int link_test()
], mysql_cv_compress=yes, mysql_cv_compress=no)])
if test "$mysql_cv_compress" = "yes"
then
AC_DEFINE(HAVE_COMPRESS)
AC_DEFINE([HAVE_COMPRESS], [1], [ZLIB and compress])
else
LIBS="$save_LIBS"
fi
@ -203,7 +208,7 @@ main()
AC_MSG_RESULT($ac_cv_ulong)
if test "$ac_cv_ulong" = "yes"
then
AC_DEFINE(HAVE_ULONG)
AC_DEFINE([HAVE_ULONG], [1], [system headers define ulong])
fi
])
@ -221,7 +226,7 @@ main()
AC_MSG_RESULT($ac_cv_uchar)
if test "$ac_cv_uchar" = "yes"
then
AC_DEFINE(HAVE_UCHAR)
AC_DEFINE([HAVE_UCHAR], [1], [system headers define uchar])
fi
])
@ -239,7 +244,7 @@ main()
AC_MSG_RESULT($ac_cv_uint)
if test "$ac_cv_uint" = "yes"
then
AC_DEFINE(HAVE_UINT)
AC_DEFINE([HAVE_UINT], [1], [system headers define uint])
fi
])
@ -261,7 +266,7 @@ int main(int argc, char **argv)
AC_MSG_RESULT($ac_cv_in_addr_t)
if test "$ac_cv_in_addr_t" = "yes"
then
AC_DEFINE(HAVE_IN_ADDR_T)
AC_DEFINE([HAVE_IN_ADDR_T], [1], [system headers define in_addr_t])
fi
])
@ -279,7 +284,8 @@ extern "C"
], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)])
if test "$ac_cv_pthread_yield_zero_arg" = "yes"
then
AC_DEFINE(HAVE_PTHREAD_YIELD_ZERO_ARG)
AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1],
[pthread_yield that doesn't take any arguments])
fi
]
[AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg,
@ -294,7 +300,8 @@ extern "C"
], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)])
if test "$ac_cv_pthread_yield_one_arg" = "yes"
then
AC_DEFINE(HAVE_PTHREAD_YIELD_ONE_ARG)
AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1],
[pthread_yield function with one argument])
fi
]
)
@ -318,7 +325,7 @@ main()
AC_MSG_RESULT($ac_cv_fp_except)
if test "$ac_cv_fp_except" = "yes"
then
AC_DEFINE(HAVE_FP_EXCEPT)
AC_DEFINE([HAVE_FP_EXCEPT], [1], [fp_except from ieeefp.h])
fi
])
@ -459,11 +466,12 @@ AC_CACHE_VAL(mysql_cv_signal_vintage,
])
AC_MSG_RESULT($mysql_cv_signal_vintage)
if test "$mysql_cv_signal_vintage" = posix; then
AC_DEFINE(HAVE_POSIX_SIGNALS)
AC_DEFINE(HAVE_POSIX_SIGNALS, [1],
[Signal handling is POSIX (sigset/sighold, etc)])
elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then
AC_DEFINE(HAVE_BSD_SIGNALS)
AC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals])
elif test "$mysql_cv_signal_vintage" = svr3; then
AC_DEFINE(HAVE_USG_SIGHOLD)
AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable])
fi
])
@ -476,7 +484,7 @@ extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();],
mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)])
AC_MSG_RESULT($mysql_cv_can_redecl_getpw)
if test "$mysql_cv_can_redecl_getpw" = "no"; then
AC_DEFINE(HAVE_GETPW_DECLS)
AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present])
fi
])
@ -488,7 +496,8 @@ AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl,
mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)])
AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl)
if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then
AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1],
[READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.])
fi
])
@ -500,7 +509,7 @@ AC_CACHE_VAL(mysql_cv_fionread_in_ioctl,
mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)])
AC_MSG_RESULT($mysql_cv_fionread_in_ioctl)
if test "$mysql_cv_fionread_in_ioctl" = "yes"; then
AC_DEFINE(FIONREAD_IN_SYS_IOCTL)
AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD])
fi
])
@ -512,7 +521,8 @@ AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl,
mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)])
AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl)
if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then
AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL)
AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1],
[declaration of TIOCSTAT in sys/ioctl.h])
fi
])
@ -545,7 +555,8 @@ struct dirent d; int z; z = d.d_ino;
], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)])
AC_MSG_RESULT($mysql_cv_dirent_has_dino)
if test "$mysql_cv_dirent_has_dino" = "yes"; then
AC_DEFINE(STRUCT_DIRENT_HAS_D_INO)
AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1],
[d_ino member present in struct dirent])
fi
])
@ -564,7 +575,7 @@ void (*signal ()) ();],
[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl
AC_MSG_RESULT($mysql_cv_void_sighandler)
if test "$mysql_cv_void_sighandler" = "yes"; then
AC_DEFINE(VOID_SIGHANDLER)
AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();])
fi
])
@ -583,7 +594,7 @@ AC_LANG_RESTORE
])
AC_MSG_RESULT($mysql_cv_have_bool)
if test "$mysql_cv_have_bool" = yes; then
AC_DEFINE(HAVE_BOOL)
AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators])
fi
])dnl
@ -624,7 +635,7 @@ then
ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])
if test "$ac_cv_header_alloca_h" = "yes"
then
AC_DEFINE(HAVE_ALLOCA)
AC_DEFINE(HAVE_ALLOCA, 1)
fi
AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works,
@ -647,7 +658,7 @@ then
], [char *p = (char *) alloca(1);],
ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)])
if test "$ac_cv_func_alloca_works" = "yes"; then
AC_DEFINE(HAVE_ALLOCA)
AC_DEFINE([HAVE_ALLOCA], [1], [If we have a working alloca() implementation])
fi
if test "$ac_cv_func_alloca_works" = "no"; then
@ -656,7 +667,7 @@ then
# contain a buggy version. If you still want to use their alloca,
# use ar to extract alloca.o from them instead of compiling alloca.c.
ALLOCA=alloca.o
AC_DEFINE(C_ALLOCA)
AC_DEFINE(C_ALLOCA, 1)
AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
[AC_EGREP_CPP(webecray,
@ -761,7 +772,7 @@ AC_DEFUN(MYSQL_CHECK_VIO, [
then
vio_dir="vio"
vio_libs="../vio/libvio.la"
AC_DEFINE(HAVE_VIO)
AC_DEFINE(HAVE_VIO, 1)
else
vio_dir=""
vio_libs=""
@ -852,7 +863,7 @@ AC_MSG_CHECKING(for OpenSSL)
#force VIO use
vio_dir="vio"
vio_libs="../vio/libvio.la"
AC_DEFINE(HAVE_VIO)
AC_DEFINE([HAVE_VIO], [1], [Virtual IO])
AC_MSG_RESULT(yes)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
# Don't set openssl_includes to /usr/include as this gives us a lot of
@ -866,7 +877,7 @@ AC_MSG_CHECKING(for OpenSSL)
then
openssl_includes="$openssl_includes -I$OPENSSL_KERBEROS_INCLUDE"
fi
AC_DEFINE(HAVE_OPENSSL)
AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL])
# openssl-devel-0.9.6 requires dlopen() and we can't link staticly
# on many platforms (We should actually test this here, but it's quite
@ -927,7 +938,7 @@ then
orbit_libs=`orbit-config --libs server`
orbit_idl="$orbit_exec_prefix/bin/orbit-idl"
AC_MSG_RESULT(found!)
AC_DEFINE(HAVE_ORBIT)
AC_DEFINE([HAVE_ORBIT], [1], [ORBIT])
else
orbit_exec_prefix=
orbit_includes=
@ -949,7 +960,7 @@ AC_DEFUN([MYSQL_CHECK_ISAM], [
isam_libs=
if test X"$with_isam" = X"yes"
then
AC_DEFINE(HAVE_ISAM)
AC_DEFINE([HAVE_ISAM], [1], [Using old ISAM tables])
isam_libs="\$(top_builddir)/isam/libnisam.a\
\$(top_builddir)/merge/libmerge.a"
fi
@ -1245,7 +1256,7 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [
case "$innodb" in
yes )
AC_MSG_RESULT([Using Innodb])
AC_DEFINE(HAVE_INNOBASE_DB)
AC_DEFINE([HAVE_INNOBASE_DB], [1], [Using Innobase DB])
have_innodb="yes"
innodb_includes="-I../innobase/include"
innodb_system_libs=""
@ -1318,7 +1329,7 @@ AC_DEFUN([MYSQL_CHECK_EXAMPLEDB], [
case "$exampledb" in
yes )
AC_DEFINE(HAVE_EXAMPLE_DB)
AC_DEFINE([HAVE_EXAMPLE_DB], [1], [Builds Example DB])
AC_MSG_RESULT([yes])
[exampledb=yes]
;;
@ -1348,7 +1359,7 @@ AC_DEFUN([MYSQL_CHECK_ARCHIVEDB], [
case "$archivedb" in
yes )
AC_DEFINE(HAVE_ARCHIVE_DB)
AC_DEFINE([HAVE_ARCHIVE_DB], [1], [Builds Archive Storage Engine])
AC_MSG_RESULT([yes])
[archivedb=yes]
;;
@ -1397,7 +1408,8 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
case "$ndb_shm" in
yes )
AC_MSG_RESULT([-- including shared memory transporter])
AC_DEFINE(NDB_SHM_TRANSPORTER)
AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
[Including Ndb Cluster DB shared memory transporter])
have_ndb_shm="yes"
;;
* )
@ -1409,7 +1421,8 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
case "$ndb_sci" in
yes )
AC_MSG_RESULT([-- including sci transporter])
AC_DEFINE(NDB_SCI_TRANSPORTER)
AC_DEFINE([NDB_SCI_TRANSPORTER], [1],
[Including Ndb Cluster DB sci transporter])
have_ndb_sci="yes"
;;
* )
@ -1457,7 +1470,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
case "$ndbcluster" in
yes )
AC_MSG_RESULT([Using NDB Cluster])
AC_DEFINE(HAVE_NDBCLUSTER_DB)
AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB])
have_ndbcluster="yes"
ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi"
ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a"
@ -1480,7 +1493,6 @@ dnl END OF MYSQL_CHECK_NDBCLUSTER SECTION
dnl ---------------------------------------------------------------------------
>>>>>>>
dnl By default, many hosts won't let programs access large files;
dnl one must use special compiler options to get large-file access to work.
dnl For more details about this brain damage please see:
@ -1603,7 +1615,7 @@ AC_DEFUN(MYSQL_SYS_LARGEFILE,
esac])
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
ac_cv_sys_largefile_source,
[Define to make fseeko etc. visible, on some hosts.],
[makes fseeko etc. visible, on some hosts.],
[case "$host_os" in
# HP-UX 10.20 and later
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
@ -1611,7 +1623,7 @@ AC_DEFUN(MYSQL_SYS_LARGEFILE,
esac])
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
ac_cv_sys_large_files,
[Define for large files, on AIX-style hosts.],
[Large files support on AIX-style hosts.],
[case "$host_os" in
# AIX 4.2 and later
aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)

View file

@ -62,9 +62,11 @@ AC_SUBST(MYSQL_NO_DASH_VERSION)
AC_SUBST(MYSQL_BASE_VERSION)
AC_SUBST(MYSQL_VERSION_ID)
AC_SUBST(PROTOCOL_VERSION)
AC_DEFINE_UNQUOTED(PROTOCOL_VERSION, $PROTOCOL_VERSION)
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
[mysql client protocol version])
AC_SUBST(DOT_FRM_VERSION)
AC_DEFINE_UNQUOTED(DOT_FRM_VERSION, $DOT_FRM_VERSION)
AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION],
[Version of .frm files])
AC_SUBST(SHARED_LIB_VERSION)
AC_SUBST(AVAILABLE_LANGUAGES)
AC_SUBST(AVAILABLE_LANGUAGES_ERRORS)
@ -74,19 +76,25 @@ AC_SUBST([NDB_VERSION_MAJOR])
AC_SUBST([NDB_VERSION_MINOR])
AC_SUBST([NDB_VERSION_BUILD])
AC_SUBST([NDB_VERSION_STATUS])
AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR])
AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR])
AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD])
AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"])
AC_DEFINE_UNQUOTED([NDB_VERSION_MAJOR], [$NDB_VERSION_MAJOR],
[NDB major version])
AC_DEFINE_UNQUOTED([NDB_VERSION_MINOR], [$NDB_VERSION_MINOR],
[NDB minor version])
AC_DEFINE_UNQUOTED([NDB_VERSION_BUILD], [$NDB_VERSION_BUILD],
[NDB build version])
AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"],
[NDB status version])
# Canonicalize the configuration name.
SYSTEM_TYPE="$host_vendor-$host_os"
MACHINE_TYPE="$host_cpu"
AC_SUBST(SYSTEM_TYPE)
AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE")
AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
[Name of system, eg solaris])
AC_SUBST(MACHINE_TYPE)
AC_DEFINE_UNQUOTED(MACHINE_TYPE, "$MACHINE_TYPE")
AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"],
[Machine type name, eg sun10])
# Detect intel x86 like processor
BASE_MACHINE_TYPE=$MACHINE_TYPE
@ -230,7 +238,7 @@ AC_MSG_CHECKING("return type of sprintf")
#check the return type of sprintf
case $SYSTEM_TYPE in
*netware*)
AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int")
AC_DEFINE(SPRINTF_RETURNS_INT, [1]) AC_MSG_RESULT("int")
;;
*)
AC_TRY_RUN([
@ -244,8 +252,9 @@ AC_TRY_RUN([
return -1;
}
],
AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int"),
AC_TRY_RUN([
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
AC_MSG_RESULT("int")],
[AC_TRY_RUN([
int main()
{
char* s = "hello";
@ -253,9 +262,12 @@ AC_DEFINE(SPRINTF_RETURNS_INT) AC_MSG_RESULT("int"),
if((char*)sprintf(buf,s) == buf + strlen(s))
return 0;
return -1;
}
], AC_DEFINE(SPRINTF_RETURNS_PTR) AC_MSG_RESULT("ptr"),
AC_DEFINE(SPRINTF_RETURNS_GARBAGE) AC_MSG_RESULT("garbage")))
} ],
[AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
AC_MSG_RESULT("ptr")],
[AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
AC_MSG_RESULT("garbage")])
])
;;
esac
@ -701,7 +713,7 @@ AC_ARG_WITH(raid,
if test "$USE_RAID" = "yes"
then
AC_MSG_RESULT([yes])
AC_DEFINE([USE_RAID])
AC_DEFINE([USE_RAID], [1], [Use MySQL RAID])
else
AC_MSG_RESULT([no])
fi
@ -745,7 +757,8 @@ AC_ARG_ENABLE(local-infile,
if test "$ENABLED_LOCAL_INFILE" = "yes"
then
AC_MSG_RESULT([yes])
AC_DEFINE([ENABLED_LOCAL_INFILE])
AC_DEFINE([ENABLED_LOCAL_INFILE], [1],
[If LOAD DATA LOCAL INFILE should be enabled by default])
else
AC_MSG_RESULT([no])
fi
@ -789,7 +802,7 @@ AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind))
# For crypt() on Linux
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
AC_CHECK_FUNC(crypt, AC_DEFINE([HAVE_CRYPT], [1], [crypt]))
# For sem_xxx functions on Solaris 2.6
AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init))
@ -797,7 +810,7 @@ AC_CHECK_FUNC(sem_init, , AC_CHECK_LIB(posix4, sem_init))
# For compress in zlib
case $SYSTEM_TYPE in
*netware* | *modesto*)
AC_DEFINE(HAVE_COMPRESS)
AC_DEFINE(HAVE_COMPRESS, [1])
;;
*)
MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
@ -832,8 +845,8 @@ int deny_severity = 0;
struct request_info *req;
],[hosts_access (req)],
AC_MSG_RESULT(yes)
AC_DEFINE(LIBWRAP)
AC_DEFINE(HAVE_LIBWRAP)
AC_DEFINE([LIBWRAP], [1], [Define if you have -lwrap])
AC_DEFINE([HAVE_LIBWRAP], [1], [Define if have -lwrap])
if test "$with_libwrap" != "yes"; then
WRAPLIBS="-L${with_libwrap}/lib"
fi
@ -861,7 +874,10 @@ int main()
atomic_add(5, &v);
return atomic_read(&v) == 28 ? 0 : -1;
}
], AC_DEFINE(HAVE_ATOMIC_ADD) atom_ops="${atom_ops}atomic_add ",
],
[AC_DEFINE([HAVE_ATOMIC_ADD], [1],
[atomic_add() from <asm/atomic.h> (Linux only)])
atom_ops="${atom_ops}atomic_add "],
)
AC_TRY_RUN([
#include <asm/atomic.h>
@ -873,7 +889,10 @@ int main()
atomic_sub(5, &v);
return atomic_read(&v) == 18 ? 0 : -1;
}
], AC_DEFINE(HAVE_ATOMIC_SUB) atom_ops="${atom_ops}atomic_sub ",
],
[AC_DEFINE([HAVE_ATOMIC_SUB], [1],
[atomic_sub() from <asm/atomic.h> (Linux only)])
atom_ops="${atom_ops}atomic_sub "],
)
if test -z "$atom_ops"; then atom_ops="no"; fi
@ -903,7 +922,7 @@ dnl I have no idea if this is a good test - can not find docs for libiberty
with_mysqld_ldflags="-all-static"
AC_SUBST([pstack_dirs])
AC_SUBST([pstack_libs])
AC_DEFINE([USE_PSTACK])
AC_DEFINE([USE_PSTACK], [1], [the pstack backtrace library])
dnl This check isn't needed, but might be nice to give some feedback....
dnl AC_CHECK_HEADER(libiberty.h,
dnl have_libiberty_h=yes,
@ -952,7 +971,11 @@ int main()
int8 i;
return 0;
}
], AC_DEFINE(HAVE_INT_8_16_32) AC_MSG_RESULT([yes]), AC_MSG_RESULT([no])
],
[AC_DEFINE([HAVE_INT_8_16_32], [1],
[whether int8, int16 and int32 types exist])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
)
;;
esac
@ -1029,7 +1052,8 @@ case $SYSTEM_TYPE in
if test "$ac_cv_prog_gcc" = "no"
then
CFLAGS="$CFLAGS -DHAVE_BROKEN_INLINE"
CXXFLAGS="$CXXFLAGS +O2"
# set working flags first in line, letting override it (i. e. for debug):
CXXFLAGS="+O2 $CXXFLAGS"
MAX_C_OPTIMIZE=""
MAX_CXX_OPTIMIZE=""
ndb_cxxflags_fix="$ndb_cxxflags_fix -Aa"
@ -1097,7 +1121,8 @@ case $SYSTEM_TYPE in
*bsdi*)
echo "Adding fix for BSDI"
CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH"
AC_DEFINE_UNQUOTED(SOCKOPT_OPTLEN_TYPE, size_t)
AC_DEFINE_UNQUOTED([SOCKOPT_OPTLEN_TYPE], [size_t],
[Last argument to get/setsockopt])
;;
*sgi-irix6*)
if test "$with_named_thread" = "no"
@ -1247,7 +1272,8 @@ then
if test "$res" -gt 0
then
AC_MSG_RESULT("Found")
AC_DEFINE(HAVE_LINUXTHREADS)
AC_DEFINE([HAVE_LINUXTHREADS], [1],
[Whether we are using Xavier Leroy's LinuxThreads])
# Linux 2.0 sanity check
AC_TRY_COMPILE([#include <sched.h>], [int a = sched_get_priority_min(1);], ,
AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual]))
@ -1270,7 +1296,8 @@ Reference Manual for more information.])
with_named_thread="-lpthread -lmach -lexc"
CFLAGS="$CFLAGS -D_REENTRANT"
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
AC_DEFINE(HAVE_DEC_THREADS)
AC_DEFINE(HAVE_DEC_THREADS, [1],
[Whether we are using DEC threads])
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
@ -1278,8 +1305,9 @@ Reference Manual for more information.])
if test -f /usr/shlib/libpthreads.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a
then
with_named_thread="-lpthreads -lmach -lc_r"
AC_DEFINE(HAVE_DEC_THREADS)
AC_DEFINE(HAVE_DEC_3_2_THREADS)
AC_DEFINE(HAVE_DEC_THREADS, [1])
AC_DEFINE([HAVE_DEC_3_2_THREADS], [1],
[Whether we are using OSF1 DEC threads on 3.2])
with_osf32_threads="yes"
MYSQLD_DEFAULT_SWITCHES="--skip-thread-priority"
AC_MSG_RESULT("yes")
@ -1353,9 +1381,9 @@ then
fi
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
AC_DEFINE(HAVE_UNIXWARE7_THREADS)
AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
else
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
fi
AC_MSG_RESULT("yes")
# We must have cc
@ -1399,9 +1427,9 @@ then
fi
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
AC_DEFINE(HAVE_UNIXWARE7_THREADS)
AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
else
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
fi
# We must have cc
AC_MSG_CHECKING("for gcc")
@ -1440,9 +1468,11 @@ then
fi
if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
then
AC_DEFINE(HAVE_UNIXWARE7_THREADS)
AC_DEFINE([HAVE_UNIXWARE7_THREADS], [1],
[UNIXWARE7 threads are not posix])
else
AC_DEFINE(HAVE_UNIXWARE7_POSIX)
AC_DEFINE([HAVE_UNIXWARE7_POSIX], [1],
[new UNIXWARE7 threads that are not yet posix])
fi
# We must have cc
AC_MSG_CHECKING("for gcc")
@ -1889,7 +1919,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
AC_MSG_CHECKING(for isinf with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISINF,,[isinf() macro or function]),
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
AC_MSG_RESULT(no))
CFLAGS="$ORG_CFLAGS"
@ -1943,7 +1973,8 @@ AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethost_style" = "solaris"
then
AC_DEFINE(HAVE_SOLARIS_STYLE_GETHOST)
AC_DEFINE([HAVE_SOLARIS_STYLE_GETHOST], [1],
[Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 arguments])
fi
#---START: Used in for client configure
@ -1977,7 +2008,8 @@ AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_style" = "glibc2"
then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE)
AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1],
[Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments])
fi
# Check 3rd argument of getthostbyname_r
@ -2008,7 +2040,8 @@ AC_LANG_RESTORE
CXXFLAGS="$ac_save_CXXFLAGS"
if test "$mysql_cv_gethostname_arg" = "hostent_data"
then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_RETURN_INT)
AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1],
[In OSF 4.0f the 3'd argument to gethostname_r is hostent_data *])
fi
@ -2027,7 +2060,8 @@ pthread_getspecific((pthread_key_t) NULL); ],
mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
if test "$mysql_cv_getspecific_args" = "other"
then
AC_DEFINE(HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1],
[For some non posix threads])
fi
# Check definition of pthread_mutex_init
@ -2045,7 +2079,8 @@ mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other))
mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other))
if test "$mysql_cv_mutex_init_args" = "other"
then
AC_DEFINE(HAVE_NONPOSIX_PTHREAD_MUTEX_INIT)
AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1],
[For some non posix threads])
fi
fi
#---END:
@ -2065,7 +2100,7 @@ readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ],
mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other))
if test "$mysql_cv_readdir_r" = "POSIX"
then
AC_DEFINE(HAVE_READDIR_R)
AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r])
fi
# Check definition of posix sigwait()
@ -2085,7 +2120,7 @@ sigwait(&set,&sig);
mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other))
if test "$mysql_cv_sigwait" = "POSIX"
then
AC_DEFINE(HAVE_SIGWAIT)
AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait])
fi
if test "$mysql_cv_sigwait" != "POSIX"
@ -2106,7 +2141,7 @@ sigwait(&set);],
mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other))
if test "$mysql_cv_sigwait" = "NONPOSIX"
then
AC_DEFINE(HAVE_NONPOSIX_SIGWAIT)
AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument])
fi
fi
#---END:
@ -2124,7 +2159,7 @@ pthread_attr_setscope(&thr_attr,0);],
mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no))
if test "$mysql_cv_pthread_attr_setscope" = "yes"
then
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE)
AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope])
fi
# Check for bad includes
@ -2140,7 +2175,7 @@ AC_TRY_COMPILE(
netinet_inc=yes, netinet_inc=no)
if test "$netinet_inc" = "no"
then
AC_DEFINE(HAVE_BROKEN_NETINET_INCLUDES)
AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included])
fi
AC_MSG_RESULT("$netinet_inc")
@ -2165,7 +2200,7 @@ AC_ARG_WITH(query_cache,
if test "$with_query_cache" = "yes"
then
AC_DEFINE(HAVE_QUERY_CACHE)
AC_DEFINE([HAVE_QUERY_CACHE], [1], [If we want to have query cache])
fi
AC_ARG_WITH(geometry,
@ -2176,8 +2211,8 @@ AC_ARG_WITH(geometry,
if test "$with_geometry" = "yes"
then
AC_DEFINE(HAVE_SPATIAL)
AC_DEFINE(HAVE_RTREE_KEYS)
AC_DEFINE([HAVE_SPATIAL], [1], [Spatial extentions])
AC_DEFINE([HAVE_RTREE_KEYS], [1], [RTree keys])
fi
AC_ARG_WITH(embedded_privilege_control,
@ -2190,7 +2225,8 @@ AC_ARG_WITH(embedded_privilege_control,
if test "$with_embedded_privilege_control" = "yes"
then
AC_DEFINE(HAVE_EMBEDDED_PRIVILEGE_CONTROL)
AC_DEFINE([HAVE_EMBEDDED_PRIVILEGE_CONTROL], [1],
[Access checks in embedded library])
fi
AC_ARG_WITH(extra-tools,
@ -2300,7 +2336,7 @@ then
readline_link="\$(top_builddir)/cmd-line-utils/libedit/liblibedit.a"
readline_h_ln_cmd="\$(LN) -s \$(top_builddir)/cmd-line-utils/libedit/readline readline"
compile_libedit=yes
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
elif test "$with_readline" = "yes"
then
readline_topdir="cmd-line-utils"
@ -2309,7 +2345,7 @@ then
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_builddir)/cmd-line-utils/readline readline"
compile_readline=yes
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE)
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else
MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE
@ -2397,121 +2433,124 @@ for cs in $CHARSETS
do
case $cs in
armscii8)
AC_DEFINE(HAVE_CHARSET_armscii8)
AC_DEFINE(HAVE_CHARSET_armscii8, 1,
[Define to enable charset armscii8])
;;
ascii)
AC_DEFINE(HAVE_CHARSET_ascii)
AC_DEFINE(HAVE_CHARSET_ascii, 1,
[Define to enable ascii character set])
;;
big5)
AC_DEFINE(HAVE_CHARSET_big5)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_big5, 1, [Define to enable charset big5])
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, [1], [ ])
;;
binary)
;;
cp1250)
AC_DEFINE(HAVE_CHARSET_cp1250)
AC_DEFINE(HAVE_CHARSET_cp1250, 1, [Define to enable cp1250])
;;
cp1251)
AC_DEFINE(HAVE_CHARSET_cp1251)
AC_DEFINE(HAVE_CHARSET_cp1251, 1, [Define to enable charset cp1251])
;;
cp1256)
AC_DEFINE(HAVE_CHARSET_cp1256)
AC_DEFINE(HAVE_CHARSET_cp1256, 1, [Define to enable charset cp1256])
;;
cp1257)
AC_DEFINE(HAVE_CHARSET_cp1257)
AC_DEFINE(HAVE_CHARSET_cp1257, 1, [Define to enable charset cp1257])
;;
cp850)
AC_DEFINE(HAVE_CHARSET_cp850)
AC_DEFINE(HAVE_CHARSET_cp850, 1, [Define to enable charset cp850])
;;
cp852)
AC_DEFINE(HAVE_CHARSET_cp852)
AC_DEFINE(HAVE_CHARSET_cp852, 1, [Define to enable charset cp852])
;;
cp866)
AC_DEFINE(HAVE_CHARSET_cp866)
AC_DEFINE(HAVE_CHARSET_cp866, 1, [Define to enable charset cp866])
;;
dec8)
AC_DEFINE(HAVE_CHARSET_dec8)
AC_DEFINE(HAVE_CHARSET_dec8, 1, [Define to enable charset dec8])
;;
euckr)
AC_DEFINE(HAVE_CHARSET_euckr)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_euckr, 1, [Define to enable charset euckr])
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
gb2312)
AC_DEFINE(HAVE_CHARSET_gb2312)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_gb2312, 1, [Define to enable charset gb2312])
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
gbk)
AC_DEFINE(HAVE_CHARSET_gbk)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_gbk, 1, [Define to enable charset gbk])
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
geostd8)
AC_DEFINE(HAVE_CHARSET_geostd8)
AC_DEFINE(HAVE_CHARSET_geostd8, 1, [Define to enable charset geostd8])
;;
greek)
AC_DEFINE(HAVE_CHARSET_greek)
AC_DEFINE(HAVE_CHARSET_greek, 1, [Define to enable charset greek])
;;
hebrew)
AC_DEFINE(HAVE_CHARSET_hebrew)
AC_DEFINE(HAVE_CHARSET_hebrew, 1, [Define to enable charset hebrew])
;;
hp8)
AC_DEFINE(HAVE_CHARSET_hp8)
AC_DEFINE(HAVE_CHARSET_hp8, 1, [Define to enable charset hp8])
;;
keybcs2)
AC_DEFINE(HAVE_CHARSET_keybcs2)
AC_DEFINE(HAVE_CHARSET_keybcs2, 1, [Define to enable charset keybcs2])
;;
koi8r)
AC_DEFINE(HAVE_CHARSET_koi8r)
AC_DEFINE(HAVE_CHARSET_koi8r, 1, [Define to enable charset koi8r])
;;
koi8u)
AC_DEFINE(HAVE_CHARSET_koi8u)
AC_DEFINE(HAVE_CHARSET_koi8u, 1, [Define to enable charset koi8u])
;;
latin1)
AC_DEFINE(HAVE_CHARSET_latin1)
AC_DEFINE(HAVE_CHARSET_latin1, 1, [Define to enable charset latin1])
;;
latin2)
AC_DEFINE(HAVE_CHARSET_latin2)
AC_DEFINE(HAVE_CHARSET_latin2, 1, [Define to enable charset latin2])
;;
latin5)
AC_DEFINE(HAVE_CHARSET_latin5)
AC_DEFINE(HAVE_CHARSET_latin5, 1, [Define to enable charset latin5])
;;
latin7)
AC_DEFINE(HAVE_CHARSET_latin7)
AC_DEFINE(HAVE_CHARSET_latin7, 1, [Define to enable charset latin7])
;;
macce)
AC_DEFINE(HAVE_CHARSET_macce)
AC_DEFINE(HAVE_CHARSET_macce, 1, [Define to enable charset macce])
;;
macroman)
AC_DEFINE(HAVE_CHARSET_macroman)
AC_DEFINE(HAVE_CHARSET_macroman, 1,
[Define to enable charset macroman])
;;
sjis)
AC_DEFINE(HAVE_CHARSET_sjis)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_sjis, 1, [Define to enable charset sjis])
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
swe7)
AC_DEFINE(HAVE_CHARSET_swe7)
AC_DEFINE(HAVE_CHARSET_swe7, 1, [Define to enable charset swe7])
;;
tis620)
AC_DEFINE(HAVE_CHARSET_tis620)
AC_DEFINE(HAVE_CHARSET_tis620, 1, [Define to enable charset tis620])
;;
ucs2)
AC_DEFINE(HAVE_CHARSET_ucs2)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_ucs2, 1, [Define to enable charset ucs2])
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
ujis)
AC_DEFINE(HAVE_CHARSET_ujis)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_ujis, 1, [Define to enable charset ujis])
AC_DEFINE([USE_MB], [1], [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
utf8)
AC_DEFINE(HAVE_CHARSET_utf8)
AC_DEFINE(USE_MB)
AC_DEFINE(USE_MB_IDENT)
AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable ut8])
AC_DEFINE([USE_MB], 1, [Use multi-byte character routines])
AC_DEFINE(USE_MB_IDENT, 1)
;;
*)
AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE).
@ -2709,8 +2748,10 @@ else
]);
fi
AC_DEFINE_UNQUOTED(MYSQL_DEFAULT_CHARSET_NAME,"$default_charset")
AC_DEFINE_UNQUOTED(MYSQL_DEFAULT_COLLATION_NAME,"$default_collation")
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"],
[Define the default charset name])
AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"],
[Define the default charset name])
MYSQL_CHECK_ISAM
MYSQL_CHECK_BDB
@ -2733,7 +2774,7 @@ if test "$THREAD_SAFE_CLIENT" != "no"
then
sql_client_dirs="libmysql_r $sql_client_dirs"
linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
AC_DEFINE(THREAD_SAFE_CLIENT)
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe])
fi
CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS"
@ -2759,7 +2800,8 @@ ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'"
if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
then
AC_DEFINE(THREAD)
AC_DEFINE([THREAD], [1],
[Define if you want to have threaded code. This may be undef on client code])
# Avoid _PROGRAMS names
THREAD_LPROGRAMS="test_thr_alarm\$(EXEEXT) test_thr_lock\$(EXEEXT)"
AC_SUBST(THREAD_LPROGRAMS)
@ -2819,7 +2861,7 @@ dnl echo "bdb = '$bdb'; inc = '$bdb_includes', lib = '$bdb_libs'"
echo "END OF BERKELEY DB CONFIGURATION"
fi
AC_DEFINE(HAVE_BERKELEY_DB)
AC_DEFINE([HAVE_BERKELEY_DB], [1], [Have berkeley db installed])
else
if test -d bdb; then :
else
@ -2876,7 +2918,7 @@ EOF
then
# MIT user level threads
thread_dirs="mit-pthreads"
AC_DEFINE(HAVE_mit_thread)
AC_DEFINE([HAVE_mit_thread], [1], [Do we use user level threads])
MT_INCLUDES="-I\$(top_srcdir)/mit-pthreads/include"
AC_SUBST(MT_INCLUDES)
if test -n "$OVERRIDE_MT_LD_ADD"
@ -2910,7 +2952,7 @@ AC_SUBST(server_scripts)
#if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes"
#then
# MIT pthreads does now support connecting with unix sockets
# AC_DEFINE(HAVE_THREADS_WITHOUT_SOCKETS)
# AC_DEFINE([HAVE_THREADS_WITHOUT_SOCKETS], [], [MIT pthreads does not support connecting with unix sockets])
#fi
# Some usefull subst

View file

@ -317,4 +317,5 @@
#define ER_UNKNOWN_TIME_ZONE 1298
#define ER_WARN_INVALID_TIMESTAMP 1299
#define ER_INVALID_CHARACTER_STRING 1300
#define ER_ERROR_MESSAGES 301
#define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301
#define ER_ERROR_MESSAGES 302

View file

@ -2717,8 +2717,11 @@ btr_estimate_number_of_different_key_vals(
rec = page_rec_get_next(rec);
}
if (n_cols == dict_index_get_n_unique_in_tree(index)) {
/* We add one because we know that the first record
/* If there is more than one leaf page in the tree,
we add one because we know that the first record
on the page certainly had a different prefix than the
last record on the previous index page in the
alphabetical order. Before this fix, if there was
@ -2726,7 +2729,11 @@ btr_estimate_number_of_different_key_vals(
algorithm grossly underestimated the number of rows
in the table. */
n_diff[n_cols]++;
if (btr_page_get_prev(page, &mtr) != FIL_NULL
|| btr_page_get_next(page, &mtr) != FIL_NULL) {
n_diff[n_cols]++;
}
}
total_external_size +=

View file

@ -418,7 +418,8 @@ lock_release_off_kernel(
/*====================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Releases table locks, and releases possible other transactions waiting
Releases table locks explicitly requested with LOCK TABLES (indicated by
lock type LOCK_TABLE_EXP), and releases possible other transactions waiting
because of these locks. */
void
@ -548,7 +549,7 @@ extern lock_sys_t* lock_sys;
/* Lock types */
#define LOCK_TABLE 16 /* these type values should be so high that */
#define LOCK_REC 32 /* they can be ORed to the lock mode */
#define LOCK_TABLE_EXP 80 /* explicit table lock */
#define LOCK_TABLE_EXP 80 /* explicit table lock (80 = 16 + 64) */
#define LOCK_TYPE_MASK 0xF0UL /* mask used to extract lock type from the
type_mode field in a lock */
/* Waiting lock flag */

View file

@ -161,11 +161,12 @@ row_lock_table_autoinc_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
table handle */
/*************************************************************************
Unlocks a table lock possibly reserved by trx. */
Unlocks all table locks explicitly requested by trx (with LOCK TABLES,
lock type LOCK_TABLE_EXP). */
void
row_unlock_table_for_mysql(
/*=======================*/
row_unlock_tables_for_mysql(
/*========================*/
trx_t* trx); /* in: transaction */
/*************************************************************************
Sets a table lock on the table mentioned in prebuilt. */

View file

@ -157,6 +157,7 @@ extern ulint srv_test_n_mutexes;
extern ulint srv_test_array_size;
extern ulint srv_activity_count;
extern ulint srv_fatal_semaphore_wait_threshold;
extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs,
query threads, and lock table: we allocate

View file

@ -95,7 +95,7 @@ void
sync_arr_wake_threads_if_sema_free(void);
/*====================================*/
/**************************************************************************
Prints warnings of long semaphore waits to stderr. Currently > 120 sec. */
Prints warnings of long semaphore waits to stderr. */
void
sync_array_print_long_waits(void);

View file

@ -423,8 +423,9 @@ struct trx_struct{
lock_t* auto_inc_lock; /* possible auto-inc lock reserved by
the transaction; note that it is also
in the lock list trx_locks */
ulint n_tables_locked;/* number of table locks reserved by
the transaction, stored in trx_locks */
ulint n_lock_table_exp;/* number of explicit table locks
(LOCK TABLES) reserved by the
transaction, stored in trx_locks */
UT_LIST_NODE_T(trx_t)
trx_list; /* list of transactions */
UT_LIST_NODE_T(trx_t)

View file

@ -2023,9 +2023,8 @@ lock_grant(
lock->trx->auto_inc_lock = lock;
} else if (lock_get_type(lock) == LOCK_TABLE_EXP) {
ut_ad(lock_get_mode(lock) == LOCK_S
ut_a(lock_get_mode(lock) == LOCK_S
|| lock_get_mode(lock) == LOCK_X);
lock->trx->n_tables_locked++;
}
if (lock_print_waits) {
@ -3203,6 +3202,10 @@ lock_table_create(
lock->type_mode = type_mode | LOCK_TABLE;
lock->trx = trx;
if (lock_get_type(lock) == LOCK_TABLE_EXP) {
lock->trx->n_lock_table_exp++;
}
lock->un_member.tab_lock.table = table;
UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock);
@ -3238,7 +3241,11 @@ lock_table_remove_low(
if (lock == trx->auto_inc_lock) {
trx->auto_inc_lock = NULL;
}
if (lock_get_type(lock) == LOCK_TABLE_EXP) {
lock->trx->n_lock_table_exp--;
}
UT_LIST_REMOVE(trx_locks, trx->trx_locks, lock);
UT_LIST_REMOVE(un_member.tab_lock.locks, table->locks, lock);
}
@ -3386,7 +3393,7 @@ lock_table(
return(DB_SUCCESS);
}
ut_ad(flags == 0 || flags == LOCK_TABLE_EXP);
ut_a(flags == 0 || flags == LOCK_TABLE_EXP);
trx = thr_get_trx(thr);
@ -3418,10 +3425,7 @@ lock_table(
lock_table_create(table, mode | flags, trx);
if (flags) {
ut_ad(mode == LOCK_S || mode == LOCK_X);
trx->n_tables_locked++;
}
ut_a(!flags || mode == LOCK_S || mode == LOCK_X);
lock_mutex_exit_kernel();
@ -3502,13 +3506,13 @@ lock_table_dequeue(
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(in_lock) == LOCK_TABLE ||
ut_a(lock_get_type(in_lock) == LOCK_TABLE ||
lock_get_type(in_lock) == LOCK_TABLE_EXP);
lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, in_lock);
lock_table_remove_low(in_lock);
/* Check if waiting locks in the queue can now be granted: grant
locks if there are no conflicting locks ahead. */
@ -3608,9 +3612,8 @@ lock_release_off_kernel(
lock_table_dequeue(lock);
if (lock_get_type(lock) == LOCK_TABLE_EXP) {
ut_ad(lock_get_mode(lock) == LOCK_S
ut_a(lock_get_mode(lock) == LOCK_S
|| lock_get_mode(lock) == LOCK_X);
trx->n_tables_locked--;
}
}
@ -3631,11 +3634,12 @@ lock_release_off_kernel(
mem_heap_empty(trx->lock_heap);
ut_a(trx->auto_inc_lock == NULL);
ut_a(trx->n_tables_locked == 0);
ut_a(trx->n_lock_table_exp == 0);
}
/*************************************************************************
Releases table locks, and releases possible other transactions waiting
Releases table locks explicitly requested with LOCK TABLES (indicated by
lock type LOCK_TABLE_EXP), and releases possible other transactions waiting
because of these locks. */
void
@ -3660,7 +3664,7 @@ lock_release_tables_off_kernel(
count++;
if (lock_get_type(lock) == LOCK_TABLE_EXP) {
ut_ad(lock_get_mode(lock) == LOCK_S
ut_a(lock_get_mode(lock) == LOCK_S
|| lock_get_mode(lock) == LOCK_X);
if (trx->insert_undo || trx->update_undo) {
@ -3676,7 +3680,7 @@ lock_release_tables_off_kernel(
}
lock_table_dequeue(lock);
trx->n_tables_locked--;
lock = UT_LIST_GET_LAST(trx->trx_locks);
continue;
}
@ -3695,9 +3699,7 @@ lock_release_tables_off_kernel(
lock = UT_LIST_GET_PREV(trx_locks, lock);
}
mem_heap_empty(trx->lock_heap);
ut_a(trx->n_tables_locked == 0);
ut_a(trx->n_lock_table_exp == 0);
}
/*************************************************************************

View file

@ -370,6 +370,32 @@ row_ins_cascade_ancestor_updates_table(
return(FALSE);
}
/*************************************************************************
Returns the number of ancestor UPDATE or DELETE nodes of a
cascaded update/delete node. */
static
ulint
row_ins_cascade_n_ancestors(
/*========================*/
/* out: number of ancestors */
que_node_t* node) /* in: node in a query graph */
{
que_node_t* parent;
ulint n_ancestors = 0;
parent = que_node_get_parent(node);
while (que_node_get_type(parent) == QUE_NODE_UPDATE) {
n_ancestors++;
parent = que_node_get_parent(parent);
ut_a(parent);
}
return(n_ancestors);
}
/**********************************************************************
Calculates the update vector node->cascade->update for a child table in
a cascaded update. */
@ -615,6 +641,34 @@ row_ins_foreign_report_add_err(
mutex_exit(&dict_foreign_err_mutex);
}
/*************************************************************************
Invalidate the query cache for the given table. */
static
void
row_ins_invalidate_query_cache(
/*===========================*/
que_thr_t* thr, /* in: query thread whose run_node
is an update node */
const char* name) /* in: table name prefixed with
database name and a '/' character */
{
char* buf;
char* ptr;
ulint len = strlen(name) + 1;
buf = mem_strdupl(name, len);
ptr = strchr(buf, '/');
ut_a(ptr);
*ptr = '\0';
/* We call a function in ha_innodb.cc */
#ifndef UNIV_HOTBACKUP
innobase_invalidate_query_cache(thr_get_trx(thr), buf, len);
#endif
mem_free(buf);
}
/*************************************************************************
Perform referential actions or checks when a parent row is deleted or updated
and the constraint had an ON DELETE or ON UPDATE condition which was not
@ -650,26 +704,15 @@ row_ins_foreign_check_on_constraint(
ulint n_to_update;
ulint err;
ulint i;
char* ptr;
char* table_name_buf;
ut_a(thr && foreign && pcur && mtr);
/* Since we are going to delete or update a row, we have to invalidate
the MySQL query cache for table */
table_name_buf = mem_strdup(table->name);
ptr = strchr(table_name_buf, '/');
ut_a(ptr);
*ptr = '\0';
#ifndef UNIV_HOTBACKUP
/* We call a function in ha_innodb.cc */
innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf,
strlen(table->name) + 1);
#endif
mem_free(table_name_buf);
row_ins_invalidate_query_cache(thr, table->name);
node = thr->run_node;
@ -757,6 +800,16 @@ row_ins_foreign_check_on_constraint(
goto nonstandard_exit_func;
}
if (row_ins_cascade_n_ancestors(cascade) >= 15) {
err = DB_ROW_IS_REFERENCED;
row_ins_foreign_report_err(
(char*)"Trying a too deep cascaded delete or update\n",
thr, foreign, btr_pcur_get_rec(pcur), entry);
goto nonstandard_exit_func;
}
index = btr_pcur_get_btr_cur(pcur)->index;
ut_a(index == foreign->foreign_index);

View file

@ -741,14 +741,15 @@ run_again:
}
/*************************************************************************
Unlocks a table lock possibly reserved by trx. */
Unlocks all table locks explicitly requested by trx (with LOCK TABLES,
lock type LOCK_TABLE_EXP). */
void
row_unlock_table_for_mysql(
/*=======================*/
row_unlock_tables_for_mysql(
/*========================*/
trx_t* trx) /* in: transaction */
{
if (!trx->n_tables_locked) {
if (!trx->n_lock_table_exp) {
return;
}
@ -3175,7 +3176,12 @@ row_check_table_for_mysql(
REPEATABLE READ here */
prebuilt->trx->isolation_level = TRX_ISO_REPEATABLE_READ;
/* Enlarge the fatal lock wait timeout during CHECK TABLE. */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */
mutex_exit(&kernel_mutex);
index = dict_table_get_first_index(table);
while (index != NULL) {
@ -3223,6 +3229,11 @@ row_check_table_for_mysql(
ret = DB_ERROR;
}
/* Restore the fatal lock wait timeout after CHECK TABLE. */
mutex_enter(&kernel_mutex);
srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */
mutex_exit(&kernel_mutex);
prebuilt->trx->op_info = "";
return(ret);

View file

@ -55,6 +55,9 @@ ibool srv_lower_case_table_names = FALSE;
in the server */
ulint srv_activity_count = 0;
/* The following is the maximum allowed duration of a lock wait. */
ulint srv_fatal_semaphore_wait_threshold = 600;
ibool srv_lock_timeout_and_monitor_active = FALSE;
ibool srv_error_monitor_active = FALSE;

View file

@ -1115,7 +1115,7 @@ NetWare. */
srv_monitor_file_name = mem_alloc(
strlen(fil_path_to_mysql_datadir) +
20 + sizeof "/innodb_status.");
sprintf(srv_monitor_file_name, "%s/innodb.status.%lu",
sprintf(srv_monitor_file_name, "%s/innodb_status.%lu",
fil_path_to_mysql_datadir, os_proc_get_number());
srv_monitor_file = fopen(srv_monitor_file_name, "w+");
if (!srv_monitor_file) {

View file

@ -895,7 +895,7 @@ sync_arr_wake_threads_if_sema_free(void)
}
/**************************************************************************
Prints warnings of long semaphore waits to stderr. Currently > 120 sec. */
Prints warnings of long semaphore waits to stderr. */
void
sync_array_print_long_waits(void)
@ -905,6 +905,7 @@ sync_array_print_long_waits(void)
ibool old_val;
ibool noticed = FALSE;
ulint i;
ulint fatal_timeout = srv_fatal_semaphore_wait_threshold;
for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
@ -919,12 +920,13 @@ sync_array_print_long_waits(void)
}
if (cell->wait_object != NULL
&& difftime(time(NULL), cell->reservation_time) > 600) {
&& difftime(time(NULL), cell->reservation_time)
> fatal_timeout) {
fputs(
"InnoDB: Error: semaphore wait has lasted > 600 seconds\n"
fprintf(stderr,
"InnoDB: Error: semaphore wait has lasted > %lu seconds\n"
"InnoDB: We intentionally crash the server, because it appears to be hung.\n",
stderr);
fatal_timeout);
ut_error;
}

View file

@ -151,7 +151,7 @@ trx_create(
trx->n_tickets_to_enter_innodb = 0;
trx->auto_inc_lock = NULL;
trx->n_tables_locked = 0;
trx->n_lock_table_exp = 0;
trx->read_view_heap = mem_heap_create(256);
trx->read_view = NULL;
@ -279,7 +279,7 @@ trx_free(
ut_a(!trx->has_search_latch);
ut_a(!trx->auto_inc_lock);
ut_a(!trx->n_tables_locked);
ut_a(!trx->n_lock_table_exp);
ut_a(trx->dict_operation_lock_mode == 0);

View file

@ -130,3 +130,30 @@ EXPORTS
my_read
llstr
mysql_get_parameters
mysql_stmt_bind_param
mysql_stmt_bind_result
mysql_stmt_execute
mysql_stmt_fetch
mysql_stmt_fetch_column
mysql_stmt_param_count
mysql_stmt_param_metadata
mysql_stmt_result_metadata
mysql_stmt_send_long_data
mysql_stmt_affected_rows
mysql_stmt_close
mysql_stmt_reset
mysql_stmt_data_seek
mysql_stmt_errno
mysql_stmt_error
mysql_stmt_free_result
mysql_stmt_num_rows
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_store_result
mysql_stmt_sqlstate
mysql_stmt_prepare
mysql_stmt_init
mysql_stmt_insert_id
mysql_stmt_attr_get
mysql_stmt_attr_set
mysql_stmt_field_count

View file

@ -246,6 +246,11 @@ select a,b from t1 order by 2 ;
prepare stmt1 from ' select a,b from t1
order by ? ';
execute stmt1 using @arg00;
set @arg00=1 ;
execute stmt1 using @arg00;
set @arg00=0 ;
--error 1054
execute stmt1 using @arg00;
##### parameter used in limit clause
set @arg00=1;

View file

@ -1449,7 +1449,7 @@ then
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
then
echo "Starting ndbcluster"
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --discless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
export NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
else
export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"

View file

@ -3,7 +3,7 @@ NoOfReplicas: 2
MaxNoOfConcurrentOperations: CHOOSE_MaxNoOfConcurrentOperations
DataMemory: CHOOSE_DataMemory
IndexMemory: CHOOSE_IndexMemory
Discless: CHOOSE_Discless
Diskless: CHOOSE_Diskless
[COMPUTER]
Id: 1

View file

@ -42,7 +42,7 @@ cfgfile=Ndb.cfg
stop_ndb=
initial_ndb=
status_ndb=
ndb_discless=0
ndb_diskless=0
ndb_con_op=100000
ndb_dmem=80M
@ -65,8 +65,8 @@ while test $# -gt 0; do
ndb_dmem=40M
ndb_imem=12M
;;
--discless)
ndb_discless=1
--diskless)
ndb_diskless=1
;;
--data-dir=*)
fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
@ -131,7 +131,7 @@ sed \
-e s,"CHOOSE_MaxNoOfConcurrentOperations",$ndb_con_op,g \
-e s,"CHOOSE_DataMemory",$ndb_dmem,g \
-e s,"CHOOSE_IndexMemory",$ndb_imem,g \
-e s,"CHOOSE_Discless",$ndb_discless,g \
-e s,"CHOOSE_Diskless",$ndb_diskless,g \
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
-e s,"CHOOSE_FILESYSTEM_NODE_1","$fs_name_1",g \
-e s,"CHOOSE_FILESYSTEM_NODE_2","$fs_name_2",g \

View file

@ -0,0 +1,19 @@
drop table if exists t1, t2;
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
ERROR 23000: Duplicate entry '1' for key 1
select * from t2;
ERROR 42S02: Table 'test.t2' doesn't exist

View file

@ -240,3 +240,6 @@ select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;

View file

@ -157,7 +157,7 @@ teststring
teststring
explain select * from t1 order by text1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL key1 32 NULL 4 Using index
1 SIMPLE t1 index NULL key1 32 NULL 3 Using index
alter table t1 modify text1 char(32) binary not null;
select * from t1 order by text1;
text1

View file

@ -225,6 +225,8 @@ substring_index("www.tcx.se","",3)
select length(repeat("a",100000000)),length(repeat("a",1000*64));
length(repeat("a",100000000)) length(repeat("a",1000*64))
NULL 64000
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
1 0 3

View file

@ -1345,6 +1345,18 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
ERROR 42S02: Unknown table 't1' in where clause
drop table t3,t2,t1;
create table t1(
id int primary key,
pid int,
index(pid),
foreign key(pid) references t1(id) on delete cascade) engine=innodb;
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
delete from t1 where id=0;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
delete from t1 where id=15;
delete from t1 where id=0;
drop table t1;
CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
(stamp))ENGINE=InnoDB;

View file

@ -0,0 +1,36 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello",
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
time_stamp timestamp,
date_field date,
time_field time,
date_time datetime,
options enum('one','two','tree') not null,
flags set('one','two','tree') not null,
PRIMARY KEY (auto),
KEY (utiny),
KEY (tiny),
KEY (short),
KEY any_name (medium),
KEY (longlong),
KEY (real_float),
KEY (ushort),
KEY (umedium),
KEY (ulong),
KEY (ulonglong,ulong),
KEY (options,flags)
);
drop table t1;

View file

@ -8,6 +8,8 @@ len
select repeat('a',2000);
repeat('a',2000)
NULL
Warnings:
Warning 1301 Result of repeat() was larger than max_allowed_packet (1024) - truncated
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024

View file

@ -302,18 +302,18 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye
prepare stmt4 from ' show storage engines ';
execute stmt4;
Engine Support Comment
MyISAM YES/NO Default type from 3.23 with great performance
HEAP YES/NO Hash based, stored in memory, useful for temporary tables
MEMORY YES/NO Alias for HEAP
MyISAM YES/NO Default engine as of MySQL 3.23 with great performance
HEAP YES/NO Alias for MEMORY
MEMORY YES/NO Hash based, stored in memory, useful for temporary tables
MERGE YES/NO Collection of identical MyISAM tables
MRG_MYISAM YES/NO Alias for MERGE
ISAM YES/NO Obsolete table type; Is replaced by MyISAM
MRG_ISAM YES/NO Obsolete table type; Is replaced by MRG_MYISAM
InnoDB YES/NO Supports transactions, row-level locking and foreign keys
ISAM YES/NO Obsolete storage engine, now replaced by MyISAM
MRG_ISAM YES/NO Obsolete storage engine, now replaced by MERGE
InnoDB YES/NO Supports transactions, row-level locking, and foreign keys
INNOBASE YES/NO Alias for INNODB
BDB YES/NO Supports transactions and page-level locking
BERKELEYDB YES/NO Alias for BDB
NDBCLUSTER YES/NO Clustered, fault tolerant memory based tables
NDBCLUSTER YES/NO Clustered, fault-tolerant, memory-based tables
NDB YES/NO Alias for NDBCLUSTER
EXAMPLE YES/NO Example storage engine
ARCHIVE YES/NO Archive storage engine

View file

@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';

View file

@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
@ -572,7 +582,7 @@ def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -581,7 +591,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
execute stmt1 ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -643,7 +653,7 @@ def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -653,7 +663,7 @@ id select_type table type possible_keys key key_len ref rows Extra
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
@arg07, @arg08, @arg09 ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where

View file

@ -335,6 +335,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';

View file

@ -377,6 +377,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';
@ -1560,6 +1570,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';

View file

@ -334,6 +334,16 @@ a b
1 one
3 three
2 two
set @arg00=1 ;
execute stmt1 using @arg00;
a b
1 one
2 two
3 three
4 four
set @arg00=0 ;
execute stmt1 using @arg00;
ERROR 42S22: Unknown column '?' in 'order clause'
set @arg00=1;
prepare stmt1 from ' select a,b from t1
limit 1 ';

View file

@ -0,0 +1,10 @@
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 table if exists t1, t2;
create table t1 (a int);
drop table t1, t2;
ERROR 42S02: Unknown table 't2'

View file

@ -120,9 +120,9 @@ DOCID DOCNAME DOCTYPEID FOLDERID AUTHOR CREATED TITLE SUBTITLE DOCABSTRACT PUBLI
c373e9f5ad07993f3859444553544200 Last Discussion c373e9f5ad079174ff17444553544200 c373e9f5ad0796c0eca4444553544200 Goldilocks 2003-06-09 11:21:06 Title: Last Discussion NULL Setting new abstract and keeping doc checked out 2003-06-09 10:51:26 2003-06-09 10:51:26 NULL NULL NULL 03eea05112b845949f3fd03278b5fe43 2003-06-09 11:21:06 admin 0 NULL Discussion NULL NULL
EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 10 Using where
1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found
1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 32 test.t2.DOCID 1
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where

View file

@ -0,0 +1,29 @@
# Testcase for BUG#4551
# The bug was that when the table was TEMPORARY, it was not deleted if
# the CREATE SELECT failed (the code intended too, but it actually
# didn't). And as the CREATE TEMPORARY TABLE was not written to the
# binlog if it was a transactional table, it resulted in an
# inconsistency between binlog and the internal list of temp tables.
-- source include/have_innodb.inc
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 ( a int );
INSERT INTO t1 VALUES (1),(2),(1);
--error 1062;
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
--error 1146;
select * from t2;
--error 1062;
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1;
--error 1146;
select * from t2;

View file

@ -157,3 +157,11 @@ select ' вася ' rlike '[[:<:]]вася[[:>:]]';
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
#
# Bug #4555
# ALTER TABLE crashes mysqld with enum column collated utf8_unicode_ci
#
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
DROP TABLE t1;

View file

@ -959,6 +959,23 @@ update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
drop table t3,t2,t1;
#
# test for recursion depth limit
#
create table t1(
id int primary key,
pid int,
index(pid),
foreign key(pid) references t1(id) on delete cascade) engine=innodb;
insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
-- error 1217
delete from t1 where id=0;
delete from t1 where id=15;
delete from t1 where id=0;
drop table t1;
#
# Test timestamps
#

View file

@ -0,0 +1,47 @@
-- source include/have_ndb.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# Test creation of different column types in NDB
#
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello",
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
time_stamp timestamp,
date_field date,
time_field time,
date_time datetime,
options enum('one','two','tree') not null,
flags set('one','two','tree') not null,
PRIMARY KEY (auto),
KEY (utiny),
KEY (tiny),
KEY (short),
KEY any_name (medium),
KEY (longlong),
KEY (real_float),
KEY (ushort),
KEY (umedium),
KEY (ulong),
KEY (ulonglong,ulong),
KEY (options,flags)
);
drop table t1;

View file

@ -0,0 +1,12 @@
# Testcase for BUG#4552 (DROP on two tables, one of which does not
# exist, must be binlogged with a non-zero error code)
source include/master-slave.inc;
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
create table t1 (a int);
--error 1051;
drop table t1, t2;
save_master_pos;
connection slave;
sync_with_master;

View file

@ -17,20 +17,7 @@
#include "mysys_priv.h"
#ifndef HAVE_COMPRESS
/* minimal set of defines for using crc32() from zlib codebase */
#define _ZLIB_H
#define ZEXPORT
#define Z_NULL 0
#define OF(args) args
#undef DYNAMIC_CRC_TABLE
typedef uchar Byte;
typedef uchar Bytef;
typedef uint uInt;
typedef ulong uLong;
typedef ulong uLongf;
#include "../zlib/crc32.c"
#endif

View file

@ -84,7 +84,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_SCAN_NEXTREQ 28
#define GSN_SCAN_TABCONF 29
#define GSN_SCAN_TABINFO 30
// 30 unused
#define GSN_SCAN_TABREF 31
#define GSN_SCAN_TABREQ 32
#define GSN_KEYINFO20 33

View file

@ -271,76 +271,6 @@ private:
#define STATUS_SHIFT (8)
#define STATUS_MASK (0xFF)
/**
*
* SENDER: Dbtc, API
* RECIVER: API, Dbtc
*/
class ScanTabInfo {
/**
* Reciver(s) and Sender(s)
*/
friend class NdbConnection;
friend class Dbtc;
/**
* For printing
*/
friend bool printSCANTABINFO(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
public:
/**
* Length of signal
*/
STATIC_CONST( SignalLength = 17 );
private:
// Type definitions
/**
* DATA VARIABLES
*/
UintR apiConnectPtr; // DATA 0
UintR operLenAndIdx[16]; // DATA 1-16
/**
* Get:ers for operLenAndIdx
*/
static Uint32 getLen(const UintR & operLenAndIdx);
static Uint8 getIdx(const UintR & operLenAndIdx);
};
/**
* Operation length and index
*
l = Length of operation - 24 Bits -> Max 16777215 (Bit 0-24)
i = Index of operation - 7 Bits -> Max 255 (Bit 25-32)
1111111111222222222233
01234567890123456789012345678901
llllllllllllllllllllllllliiiiiii
*/
#define LENGTH_SHIFT (0)
#define LENGTH_MASK (0xFFFFFF)
#define INDEX_SHIFT (24)
#define INDEX_MASK (0xFF)
inline
Uint32
ScanTabInfo::getLen(const UintR & operLenAndIdx){
return (Uint32)((operLenAndIdx >> LENGTH_SHIFT) & LENGTH_MASK);
}
inline
Uint8
ScanTabInfo::getIdx(const UintR & operLenAndIdx){
return (Uint8)((operLenAndIdx >> INDEX_SHIFT) & INDEX_MASK);
}
/**
*

View file

@ -18,7 +18,7 @@
#define NDB_SQL_UTIL_HPP
#include <string.h>
#include <ndb_types.h>
#include <ndb_global.h>
#include <kernel/ndb_limits.h>
class NdbSqlUtil {
@ -131,6 +131,7 @@ private:
inline int
NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size)
{
// XXX require size >= 1
if (size > full)
return CmpError;
switch ((Type::Enum)typeId) {
@ -192,10 +193,38 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
case Type::Mediumint: // XXX fix these
break;
case Type::Mediumint:
{
if (size >= 1) {
union { const Uint32* p; const unsigned char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
Int32 v1 = sint3korr(u1.v);
Int32 v2 = sint3korr(u2.v);
if (v1 < v2)
return -1;
if (v1 > v2)
return +1;
return 0;
}
return CmpUnknown;
}
case Type::Mediumunsigned:
break;
{
if (size >= 1) {
union { const Uint32* p; const unsigned char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
Uint32 v1 = uint3korr(u1.v);
Uint32 v2 = uint3korr(u2.v);
if (v1 < v2)
return -1;
if (v1 > v2)
return +1;
return 0;
}
return CmpUnknown;
}
case Type::Int:
{
if (size >= 1) {
@ -287,6 +316,7 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
return CmpUnknown;
}
case Type::Decimal:
// XXX not used by MySQL or NDB
break;
case Type::Char:
{
@ -317,10 +347,28 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
}
return CmpUnknown;
}
case Type::Binary: // XXX fix these
break;
case Type::Binary:
{
// compare byte wise
union { const Uint32* p; const char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
int k = memcmp(u1.v, u2.v, size << 2);
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
}
case Type::Varbinary:
break;
{
// assume correctly padded and compare byte wise
if (size >= 1) {
union { const Uint32* p; const char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
// length in first 2 bytes
int k = memcmp(u1.v + 2, u2.v + 2, (size << 2) - 2);
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
}
return CmpUnknown;
}
case Type::Datetime:
{
/*
@ -331,19 +379,57 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
u1.p = p1;
u2.p = p2;
// skip format check
int k = strncmp(u1.v, u2.v, 4);
int k = memcmp(u1.v, u2.v, 4);
if (k != 0)
return k;
return k < 0 ? -1 : +1;
if (size >= 2) {
return strncmp(u1.v + 4, u2.v + 4, 4);
k = memcmp(u1.v + 4, u2.v + 4, 4);
return k < 0 ? -1 : k > 0 ? +1 : 0;
}
}
return CmpUnknown;
}
case Type::Timespec: // XXX fix this
break;
case Type::Blob: // XXX fix
break;
case Type::Timespec:
{
/*
* Timespec is CC YY MM DD hh mm ss \0 NN NN NN NN
*/
if (size >= 1) {
union { const Uint32* p; const char* v; } u1, u2;
u1.p = p1;
u2.p = p2;
// skip format check
int k = memcmp(u1.v, u2.v, 4);
if (k != 0)
return k < 0 ? -1 : +1;
if (size >= 2) {
k = memcmp(u1.v + 4, u2.v + 4, 4);
if (k != 0)
return k < 0 ? -1 : +1;
Uint32 n1 = *(const Uint32*)(u1.v + 8);
Uint32 n2 = *(const Uint32*)(u2.v + 8);
if (n1 < n2)
return -1;
if (n2 > n1)
return +1;
return 0;
}
}
return CmpUnknown;
}
case Type::Blob:
{
// skip blob head, the rest is binary
const unsigned skip = NDB_BLOB_HEAD_SIZE;
if (size >= skip + 1) {
union { const Uint32* p; const char* v; } u1, u2;
u1.p = p1 + skip;
u2.p = p2 + skip;
int k = memcmp(u1.v, u2.v, (size - 1) << 2);
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
}
return CmpUnknown;
}
case Type::Text:
{
// skip blob head, the rest is char
@ -352,7 +438,8 @@ NdbSqlUtil::cmp(Uint32 typeId, const Uint32* p1, const Uint32* p2, Uint32 full,
union { const Uint32* p; const char* v; } u1, u2;
u1.p = p1 + skip;
u2.p = p2 + skip;
// TODO
int k = memcmp(u1.v, u2.v, (size - 1) << 2);
return k < 0 ? -1 : k > 0 ? +1 : full == size ? 0 : CmpUnknown;
}
return CmpUnknown;
}

View file

@ -135,7 +135,7 @@ EventLogger::defEventLogMatrixSize = sizeof(EventLogger::defEventLogMatrix)/
*/
const EventLogger::EventCategoryName EventLogger::eventCategoryNames[] = {
{ LogLevel::llStartUp, "STARTUP" },
{ LogLevel::llStatistic, "STATISTIC" },
{ LogLevel::llStatistic, "STATISTICS" },
{ LogLevel::llCheckpoint, "CHECKPOINT" },
{ LogLevel::llNodeRestart, "NODERESTART" },
{ LogLevel::llConnection, "CONNECTION" },

View file

@ -99,25 +99,6 @@ printSCANTABCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 recei
return false;
}
bool
printSCANTABINFO(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){
const ScanTabInfo * const sig = (ScanTabInfo *) theData;
fprintf(output, " apiConnectPtr: H\'%.8x\n",
sig->apiConnectPtr);
fprintf(output, " Operation(s):\n");
for(int i = 0; i<16; i++){
fprintf(output, " [%.2u]ix=%d l=%.2d,",
i, sig->getIdx(sig->operLenAndIdx[i]), sig->getLen(sig->operLenAndIdx[i]));
if (((i+1) % 4) == 0)
fprintf(output, "\n");
}
return false;
}
bool
printSCANTABREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo){

View file

@ -32,7 +32,6 @@ const GsnName SignalNames [] = {
,{ GSN_READCONF, "READCONF" }
,{ GSN_SCAN_NEXTREQ, "SCAN_NEXTREQ" }
,{ GSN_SCAN_TABCONF, "SCAN_TABCONF" }
,{ GSN_SCAN_TABINFO, "SCAN_TABINFO" }
,{ GSN_SCAN_TABREF, "SCAN_TABREF" }
,{ GSN_SCAN_TABREQ, "SCAN_TABREQ" }
,{ GSN_TC_COMMITCONF, "TC_COMMITCONF" }

View file

@ -172,6 +172,7 @@ struct DepricationTransform {
static
const DepricationTransform f_deprication[] = {
{ "DB", "Discless", "Diskless", 0, 1 },
{ 0, 0, 0, 0, 0}
};
@ -796,7 +797,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
{
CFG_DB_DISCLESS,
"Discless",
"Diskless",
"DB",
"Run wo/ disk",
ConfigInfo::USED,
@ -805,6 +806,20 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
0,
0,
1},
{
CFG_DB_DISCLESS,
"Discless",
"DB",
"Diskless",
ConfigInfo::DEPRICATED,
true,
ConfigInfo::BOOL,
0,
0,
1},
{
CFG_DB_ARBIT_TIMEOUT,
@ -2732,7 +2747,8 @@ transform(InitConfigFileParser::Context & ctx,
require(ctx.m_currentSection->getTypeOf(oldName, &oldType));
ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName);
if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64)
&& (newType == ConfigInfo::INT || newType == ConfigInfo::INT64))){
&& (newType == ConfigInfo::INT || newType == ConfigInfo::INT64 || newType == ConfigInfo::BOOL))){
ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl;
ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s"
"- [%s] starting at line: %d",
oldName, newName,

View file

@ -98,11 +98,11 @@ NdbSqlUtil::m_typeList[] = {
},
{
Type::Mediumint,
NULL // cmpMediumint
cmpMediumint
},
{
Type::Mediumunsigned,
NULL // cmpMediumunsigned
cmpMediumunsigned
},
{
Type::Int,
@ -130,7 +130,7 @@ NdbSqlUtil::m_typeList[] = {
},
{
Type::Decimal,
NULL // cmpDecimal
NULL // cmpDecimal
},
{
Type::Char,
@ -142,11 +142,11 @@ NdbSqlUtil::m_typeList[] = {
},
{
Type::Binary,
NULL // cmpBinary
cmpBinary
},
{
Type::Varbinary,
NULL // cmpVarbinary
cmpVarbinary
},
{
Type::Datetime,
@ -154,11 +154,11 @@ NdbSqlUtil::m_typeList[] = {
},
{
Type::Timespec,
NULL // cmpTimespec
cmpTimespec
},
{
Type::Blob,
NULL // cmpDatetime
cmpBlob
},
{
Type::Text,

View file

@ -35,6 +35,8 @@
#include <NdbSleep.h>
#include <new>
#include <signal.h> // For process signals
extern "C" {
extern void (* ndb_new_handler)();
}

View file

@ -15,18 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/******************************************************************************
Name: NdbApiSignal.C
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
Date: 970829
Version: 0.1
Description: Interface between TIS and NDB
Documentation:
Adjust: 971114 UABMNST First version.
000705 QABANAB Update of Protocol2
******************************************************************************/
#include "API.hpp"
#include "NdbApiSignal.hpp"
@ -193,15 +181,6 @@ NdbApiSignal::setSignal(int aNdbSignalType)
}
break;
case GSN_SCAN_TABINFO:
{
theTrace = TestOrd::TraceAPI;
theReceiversBlockNumber = DBTC;
theVerId_signalNumber = GSN_SCAN_TABINFO;
theLength = 17;
}
break;
case GSN_SCAN_NEXTREQ:
{
theTrace = TestOrd::TraceAPI;

View file

@ -43,11 +43,6 @@
#include <NdbOut.hpp>
// time out for next scan result (-1 is infinite)
// XXX should change default only if non-trivial interpreted program is used
#define WAITFOR_SCAN_TIMEOUT 120000
/***************************************************************************
* int receiveSCAN_TABREF(NdbApiSignal* aSignal)

View file

@ -470,11 +470,6 @@ int NdbScanOperation::nextResult(bool fetchAllowed)
if(DEBUG_NEXT_RESULT)
ndbout_c("nextResult(%d) idx=%d last=%d", fetchAllowed, idx, last);
if(DEBUG_NEXT_RESULT)
ndbout_c("nextResult(%d) idx=%d last=%d",
fetchAllowed,
idx, last);
/**
* Check next buckets
*/

View file

@ -380,7 +380,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
break;
case NdbReceiver::NDB_SCANRECEIVER:
tCon->theScanningOp->receiver_delivered(tRec);
theWaiter.m_state = NO_WAIT;
theWaiter.m_state = (tWaitState == WAIT_SCAN? NO_WAIT: tWaitState);
break;
default:
goto InvalidSignal;
@ -721,17 +721,13 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
if (tCon->checkMagicNumber() == 0){
tReturnCode = tCon->receiveSCAN_TABREF(aSignal);
if (tReturnCode != -1){
if (tReturnCode != -1 && tWaitState == WAIT_SCAN){
theWaiter.m_state = NO_WAIT;
}
break;
}
goto InvalidSignal;
}
case GSN_SCAN_TABINFO:
{
goto InvalidSignal;
}
case GSN_KEYINFO20: {
tFirstDataPtr = int2void(tFirstData);
if (tFirstDataPtr == 0) goto InvalidSignal;
@ -752,7 +748,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
switch(com){
case 1:
tCon->theScanningOp->receiver_delivered(tRec);
theWaiter.m_state = NO_WAIT;
theWaiter.m_state = (tWaitState == WAIT_SCAN ? NO_WAIT : tWaitState);
break;
case 0:
break;

View file

@ -25,6 +25,7 @@ testOperations \
testRestartGci \
testScan \
testScanInterpreter \
testScanPerf \
testSystemRestart \
testTimeout \
testTransactions \
@ -57,8 +58,9 @@ testNodeRestart_SOURCES = testNodeRestart.cpp
testOIBasic_SOURCES = testOIBasic.cpp
testOperations_SOURCES = testOperations.cpp
testRestartGci_SOURCES = testRestartGci.cpp
testScan_SOURCES = testScan.cpp
testScanInterpreter_SOURCES = testScanInterpreter.cpp
testScan_SOURCES = testScan.cpp ScanFunctions.hpp
testScanInterpreter_SOURCES = testScanInterpreter.cpp ScanFilter.hpp ScanInterpretTest.hpp
testScanPerf_SOURCES = testScanPerf.cpp
testSystemRestart_SOURCES = testSystemRestart.cpp
testTimeout_SOURCES = testTimeout.cpp
testTransactions_SOURCES = testTransactions.cpp

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankCreator
SOURCES = bankCreator.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankMakeGL
SOURCES = bankMakeGL.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankSumAccounts
SOURCES = bankSumAccounts.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankTimer
SOURCES = bankTimer.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankTransactionMaker
SOURCES = bankTransactionMaker.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,8 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = bankValidateAllGLs
SOURCES = bankValidateAllGLs.cpp
BIN_TARGET_LIBS += bank
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,7 +0,0 @@
include .defs.mk
TYPE = ndbapitest
ARCHIVE_TARGET = bank
SOURCES = Bank.cpp BankLoad.cpp
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,9 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = testBank
BIN_TARGET_LIBS += bank
SOURCES = testBank.cpp
include $(NDB_TOP)/Epilogue.mk

View file

@ -1,9 +0,0 @@
include .defs.mk
TYPE = ndbapitest
BIN_TARGET = testScanPerf
SOURCES = testScanPerf.cpp
include $(NDB_TOP)/Epilogue.mk

View file

@ -116,10 +116,14 @@ static ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table)
pthread_mutex_lock(&LOCK_mysql_create_db);
if (!archive_init)
{
archive_init++;
VOID(pthread_mutex_init(&archive_mutex,MY_MUTEX_INIT_FAST));
(void) hash_init(&archive_open_tables,system_charset_info,32,0,0,
(hash_get_key) archive_get_key,0,0);
if (!hash_init(&archive_open_tables,system_charset_info,32,0,0,
(hash_get_key) archive_get_key,0,0))
{
pthread_mutex_unlock(&LOCK_mysql_create_db);
return NULL;
}
archive_init++;
}
pthread_mutex_unlock(&LOCK_mysql_create_db);
}
@ -130,11 +134,10 @@ static ARCHIVE_SHARE *get_share(const char *table_name, TABLE *table)
(byte*) table_name,
length)))
{
if (!(share=(ARCHIVE_SHARE *)
my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
if (!my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
&share, sizeof(*share),
&tmp_name, length+1,
NullS)))
NullS))
{
pthread_mutex_unlock(&archive_mutex);
return NULL;
@ -238,11 +241,7 @@ int ha_archive::open(const char *name, int mode, uint test_if_locked)
int ha_archive::close(void)
{
DBUG_ENTER("ha_archive::close");
int rc= 0;
if (gzclose(archive) == Z_ERRNO)
rc =-1;
rc |= free_share(share);
DBUG_RETURN(rc);
DBUG_RETURN(((gzclose(archive) == Z_ERRNO || free_share(share)) ? -1 : 0));
}
@ -276,12 +275,7 @@ int ha_archive::create(const char *name, TABLE *table_arg, HA_CREATE_INFO *creat
}
version= ARCHIVE_VERSION;
written= gzwrite(archive, &version, sizeof(version));
if (written == 0 || written != sizeof(version))
{
delete_table(name);
DBUG_RETURN(-1);
}
if (gzclose(archive))
if (written != sizeof(version) || gzclose(archive))
{
delete_table(name);
DBUG_RETURN(-1);
@ -305,7 +299,7 @@ int ha_archive::write_row(byte * buf)
update_timestamp(buf+table->timestamp_default_now-1);
written= gzwrite(share->archive_write, buf, table->reclength);
share->dirty= true;
if (written == 0 || written != table->reclength)
if (written != table->reclength)
DBUG_RETURN(-1);
for (Field_blob **field=table->blob_field ; *field ; field++)
@ -315,7 +309,7 @@ int ha_archive::write_row(byte * buf)
(*field)->get_ptr(&ptr);
written= gzwrite(share->archive_write, ptr, (unsigned)size);
if (written == 0 || written != size)
if (written != size)
DBUG_RETURN(-1);
}

View file

@ -5625,8 +5625,11 @@ bool Field_enum::eq_def(Field *field)
if (typelib->count < from_lib->count)
return 0;
for (uint i=0 ; i < from_lib->count ; i++)
if (my_strcasecmp(field_charset,
typelib->type_names[i],from_lib->type_names[i]))
if (my_strnncoll(field_charset,
(const uchar*)typelib->type_names[i],
strlen(typelib->type_names[i]),
(const uchar*)from_lib->type_names[i],
strlen(from_lib->type_names[i])))
return 0;
return 1;
}

View file

@ -4783,8 +4783,8 @@ ha_innobase::external_lock(
trx->n_mysql_tables_in_use--;
prebuilt->mysql_has_locked = FALSE;
auto_inc_counter_for_this_stat = 0;
if (trx->n_tables_locked) {
row_unlock_table_for_mysql(trx);
if (trx->n_lock_table_exp) {
row_unlock_tables_for_mysql(trx);
}
/* If the MySQL lock count drops to zero we know that the current SQL

View file

@ -41,7 +41,10 @@ static const int parallelism= 240;
// Default value for max number of transactions
// createable against NDB from this handler
static const int max_transactions = 256;
static const int max_transactions= 256;
// Default value for prefetch of autoincrement values
static const ha_rows autoincrement_prefetch= 32;
#define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8
@ -286,7 +289,7 @@ int ha_ndbcluster::set_ndb_value(NdbOperation *ndb_op, Field *field,
}
// Blob type
NdbBlob *ndb_blob = ndb_op->getBlobHandle(fieldnr);
NdbBlob *ndb_blob= ndb_op->getBlobHandle(fieldnr);
if (ndb_blob != NULL)
{
if (field->is_null())
@ -832,7 +835,7 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data)
ERR_RETURN(trans->getNdbError());
int res;
if (res= set_primary_key_from_old_data(op, old_data))
if ((res= set_primary_key_from_old_data(op, old_data)))
ERR_RETURN(trans->getNdbError());
// Read all unreferenced non-key field(s)
@ -950,7 +953,7 @@ inline int ha_ndbcluster::next_result(byte *buf)
If this an update or delete, call nextResult with false
to process any records already cached in NdbApi
*/
bool contact_ndb = m_lock.type != TL_WRITE_ALLOW_WRITE;
bool contact_ndb= m_lock.type != TL_WRITE_ALLOW_WRITE;
do {
DBUG_PRINT("info", ("Call nextResult, contact_ndb: %d", contact_ndb));
/*
@ -1328,7 +1331,8 @@ int ha_ndbcluster::write_row(byte *record)
Find out how this is detected!
*/
rows_inserted++;
if ((rows_inserted == rows_to_insert) ||
bulk_insert_not_flushed= true;
if ((rows_to_insert == 1) ||
((rows_inserted % bulk_insert_rows) == 0) ||
uses_blob_value(false) != 0)
{
@ -1336,6 +1340,7 @@ int ha_ndbcluster::write_row(byte *record)
DBUG_PRINT("info", ("Sending inserts to NDB, "\
"rows_inserted:%d, bulk_insert_rows: %d",
(int)rows_inserted, (int)bulk_insert_rows));
bulk_insert_not_flushed= false;
if (trans->execute(NoCommit) != 0)
DBUG_RETURN(ndb_err(trans));
}
@ -1398,38 +1403,34 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
if ((table->primary_key != MAX_KEY) &&
(key_cmp(table->primary_key, old_data, new_data)))
{
DBUG_PRINT("info", ("primary key update, doing pk read+insert+delete"));
int read_res, insert_res, delete_res;
DBUG_PRINT("info", ("primary key update, doing pk read+insert+delete"));
// Get all old fields, since we optimize away fields not in query
int read_res= complemented_pk_read(old_data, new_data);
read_res= complemented_pk_read(old_data, new_data);
if (read_res)
{
DBUG_PRINT("info", ("pk read failed"));
DBUG_RETURN(read_res);
}
// Insert new row
int insert_res= write_row(new_data);
if (!insert_res)
{
// Delete old row
DBUG_PRINT("info", ("insert succeded"));
int delete_res= delete_row(old_data);
if (!delete_res)
{
DBUG_PRINT("info", ("insert+delete succeeded"));
DBUG_RETURN(0);
}
else
{
DBUG_PRINT("info", ("delete failed"));
DBUG_RETURN(delete_row(new_data));
}
}
else
insert_res= write_row(new_data);
if (insert_res)
{
DBUG_PRINT("info", ("insert failed"));
DBUG_RETURN(insert_res);
}
// Delete old row
DBUG_PRINT("info", ("insert succeded"));
delete_res= delete_row(old_data);
if (delete_res)
{
DBUG_PRINT("info", ("delete failed"));
// Undo write_row(new_data)
DBUG_RETURN(delete_row(new_data));
}
DBUG_PRINT("info", ("insert+delete succeeded"));
DBUG_RETURN(0);
}
if (cursor)
@ -1833,7 +1834,7 @@ int ha_ndbcluster::index_next(byte *buf)
{
DBUG_ENTER("index_next");
int error = 1;
int error= 1;
statistic_increment(ha_read_next_count,&LOCK_status);
DBUG_RETURN(next_result(buf));
}
@ -2208,7 +2209,7 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
degrade if too many bytes are inserted, thus it's limited by this
calculation.
*/
const int bytesperbatch = 8192;
const int bytesperbatch= 8192;
bytes= 12 + tab->getRowSizeInBytes() + 4 * tab->getNoOfColumns();
batch= bytesperbatch/bytes;
batch= batch == 0 ? 1 : batch;
@ -2223,10 +2224,25 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows)
*/
int ha_ndbcluster::end_bulk_insert()
{
int error= 0;
DBUG_ENTER("end_bulk_insert");
// Check if last inserts need to be flushed
if (bulk_insert_not_flushed)
{
NdbConnection *trans= m_active_trans;
// Send rows to NDB
DBUG_PRINT("info", ("Sending inserts to NDB, "\
"rows_inserted:%d, bulk_insert_rows: %d",
rows_inserted, bulk_insert_rows));
bulk_insert_not_flushed= false;
if (trans->execute(NoCommit) != 0)
error= ndb_err(trans);
}
rows_inserted= 0;
rows_to_insert= 1;
DBUG_RETURN(0);
DBUG_RETURN(error);
}
@ -2247,7 +2263,7 @@ int ha_ndbcluster::reset()
const char **ha_ndbcluster::bas_ext() const
{ static const char *ext[1] = { NullS }; return ext; }
{ static const char *ext[1]= { NullS }; return ext; }
/*
@ -2751,7 +2767,7 @@ int ha_ndbcluster::create(const char *name,
DBUG_PRINT("info", ("name: %s, type: %u, pack_length: %d",
field->field_name, field->real_type(),
field->pack_length()));
if (my_errno= create_ndb_column(col, field, info))
if ((my_errno= create_ndb_column(col, field, info)))
DBUG_RETURN(my_errno);
tab.addColumn(col);
}
@ -3001,7 +3017,10 @@ longlong ha_ndbcluster::get_auto_increment()
{
DBUG_ENTER("get_auto_increment");
DBUG_PRINT("enter", ("m_tabname: %s", m_tabname));
int cache_size = rows_to_insert ? rows_to_insert : 32;
int cache_size=
(rows_to_insert > autoincrement_prefetch) ?
rows_to_insert
: autoincrement_prefetch;
Uint64 auto_value=
m_ndb->getAutoIncrementValue(m_tabname, cache_size);
DBUG_RETURN((longlong)auto_value);
@ -3026,6 +3045,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
rows_to_insert(1),
rows_inserted(0),
bulk_insert_rows(1024),
bulk_insert_not_flushed(false),
ops_pending(0),
blobs_buffer(0),
blobs_buffer_size(0)
@ -3378,7 +3398,7 @@ void ha_ndbcluster::set_tabname(const char *path_name)
ptr= m_tabname;
while (*ptr != '\0') {
*ptr = tolower(*ptr);
*ptr= tolower(*ptr);
ptr++;
}
#endif
@ -3394,17 +3414,17 @@ ha_ndbcluster::set_tabname(const char *path_name, char * tabname)
char *end, *ptr;
/* Scan name from the end */
end = strend(path_name)-1;
ptr = end;
end= strend(path_name)-1;
ptr= end;
while (ptr >= path_name && *ptr != '\\' && *ptr != '/') {
ptr--;
}
uint name_len = end - ptr;
uint name_len= end - ptr;
memcpy(tabname, ptr + 1, end - ptr);
tabname[name_len] = '\0';
tabname[name_len]= '\0';
#ifdef __WIN__
/* Put to lower case */
ptr = tabname;
ptr= tabname;
while (*ptr != '\0') {
*ptr= tolower(*ptr);
@ -3567,7 +3587,7 @@ static int packfrm(const void *data, uint len,
DBUG_PRINT("enter", ("data: %x, len: %d", data, len));
error= 1;
org_len = len;
org_len= len;
if (my_compress((byte*)data, &org_len, &comp_len))
goto err;
@ -3587,9 +3607,9 @@ static int packfrm(const void *data, uint len,
// Copy frm data into blob, already in machine independent format
memcpy(blob->data, data, org_len);
*pack_data = blob;
*pack_len = blob_len;
error = 0;
*pack_data= blob;
*pack_len= blob_len;
error= 0;
DBUG_PRINT("exit", ("pack_data: %x, pack_len: %d", *pack_data, *pack_len));
err:
@ -3601,7 +3621,7 @@ err:
static int unpackfrm(const void **unpack_data, uint *unpack_len,
const void *pack_data)
{
const frm_blob_struct *blob = (frm_blob_struct*)pack_data;
const frm_blob_struct *blob= (frm_blob_struct*)pack_data;
byte *data;
ulong complen, orglen, ver;
DBUG_ENTER("unpackfrm");
@ -3617,7 +3637,7 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len,
if (ver != 1)
DBUG_RETURN(1);
if (!(data = my_malloc(max(orglen, complen), MYF(MY_WME))))
if (!(data= my_malloc(max(orglen, complen), MYF(MY_WME))))
DBUG_RETURN(2);
memcpy(data, blob->data, complen);
@ -3627,8 +3647,8 @@ static int unpackfrm(const void **unpack_data, uint *unpack_len,
DBUG_RETURN(3);
}
*unpack_data = data;
*unpack_len = complen;
*unpack_data= data;
*unpack_len= complen;
DBUG_PRINT("exit", ("frmdata: %x, len: %d", *unpack_data, *unpack_len));

View file

@ -221,6 +221,7 @@ class ha_ndbcluster: public handler
ha_rows rows_to_insert;
ha_rows rows_inserted;
ha_rows bulk_insert_rows;
bool bulk_insert_not_flushed;
ha_rows ops_pending;
bool blobs_pending;
// memory for blobs in one tuple

View file

@ -62,21 +62,21 @@ static SHOW_COMP_OPTION have_yes= SHOW_OPTION_YES;
struct show_table_type_st sys_table_types[]=
{
{"MyISAM", &have_yes,
"Default type from 3.23 with great performance", DB_TYPE_MYISAM},
"Default engine as of MySQL 3.23 with great performance", DB_TYPE_MYISAM},
{"HEAP", &have_yes,
"Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP},
"Alias for MEMORY", DB_TYPE_HEAP},
{"MEMORY", &have_yes,
"Alias for HEAP", DB_TYPE_HEAP},
"Hash based, stored in memory, useful for temporary tables", DB_TYPE_HEAP},
{"MERGE", &have_yes,
"Collection of identical MyISAM tables", DB_TYPE_MRG_MYISAM},
{"MRG_MYISAM",&have_yes,
"Alias for MERGE", DB_TYPE_MRG_MYISAM},
{"ISAM", &have_isam,
"Obsolete table type; Is replaced by MyISAM", DB_TYPE_ISAM},
"Obsolete storage engine, now replaced by MyISAM", DB_TYPE_ISAM},
{"MRG_ISAM", &have_isam,
"Obsolete table type; Is replaced by MRG_MYISAM", DB_TYPE_MRG_ISAM},
"Obsolete storage engine, now replaced by MERGE", DB_TYPE_MRG_ISAM},
{"InnoDB", &have_innodb,
"Supports transactions, row-level locking and foreign keys", DB_TYPE_INNODB},
"Supports transactions, row-level locking, and foreign keys", DB_TYPE_INNODB},
{"INNOBASE", &have_innodb,
"Alias for INNODB", DB_TYPE_INNODB},
{"BDB", &have_berkeley_db,
@ -84,7 +84,7 @@ struct show_table_type_st sys_table_types[]=
{"BERKELEYDB",&have_berkeley_db,
"Alias for BDB", DB_TYPE_BERKELEY_DB},
{"NDBCLUSTER", &have_ndbcluster,
"Clustered, fault tolerant memory based tables", DB_TYPE_NDBCLUSTER},
"Clustered, fault-tolerant, memory-based tables", DB_TYPE_NDBCLUSTER},
{"NDB", &have_ndbcluster,
"Alias for NDBCLUSTER", DB_TYPE_NDBCLUSTER},
{"EXAMPLE",&have_example_db,

View file

@ -446,7 +446,13 @@ String *Item_func_spatial_collection::val_str(String *str)
}
}
if (str->length() > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto err;
}
null_value = 0;
return str;

View file

@ -266,7 +266,13 @@ String *Item_func_concat::val_str(String *str)
continue;
if (res->length()+res2->length() >
current_thd->variables.max_allowed_packet)
goto null; // Error check
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
current_thd->variables.max_allowed_packet);
goto null;
}
if (res->alloced_length() >= res->length()+res2->length())
{ // Use old buffer
res->append(*res2);
@ -544,7 +550,13 @@ String *Item_func_concat_ws::val_str(String *str)
if (res->length() + sep_str->length() + res2->length() >
current_thd->variables.max_allowed_packet)
goto null; // Error check
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
current_thd->variables.max_allowed_packet);
goto null;
}
if (res->alloced_length() >=
res->length() + sep_str->length() + res2->length())
{ // Use old buffer
@ -801,7 +813,15 @@ redo:
offset= (int) (ptr-res->ptr());
if (res->length()-from_length + to_length >
current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(),
current_thd->variables.max_allowed_packet);
goto null;
}
if (!alloced)
{
alloced=1;
@ -822,7 +842,13 @@ skip:
{
if (res->length()-from_length + to_length >
current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
current_thd->variables.max_allowed_packet);
goto null;
}
if (!alloced)
{
alloced=1;
@ -882,7 +908,13 @@ String *Item_func_insert::val_str(String *str)
length=res->length()-start;
if (res->length() - length + res2->length() >
current_thd->variables.max_allowed_packet)
goto null; // OOM check
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto null;
}
res=copy_if_not_alloced(str,res,res->length());
res->replace(start,length,*res2);
return res;
@ -1934,7 +1966,13 @@ String *Item_func_repeat::val_str(String *str)
length=res->length();
// Safe length check
if (length > current_thd->variables.max_allowed_packet/count)
goto err; // Probably an error
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto err;
}
tot_length= length*(uint) count;
if (!(res= alloc_buffer(res,str,&tmp_value,tot_length)))
goto err;
@ -1999,8 +2037,15 @@ String *Item_func_rpad::val_str(String *str)
return (res);
}
pad_char_length= rpad->numchars();
if ((ulong) byte_count > current_thd->variables.max_allowed_packet ||
args[2]->null_value || !pad_char_length)
if ((ulong) byte_count > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto err;
}
if(args[2]->null_value || !pad_char_length)
goto err;
res_byte_length= res->length(); /* Must be done before alloc_buffer */
if (!(res= alloc_buffer(res,str,&tmp_value,byte_count)))
@ -2079,8 +2124,16 @@ String *Item_func_lpad::val_str(String *str)
pad_char_length= pad->numchars();
byte_count= count * collation.collation->mbmaxlen;
if (byte_count > current_thd->variables.max_allowed_packet ||
args[2]->null_value || !pad_char_length || str->alloc(byte_count))
if (byte_count > current_thd->variables.max_allowed_packet)
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto err;
}
if (args[2]->null_value || !pad_char_length || str->alloc(byte_count))
goto err;
str->length(0);
@ -2368,7 +2421,10 @@ String *Item_load_file::val_str(String *str)
}
if (stat_info.st_size > (long) current_thd->variables.max_allowed_packet)
{
/* my_error(ER_TOO_LONG_STRING, MYF(0), file_name->c_ptr()); */
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), current_thd->variables.max_allowed_packet);
goto err;
}
if (tmp_value.alloc(stat_info.st_size))

View file

@ -1702,6 +1702,11 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
thd->query_length= 0; // Should not be needed
thd->query_error= 0;
clear_all_errors(thd, rli);
/*
Usually mysql_init_query() is called by mysql_parse(), but we need it here
as the present method does not call mysql_parse().
*/
mysql_init_query(thd, 0, 0);
if (!use_rli_only_for_errors)
{
#if MYSQL_VERSION_ID < 50000
@ -1730,6 +1735,13 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
VOID(pthread_mutex_lock(&LOCK_thread_count));
thd->query_id = query_id++;
VOID(pthread_mutex_unlock(&LOCK_thread_count));
/*
Initing thd->row_count is not necessary in theory as this variable has no
influence in the case of the slave SQL thread (it is used to generate a
"data truncated" warning but which is absorbed and never gets to the
error log); still we init it to avoid a Valgrind message.
*/
mysql_reset_errors(thd);
TABLE_LIST tables;
bzero((char*) &tables,sizeof(tables));

View file

@ -434,7 +434,7 @@ bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool is_update_query(enum enum_sql_command command);
bool alloc_query(THD *thd, char *packet, ulong packet_length);
void mysql_init_select(LEX *lex);
void mysql_init_query(THD *thd);
void mysql_init_query(THD *thd, uchar *buf, uint length);
bool mysql_new_select(LEX *lex, bool move_down);
void create_select_for_variable(const char *var_name);
void mysql_init_multi_delete(LEX *lex);

View file

@ -4523,7 +4523,7 @@ replicating a LOAD DATA INFILE command.",
0, 0, 0, 0, 0, 0},
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-warnings", 'W', "Log some not critical warnings to the log file.",
{"log-warnings", 'W', "Log some not critical warnings to the log file. Use this option twice, or --log-warnings=2 if you want 'Aborted connections' warning to be logged in the error log file.",
(gptr*) &global_system_variables.log_warnings,
(gptr*) &max_system_variables.log_warnings, 0, GET_ULONG, OPT_ARG, 1, 0, 0,
0, 0, 0},

View file

@ -313,3 +313,4 @@ character-set=latin2
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -307,3 +307,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -315,3 +315,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -304,3 +304,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -309,3 +309,4 @@ character-set=latin7
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -304,3 +304,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -316,3 +316,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -304,3 +304,4 @@ character-set=greek
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -306,3 +306,4 @@ character-set=latin2
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -304,3 +304,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -306,3 +306,4 @@ character-set=ujis
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -304,3 +304,4 @@ character-set=euckr
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -306,3 +306,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -306,3 +306,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -308,3 +308,4 @@ character-set=latin2
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -305,3 +305,4 @@ character-set=latin1
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -308,3 +308,4 @@ character-set=latin2
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

View file

@ -306,3 +306,4 @@ character-set=koi8r
"Unknown or incorrect time zone: '%-.64s'",
"Invalid TIMESTAMP value in column '%s' at row %ld",
"Invalid %s character string: '%.64s'",
"Result of %s() was larger than max_allowed_packet (%d) - truncated"

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