mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Merge mskold@build.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1-ndb ndb/test/ndbapi/Makefile.am: Auto merged sql/handler.cc: Auto merged
This commit is contained in:
commit
5fbf11ba9b
198 changed files with 6591 additions and 17405 deletions
|
@ -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
|
||||
|
||||
|
|
80
BUILD/compile-hpux11-parisc2-aCC
Executable file
80
BUILD/compile-hpux11-parisc2-aCC
Executable 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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
372
acconfig.h
372
acconfig.h
|
@ -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). */
|
98
acinclude.m4
98
acinclude.m4
|
@ -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]*)
|
||||
|
|
260
configure.in
260
configure.in
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 +=
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
19
mysql-test/r/create_select_tmp.result
Normal file
19
mysql-test/r/create_select_tmp.result
Normal 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
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ';
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ';
|
||||
|
|
|
@ -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 ';
|
||||
|
|
|
@ -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 ';
|
||||
|
|
10
mysql-test/r/rpl_drop.result
Normal file
10
mysql-test/r/rpl_drop.result
Normal 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'
|
|
@ -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
|
||||
|
|
29
mysql-test/t/create_select_tmp.test
Normal file
29
mysql-test/t/create_select_tmp.test
Normal 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;
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
|
12
mysql-test/t/rpl_drop.test
Normal file
12
mysql-test/t/rpl_drop.test
Normal 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;
|
|
@ -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
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@
|
|||
#include <NdbSleep.h>
|
||||
#include <new>
|
||||
|
||||
#include <signal.h> // For process signals
|
||||
|
||||
extern "C" {
|
||||
extern void (* ndb_new_handler)();
|
||||
}
|
||||
|
|
|
@ -57,8 +57,8 @@ 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
|
||||
testSystemRestart_SOURCES = testSystemRestart.cpp
|
||||
testTimeout_SOURCES = testTimeout.cpp
|
||||
testTransactions_SOURCES = testTransactions.cpp
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankCreator
|
||||
SOURCES = bankCreator.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankMakeGL
|
||||
SOURCES = bankMakeGL.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankSumAccounts
|
||||
SOURCES = bankSumAccounts.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankTimer
|
||||
SOURCES = bankTimer.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankTransactionMaker
|
||||
SOURCES = bankTransactionMaker.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,8 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
BIN_TARGET = bankValidateAllGLs
|
||||
SOURCES = bankValidateAllGLs.cpp
|
||||
BIN_TARGET_LIBS += bank
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,7 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
ARCHIVE_TARGET = bank
|
||||
SOURCES = Bank.cpp BankLoad.cpp
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -1,9 +0,0 @@
|
|||
include .defs.mk
|
||||
|
||||
TYPE = ndbapitest
|
||||
|
||||
BIN_TARGET = testBank
|
||||
BIN_TARGET_LIBS += bank
|
||||
SOURCES = testBank.cpp
|
||||
|
||||
include $(NDB_TOP)/Epilogue.mk
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -310,3 +310,4 @@ character-set=cp1250
|
|||
"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"
|
||||
|
|
|
@ -312,3 +312,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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -309,3 +309,4 @@ character-set=koi8u
|
|||
"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"
|
||||
|
|
|
@ -64,7 +64,7 @@ static DYNAMIC_ARRAY acl_wild_hosts;
|
|||
static hash_filo *acl_cache;
|
||||
static uint grant_version=0;
|
||||
static uint priv_version=0; /* Version of priv tables. incremented by acl_init */
|
||||
static ulong get_access(TABLE *form,uint fieldnr);
|
||||
static ulong get_access(TABLE *form,uint fieldnr, uint *next_field=0);
|
||||
static int acl_compare(ACL_ACCESS *a,ACL_ACCESS *b);
|
||||
static ulong get_sort(uint count,...);
|
||||
static void init_check_host(void);
|
||||
|
@ -299,13 +299,14 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
}
|
||||
else // password is correct
|
||||
{
|
||||
user.access= get_access(table,3) & GLOBAL_ACLS;
|
||||
uint next_field;
|
||||
user.access= get_access(table,3,&next_field) & GLOBAL_ACLS;
|
||||
user.sort= get_sort(2,user.host.hostname,user.user);
|
||||
user.hostname_length= (user.host.hostname ?
|
||||
(uint) strlen(user.host.hostname) : 0);
|
||||
if (table->fields >= 31) /* Starting from 4.0.2 we have more fields */
|
||||
{
|
||||
char *ssl_type=get_field(&mem, table->field[24]);
|
||||
char *ssl_type=get_field(&mem, table->field[next_field++]);
|
||||
if (!ssl_type)
|
||||
user.ssl_type=SSL_TYPE_NONE;
|
||||
else if (!strcmp(ssl_type, "ANY"))
|
||||
|
@ -315,16 +316,16 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||
else /* !strcmp(ssl_type, "SPECIFIED") */
|
||||
user.ssl_type=SSL_TYPE_SPECIFIED;
|
||||
|
||||
user.ssl_cipher= get_field(&mem, table->field[25]);
|
||||
user.x509_issuer= get_field(&mem, table->field[26]);
|
||||
user.x509_subject= get_field(&mem, table->field[27]);
|
||||
user.ssl_cipher= get_field(&mem, table->field[next_field++]);
|
||||
user.x509_issuer= get_field(&mem, table->field[next_field++]);
|
||||
user.x509_subject= get_field(&mem, table->field[next_field++]);
|
||||
|
||||
char *ptr = get_field(&mem, table->field[28]);
|
||||
user.user_resource.questions=atoi(ptr);
|
||||
ptr = get_field(&mem, table->field[29]);
|
||||
user.user_resource.updates=atoi(ptr);
|
||||
ptr = get_field(&mem, table->field[30]);
|
||||
user.user_resource.connections=atoi(ptr);
|
||||
char *ptr = get_field(&mem, table->field[next_field++]);
|
||||
user.user_resource.questions=ptr ? atoi(ptr) : 0;
|
||||
ptr = get_field(&mem, table->field[next_field++]);
|
||||
user.user_resource.updates=ptr ? atoi(ptr) : 0;
|
||||
ptr = get_field(&mem, table->field[next_field++]);
|
||||
user.user_resource.connections=ptr ? atoi(ptr) : 0;
|
||||
if (user.user_resource.questions || user.user_resource.updates ||
|
||||
user.user_resource.connections)
|
||||
mqh_used=1;
|
||||
|
@ -489,11 +490,24 @@ void acl_reload(THD *thd)
|
|||
|
||||
/*
|
||||
Get all access bits from table after fieldnr
|
||||
We know that the access privileges ends when there is no more fields
|
||||
or the field is not an enum with two elements.
|
||||
|
||||
IMPLEMENTATION
|
||||
We know that the access privileges ends when there is no more fields
|
||||
or the field is not an enum with two elements.
|
||||
|
||||
SYNOPSIS
|
||||
get_access()
|
||||
form an open table to read privileges from.
|
||||
The record should be already read in table->record[0]
|
||||
fieldnr number of the first privilege (that is ENUM('N','Y') field
|
||||
next_field on return - number of the field next to the last ENUM
|
||||
(unless next_field == 0)
|
||||
|
||||
RETURN VALUE
|
||||
privilege mask
|
||||
*/
|
||||
|
||||
static ulong get_access(TABLE *form, uint fieldnr)
|
||||
static ulong get_access(TABLE *form, uint fieldnr, uint *next_field)
|
||||
{
|
||||
ulong access_bits=0,bit;
|
||||
char buff[2];
|
||||
|
@ -503,12 +517,14 @@ static ulong get_access(TABLE *form, uint fieldnr)
|
|||
for (pos=form->field+fieldnr, bit=1;
|
||||
*pos && (*pos)->real_type() == FIELD_TYPE_ENUM &&
|
||||
((Field_enum*) (*pos))->typelib->count == 2 ;
|
||||
pos++ , bit<<=1)
|
||||
pos++, fieldnr++, bit<<=1)
|
||||
{
|
||||
(*pos)->val_str(&res);
|
||||
if (my_toupper(&my_charset_latin1, res[0]) == 'Y')
|
||||
access_bits|= bit;
|
||||
}
|
||||
if (next_field)
|
||||
*next_field=fieldnr;
|
||||
return access_bits;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,8 @@ void del_dbopt(const char *path)
|
|||
{
|
||||
my_dbopt_t *opt;
|
||||
rw_wrlock(&LOCK_dboptions);
|
||||
if ((opt= (my_dbopt_t *)hash_search(&dboptions, path, strlen(path))))
|
||||
if ((opt= (my_dbopt_t *)hash_search(&dboptions, (const byte*) path,
|
||||
strlen(path))))
|
||||
hash_delete(&dboptions, (byte*) opt);
|
||||
rw_unlock(&LOCK_dboptions);
|
||||
}
|
||||
|
@ -326,6 +327,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
|
|||
{
|
||||
sql_print_error("Error while loading database options: '%s':",path);
|
||||
sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
|
||||
create->default_table_charset= default_charset_info;
|
||||
}
|
||||
}
|
||||
else if (!strncmp(buf,"default-collation", (pos-buf)))
|
||||
|
@ -335,6 +337,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
|
|||
{
|
||||
sql_print_error("Error while loading database options: '%s':",path);
|
||||
sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
|
||||
create->default_table_charset= default_charset_info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1696,9 +1696,13 @@ void select_create::abort()
|
|||
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
|
||||
enum db_type table_type=table->db_type;
|
||||
if (!table->tmp_table)
|
||||
{
|
||||
hash_delete(&open_cache,(byte*) table);
|
||||
if (!create_info->table_existed)
|
||||
quick_rm_table(table_type,db,name);
|
||||
if (!create_info->table_existed)
|
||||
quick_rm_table(table_type, db, name);
|
||||
}
|
||||
else if (!create_info->table_existed)
|
||||
close_temporary_table(thd, db, name);
|
||||
table=0;
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
|
|
|
@ -104,14 +104,13 @@ void lex_free(void)
|
|||
(We already do too much here)
|
||||
*/
|
||||
|
||||
LEX *lex_start(THD *thd, uchar *buf,uint length)
|
||||
void lex_start(THD *thd, uchar *buf,uint length)
|
||||
{
|
||||
LEX *lex= thd->lex;
|
||||
lex->thd= thd;
|
||||
lex->next_state=MY_LEX_START;
|
||||
lex->end_of_query=(lex->ptr=buf)+length;
|
||||
lex->yylineno = 1;
|
||||
lex->select_lex.parsing_place= SELECT_LEX_NODE::NO_MATTER;
|
||||
lex->in_comment=0;
|
||||
lex->length=0;
|
||||
lex->select_lex.in_sum_expr=0;
|
||||
|
@ -125,7 +124,6 @@ LEX *lex_start(THD *thd, uchar *buf,uint length)
|
|||
lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
|
||||
lex->sql_command=SQLCOM_END;
|
||||
lex->duplicates= DUP_ERROR;
|
||||
return lex;
|
||||
}
|
||||
|
||||
void lex_end(LEX *lex)
|
||||
|
@ -1009,6 +1007,7 @@ void st_select_lex::init_query()
|
|||
select_n_having_items= 0;
|
||||
prep_where= 0;
|
||||
subquery_in_having= explicit_limit= 0;
|
||||
parsing_place= SELECT_LEX_NODE::NO_MATTER;
|
||||
}
|
||||
|
||||
void st_select_lex::init_select()
|
||||
|
@ -1022,9 +1021,9 @@ void st_select_lex::init_select()
|
|||
in_sum_expr= with_wild= 0;
|
||||
options= 0;
|
||||
braces= 0;
|
||||
when_list.empty();
|
||||
when_list.empty();
|
||||
expr_list.empty();
|
||||
interval_list.empty();
|
||||
interval_list.empty();
|
||||
use_index.empty();
|
||||
ftfunc_list_alloc.empty();
|
||||
ftfunc_list= &ftfunc_list_alloc;
|
||||
|
@ -1035,7 +1034,6 @@ void st_select_lex::init_select()
|
|||
select_limit= HA_POS_ERROR;
|
||||
offset_limit= 0;
|
||||
with_sum_func= 0;
|
||||
parsing_place= SELECT_LEX_NODE::NO_MATTER;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1055,7 +1053,7 @@ void st_select_lex_node::include_down(st_select_lex_node *upper)
|
|||
|
||||
/*
|
||||
include on level down (but do not link)
|
||||
|
||||
|
||||
SYNOPSYS
|
||||
st_select_lex_node::include_standalone()
|
||||
upper - reference on node underr which this node should be included
|
||||
|
|
|
@ -375,7 +375,7 @@ public:
|
|||
ulong init_prepare_fake_select_lex(THD *thd);
|
||||
int change_result(select_subselect *result, select_subselect *old_result);
|
||||
|
||||
friend void mysql_init_query(THD *thd);
|
||||
friend void mysql_init_query(THD *thd, uchar *buf, uint length);
|
||||
friend int subselect_union_engine::exec();
|
||||
private:
|
||||
bool create_total_list_n_last_return(THD *thd, st_lex *lex,
|
||||
|
@ -514,7 +514,7 @@ public:
|
|||
|
||||
bool test_limit();
|
||||
|
||||
friend void mysql_init_query(THD *thd);
|
||||
friend void mysql_init_query(THD *thd, uchar *buf, uint length);
|
||||
st_select_lex() {}
|
||||
void make_empty_select()
|
||||
{
|
||||
|
@ -664,7 +664,7 @@ typedef struct st_lex
|
|||
|
||||
void lex_init(void);
|
||||
void lex_free(void);
|
||||
LEX *lex_start(THD *thd, uchar *buf,uint length);
|
||||
void lex_start(THD *thd, uchar *buf,uint length);
|
||||
void lex_end(LEX *lex);
|
||||
|
||||
extern pthread_key(LEX*,THR_LEX);
|
||||
|
|
|
@ -310,6 +310,11 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||
{
|
||||
if (transactional_table)
|
||||
ha_autocommit_or_rollback(thd,error);
|
||||
|
||||
if (read_file_from_client)
|
||||
while (!read_info.next_line())
|
||||
;
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
|
|
|
@ -3850,7 +3850,7 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
|
|||
****************************************************************************/
|
||||
|
||||
void
|
||||
mysql_init_query(THD *thd)
|
||||
mysql_init_query(THD *thd, uchar *buf, uint length)
|
||||
{
|
||||
DBUG_ENTER("mysql_init_query");
|
||||
LEX *lex= thd->lex;
|
||||
|
@ -3875,6 +3875,7 @@ mysql_init_query(THD *thd)
|
|||
lex->lock_option= TL_READ;
|
||||
lex->found_colon= 0;
|
||||
lex->safe_to_cache_query= 1;
|
||||
lex_start(thd, buf, length);
|
||||
thd->select_number= lex->select_lex.select_number= 1;
|
||||
thd->free_list= 0;
|
||||
thd->total_warn_count=0; // Warnings for this query
|
||||
|
@ -4012,10 +4013,10 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
|
|||
{
|
||||
DBUG_ENTER("mysql_parse");
|
||||
|
||||
mysql_init_query(thd);
|
||||
mysql_init_query(thd, (uchar*) inBuf, length);
|
||||
if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
|
||||
{
|
||||
LEX *lex=lex_start(thd, (uchar*) inBuf, length);
|
||||
LEX *lex= thd->lex;
|
||||
if (!yyparse((void *)thd) && ! thd->is_fatal_error)
|
||||
{
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
|
@ -4062,11 +4063,10 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
|
|||
|
||||
bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
|
||||
{
|
||||
LEX *lex;
|
||||
LEX *lex= thd->lex;
|
||||
bool error= 0;
|
||||
|
||||
mysql_init_query(thd);
|
||||
lex= lex_start(thd, (uchar*) inBuf, length);
|
||||
mysql_init_query(thd, (uchar*) inBuf, length);
|
||||
if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
|
||||
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
|
||||
error= 1; /* Ignore question */
|
||||
|
|
|
@ -1613,8 +1613,8 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
|
|||
mysql_log.write(thd, COM_PREPARE, "%s", packet);
|
||||
|
||||
thd->current_statement= stmt;
|
||||
lex= lex_start(thd, (uchar *) thd->query, thd->query_length);
|
||||
mysql_init_query(thd);
|
||||
mysql_init_query(thd, (uchar *) thd->query, thd->query_length);
|
||||
lex= thd->lex;
|
||||
lex->safe_to_cache_query= 0;
|
||||
|
||||
error= yyparse((void *)thd) || thd->is_fatal_error ||
|
||||
|
@ -1671,7 +1671,10 @@ static void reset_stmt_for_execute(Prepared_statement *stmt)
|
|||
Copy WHERE clause pointers to avoid damaging they by optimisation
|
||||
*/
|
||||
if (sl->prep_where)
|
||||
{
|
||||
sl->where= sl->prep_where->copy_andor_structure(thd);
|
||||
sl->where->cleanup();
|
||||
}
|
||||
DBUG_ASSERT(sl->join == 0);
|
||||
ORDER *order;
|
||||
/* Fix GROUP list */
|
||||
|
|
|
@ -8000,7 +8000,7 @@ find_order_in_list(THD *thd, Item **ref_pointer_array,
|
|||
Item *itemptr=*order->item;
|
||||
if (itemptr->type() == Item::INT_ITEM)
|
||||
{ /* Order by position */
|
||||
uint count= (uint) ((Item_int*)itemptr)->value;
|
||||
uint count= itemptr->val_int();
|
||||
if (!count || count > fields.elements)
|
||||
{
|
||||
my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),
|
||||
|
|
260
zlib/ChangeLog
260
zlib/ChangeLog
|
@ -1,5 +1,251 @@
|
|||
|
||||
ChangeLog file for zlib
|
||||
ChangeLog file for zlib
|
||||
Changes in port for MySQL (19 July 2004)
|
||||
- removed contrib, nt, os2, amiga, directories and some other files not used
|
||||
in MySQL distribution. If you are working on porting MySQL to one of rare
|
||||
platforms, you might find worth looking at the original zlib distribution
|
||||
and using appropriate Makefiles/project files from it.
|
||||
|
||||
Changes in 1.2.1 (17 November 2003)
|
||||
- Remove a tab in contrib/gzappend/gzappend.c
|
||||
- Update some interfaces in contrib for new zlib functions
|
||||
- Update zlib version number in some contrib entries
|
||||
- Add Windows CE definition for ptrdiff_t in zutil.h [Mai, Truta]
|
||||
- Support shared libraries on Hurd and KFreeBSD [Brown]
|
||||
- Fix error in NO_DIVIDE option of adler32.c
|
||||
|
||||
Changes in 1.2.0.8 (4 November 2003)
|
||||
- Update version in contrib/delphi/ZLib.pas and contrib/pascal/zlibpas.pas
|
||||
- Add experimental NO_DIVIDE #define in adler32.c
|
||||
- Possibly faster on some processors (let me know if it is)
|
||||
- Correct Z_BLOCK to not return on first inflate call if no wrap
|
||||
- Fix strm->data_type on inflate() return to correctly indicate EOB
|
||||
- Add deflatePrime() function for appending in the middle of a byte
|
||||
- Add contrib/gzappend for an example of appending to a stream
|
||||
- Update win32/DLL_FAQ.txt [Truta]
|
||||
- Delete Turbo C comment in README [Truta]
|
||||
- Improve some indentation in zconf.h [Truta]
|
||||
- Fix infinite loop on bad input in configure script [Church]
|
||||
- Fix gzeof() for concatenated gzip files [Johnson]
|
||||
- Add example to contrib/visual-basic.txt [Michael B.]
|
||||
- Add -p to mkdir's in Makefile.in [vda]
|
||||
- Fix configure to properly detect presence or lack of printf functions
|
||||
- Add AS400 support [Monnerat]
|
||||
- Add a little Cygwin support [Wilson]
|
||||
|
||||
Changes in 1.2.0.7 (21 September 2003)
|
||||
- Correct some debug formats in contrib/infback9
|
||||
- Cast a type in a debug statement in trees.c
|
||||
- Change search and replace delimiter in configure from % to # [Beebe]
|
||||
- Update contrib/untgz to 0.2 with various fixes [Truta]
|
||||
- Add build support for Amiga [Nikl]
|
||||
- Remove some directories in old that have been updated to 1.2
|
||||
- Add dylib building for Mac OS X in configure and Makefile.in
|
||||
- Remove old distribution stuff from Makefile
|
||||
- Update README to point to DLL_FAQ.txt, and add comment on Mac OS X
|
||||
- Update links in README
|
||||
|
||||
Changes in 1.2.0.6 (13 September 2003)
|
||||
- Minor FAQ updates
|
||||
- Update contrib/minizip to 1.00 [Vollant]
|
||||
- Remove test of gz functions in example.c when GZ_COMPRESS defined [Truta]
|
||||
- Update POSTINC comment for 68060 [Nikl]
|
||||
- Add contrib/infback9 with deflate64 decoding (unsupported)
|
||||
- For MVS define NO_vsnprintf and undefine FAR [van Burik]
|
||||
- Add pragma for fdopen on MVS [van Burik]
|
||||
|
||||
Changes in 1.2.0.5 (8 September 2003)
|
||||
- Add OF to inflateBackEnd() declaration in zlib.h
|
||||
- Remember start when using gzdopen in the middle of a file
|
||||
- Use internal off_t counters in gz* functions to properly handle seeks
|
||||
- Perform more rigorous check for distance-too-far in inffast.c
|
||||
- Add Z_BLOCK flush option to return from inflate at block boundary
|
||||
- Set strm->data_type on return from inflate
|
||||
- Indicate bits unused, if at block boundary, and if in last block
|
||||
- Replace size_t with ptrdiff_t in crc32.c, and check for correct size
|
||||
- Add condition so old NO_DEFLATE define still works for compatibility
|
||||
- FAQ update regarding the Windows DLL [Truta]
|
||||
- INDEX update: add qnx entry, remove aix entry [Truta]
|
||||
- Install zlib.3 into mandir [Wilson]
|
||||
- Move contrib/zlib_dll_FAQ.txt to win32/DLL_FAQ.txt; update [Truta]
|
||||
- Adapt the zlib interface to the new DLL convention guidelines [Truta]
|
||||
- Introduce ZLIB_WINAPI macro to allow the export of functions using
|
||||
the WINAPI calling convention, for Visual Basic [Vollant, Truta]
|
||||
- Update msdos and win32 scripts and makefiles [Truta]
|
||||
- Export symbols by name, not by ordinal, in win32/zlib.def [Truta]
|
||||
- Add contrib/ada [Anisimkov]
|
||||
- Move asm files from contrib/vstudio/vc70_32 to contrib/asm386 [Truta]
|
||||
- Rename contrib/asm386 to contrib/masmx86 [Truta, Vollant]
|
||||
- Add contrib/masm686 [Truta]
|
||||
- Fix offsets in contrib/inflate86 and contrib/masmx86/inffas32.asm
|
||||
[Truta, Vollant]
|
||||
- Update contrib/delphi; rename to contrib/pascal; add example [Truta]
|
||||
- Remove contrib/delphi2; add a new contrib/delphi [Truta]
|
||||
- Avoid inclusion of the nonstandard <memory.h> in contrib/iostream,
|
||||
and fix some method prototypes [Truta]
|
||||
- Fix the ZCR_SEED2 constant to avoid warnings in contrib/minizip
|
||||
[Truta]
|
||||
- Avoid the use of backslash (\) in contrib/minizip [Vollant]
|
||||
- Fix file time handling in contrib/untgz; update makefiles [Truta]
|
||||
- Update contrib/vstudio/vc70_32 to comply with the new DLL guidelines
|
||||
[Vollant]
|
||||
- Remove contrib/vstudio/vc15_16 [Vollant]
|
||||
- Rename contrib/vstudio/vc70_32 to contrib/vstudio/vc7 [Truta]
|
||||
- Update README.contrib [Truta]
|
||||
- Invert the assignment order of match_head and s->prev[...] in
|
||||
INSERT_STRING [Truta]
|
||||
- Compare TOO_FAR with 32767 instead of 32768, to avoid 16-bit warnings
|
||||
[Truta]
|
||||
- Compare function pointers with 0, not with NULL or Z_NULL [Truta]
|
||||
- Fix prototype of syncsearch in inflate.c [Truta]
|
||||
- Introduce ASMINF macro to be enabled when using an ASM implementation
|
||||
of inflate_fast [Truta]
|
||||
- Change NO_DEFLATE to NO_GZCOMPRESS [Truta]
|
||||
- Modify test_gzio in example.c to take a single file name as a
|
||||
parameter [Truta]
|
||||
- Exit the example.c program if gzopen fails [Truta]
|
||||
- Add type casts around strlen in example.c [Truta]
|
||||
- Remove casting to sizeof in minigzip.c; give a proper type
|
||||
to the variable compared with SUFFIX_LEN [Truta]
|
||||
- Update definitions of STDC and STDC99 in zconf.h [Truta]
|
||||
- Synchronize zconf.h with the new Windows DLL interface [Truta]
|
||||
- Use SYS16BIT instead of __32BIT__ to distinguish between
|
||||
16- and 32-bit platforms [Truta]
|
||||
- Use far memory allocators in small 16-bit memory models for
|
||||
Turbo C [Truta]
|
||||
- Add info about the use of ASMV, ASMINF and ZLIB_WINAPI in
|
||||
zlibCompileFlags [Truta]
|
||||
- Cygwin has vsnprintf [Wilson]
|
||||
- In Windows16, OS_CODE is 0, as in MSDOS [Truta]
|
||||
- In Cygwin, OS_CODE is 3 (Unix), not 11 (Windows32) [Wilson]
|
||||
|
||||
Changes in 1.2.0.4 (10 August 2003)
|
||||
- Minor FAQ updates
|
||||
- Be more strict when checking inflateInit2's windowBits parameter
|
||||
- Change NO_GUNZIP compile option to NO_GZIP to cover deflate as well
|
||||
- Add gzip wrapper option to deflateInit2 using windowBits
|
||||
- Add updated QNX rule in configure and qnx directory [Bonnefoy]
|
||||
- Make inflate distance-too-far checks more rigorous
|
||||
- Clean up FAR usage in inflate
|
||||
- Add casting to sizeof() in gzio.c and minigzip.c
|
||||
|
||||
Changes in 1.2.0.3 (19 July 2003)
|
||||
- Fix silly error in gzungetc() implementation [Vollant]
|
||||
- Update contrib/minizip and contrib/vstudio [Vollant]
|
||||
- Fix printf format in example.c
|
||||
- Correct cdecl support in zconf.in.h [Anisimkov]
|
||||
- Minor FAQ updates
|
||||
|
||||
Changes in 1.2.0.2 (13 July 2003)
|
||||
- Add ZLIB_VERNUM in zlib.h for numerical preprocessor comparisons
|
||||
- Attempt to avoid warnings in crc32.c for pointer-int conversion
|
||||
- Add AIX to configure, remove aix directory [Bakker]
|
||||
- Add some casts to minigzip.c
|
||||
- Improve checking after insecure sprintf() or vsprintf() calls
|
||||
- Remove #elif's from crc32.c
|
||||
- Change leave label to inf_leave in inflate.c and infback.c to avoid
|
||||
library conflicts
|
||||
- Remove inflate gzip decoding by default--only enable gzip decoding by
|
||||
special request for stricter backward compatibility
|
||||
- Add zlibCompileFlags() function to return compilation information
|
||||
- More typecasting in deflate.c to avoid warnings
|
||||
- Remove leading underscore from _Capital #defines [Truta]
|
||||
- Fix configure to link shared library when testing
|
||||
- Add some Windows CE target adjustments [Mai]
|
||||
- Remove #define ZLIB_DLL in zconf.h [Vollant]
|
||||
- Add zlib.3 [Rodgers]
|
||||
- Update RFC URL in deflate.c and algorithm.txt [Mai]
|
||||
- Add zlib_dll_FAQ.txt to contrib [Truta]
|
||||
- Add UL to some constants [Truta]
|
||||
- Update minizip and vstudio [Vollant]
|
||||
- Remove vestigial NEED_DUMMY_RETURN from zconf.in.h
|
||||
- Expand use of NO_DUMMY_DECL to avoid all dummy structures
|
||||
- Added iostream3 to contrib [Schwardt]
|
||||
- Replace rewind() with fseek() for WinCE [Truta]
|
||||
- Improve setting of zlib format compression level flags
|
||||
- Report 0 for huffman and rle strategies and for level == 0 or 1
|
||||
- Report 2 only for level == 6
|
||||
- Only deal with 64K limit when necessary at compile time [Truta]
|
||||
- Allow TOO_FAR check to be turned off at compile time [Truta]
|
||||
- Add gzclearerr() function [Souza]
|
||||
- Add gzungetc() function
|
||||
|
||||
Changes in 1.2.0.1 (17 March 2003)
|
||||
- Add Z_RLE strategy for run-length encoding [Truta]
|
||||
- When Z_RLE requested, restrict matches to distance one
|
||||
- Update zlib.h, minigzip.c, gzopen(), gzdopen() for Z_RLE
|
||||
- Correct FASTEST compilation to allow level == 0
|
||||
- Clean up what gets compiled for FASTEST
|
||||
- Incorporate changes to zconf.in.h [Vollant]
|
||||
- Refine detection of Turbo C need for dummy returns
|
||||
- Refine ZLIB_DLL compilation
|
||||
- Include additional header file on VMS for off_t typedef
|
||||
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
|
||||
- Add some casts in inffast.c
|
||||
- Enchance comments in zlib.h on what happens if gzprintf() tries to
|
||||
write more than 4095 bytes before compression
|
||||
- Remove unused state from inflateBackEnd()
|
||||
- Remove exit(0) from minigzip.c, example.c
|
||||
- Get rid of all those darn tabs
|
||||
- Add "check" target to Makefile.in that does the same thing as "test"
|
||||
- Add "mostlyclean" and "maintainer-clean" targets to Makefile.in
|
||||
- Update contrib/inflate86 [Anderson]
|
||||
- Update contrib/testzlib, contrib/vstudio, contrib/minizip [Vollant]
|
||||
- Add msdos and win32 directories with makefiles [Truta]
|
||||
- More additions and improvements to the FAQ
|
||||
|
||||
Changes in 1.2.0 (9 March 2003)
|
||||
- New and improved inflate code
|
||||
- About 20% faster
|
||||
- Does not allocate 32K window unless and until needed
|
||||
- Automatically detects and decompresses gzip streams
|
||||
- Raw inflate no longer needs an extra dummy byte at end
|
||||
- Added inflateBack functions using a callback interface--even faster
|
||||
than inflate, useful for file utilities (gzip, zip)
|
||||
- Added inflateCopy() function to record state for random access on
|
||||
externally generated deflate streams (e.g. in gzip files)
|
||||
- More readable code (I hope)
|
||||
- New and improved crc32()
|
||||
- About 50% faster, thanks to suggestions from Rodney Brown
|
||||
- Add deflateBound() and compressBound() functions
|
||||
- Fix memory leak in deflateInit2()
|
||||
- Permit setting dictionary for raw deflate (for parallel deflate)
|
||||
- Fix const declaration for gzwrite()
|
||||
- Check for some malloc() failures in gzio.c
|
||||
- Fix bug in gzopen() on single-byte file 0x1f
|
||||
- Fix bug in gzread() on concatenated file with 0x1f at end of buffer
|
||||
and next buffer doesn't start with 0x8b
|
||||
- Fix uncompress() to return Z_DATA_ERROR on truncated input
|
||||
- Free memory at end of example.c
|
||||
- Remove MAX #define in trees.c (conflicted with some libraries)
|
||||
- Fix static const's in deflate.c, gzio.c, and zutil.[ch]
|
||||
- Declare malloc() and free() in gzio.c if STDC not defined
|
||||
- Use malloc() instead of calloc() in zutil.c if int big enough
|
||||
- Define STDC for AIX
|
||||
- Add aix/ with approach for compiling shared library on AIX
|
||||
- Add HP-UX support for shared libraries in configure
|
||||
- Add OpenUNIX support for shared libraries in configure
|
||||
- Use $cc instead of gcc to build shared library
|
||||
- Make prefix directory if needed when installing
|
||||
- Correct Macintosh avoidance of typedef Byte in zconf.h
|
||||
- Correct Turbo C memory allocation when under Linux
|
||||
- Use libz.a instead of -lz in Makefile (assure use of compiled library)
|
||||
- Update configure to check for snprintf or vsnprintf functions and their
|
||||
return value, warn during make if using an insecure function
|
||||
- Fix configure problem with compile-time knowledge of HAVE_UNISTD_H that
|
||||
is lost when library is used--resolution is to build new zconf.h
|
||||
- Documentation improvements (in zlib.h):
|
||||
- Document raw deflate and inflate
|
||||
- Update RFCs URL
|
||||
- Point out that zlib and gzip formats are different
|
||||
- Note that Z_BUF_ERROR is not fatal
|
||||
- Document string limit for gzprintf() and possible buffer overflow
|
||||
- Note requirement on avail_out when flushing
|
||||
- Note permitted values of flush parameter of inflate()
|
||||
- Add some FAQs (and even answers) to the FAQ
|
||||
- Add contrib/inflate86/ for x86 faster inflate
|
||||
- Add contrib/blast/ for PKWare Data Compression Library decompression
|
||||
- Add contrib/puff/ simple inflate for deflate format description
|
||||
|
||||
Changes in 1.1.4 (11 March 2002)
|
||||
- ZFREE was repeated on same allocation on some error conditions.
|
||||
|
@ -10,7 +256,7 @@ Changes in 1.1.4 (11 March 2002)
|
|||
less than 32K.
|
||||
- force windowBits > 8 to avoid a bug in the encoder for a window size
|
||||
of 256 bytes. (A complete fix will be available in 1.1.5).
|
||||
|
||||
|
||||
Changes in 1.1.3 (9 July 1998)
|
||||
- fix "an inflate input buffer bug that shows up on rare but persistent
|
||||
occasions" (Mark)
|
||||
|
@ -184,13 +430,13 @@ Changes in 1.0.6 (19 Jan 1998)
|
|||
- added Makefile.nt (thanks to Stephen Williams)
|
||||
- added the unsupported "contrib" directory:
|
||||
contrib/asm386/ by Gilles Vollant <info@winimage.com>
|
||||
386 asm code replacing longest_match().
|
||||
386 asm code replacing longest_match().
|
||||
contrib/iostream/ by Kevin Ruland <kevin@rodin.wustl.edu>
|
||||
A C++ I/O streams interface to the zlib gz* functions
|
||||
contrib/iostream2/ by Tyge Løvset <Tyge.Lovset@cmr.no>
|
||||
Another C++ I/O streams interface
|
||||
Another C++ I/O streams interface
|
||||
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <paag@tid.es>
|
||||
A very simple tar.gz file extractor using zlib
|
||||
A very simple tar.gz file extractor using zlib
|
||||
contrib/visual-basic.txt by Carlos Rios <c_rios@sonda.cl>
|
||||
How to use compress(), uncompress() and the gz* functions from VB.
|
||||
- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
|
||||
|
@ -217,7 +463,7 @@ Changes in 1.0.6 (19 Jan 1998)
|
|||
- add NEED_DUMMY_RETURN for Borland
|
||||
- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
|
||||
- allow compilation with CC
|
||||
- defined STDC for OS/2 (David Charlap)
|
||||
- defined STDC for OS/2 (David Charlap)
|
||||
- limit external names to 8 chars for MVS (Thomas Lund)
|
||||
- in minigzip.c, use static buffers only for 16-bit systems
|
||||
- fix suffix check for "minigzip -d foo.gz"
|
||||
|
@ -242,7 +488,7 @@ Changes in 1.0.5 (3 Jan 98)
|
|||
- Eliminate memory leaks on error conditions in inflate
|
||||
- Removed some vestigial code in inflate
|
||||
- Update web address in README
|
||||
|
||||
|
||||
Changes in 1.0.4 (24 Jul 96)
|
||||
- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
|
||||
bit, so the decompressor could decompress all the correct data but went
|
||||
|
|
315
zlib/FAQ
Normal file
315
zlib/FAQ
Normal file
|
@ -0,0 +1,315 @@
|
|||
|
||||
Frequently Asked Questions about zlib
|
||||
|
||||
|
||||
If your question is not there, please check the zlib home page
|
||||
http://www.zlib.org which may have more recent information.
|
||||
The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html
|
||||
|
||||
|
||||
1. Is zlib Y2K-compliant?
|
||||
|
||||
Yes. zlib doesn't handle dates.
|
||||
|
||||
2. Where can I get a Windows DLL version?
|
||||
|
||||
The zlib sources can be compiled without change to produce a DLL.
|
||||
See the file win32/DLL_FAQ.txt in the zlib distribution.
|
||||
Pointers to the precompiled DLL are found in the zlib web site at
|
||||
http://www.zlib.org.
|
||||
|
||||
3. Where can I get a Visual Basic interface to zlib?
|
||||
|
||||
See
|
||||
* http://www.winimage.com/zLibDll/
|
||||
* http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm
|
||||
* contrib/visual-basic.txt in the zlib distribution
|
||||
|
||||
4. compress() returns Z_BUF_ERROR
|
||||
|
||||
Make sure that before the call of compress, the length of the compressed
|
||||
buffer is equal to the total size of the compressed buffer and not
|
||||
zero. For Visual Basic, check that this parameter is passed by reference
|
||||
("as any"), not by value ("as long").
|
||||
|
||||
5. deflate() or inflate() returns Z_BUF_ERROR
|
||||
|
||||
Before making the call, make sure that avail_in and avail_out are not
|
||||
zero. When setting the parameter flush equal to Z_FINISH, also make sure
|
||||
that avail_out is big enough to allow processing all pending input.
|
||||
Note that a Z_BUF_ERROR is not fatal--another call to deflate() or
|
||||
inflate() can be made with more input or output space. A Z_BUF_ERROR
|
||||
may in fact be unavoidable depending on how the functions are used, since
|
||||
it is not possible to tell whether or not there is more output pending
|
||||
when strm.avail_out returns with zero.
|
||||
|
||||
6. Where's the zlib documentation (man pages, etc.)?
|
||||
|
||||
It's in zlib.h for the moment, and Francis S. Lin has converted it to a
|
||||
web page zlib.html. Volunteers to transform this to Unix-style man pages,
|
||||
please contact Jean-loup Gailly (jloup@gzip.org). Examples of zlib usage
|
||||
are in the files example.c and minigzip.c.
|
||||
|
||||
7. Why don't you use GNU autoconf or libtool or ...?
|
||||
|
||||
Because we would like to keep zlib as a very small and simple
|
||||
package. zlib is rather portable and doesn't need much configuration.
|
||||
|
||||
8. I found a bug in zlib.
|
||||
|
||||
Most of the time, such problems are due to an incorrect usage of
|
||||
zlib. Please try to reproduce the problem with a small program and send
|
||||
the corresponding source to us at zlib@gzip.org . Do not send
|
||||
multi-megabyte data files without prior agreement.
|
||||
|
||||
9. Why do I get "undefined reference to gzputc"?
|
||||
|
||||
If "make test" produces something like
|
||||
|
||||
example.o(.text+0x154): undefined reference to `gzputc'
|
||||
|
||||
check that you don't have old files libz.* in /usr/lib, /usr/local/lib or
|
||||
/usr/X11R6/lib. Remove any old versions, then do "make install".
|
||||
|
||||
10. I need a Delphi interface to zlib.
|
||||
|
||||
See the contrib/delphi directory in the zlib distribution.
|
||||
|
||||
11. Can zlib handle .zip archives?
|
||||
|
||||
See the directory contrib/minizip in the zlib distribution.
|
||||
|
||||
12. Can zlib handle .Z files?
|
||||
|
||||
No, sorry. You have to spawn an uncompress or gunzip subprocess, or adapt
|
||||
the code of uncompress on your own.
|
||||
|
||||
13. How can I make a Unix shared library?
|
||||
|
||||
make clean
|
||||
./configure -s
|
||||
make
|
||||
|
||||
14. How do I install a shared zlib library on Unix?
|
||||
|
||||
make install
|
||||
|
||||
However, many flavors of Unix come with a shared zlib already installed.
|
||||
Before going to the trouble of compiling a shared version of zlib and
|
||||
trying to install it, you may want to check if it's already there! If you
|
||||
can #include <zlib.h>, it's there. The -lz option will probably link to it.
|
||||
|
||||
15. I have a question about OttoPDF
|
||||
|
||||
We are not the authors of OttoPDF. The real author is on the OttoPDF web
|
||||
site Joel Hainley jhainley@myndkryme.com.
|
||||
|
||||
16. Why does gzip give an error on a file I make with compress/deflate?
|
||||
|
||||
The compress and deflate functions produce data in the zlib format, which
|
||||
is different and incompatible with the gzip format. The gz* functions in
|
||||
zlib on the other hand use the gzip format. Both the zlib and gzip
|
||||
formats use the same compressed data format internally, but have different
|
||||
headers and trailers around the compressed data.
|
||||
|
||||
17. Ok, so why are there two different formats?
|
||||
|
||||
The gzip format was designed to retain the directory information about
|
||||
a single file, such as the name and last modification date. The zlib
|
||||
format on the other hand was designed for in-memory and communication
|
||||
channel applications, and has a much more compact header and trailer and
|
||||
uses a faster integrity check than gzip.
|
||||
|
||||
18. Well that's nice, but how do I make a gzip file in memory?
|
||||
|
||||
You can request that deflate write the gzip format instead of the zlib
|
||||
format using deflateInit2(). You can also request that inflate decode
|
||||
the gzip format using inflateInit2(). Read zlib.h for more details.
|
||||
|
||||
Note that you cannot specify special gzip header contents (e.g. a file
|
||||
name or modification date), nor will inflate tell you what was in the
|
||||
gzip header. If you need to customize the header or see what's in it,
|
||||
you can use the raw deflate and inflate operations and the crc32()
|
||||
function and roll your own gzip encoding and decoding. Read the gzip
|
||||
RFC 1952 for details of the header and trailer format.
|
||||
|
||||
19. Is zlib thread-safe?
|
||||
|
||||
Yes. However any library routines that zlib uses and any application-
|
||||
provided memory allocation routines must also be thread-safe. zlib's gz*
|
||||
functions use stdio library routines, and most of zlib's functions use the
|
||||
library memory allocation routines by default. zlib's Init functions allow
|
||||
for the application to provide custom memory allocation routines.
|
||||
|
||||
Of course, you should only operate on any given zlib or gzip stream from a
|
||||
single thread at a time.
|
||||
|
||||
20. Can I use zlib in my commercial application?
|
||||
|
||||
Yes. Please read the license in zlib.h.
|
||||
|
||||
21. Is zlib under the GNU license?
|
||||
|
||||
No. Please read the license in zlib.h.
|
||||
|
||||
22. The license says that altered source versions must be "plainly marked". So
|
||||
what exactly do I need to do to meet that requirement?
|
||||
|
||||
You need to change the ZLIB_VERSION and ZLIB_VERNUM #defines in zlib.h. In
|
||||
particular, the final version number needs to be changed to "f", and an
|
||||
identification string should be appended to ZLIB_VERSION. Version numbers
|
||||
x.x.x.f are reserved for modifications to zlib by others than the zlib
|
||||
maintainers. For example, if the version of the base zlib you are altering
|
||||
is "1.2.3.4", then in zlib.h you should change ZLIB_VERNUM to 0x123f, and
|
||||
ZLIB_VERSION to something like "1.2.3.f-zachary-mods-v3". You can also
|
||||
update the version strings in deflate.c and inftrees.c.
|
||||
|
||||
For altered source distributions, you should also note the origin and
|
||||
nature of the changes in zlib.h, as well as in ChangeLog and README, along
|
||||
with the dates of the alterations. The origin should include at least your
|
||||
name (or your company's name), and an email address to contact for help or
|
||||
issues with the library.
|
||||
|
||||
Note that distributing a compiled zlib library along with zlib.h and
|
||||
zconf.h is also a source distribution, and so you should change
|
||||
ZLIB_VERSION and ZLIB_VERNUM and note the origin and nature of the changes
|
||||
in zlib.h as you would for a full source distribution.
|
||||
|
||||
23. Will zlib work on a big-endian or little-endian architecture, and can I
|
||||
exchange compressed data between them?
|
||||
|
||||
Yes and yes.
|
||||
|
||||
24. Will zlib work on a 64-bit machine?
|
||||
|
||||
It should. It has been tested on 64-bit machines, and has no dependence
|
||||
on any data types being limited to 32-bits in length. If you have any
|
||||
difficulties, please provide a complete problem report to zlib@gzip.org
|
||||
|
||||
25. Will zlib decompress data from the PKWare Data Compression Library?
|
||||
|
||||
No. The PKWare DCL uses a completely different compressed data format
|
||||
than does PKZIP and zlib. However, you can look in zlib's contrib/blast
|
||||
directory for a possible solution to your problem.
|
||||
|
||||
26. Can I access data randomly in a compressed stream?
|
||||
|
||||
No, not without some preparation. If when compressing you periodically
|
||||
use Z_FULL_FLUSH, carefully write all the pending data at those points,
|
||||
and keep an index of those locations, then you can start decompression
|
||||
at those points. You have to be careful to not use Z_FULL_FLUSH too
|
||||
often, since it can significantly degrade compression.
|
||||
|
||||
27. Does zlib work on MVS, OS/390, CICS, etc.?
|
||||
|
||||
We don't know for sure. We have heard occasional reports of success on
|
||||
these systems. If you do use it on one of these, please provide us with
|
||||
a report, instructions, and patches that we can reference when we get
|
||||
these questions. Thanks.
|
||||
|
||||
28. Is there some simpler, easier to read version of inflate I can look at
|
||||
to understand the deflate format?
|
||||
|
||||
First off, you should read RFC 1951. Second, yes. Look in zlib's
|
||||
contrib/puff directory.
|
||||
|
||||
29. Does zlib infringe on any patents?
|
||||
|
||||
As far as we know, no. In fact, that was originally the whole point behind
|
||||
zlib. Look here for some more information:
|
||||
|
||||
http://www.gzip.org/#faq11
|
||||
|
||||
30. Can zlib work with greater than 4 GB of data?
|
||||
|
||||
Yes. inflate() and deflate() will process any amount of data correctly.
|
||||
Each call of inflate() or deflate() is limited to input and output chunks
|
||||
of the maximum value that can be stored in the compiler's "unsigned int"
|
||||
type, but there is no limit to the number of chunks. Note however that the
|
||||
strm.total_in and strm_total_out counters may be limited to 4 GB. These
|
||||
counters are provided as a convenience and are not used internally by
|
||||
inflate() or deflate(). The application can easily set up its own counters
|
||||
updated after each call of inflate() or deflate() to count beyond 4 GB.
|
||||
compress() and uncompress() may be limited to 4 GB, since they operate in a
|
||||
single call. gzseek() and gztell() may be limited to 4 GB depending on how
|
||||
zlib is compiled. See the zlibCompileFlags() function in zlib.h.
|
||||
|
||||
The word "may" appears several times above since there is a 4 GB limit
|
||||
only if the compiler's "long" type is 32 bits. If the compiler's "long"
|
||||
type is 64 bits, then the limit is 16 exabytes.
|
||||
|
||||
31. Does zlib have any security vulnerabilities?
|
||||
|
||||
The only one that we are aware of is potentially in gzprintf(). If zlib
|
||||
is compiled to use sprintf() or vsprintf(), then there is no protection
|
||||
against a buffer overflow of a 4K string space, other than the caller of
|
||||
gzprintf() assuring that the output will not exceed 4K. On the other
|
||||
hand, if zlib is compiled to use snprintf() or vsnprintf(), which should
|
||||
normally be the case, then there is no vulnerability. The ./configure
|
||||
script will display warnings if an insecure variation of sprintf() will
|
||||
be used by gzprintf(). Also the zlibCompileFlags() function will return
|
||||
information on what variant of sprintf() is used by gzprintf().
|
||||
|
||||
If you don't have snprintf() or vsnprintf() and would like one, you can
|
||||
find a portable implementation here:
|
||||
|
||||
http://www.ijs.si/software/snprintf/
|
||||
|
||||
Note that you should be using the most recent version of zlib. Versions
|
||||
1.1.3 and before were subject to a double-free vulnerability.
|
||||
|
||||
32. Is there a Java version of zlib?
|
||||
|
||||
Probably what you want is to use zlib in Java. zlib is already included
|
||||
as part of the Java SDK in the java.util.zip package. If you really want
|
||||
a version of zlib written in the Java language, look on the zlib home
|
||||
page for links: http://www.zlib.org/
|
||||
|
||||
33. I get this or that compiler or source-code scanner warning when I crank it
|
||||
up to maximally-pendantic. Can't you guys write proper code?
|
||||
|
||||
Many years ago, we gave up attempting to avoid warnings on every compiler
|
||||
in the universe. It just got to be a waste of time, and some compilers
|
||||
were downright silly. So now, we simply make sure that the code always
|
||||
works.
|
||||
|
||||
34. Will zlib read the (insert any ancient or arcane format here) compressed
|
||||
data format?
|
||||
|
||||
Probably not. Look in the comp.compression FAQ for pointers to various
|
||||
formats and associated software.
|
||||
|
||||
35. How can I encrypt/decrypt zip files with zlib?
|
||||
|
||||
zlib doesn't support encryption. The original PKZIP encryption is very weak
|
||||
and can be broken with freely available programs. To get strong encryption,
|
||||
use gpg ( http://www.gnupg.org/ ) which already includes zlib compression.
|
||||
For PKZIP compatible "encryption", look at http://www.info-zip.org/
|
||||
|
||||
36. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings?
|
||||
|
||||
"gzip" is the gzip format, and "deflate" is the zlib format. They should
|
||||
probably have called the second one "zlib" instead to avoid confusion
|
||||
with the raw deflate compressed data format. While the HTTP 1.1 RFC 2616
|
||||
correctly points to the zlib specification in RFC 1950 for the "deflate"
|
||||
transfer encoding, there have been reports of servers and browsers that
|
||||
incorrectly produce or expect raw deflate data per the deflate
|
||||
specficiation in RFC 1951, most notably Microsoft. So even though the
|
||||
"deflate" transfer encoding using the zlib format would be the more
|
||||
efficient approach (and in fact exactly what the zlib format was designed
|
||||
for), using the "gzip" transfer encoding is probably more reliable due to
|
||||
an unfortunate choice of name on the part of the HTTP 1.1 authors.
|
||||
|
||||
Bottom line: use the gzip format for HTTP 1.1 encoding.
|
||||
|
||||
37. Does zlib support the new "Deflate64" format introduced by PKWare?
|
||||
|
||||
No. PKWare has apparently decided to keep that format proprietary, since
|
||||
they have not documented it as they have previous compression formats.
|
||||
In any case, the compression improvements are so modest compared to other
|
||||
more modern approaches, that it's not worth the effort to implement.
|
||||
|
||||
38. Can you please sign these lengthy legal documents and fax them back to us
|
||||
so that we can use your software in our product?
|
||||
|
||||
No. Go away. Shoo.
|
48
zlib/INDEX
Normal file
48
zlib/INDEX
Normal file
|
@ -0,0 +1,48 @@
|
|||
ChangeLog history of changes
|
||||
FAQ Frequently Asked Questions about zlib
|
||||
INDEX this file
|
||||
Makefile makefile for Unix (generated by configure)
|
||||
Makefile.in makefile for Unix (template for configure)
|
||||
README guess what
|
||||
algorithm.txt description of the (de)compression algorithm
|
||||
configure configure script for Unix
|
||||
zconf.in.h template for zconf.h (used by configure)
|
||||
|
||||
msdos/ makefiles for MSDOS
|
||||
old/ makefiles for various architectures and zlib documentation
|
||||
files that have not yet been updated for zlib 1.2.x
|
||||
qnx/ makefiles for QNX
|
||||
win32/ makefiles for Windows
|
||||
|
||||
zlib public header files (must be kept):
|
||||
zconf.h
|
||||
zlib.h
|
||||
|
||||
private source files used to build the zlib library:
|
||||
adler32.c
|
||||
compress.c
|
||||
crc32.c
|
||||
crc32.h
|
||||
deflate.c
|
||||
deflate.h
|
||||
gzio.c
|
||||
infback.c
|
||||
inffast.c
|
||||
inffast.h
|
||||
inffixed.h
|
||||
inflate.c
|
||||
inflate.h
|
||||
inftrees.c
|
||||
inftrees.h
|
||||
trees.c
|
||||
trees.h
|
||||
uncompr.c
|
||||
zutil.c
|
||||
zutil.h
|
||||
|
||||
source files for sample programs:
|
||||
example.c
|
||||
minigzip.c
|
||||
|
||||
unsupported contribution by third parties
|
||||
See contrib/README.contrib
|
|
@ -1,115 +0,0 @@
|
|||
$! make libz under VMS
|
||||
$! written by Martin P.J. Zinser <m.zinser@gsi.de>
|
||||
$!
|
||||
$! Look for the compiler used
|
||||
$!
|
||||
$ ccopt = ""
|
||||
$ if f$getsyi("HW_MODEL").ge.1024
|
||||
$ then
|
||||
$ ccopt = "/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ else
|
||||
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
||||
$ then
|
||||
$ comp = "__vaxc__=1"
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
||||
$ else
|
||||
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
|
||||
$ ccopt = "/decc/prefix=all"+ccopt
|
||||
$ comp = "__decc__=1"
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$! Build the thing plain or with mms
|
||||
$!
|
||||
$ write sys$output "Compiling Zlib sources ..."
|
||||
$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
|
||||
$ then
|
||||
$ dele example.obj;*,minigzip.obj;*
|
||||
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
|
||||
adler32.c zlib.h zconf.h
|
||||
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
|
||||
compress.c zlib.h zconf.h
|
||||
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
|
||||
crc32.c zlib.h zconf.h
|
||||
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
|
||||
deflate.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
|
||||
gzio.c zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
|
||||
infblock.c zutil.h zlib.h zconf.h infblock.h
|
||||
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -
|
||||
infcodes.c zutil.h zlib.h zconf.h inftrees.h
|
||||
$ CALL MAKE inffast.OBJ "CC ''CCOPT' inffast" -
|
||||
inffast.c zutil.h zlib.h zconf.h inffast.h
|
||||
$ CALL MAKE inflate.OBJ "CC ''CCOPT' inflate" -
|
||||
inflate.c zutil.h zlib.h zconf.h infblock.h
|
||||
$ CALL MAKE inftrees.OBJ "CC ''CCOPT' inftrees" -
|
||||
inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
||||
$ CALL MAKE infutil.OBJ "CC ''CCOPT' infutil" -
|
||||
infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
|
||||
$ CALL MAKE trees.OBJ "CC ''CCOPT' trees" -
|
||||
trees.c deflate.h zutil.h zlib.h zconf.h
|
||||
$ CALL MAKE uncompr.OBJ "CC ''CCOPT' uncompr" -
|
||||
uncompr.c zlib.h zconf.h
|
||||
$ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
|
||||
zutil.c zutil.h zlib.h zconf.h
|
||||
$ write sys$output "Building Zlib ..."
|
||||
$ CALL MAKE libz.OLB "lib/crea libz.olb *.obj" *.OBJ
|
||||
$ write sys$output "Building example..."
|
||||
$ CALL MAKE example.OBJ "CC ''CCOPT' example" -
|
||||
example.c zlib.h zconf.h
|
||||
$ call make example.exe "LINK example,libz.olb/lib" example.obj libz.olb
|
||||
$ write sys$output "Building minigzip..."
|
||||
$ CALL MAKE minigzip.OBJ "CC ''CCOPT' minigzip" -
|
||||
minigzip.c zlib.h zconf.h
|
||||
$ call make minigzip.exe -
|
||||
"LINK minigzip,libz.olb/lib,x11vms:xvmsutils.olb/lib" -
|
||||
minigzip.obj libz.olb
|
||||
$ else
|
||||
$ mms/macro=('comp')
|
||||
$ endif
|
||||
$ write sys$output "Zlib build completed"
|
||||
$ exit
|
||||
$!
|
||||
$!
|
||||
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
|
||||
$ V = 'F$Verify(0)
|
||||
$! P1 = What we are trying to make
|
||||
$! P2 = Command to make it
|
||||
$! P3 - P8 What it depends on
|
||||
$
|
||||
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
|
||||
$ Time = F$CvTime(F$File(P1,"RDT"))
|
||||
$arg=3
|
||||
$Loop:
|
||||
$ Argument = P'arg
|
||||
$ If Argument .Eqs. "" Then Goto Exit
|
||||
$ El=0
|
||||
$Loop2:
|
||||
$ File = F$Element(El," ",Argument)
|
||||
$ If File .Eqs. " " Then Goto Endl
|
||||
$ AFile = ""
|
||||
$Loop3:
|
||||
$ OFile = AFile
|
||||
$ AFile = F$Search(File)
|
||||
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
|
||||
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
|
||||
$ Goto Loop3
|
||||
$NextEL:
|
||||
$ El = El + 1
|
||||
$ Goto Loop2
|
||||
$EndL:
|
||||
$ arg=arg+1
|
||||
$ If arg .Le. 8 Then Goto Loop
|
||||
$ Goto Exit
|
||||
$
|
||||
$Makeit:
|
||||
$ VV=F$VERIFY(0)
|
||||
$ write sys$output P2
|
||||
$ 'P2
|
||||
$ VV='F$Verify(VV)
|
||||
$Exit:
|
||||
$ If V Then Set Verify
|
||||
$ENDSUBROUTINE
|
|
@ -1,151 +0,0 @@
|
|||
# Project: zlib_1_03
|
||||
# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
|
||||
# test works out-of-the-box, installs `somewhere' on demand
|
||||
|
||||
# Toolflags:
|
||||
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
|
||||
C++flags = -c -depend !Depend -IC: -throwback
|
||||
Linkflags = -aif -c++ -o $@
|
||||
ObjAsmflags = -throwback -NoCache -depend !Depend
|
||||
CMHGflags =
|
||||
LibFileflags = -c -l -o $@
|
||||
Squeezeflags = -o $@
|
||||
|
||||
# change the line below to where _you_ want the library installed.
|
||||
libdest = lib:zlib
|
||||
|
||||
# Final targets:
|
||||
@.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
|
||||
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
|
||||
@.o.uncompr @.o.zutil
|
||||
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
|
||||
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
|
||||
@.o.trees @.o.uncompr @.o.zutil
|
||||
test: @.minigzip @.example @.lib
|
||||
@copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo running tests: hang on.
|
||||
@/@.minigzip -f -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -f -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -h -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -9 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@/@.minigzip -1 libc
|
||||
@/@.minigzip -d libc-gz
|
||||
@diff @.lib @.libc
|
||||
@echo that should have reported '@.lib and @.libc identical' if you have diff.
|
||||
@/@.example @.fred @.fred
|
||||
@echo that will have given lots of hello!'s.
|
||||
|
||||
@.minigzip: @.o.minigzip @.lib C:o.Stubs
|
||||
Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
|
||||
@.example: @.o.example @.lib C:o.Stubs
|
||||
Link $(Linkflags) @.o.example @.lib C:o.Stubs
|
||||
|
||||
install: @.lib
|
||||
cdir $(libdest)
|
||||
cdir $(libdest).h
|
||||
@copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
|
||||
@copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
|
||||
@echo okay, installed zlib in $(libdest)
|
||||
|
||||
clean:; remove @.minigzip
|
||||
remove @.example
|
||||
remove @.libc
|
||||
-wipe @.o.* F~r~cV
|
||||
remove @.fred
|
||||
|
||||
# User-editable dependencies:
|
||||
.c.o:
|
||||
cc $(ccflags) -o $@ $<
|
||||
|
||||
# Static dependencies:
|
||||
|
||||
# Dynamic dependencies:
|
||||
o.example: c.example
|
||||
o.example: h.zlib
|
||||
o.example: h.zconf
|
||||
o.minigzip: c.minigzip
|
||||
o.minigzip: h.zlib
|
||||
o.minigzip: h.zconf
|
||||
o.adler32: c.adler32
|
||||
o.adler32: h.zlib
|
||||
o.adler32: h.zconf
|
||||
o.compress: c.compress
|
||||
o.compress: h.zlib
|
||||
o.compress: h.zconf
|
||||
o.crc32: c.crc32
|
||||
o.crc32: h.zlib
|
||||
o.crc32: h.zconf
|
||||
o.deflate: c.deflate
|
||||
o.deflate: h.deflate
|
||||
o.deflate: h.zutil
|
||||
o.deflate: h.zlib
|
||||
o.deflate: h.zconf
|
||||
o.gzio: c.gzio
|
||||
o.gzio: h.zutil
|
||||
o.gzio: h.zlib
|
||||
o.gzio: h.zconf
|
||||
o.infblock: c.infblock
|
||||
o.infblock: h.zutil
|
||||
o.infblock: h.zlib
|
||||
o.infblock: h.zconf
|
||||
o.infblock: h.infblock
|
||||
o.infblock: h.inftrees
|
||||
o.infblock: h.infcodes
|
||||
o.infblock: h.infutil
|
||||
o.infcodes: c.infcodes
|
||||
o.infcodes: h.zutil
|
||||
o.infcodes: h.zlib
|
||||
o.infcodes: h.zconf
|
||||
o.infcodes: h.inftrees
|
||||
o.infcodes: h.infblock
|
||||
o.infcodes: h.infcodes
|
||||
o.infcodes: h.infutil
|
||||
o.infcodes: h.inffast
|
||||
o.inffast: c.inffast
|
||||
o.inffast: h.zutil
|
||||
o.inffast: h.zlib
|
||||
o.inffast: h.zconf
|
||||
o.inffast: h.inftrees
|
||||
o.inffast: h.infblock
|
||||
o.inffast: h.infcodes
|
||||
o.inffast: h.infutil
|
||||
o.inffast: h.inffast
|
||||
o.inflate: c.inflate
|
||||
o.inflate: h.zutil
|
||||
o.inflate: h.zlib
|
||||
o.inflate: h.zconf
|
||||
o.inflate: h.infblock
|
||||
o.inftrees: c.inftrees
|
||||
o.inftrees: h.zutil
|
||||
o.inftrees: h.zlib
|
||||
o.inftrees: h.zconf
|
||||
o.inftrees: h.inftrees
|
||||
o.inftrees: h.inffixed
|
||||
o.infutil: c.infutil
|
||||
o.infutil: h.zutil
|
||||
o.infutil: h.zlib
|
||||
o.infutil: h.zconf
|
||||
o.infutil: h.infblock
|
||||
o.infutil: h.inftrees
|
||||
o.infutil: h.infcodes
|
||||
o.infutil: h.infutil
|
||||
o.trees: c.trees
|
||||
o.trees: h.deflate
|
||||
o.trees: h.zutil
|
||||
o.trees: h.zlib
|
||||
o.trees: h.zconf
|
||||
o.trees: h.trees
|
||||
o.uncompr: c.uncompr
|
||||
o.uncompr: h.zlib
|
||||
o.uncompr: h.zconf
|
||||
o.zutil: c.zutil
|
||||
o.zutil: h.zutil
|
||||
o.zutil: h.zlib
|
||||
o.zutil: h.zconf
|
126
zlib/README
Normal file
126
zlib/README
Normal file
|
@ -0,0 +1,126 @@
|
|||
ZLIB DATA COMPRESSION LIBRARY
|
||||
|
||||
zlib 1.2.1 is a general purpose data compression library. All the code is
|
||||
thread safe. The data format used by the zlib library is described by RFCs
|
||||
(Request for Comments) 1950 to 1952 in the files
|
||||
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
|
||||
and rfc1952.txt (gzip format). These documents are also available in other
|
||||
formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
|
||||
|
||||
All functions of the compression library are documented in the file zlib.h
|
||||
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
|
||||
of the library is given in the file example.c which also tests that the library
|
||||
is working correctly. Another example is given in the file minigzip.c. The
|
||||
compression library itself is composed of all source files except example.c and
|
||||
minigzip.c.
|
||||
|
||||
To compile all files and run the test program, follow the instructions given at
|
||||
the top of Makefile. In short "make test; make install" should work for most
|
||||
machines. For Unix: "./configure; make test; make install" For MSDOS, use one
|
||||
of the special makefiles such as Makefile.msc. For VMS, use Make_vms.com or
|
||||
descrip.mms.
|
||||
|
||||
Questions about zlib should be sent to <zlib@gzip.org>, or to Gilles Vollant
|
||||
<info@winimage.com> for the Windows DLL version. The zlib home page is
|
||||
http://www.zlib.org or http://www.gzip.org/zlib/ Before reporting a problem,
|
||||
please check this site to verify that you have the latest version of zlib;
|
||||
otherwise get the latest version and check whether the problem still exists or
|
||||
not.
|
||||
|
||||
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html before asking
|
||||
for help.
|
||||
|
||||
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
|
||||
issue of Dr. Dobb's Journal; a copy of the article is available in
|
||||
http://dogma.net/markn/articles/zlibtool/zlibtool.htm
|
||||
|
||||
The changes made in version 1.2.1 are documented in the file ChangeLog.
|
||||
|
||||
Unsupported third party contributions are provided in directory "contrib".
|
||||
|
||||
A Java implementation of zlib is available in the Java Development Kit
|
||||
http://java.sun.com/j2se/1.4.2/docs/api/java/util/zip/package-summary.html
|
||||
See the zlib home page http://www.zlib.org for details.
|
||||
|
||||
A Perl interface to zlib written by Paul Marquess <pmqs@cpan.org> is in the
|
||||
CPAN (Comprehensive Perl Archive Network) sites
|
||||
http://www.cpan.org/modules/by-module/Compress/
|
||||
|
||||
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com> is
|
||||
available in Python 1.5 and later versions, see
|
||||
http://www.python.org/doc/lib/module-zlib.html
|
||||
|
||||
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> is
|
||||
availlable at http://www.oche.de/~akupries/soft/trf/trf_zip.html
|
||||
|
||||
An experimental package to read and write files in .zip format, written on top
|
||||
of zlib by Gilles Vollant <info@winimage.com>, is available in the
|
||||
contrib/minizip directory of zlib.
|
||||
|
||||
|
||||
Notes for some targets:
|
||||
|
||||
- For Windows DLL versions, please see win32/DLL_FAQ.txt
|
||||
|
||||
- For 64-bit Irix, deflate.c must be compiled without any optimization. With
|
||||
-O, one libpng test fails. The test works in 32 bit mode (with the -n32
|
||||
compiler flag). The compiler bug has been reported to SGI.
|
||||
|
||||
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
|
||||
when compiled with cc.
|
||||
|
||||
- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
|
||||
necessary to get gzprintf working correctly. This is done by configure.
|
||||
|
||||
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
|
||||
other compilers. Use "make test" to check your compiler.
|
||||
|
||||
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
|
||||
|
||||
- For PalmOs, see http://palmzlib.sourceforge.net/
|
||||
|
||||
- When building a shared, i.e. dynamic library on Mac OS X, the library must be
|
||||
installed before testing (do "make install" before "make test"), since the
|
||||
library location is specified in the library.
|
||||
|
||||
|
||||
Acknowledgments:
|
||||
|
||||
The deflate format used by zlib was defined by Phil Katz. The deflate
|
||||
and zlib specifications were written by L. Peter Deutsch. Thanks to all the
|
||||
people who reported problems and suggested various improvements in zlib;
|
||||
they are too numerous to cite here.
|
||||
|
||||
Copyright notice:
|
||||
|
||||
(C) 1995-2003 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
If you use the zlib library in a product, we would appreciate *not*
|
||||
receiving lengthy legal documents to sign. The sources are provided
|
||||
for free but without warranty of any kind. The library has been
|
||||
entirely written by Jean-loup Gailly and Mark Adler; it does not
|
||||
include third-party code.
|
||||
|
||||
If you redistribute modified sources, we would appreciate that you include
|
||||
in the file ChangeLog history information documenting your changes. Please
|
||||
read the FAQ for more information on the distribution of modified source
|
||||
versions.
|
|
@ -1,13 +1,14 @@
|
|||
/* adler32.c -- compute the Adler-32 checksum of a data stream
|
||||
* Copyright (C) 1995-2002 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
* Copyright (C) 1995-2003 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
#define BASE 65521L /* largest prime smaller than 65536 */
|
||||
#define BASE 65521UL /* largest prime smaller than 65536 */
|
||||
#define NMAX 5552
|
||||
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
|
||||
|
||||
|
@ -17,6 +18,31 @@
|
|||
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
|
||||
#define DO16(buf) DO8(buf,0); DO8(buf,8);
|
||||
|
||||
#ifdef NO_DIVIDE
|
||||
# define MOD(a) \
|
||||
do { \
|
||||
if (a >= (BASE << 16)) a -= (BASE << 16); \
|
||||
if (a >= (BASE << 15)) a -= (BASE << 15); \
|
||||
if (a >= (BASE << 14)) a -= (BASE << 14); \
|
||||
if (a >= (BASE << 13)) a -= (BASE << 13); \
|
||||
if (a >= (BASE << 12)) a -= (BASE << 12); \
|
||||
if (a >= (BASE << 11)) a -= (BASE << 11); \
|
||||
if (a >= (BASE << 10)) a -= (BASE << 10); \
|
||||
if (a >= (BASE << 9)) a -= (BASE << 9); \
|
||||
if (a >= (BASE << 8)) a -= (BASE << 8); \
|
||||
if (a >= (BASE << 7)) a -= (BASE << 7); \
|
||||
if (a >= (BASE << 6)) a -= (BASE << 6); \
|
||||
if (a >= (BASE << 5)) a -= (BASE << 5); \
|
||||
if (a >= (BASE << 4)) a -= (BASE << 4); \
|
||||
if (a >= (BASE << 3)) a -= (BASE << 3); \
|
||||
if (a >= (BASE << 2)) a -= (BASE << 2); \
|
||||
if (a >= (BASE << 1)) a -= (BASE << 1); \
|
||||
if (a >= BASE) a -= BASE; \
|
||||
} while (0)
|
||||
#else
|
||||
# define MOD(a) a %= BASE
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
uLong ZEXPORT adler32(adler, buf, len)
|
||||
uLong adler;
|
||||
|
@ -30,19 +56,19 @@ uLong ZEXPORT adler32(adler, buf, len)
|
|||
if (buf == Z_NULL) return 1L;
|
||||
|
||||
while (len > 0) {
|
||||
k = len < NMAX ? len : NMAX;
|
||||
k = len < NMAX ? (int)len : NMAX;
|
||||
len -= k;
|
||||
while (k >= 16) {
|
||||
DO16(buf);
|
||||
buf += 16;
|
||||
buf += 16;
|
||||
k -= 16;
|
||||
}
|
||||
if (k != 0) do {
|
||||
s1 += *buf++;
|
||||
s2 += s1;
|
||||
s2 += s1;
|
||||
} while (--k);
|
||||
s1 %= BASE;
|
||||
s2 %= BASE;
|
||||
MOD(s1);
|
||||
MOD(s2);
|
||||
}
|
||||
return (s2 << 16) | s1;
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue