Commit 5f98914d authored by unknown's avatar unknown

Merge paul@work.mysql.com:/home/bk/mysql-4.0

into teton.kitebird.com:/home/paul/mysql-4.0


Docs/manual.texi:
  Auto merged
parents c8d8213d d737186f
...@@ -461,3 +461,4 @@ vio/viotest-ssl ...@@ -461,3 +461,4 @@ vio/viotest-ssl
Docs/mysql.xml Docs/mysql.xml
mysql-test/r/rpl000001.eval mysql-test/r/rpl000001.eval
Docs/safe-mysql.xml Docs/safe-mysql.xml
mysys/test_vsnprintf
cflags="$c_warnings $extra_flags" cflags="$c_warnings $extra_flags"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags" cxxflags="$cxx_warnings $base_cxxflags $extra_flags"
extra_configs="$extra_configs $local_infile_configs"
configure="./configure $base_configs $extra_configs" configure="./configure $base_configs $extra_configs"
for arg for arg
do do
......
...@@ -57,6 +57,10 @@ static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static ...@@ -57,6 +57,10 @@ static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
alpha_configs="" # Not used yet alpha_configs="" # Not used yet
pentium_configs="" pentium_configs=""
sparc_configs="" sparc_configs=""
# we need local-infile in all binaries for rpl000001
# if you need to disable local-infile in the client, write a build script
# and unset local_infile_configs
local_infile_configs="--enable-local-infile"
debug_configs="--with-debug" debug_configs="--with-debug"
......
...@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings" ...@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs" extra_configs="$pentium_configs $debug_configs"
extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server --with-openssl --enable-local-infile" extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-embedded-server --with-openssl"
. "$path/FINISH.sh" . "$path/FINISH.sh"
...@@ -76,7 +76,7 @@ gmake -j 2 ...@@ -76,7 +76,7 @@ gmake -j 2
time gmake -j 2 distcheck \ time gmake -j 2 distcheck \
EXTRA_CONF_ARGS="--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory $EXTRA_CONFIG" EXTRA_CONF_ARGS="--with-unix-socket-path=/var/tmp/mysql.sock --with-low-memory $EXTRA_CONFIG"
sh $BD/Build-tools/Do-rpm sh $BD/Build-tools/Do-rpm $*
rm -f $TMP_SCRIPT rm -f $TMP_SCRIPT
END END
......
...@@ -7,7 +7,7 @@ $opt_tmp=$opt_version_suffix=""; ...@@ -7,7 +7,7 @@ $opt_tmp=$opt_version_suffix="";
$opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0; $opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_innodb=$opt_bdb=0; $opt_innodb=$opt_bdb=0;
GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s") || usage(); GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s) || usage();
usage() if ($opt_help || $opt_Information); usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution); usage() if (!$opt_distribution);
...@@ -147,6 +147,10 @@ if ($opt_stage <= 1) ...@@ -147,6 +147,10 @@ if ($opt_stage <= 1)
{ {
$opt_config_options.=" --with-client-ldflags=-all-static"; $opt_config_options.=" --with-client-ldflags=-all-static";
} }
if ($opt_with_other_libc)
{
$opt_with_other_libc = "--with-other-libc=$opt_with_other_libc";
}
if (!$opt_enable_shared) if (!$opt_enable_shared)
{ {
$opt_config_options.= " --disable-shared"; # Default for binary versions $opt_config_options.= " --disable-shared"; # Default for binary versions
......
#! /bin/sh
set -e -x
OTHER_LIBC_DIR=/usr/local/mysql-glibc
BUILD/compile-pentium-max --with-other-libc=$OTHER_LIBC_DIR \
--with-comment="Official MySQL Binary" \
--prefix=/usr/local/mysql --with-extra-charset=complex \
--enable-thread-safe-client --enable-local-infile \
--with-server-suffix=-max
scripts/make_binary_distribution
make dist
Build-tools/Do-rpm --local
BUILD/compile-pentium --with-other-libc=$OTHER_LIBC_DIR \
--with-comment="Official MySQL Binary" \
--prefix=/usr/local/mysql --with-extra-charset=complex \
--enable-thread-safe-client --enable-local-infile
scripts/make_binary_distribution
...@@ -40,7 +40,21 @@ owner=my ...@@ -40,7 +40,21 @@ owner=my
# Hard path!! # Hard path!!
bpath=`/bin/pwd` bpath=`/bin/pwd`
rpmdir="/usr/src/redhat"
for d in /usr/src/redhat /usr/src/packages ; do
if test -d "$d"
then
rpmdir=$d
fi
done
if test -z "$rpmdir"
then
echo "Could not find suitable rpmdir on this system"
exit 1
fi
logdir="$bpath/Logs" logdir="$bpath/Logs"
###### Perl STUFF ##### ###### Perl STUFF #####
......
...@@ -98,7 +98,7 @@ $data =~ s{(\S+)[\t ]+</para>} ...@@ -98,7 +98,7 @@ $data =~ s{(\S+)[\t ]+</para>}
{$1</para>}g; {$1</para>}g;
msg ("Removing PARA around INDEXTERM if no text in PARA..."); msg ("Removing PARA around INDEXTERM if no text in PARA...");
$data =~ s{<para>((?:<indexterm role=\"(?:cp|fn)\">(?:<(primary|secondary)>[^>]+</\2>)+?</indexterm>)+?)\s*</para>} $data =~ s{<para>((?:<indexterm role=\"[^"]+\">(?:<(primary|secondary)>[^>]+</\2>)+?</indexterm>)+?)\s*</para>}
{$1}gs; {$1}gs;
@apx = ("Users", "MySQL Testimonials", "News", "GPL-license", "LGPL-license"); @apx = ("Users", "MySQL Testimonials", "News", "GPL-license", "LGPL-license");
......
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/internals.h ./linuxthreads/internals.h
--- ../glibc-2.2.5/linuxthreads/internals.h Thu Nov 29 00:44:16 2001
+++ ./linuxthreads/internals.h Fri Feb 22 21:18:09 2002
@@ -343,7 +343,7 @@
THREAD_SELF implementation is used, this must be a power of two and
a multiple of PAGE_SIZE. */
#ifndef STACK_SIZE
-#define STACK_SIZE (2 * 1024 * 1024)
+#define STACK_SIZE (128 * 1024)
#endif
/* The initial size of the thread stack. Must be a multiple of PAGE_SIZE. */
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h
--- ../glibc-2.2.5/linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Thu Jun 8 13:49:49 2000
+++ ./linuxthreads/sysdeps/unix/sysv/linux/bits/local_lim.h Fri Feb 22 21:18:09 2002
@@ -64,7 +64,7 @@
/* The number of threads per process. */
#define _POSIX_THREAD_THREADS_MAX 64
/* This is the value this implementation supports. */
-#define PTHREAD_THREADS_MAX 1024
+#define PTHREAD_THREADS_MAX 4096
/* Maximum amount by which a process can descrease its asynchronous I/O
priority level. */
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/nss/nsswitch.c ./nss/nsswitch.c
--- ../glibc-2.2.5/nss/nsswitch.c Tue Jul 17 02:21:36 2001
+++ ./nss/nsswitch.c Fri Feb 22 21:18:09 2002
@@ -515,8 +515,16 @@
+ (line - name + 1));
if (new_service == NULL)
return result;
-
+#ifdef DO_STATIC_NSS
+ if (strncmp(name,"files",5) == 0 ||
+ strncmp(name,"dns",3) == 0)
+#endif
*((char *) __mempcpy (new_service->name, name, line - name)) = '\0';
+#ifdef DO_STATIC_NSS
+ else
+ *((char *) __mempcpy (new_service->name, "files", 5)) = '\0';
+#endif
+
/* Set default actions. */
new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/time/Makefile ./time/Makefile
--- ../glibc-2.2.5/time/Makefile Fri Feb 22 21:27:19 2002
+++ ./time/Makefile Fri Feb 22 21:26:47 2002
@@ -37,8 +37,8 @@
include ../Rules
-tz-cflags = -DTZDIR='"$(zonedir)"' \
- -DTZDEFAULT='"$(localtime-file)"' \
+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
+ -DTZDEFAULT='"/etc/localtime"' \
-DTZDEFRULES='"$(posixrules-file)"'
CFLAGS-tzfile.c = $(tz-cflags)
diff -Nur --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet ../glibc-2.2.5/timezone/Makefile ./timezone/Makefile
--- ../glibc-2.2.5/timezone/Makefile Wed Aug 29 16:45:25 2001
+++ ./timezone/Makefile Fri Feb 22 21:18:09 2002
@@ -159,8 +159,8 @@
$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
-tz-cflags = -DTZDIR='"$(zonedir)"' \
- -DTZDEFAULT='"$(localtime-file)"' \
+tz-cflags = -DTZDIR='"/usr/share/zoneinfo/"' \
+ -DTZDEFAULT='"/etc/localtime"' \
-DTZDEFRULES='"$(posixrules-file)"' \
-DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
Notes on compiling glibc for the standard MySQL binary:
- make sure you have gcc 2.95 and gmake 3.79 or newer
- wget ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.2.5.tar.gz
- wget ftp://ftp.gnu.org/pub/gnu/glibc/glibc-linuxthreads-2.2.5.tar.gz
- tar zxvf glibc-2.2.5.tar.gz ; cd glibc-2.2.5 ;
tar zxvf ../glibc-linuxthreads-2.2.5.tar.gz
- patch -p1 < ~/bk/mysql/Docs/glibc-2.2.5.patch
- ./configure --prefix=/usr/local/mysql-glibc --enable-static-nss \
--disable-shared --enable-add-ons=linuxthreads --target=i386 \
--host=i386-pc-linux-gnu
- make
- possible problems - if compiler is not properly installed, one can get
"cpp: too many input" files error - easiest way to solve - SUSE RPM for gcc
2.95
- surun make install
- To build the binaries, run Build-tools/Do-linux-build
...@@ -48637,6 +48637,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. ...@@ -48637,6 +48637,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Fixed bug in truncation operator for boolean fulltext search.
@item
Allow numeric user id to @code{mysqld --user=#}. Allow numeric user id to @code{mysqld --user=#}.
@item @item
Fixed a bug where @code{SQL_CALC_ROWS} returned a wrong value when used Fixed a bug where @code{SQL_CALC_ROWS} returned a wrong value when used
...@@ -48948,6 +48950,7 @@ users use this code as the rest of the code and because of this we are ...@@ -48948,6 +48950,7 @@ users use this code as the rest of the code and because of this we are
not yet 100% confident in this code. not yet 100% confident in this code.
@menu @menu
* News-3.23.50:: Changes in release 3.23.50
* News-3.23.49:: Changes in release 3.23.49 * News-3.23.49:: Changes in release 3.23.49
* News-3.23.48:: Changes in release 3.23.48 * News-3.23.48:: Changes in release 3.23.48
* News-3.23.47:: Changes in release 3.23.47 * News-3.23.47:: Changes in release 3.23.47
...@@ -49001,7 +49004,14 @@ not yet 100% confident in this code. ...@@ -49001,7 +49004,14 @@ not yet 100% confident in this code.
* News-3.23.0:: Changes in release 3.23.0 * News-3.23.0:: Changes in release 3.23.0
@end menu @end menu
@node News-3.23.49, News-3.23.48, News-3.23.x, News-3.23.x @node News-3.23.50, News-3.23.49, News-3.23.x, News-3.23.x
@appendixsubsec Changes in release 3.23.50
@itemize @bullet
@item
Memory leak (16 bytes per every @strong{corrupted} table) closed.
@end itemize
@node News-3.23.49, News-3.23.48, News-3.23.50, News-3.23.x
@appendixsubsec Changes in release 3.23.49 @appendixsubsec Changes in release 3.23.49
@itemize @bullet @itemize @bullet
@item @item
...@@ -439,8 +439,27 @@ AC_ARG_WITH(other-libc, ...@@ -439,8 +439,27 @@ AC_ARG_WITH(other-libc,
#There seems to be a feature in gcc that treats system and libc headers #There seems to be a feature in gcc that treats system and libc headers
#leniently when they violatate ANSI C++ standard, but it is strict otherwise #leniently when they violatate ANSI C++ standard, but it is strict otherwise
#since gcc cannot now recognize that our headers are libc, we work around #since gcc cannot now recognize that our headers are libc, we work around
#by telling it to be permissive #by telling it to be permissive
LDFLAGS="$LDFLAGS -static -L$other_libc_lib " static_nss=
if test -f "$other_libc_lib/libnss_files.a"
then
# libc has been compiled with --enable-static-nss
# we need special flags, but we will have to add those later
STATIC_NSS_FLAGS="-Wl,--start-group -lc -lnss_files -lnss_dns -lresolv \
-Wl,--end-group"
static_nss=1
else
# this is a dirty hack. We if we detect static nss glibc in the special
# location, we do not re-direct the linker to get libraries from there
# during check. The reason is that if we did, we would have to find a
# way to append the special static nss flags to LIBS every time we do
# any check - this is definitely feasible, but not worthwhile the risk
# of breaking other things. So for our purposes it would be sufficient
# to assume that whoever is using static NSS knows what he is doing and
# has sensible libraries in the regular location
LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
fi
with_mysqld_ldflags="-all-static" with_mysqld_ldflags="-all-static"
with_client_ldflags="-all-static" with_client_ldflags="-all-static"
NOINST_LDFLAGS="-all-static" NOINST_LDFLAGS="-all-static"
...@@ -587,10 +606,13 @@ AC_SUBST(MYSQLD_USER) ...@@ -587,10 +606,13 @@ AC_SUBST(MYSQLD_USER)
AC_ARG_ENABLE(local-infile, AC_ARG_ENABLE(local-infile,
[ --enable-local-infile [ --enable-local-infile
If LOAD DATA LOCAL INFILE is enabled by default.], If LOAD DATA LOCAL INFILE is enabled by default.],
[ ENABLED_LOCAL_INFILE=$enablewal ], [
ENABLED_LOCAL_INFILE=$enablewal
AC_DEFINE(ENABLED_LOCAL_INFILE)
],
[ ENABLED_LOCAL_INFILE=no ] [ ENABLED_LOCAL_INFILE=no ]
) )
# Use Paul Eggerts macros from GNU tar to check for large file support. # Use Paul Eggerts macros from GNU tar to check for large file support.
MYSQL_SYS_LARGEFILE MYSQL_SYS_LARGEFILE
...@@ -2114,11 +2136,17 @@ then ...@@ -2114,11 +2136,17 @@ then
linked_client_targets="$linked_client_targets linked_libmysql_r_sources" linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
AC_DEFINE(THREAD_SAFE_CLIENT) AC_DEFINE(THREAD_SAFE_CLIENT)
fi fi
if test "$static_nss" = "1"
then
CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS"
fi
AC_SUBST(CLIENT_LIBS) AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs) AC_SUBST(sql_client_dirs)
AC_SUBST(linked_client_targets) AC_SUBST(linked_client_targets)
if test "$with_server" = "yes" if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
then then
AC_DEFINE(THREAD) AC_DEFINE(THREAD)
# Avoid _PROGRAMS names # Avoid _PROGRAMS names
...@@ -2254,6 +2282,17 @@ EOF ...@@ -2254,6 +2282,17 @@ EOF
LIBS="$MT_LD_ADD $LIBS" LIBS="$MT_LD_ADD $LIBS"
fi fi
fi fi
#IMPORTANT - do not modify LIBS past this line - this hack is the only way
# I know to add the static NSS magic if we have static NSS libraries with
# glibc - Sasha
if test "$static_nss" = "1"
then
LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
LIBS="$LIBS $STATIC_NSS_FLAGS"
fi
AC_SUBST(sql_server_dirs) AC_SUBST(sql_server_dirs)
AC_SUBST(thread_dirs) AC_SUBST(thread_dirs)
AC_SUBST(server_scripts) AC_SUBST(server_scripts)
......
...@@ -43,9 +43,10 @@ typedef struct st_hash { ...@@ -43,9 +43,10 @@ typedef struct st_hash {
uint (*calc_hashnr)(const byte *key,uint length); uint (*calc_hashnr)(const byte *key,uint length);
} HASH; } HASH;
my_bool hash_init(HASH *hash,uint default_array_elements, uint key_offset, #define hash_init(A,B,C,D,E,F,G) _hash_init(A,B,C,D,E,F,G CALLER_INFO)
my_bool _hash_init(HASH *hash,uint default_array_elements, uint key_offset,
uint key_length, hash_get_key get_key, uint key_length, hash_get_key get_key,
void (*free_element)(void*), uint flags); void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
void hash_free(HASH *tree); void hash_free(HASH *tree);
byte *hash_element(HASH *hash,uint idx); byte *hash_element(HASH *hash,uint idx);
gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_search(HASH *info,const byte *key,uint length);
......
...@@ -127,6 +127,7 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -127,6 +127,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc( SZ, __FILE__, __LINE__, FLAG ) #define my_malloc(SZ,FLAG) _mymalloc( SZ, __FILE__, __LINE__, FLAG )
#define my_malloc_ci(SZ,FLAG) _mymalloc( SZ, sFile, uLine, FLAG )
#define my_realloc(PTR,SZ,FLAG) _myrealloc( PTR, SZ, __FILE__, __LINE__, FLAG ) #define my_realloc(PTR,SZ,FLAG) _myrealloc( PTR, SZ, __FILE__, __LINE__, FLAG )
#define my_checkmalloc() _sanity( __FILE__, __LINE__ ) #define my_checkmalloc() _sanity( __FILE__, __LINE__ )
#define my_free(PTR,FLAG) _myfree( PTR, __FILE__, __LINE__,FLAG) #define my_free(PTR,FLAG) _myfree( PTR, __FILE__, __LINE__,FLAG)
...@@ -136,6 +137,9 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -136,6 +137,9 @@ extern int NEAR my_errno; /* Last error in mysys */
#define NORMAL_SAFEMALLOC sf_malloc_quick=0 #define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
extern ulonglong safemalloc_mem_limit; extern ulonglong safemalloc_mem_limit;
#define CALLER_INFO_PROTO , const char *sFile, uint uLine
#define CALLER_INFO , __FILE__, __LINE__
#define ORIG_CALLER_INFO , sFile, uLine
#else #else
#define my_checkmalloc() (0) #define my_checkmalloc() (0)
#undef TERMINATE #undef TERMINATE
...@@ -143,11 +147,15 @@ extern ulonglong safemalloc_mem_limit; ...@@ -143,11 +147,15 @@ extern ulonglong safemalloc_mem_limit;
#define QUICK_SAFEMALLOC #define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC #define NORMAL_SAFEMALLOC
extern gptr my_malloc(uint Size,myf MyFlags); extern gptr my_malloc(uint Size,myf MyFlags);
#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG )
extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr); extern void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern my_string my_strdup(const char *from,myf MyFlags); extern my_string my_strdup(const char *from,myf MyFlags);
#define my_free(PTR,FG) my_no_flags_free(PTR) #define my_free(PTR,FG) my_no_flags_free(PTR)
#define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */
#endif #endif
#ifdef HAVE_ALLOCA #ifdef HAVE_ALLOCA
#define my_alloca(SZ) alloca((size_t) (SZ)) #define my_alloca(SZ) alloca((size_t) (SZ))
...@@ -661,8 +669,10 @@ extern my_bool real_open_cached_file(IO_CACHE *cache); ...@@ -661,8 +669,10 @@ extern my_bool real_open_cached_file(IO_CACHE *cache);
extern void close_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache);
File create_temp_file(char *to, const char *dir, const char *pfx, File create_temp_file(char *to, const char *dir, const char *pfx,
int mode, myf MyFlags); int mode, myf MyFlags);
extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, #define init_dynamic_array(A,B,C,D) _init_dynamic_array(A,B,C,D CALLER_INFO)
uint init_alloc,uint alloc_increment); #define init_dynamic_array_ci(A,B,C,D) _init_dynamic_array(A,B,C,D ORIG_CALLER_INFO)
extern my_bool _init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
uint init_alloc,uint alloc_increment CALLER_INFO_PROTO);
extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element);
extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); extern byte *alloc_dynamic(DYNAMIC_ARRAY *array);
extern byte *pop_dynamic(DYNAMIC_ARRAY*); extern byte *pop_dynamic(DYNAMIC_ARRAY*);
......
...@@ -1987,7 +1987,7 @@ loop: ...@@ -1987,7 +1987,7 @@ loop:
ptr = dict_accept(ptr, (char *) "FOREIGN", &success); ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
if (!isspace(*ptr)) { if (!isspace(*ptr)) {
return(DB_CANNOT_ADD_CONSTRAINT); goto loop;
} }
ptr = dict_accept(ptr, (char *) "KEY", &success); ptr = dict_accept(ptr, (char *) "KEY", &success);
......
...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options, ...@@ -737,7 +737,7 @@ static void mysql_read_default_options(struct st_mysql_options *options,
*end=0; /* Remove '=' */ *end=0; /* Remove '=' */
} }
/* Change all '_' in variable name to '-' */ /* Change all '_' in variable name to '-' */
for (end= *option ; (end= strcend(end,'_')) ; ) for (end= *option ; (end= strcend(end,'_')) && *end ; )
*end= '-'; *end= '-';
switch (find_type(*option+2,&option_types,2)) { switch (find_type(*option+2,&option_types,2)) {
case 1: /* port */ case 1: /* port */
......
...@@ -96,7 +96,7 @@ int FTB_WORD_cmp(void *v __attribute__((unused)), byte *a, byte *b) ...@@ -96,7 +96,7 @@ int FTB_WORD_cmp(void *v __attribute__((unused)), byte *a, byte *b)
} }
void _ftb_parse_query(FTB *ftb, byte **start, byte *end, void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
FTB_EXPR *up, uint ndepth, uint depth) FTB_EXPR *up, uint depth)
{ {
byte res; byte res;
FTB_PARAM param; FTB_PARAM param;
...@@ -125,7 +125,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ...@@ -125,7 +125,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbw->weight=weight; ftbw->weight=weight;
ftbw->up=up; ftbw->up=up;
ftbw->docid=HA_POS_ERROR; ftbw->docid=HA_POS_ERROR;
ftbw->ndepth= param.yesno<0 ? depth : ndepth; ftbw->ndepth= (param.yesno<0) + depth;
memcpy(ftbw->word+1, w.pos, w.len); memcpy(ftbw->word+1, w.pos, w.len);
ftbw->word[0]=w.len; ftbw->word[0]=w.len;
if (ftbw->yesno > 0) up->ythresh++; if (ftbw->yesno > 0) up->ythresh++;
...@@ -139,8 +139,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ...@@ -139,8 +139,7 @@ void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbe->ythresh=0; ftbe->ythresh=0;
ftbe->docid=HA_POS_ERROR; ftbe->docid=HA_POS_ERROR;
if (ftbe->yesno > 0) up->ythresh++; if (ftbe->yesno > 0) up->ythresh++;
_ftb_parse_query(ftb, start, end, ftbe, depth+1, _ftb_parse_query(ftb, start, end, ftbe, depth+1);
(param.yesno<0 ? depth+1 : ndepth));
break; break;
case 3: /* right bracket */ case 3: /* right bracket */
return; return;
...@@ -169,7 +168,7 @@ void _ftb_init_index_search(FT_INFO *ftb) ...@@ -169,7 +168,7 @@ void _ftb_init_index_search(FT_INFO *ftb)
ftbw=(FTB_WORD *)(ftb->queue.root[i]); ftbw=(FTB_WORD *)(ftb->queue.root[i]);
r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len, r=_mi_search(info, keyinfo, (uchar*) ftbw->word, ftbw->len,
SEARCH_FIND | SEARCH_PREFIX, keyroot); SEARCH_FIND | SEARCH_BIGGER, keyroot);
if (!r) if (!r)
{ {
r=_mi_compare_text(default_charset_info, r=_mi_compare_text(default_charset_info,
...@@ -224,7 +223,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ...@@ -224,7 +223,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftbe->ythresh=0; ftbe->ythresh=0;
ftbe->docid=HA_POS_ERROR; ftbe->docid=HA_POS_ERROR;
ftb->root=ftbe; ftb->root=ftbe;
_ftb_parse_query(ftb, &query, query+query_len, ftbe, 0, 0); _ftb_parse_query(ftb, &query, query+query_len, ftbe, 0);
ftb->state=READY; ftb->state=READY;
return ftb; return ftb;
} }
......
...@@ -166,6 +166,7 @@ MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd ...@@ -166,6 +166,7 @@ MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root MYSQL_MANAGER_USER=root
NO_SLAVE=0 NO_SLAVE=0
USER_TEST=
EXTRA_MASTER_OPT="" EXTRA_MASTER_OPT=""
EXTRA_MYSQL_TEST_OPT="" EXTRA_MYSQL_TEST_OPT=""
...@@ -250,6 +251,9 @@ while test $# -gt 0; do ...@@ -250,6 +251,9 @@ while test $# -gt 0; do
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1"
SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
;; ;;
--user-test=*)
USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
;;
--mysqld=*) --mysqld=*)
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"` TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP" EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
......
...@@ -150,3 +150,9 @@ select * from t1; ...@@ -150,3 +150,9 @@ select * from t1;
id title id title
1 this test once revealed a bug 1 this test once revealed a bug
update t1 set title=NULL where id=1; update t1 set title=NULL where id=1;
drop table t1;
CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) TYPE=MyISAM;
insert into t1 values (1,"I wonder why the fulltext index doesnt work?");
SELECT * from t1 where MATCH (b) AGAINST ('apples');
a b
drop table t1;
...@@ -86,6 +86,21 @@ explain select a,b from t1 union all select a,b from t2; ...@@ -86,6 +86,21 @@ explain select a,b from t1 union all select a,b from t2;
table type possible_keys key key_len ref rows Extra table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4 t1 ALL NULL NULL NULL NULL 4
t2 ALL NULL NULL NULL NULL 4 t2 ALL NULL NULL NULL NULL 4
explain select xx from t1 union select 1;
Unknown column 'xx' in 'field list'
explain select a,b from t1 union select 1;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
0 0 No tables used
explain select 1 union select a,b from t1 union select 1;
table type possible_keys key key_len ref rows Extra
0 0 No tables used
t1 ALL NULL NULL NULL NULL 4
0 0 No tables used
explain select a,b from t1 union select 1 limit 0;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
0 0 Impossible WHERE
select a,b from t1 into outfile 'skr' union select a,b from t2; select a,b from t1 into outfile 'skr' union select a,b from t2;
Wrong usage of UNION and INTO Wrong usage of UNION and INTO
select a,b from t1 order by a union select a,b from t2; select a,b from t1 order by a union select a,b from t2;
......
...@@ -129,3 +129,13 @@ check table t1; ...@@ -129,3 +129,13 @@ check table t1;
update t1 set title='this test once revealed a bug' where id=1; update t1 set title='this test once revealed a bug' where id=1;
select * from t1; select * from t1;
update t1 set title=NULL where id=1; update t1 set title=NULL where id=1;
drop table t1;
# one more bug - const_table related
CREATE TABLE t1 (a int(11), b text, FULLTEXT KEY (b)) TYPE=MyISAM;
insert into t1 values (1,"I wonder why the fulltext index doesnt work?");
SELECT * from t1 where MATCH (b) AGAINST ('apples');
drop table t1;
...@@ -24,6 +24,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g ...@@ -24,6 +24,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
# Test some error conditions with UNION # Test some error conditions with UNION
explain select a,b from t1 union all select a,b from t2; explain select a,b from t1 union all select a,b from t2;
--error 1054
explain select xx from t1 union select 1;
explain select a,b from t1 union select 1;
explain select 1 union select a,b from t1 union select 1;
explain select a,b from t1 union select 1 limit 0;
--error 1221 --error 1221
select a,b from t1 into outfile 'skr' union select a,b from t2; select a,b from t1 into outfile 'skr' union select a,b from t2;
......
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
even if space allocation failed even if space allocation failed
*/ */
my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, my_bool _init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
uint init_alloc, uint alloc_increment) uint init_alloc, uint alloc_increment CALLER_INFO_PROTO)
{ {
DBUG_ENTER("init_dynamic_array"); DBUG_ENTER("init_dynamic_array");
if (!alloc_increment) if (!alloc_increment)
{ {
alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16); alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16);
if (init_alloc > 8 && alloc_increment > init_alloc * 2) if (init_alloc > 8 && alloc_increment > init_alloc * 2)
alloc_increment=init_alloc*2; alloc_increment=init_alloc*2;
...@@ -45,7 +45,7 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, ...@@ -45,7 +45,7 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
array->max_element=init_alloc; array->max_element=init_alloc;
array->alloc_increment=alloc_increment; array->alloc_increment=alloc_increment;
array->size_of_element=element_size; array->size_of_element=element_size;
if (!(array->buffer=(char*) my_malloc(element_size*init_alloc,MYF(MY_WME)))) if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME))))
{ {
array->max_element=0; array->max_element=0;
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
...@@ -36,15 +36,15 @@ static uint calc_hashnr_caseup(const byte *key,uint length); ...@@ -36,15 +36,15 @@ static uint calc_hashnr_caseup(const byte *key,uint length);
static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length); static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length);
my_bool hash_init(HASH *hash,uint size,uint key_offset,uint key_length, my_bool _hash_init(HASH *hash,uint size,uint key_offset,uint key_length,
hash_get_key get_key, hash_get_key get_key,
void (*free_element)(void*),uint flags) void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
{ {
DBUG_ENTER("hash_init"); DBUG_ENTER("hash_init");
DBUG_PRINT("enter",("hash: %lx size: %d",hash,size)); DBUG_PRINT("enter",("hash: %lx size: %d",hash,size));
hash->records=0; hash->records=0;
if (init_dynamic_array(&hash->array,sizeof(HASH_LINK),size,0)) if (init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0))
{ {
hash->free=0; /* Allow call to hash_free */ hash->free=0; /* Allow call to hash_free */
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <m_string.h> #include <m_string.h>
#include <stdarg.h> #include <stdarg.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <assert.h>
int my_snprintf(char* to, size_t n, const char* fmt, ...) int my_snprintf(char* to, size_t n, const char* fmt, ...)
{ {
...@@ -39,7 +40,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) ...@@ -39,7 +40,7 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
*to++= *fmt; /* Copy ordinary char */ *to++= *fmt; /* Copy ordinary char */
continue; continue;
} }
/* Skipp if max size is used (to be compatible with printf) */ /* Skip if max size is used (to be compatible with printf) */
fmt++; fmt++;
while (isdigit(*fmt) || *fmt == '.' || *fmt == '-') while (isdigit(*fmt) || *fmt == '.' || *fmt == '-')
fmt++; fmt++;
...@@ -48,14 +49,13 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) ...@@ -48,14 +49,13 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
if (*fmt == 's') /* String parameter */ if (*fmt == 's') /* String parameter */
{ {
reg2 char *par = va_arg(ap, char *); reg2 char *par = va_arg(ap, char *);
uint plen; uint plen,left_len = (uint)(end-to);
if (!par) par = (char*)"(null)"; if (!par) par = (char*)"(null)";
plen = (uint) strlen(par); plen = (uint) strlen(par);
if ((uint) (end-to) > plen) /* Replace if possible */ if (left_len <= plen)
{ plen = left_len - 1;
to=strmov(to,par); to=strnmov(to,par,plen);
continue; continue;
}
} }
else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */ else if (*fmt == 'd' || *fmt == 'u') /* Integer parameter */
{ {
...@@ -74,20 +74,28 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) ...@@ -74,20 +74,28 @@ int my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
break; break;
*to++='%'; /* % used as % or unknown code */ *to++='%'; /* % used as % or unknown code */
} }
DBUG_ASSERT(to <= end);
*to='\0'; /* End of errmessage */ *to='\0'; /* End of errmessage */
return (uint) (to - start); return (uint) (to - start);
} }
#ifdef MAIN #ifdef MAIN
#define OVERRUN_SENTRY 250
static void my_printf(const char * fmt, ...) static void my_printf(const char * fmt, ...)
{ {
char buf[32]; char buf[33];
int n; int n;
va_list ar; va_list ar;
va_start(ar, fmt); va_start(ar, fmt);
n = my_vsnprintf(buf, sizeof(buf),fmt, ar); buf[sizeof(buf)-1]=OVERRUN_SENTRY;
n = my_vsnprintf(buf, sizeof(buf)-1,fmt, ar);
printf(buf); printf(buf);
printf("n=%d, strlen=%d\n", n, strlen(buf)); printf("n=%d, strlen=%d\n", n, strlen(buf));
if (buf[sizeof(buf)-1] != OVERRUN_SENTRY)
{
fprintf(stderr, "Buffer overrun\n");
abort();
}
va_end(ar); va_end(ar);
} }
......
...@@ -2108,6 +2108,7 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist) ...@@ -2108,6 +2108,7 @@ bool Item_func_match::fix_fields(THD *thd,struct st_table_list *tlist)
key=NO_SUCH_KEY; key=NO_SUCH_KEY;
const_item_cache=0; const_item_cache=0;
table=((Item_field *)fields.head())->field->table; table=((Item_field *)fields.head())->field->table;
table->fulltext_searched=1;
record=table->record[0]; record=table->record[0];
if (key == NO_SUCH_KEY && mode != FT_BOOL) if (key == NO_SUCH_KEY && mode != FT_BOOL)
{ {
......
...@@ -930,6 +930,7 @@ public: ...@@ -930,6 +930,7 @@ public:
ft_handler=0; ft_handler=0;
if(join_key) if(join_key)
table->file->ft_handler=0; table->file->ft_handler=0;
table->fulltext_searched=0;
} }
if (concat) delete concat; if (concat) delete concat;
} }
......
...@@ -237,7 +237,8 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, ...@@ -237,7 +237,8 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
/* /*
Explanation of the boolean black magic: Explanation of the boolean black magic:
if we are supposed to write magic number try write if we are supposed to write magic number try write
clean up if failed clean
up if failed
then if index_file has not been previously opened, try to open it then if index_file has not been previously opened, try to open it
clean up if failed clean up if failed
*/ */
......
...@@ -28,7 +28,7 @@ NTService::NTService() ...@@ -28,7 +28,7 @@ NTService::NTService()
//time-out variables //time-out variables
nStartTimeOut = 15000; nStartTimeOut = 15000;
nStopTimeOut = 15000; nStopTimeOut = 86400000;
nPauseTimeOut = 5000; nPauseTimeOut = 5000;
nResumeTimeOut = 5000; nResumeTimeOut = 5000;
...@@ -253,7 +253,7 @@ void NTService::ServiceMain(DWORD argc, LPTSTR *argv) ...@@ -253,7 +253,7 @@ void NTService::ServiceMain(DWORD argc, LPTSTR *argv)
WaitForSingleObject (pService->hExitEvent, INFINITE); WaitForSingleObject (pService->hExitEvent, INFINITE);
// wait for thread to exit // wait for thread to exit
if (WaitForSingleObject (pService->hThreadHandle, 1000) == WAIT_TIMEOUT) if (WaitForSingleObject (pService->hThreadHandle, INFINITE) == WAIT_TIMEOUT)
CloseHandle(pService->hThreadHandle); CloseHandle(pService->hThreadHandle);
pService->Exit(0); pService->Exit(0);
......
...@@ -361,6 +361,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, ...@@ -361,6 +361,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
abstime.tv_sec=tv.tv_sec+2; abstime.tv_sec=tv.tv_sec+2;
abstime.tv_nsec=tv.tv_usec*1000; abstime.tv_nsec=tv.tv_usec*1000;
#endif #endif
DBUG_ASSERT(cond_lock->count > 0 && cond_lock->thread == pthread_self());
pthread_cond_timedwait(term_cond, cond_lock, &abstime); pthread_cond_timedwait(term_cond, cond_lock, &abstime);
if (*slave_running) if (*slave_running)
KICK_SLAVE(thd); KICK_SLAVE(thd);
...@@ -947,7 +948,6 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname) ...@@ -947,7 +948,6 @@ int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname)
int info_fd; int info_fd;
const char* msg = 0; const char* msg = 0;
int error = 0; int error = 0;
fn_format(fname, info_fname, fn_format(fname, info_fname,
mysql_data_home, "", 4+32); mysql_data_home, "", 4+32);
pthread_mutex_lock(&rli->data_lock); pthread_mutex_lock(&rli->data_lock);
...@@ -1762,6 +1762,7 @@ reconnect done to recover from failed read"); ...@@ -1762,6 +1762,7 @@ reconnect done to recover from failed read");
from master"); from master");
goto err; goto err;
} }
flush_master_info(mi);
// TODO: check debugging abort code // TODO: check debugging abort code
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (abort_slave_event_count && !--events_till_abort) if (abort_slave_event_count && !--events_till_abort)
......
...@@ -157,6 +157,7 @@ typedef struct st_relay_log_info ...@@ -157,6 +157,7 @@ typedef struct st_relay_log_info
log_pos_current(0) log_pos_current(0)
{ {
relay_log_name[0] = master_log_name[0] = 0; relay_log_name[0] = master_log_name[0] = 0;
bzero(&info_file,sizeof(info_file));
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
pthread_cond_init(&data_cond, NULL); pthread_cond_init(&data_cond, NULL);
...@@ -271,6 +272,7 @@ typedef struct st_master_info ...@@ -271,6 +272,7 @@ typedef struct st_master_info
st_master_info():fd(-1), io_thd(0), inited(0), old_format(0) st_master_info():fd(-1), io_thd(0), inited(0), old_format(0)
{ {
host[0] = 0; user[0] = 0; password[0] = 0; host[0] = 0; user[0] = 0; password[0] = 0;
bzero(&file,sizeof(file));
pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST);
pthread_cond_init(&data_cond, NULL); pthread_cond_init(&data_cond, NULL);
......
...@@ -273,6 +273,7 @@ void intern_close_table(TABLE *table) ...@@ -273,6 +273,7 @@ void intern_close_table(TABLE *table)
free_io_cache(table); free_io_cache(table);
if (table->file) if (table->file)
VOID(closefrm(table)); // close file VOID(closefrm(table)); // close file
hash_free(&table->name_hash);
} }
......
...@@ -982,7 +982,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds, ...@@ -982,7 +982,8 @@ make_join_statistics(JOIN *join,TABLE_LIST *tables,COND *conds,
s->dependent=(table_map) 0; s->dependent=(table_map) 0;
s->key_dependent=(table_map) 0; s->key_dependent=(table_map) 0;
if ((table->system || table->file->records <= 1) && ! s->dependent && if ((table->system || table->file->records <= 1) && ! s->dependent &&
!(table->file->option_flag() & HA_NOT_EXACT_COUNT)) !(table->file->option_flag() & HA_NOT_EXACT_COUNT) &&
!table->fulltext_searched)
{ {
set_position(join,const_count++,s,(KEYUSE*) 0); set_position(join,const_count++,s,(KEYUSE*) 0);
} }
......
...@@ -1928,7 +1928,7 @@ opt_else: ...@@ -1928,7 +1928,7 @@ opt_else:
| ELSE expr { $$= $2; } | ELSE expr { $$= $2; }
when_list: when_list:
{ Select->when_list.push_front(new List<Item>) } { Select->when_list.push_front(new List<Item>); }
when_list2 when_list2
{ $$= Select->when_list.pop(); } { $$= Select->when_list.pop(); }
...@@ -2031,7 +2031,7 @@ opt_key_definition: ...@@ -2031,7 +2031,7 @@ opt_key_definition:
} }
key_usage_list: key_usage_list:
key_or_index { Select->interval_list.empty() } '(' key_usage_list2 ')' key_or_index { Select->interval_list.empty(); } '(' key_usage_list2 ')'
{ $$= &Select->interval_list; } { $$= &Select->interval_list; }
key_usage_list2: key_usage_list2:
...@@ -2637,7 +2637,7 @@ describe: ...@@ -2637,7 +2637,7 @@ describe:
YYABORT; YYABORT;
} }
opt_describe_column opt_describe_column
| describe_command select { Lex->select_lex.options|= SELECT_DESCRIBE }; | describe_command select { Lex->select_lex.options|= SELECT_DESCRIBE; }
describe_command: describe_command:
...@@ -3077,7 +3077,7 @@ set: ...@@ -3077,7 +3077,7 @@ set:
lex->select->select_limit=lex->thd->default_select_limit; lex->select->select_limit=lex->thd->default_select_limit;
lex->tx_isolation=lex->thd->tx_isolation; lex->tx_isolation=lex->thd->tx_isolation;
lex->option_type=0; lex->option_type=0;
lex->option_list.empty() lex->option_list.empty();
} }
option_value_list option_value_list
......
...@@ -603,7 +603,6 @@ int closefrm(register TABLE *table) ...@@ -603,7 +603,6 @@ int closefrm(register TABLE *table)
} }
delete table->file; delete table->file;
table->file=0; /* For easyer errorchecking */ table->file=0; /* For easyer errorchecking */
hash_free(&table->name_hash);
free_root(&table->mem_root,MYF(0)); free_root(&table->mem_root,MYF(0));
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
...@@ -95,6 +95,7 @@ struct st_table { ...@@ -95,6 +95,7 @@ struct st_table {
my_bool db_low_byte_first; /* Portable row format */ my_bool db_low_byte_first; /* Portable row format */
my_bool locked_by_flush; my_bool locked_by_flush;
my_bool locked_by_name; my_bool locked_by_name;
my_bool fulltext_searched;
my_bool crashed; my_bool crashed;
my_bool is_view; my_bool is_view;
my_bool no_keyread; my_bool no_keyread;
......
...@@ -51,7 +51,8 @@ EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \ ...@@ -51,7 +51,8 @@ EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \
strmake.c strnmov.c strmov.c strnlen.c \ strmake.c strnmov.c strmov.c strnlen.c \
bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \ bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \
strinstr-sparc.s strmake-sparc.s strmov-sparc.s \ strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
strnmov-sparc.s strstr-sparc.s strxmov-sparc.s strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
t_ctype.h
OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\ OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
__math.h time.h __time.h unistd.h __unistd.h types.h \ __math.h time.h __time.h unistd.h __unistd.h types.h \
......
...@@ -74,6 +74,7 @@ Group: Applications/Databases ...@@ -74,6 +74,7 @@ Group: Applications/Databases
Summary(pt_BR): MySQL - Cliente Summary(pt_BR): MySQL - Cliente
Group(pt_BR): Aplicaes/Banco_de_Dados Group(pt_BR): Aplicaes/Banco_de_Dados
Obsoletes: mysql-client Obsoletes: mysql-client
Provides: mysql-client
%description client %description client
This package contains the standard MySQL clients. This package contains the standard MySQL clients.
...@@ -90,6 +91,7 @@ Summary: MySQL - Benchmarks and test system ...@@ -90,6 +91,7 @@ Summary: MySQL - Benchmarks and test system
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados Group(pt_BR): Aplicaes/Banco_de_Dados
Provides: mysql-bench
Obsoletes: mysql-bench Obsoletes: mysql-bench
%description bench %description bench
...@@ -107,6 +109,7 @@ Summary: MySQL - Development header files and libraries ...@@ -107,6 +109,7 @@ Summary: MySQL - Development header files and libraries
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados Group(pt_BR): Aplicaes/Banco_de_Dados
Provides: mysql-devel
Obsoletes: mysql-devel Obsoletes: mysql-devel
%description devel %description devel
...@@ -132,6 +135,7 @@ languages and applications need to dynamically load and use MySQL. ...@@ -132,6 +135,7 @@ languages and applications need to dynamically load and use MySQL.
Release: %{release} Release: %{release}
Summary: MySQL - server with Berkeley DB and Innodb support Summary: MySQL - server with Berkeley DB and Innodb support
Group: Applications/Databases Group: Applications/Databases
Provides: mysql-Max
Obsoletes: mysql-Max Obsoletes: mysql-Max
%description Max %description Max
...@@ -202,6 +206,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \ ...@@ -202,6 +206,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
# Use the build root for temporary storage of the shared libraries. # Use the build root for temporary storage of the shared libraries.
OTHER_LIBC_DIR=/usr/local/mysql-glibc
RBR=$RPM_BUILD_ROOT RBR=$RPM_BUILD_ROOT
MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
if test -z "$RBR" -o "$RBR" = "/" if test -z "$RBR" -o "$RBR" = "/"
...@@ -212,16 +217,25 @@ fi ...@@ -212,16 +217,25 @@ fi
rm -rf $RBR rm -rf $RBR
mkdir -p $RBR mkdir -p $RBR
# Build the shared libraries and mysqld-max # We need to build shared libraries separate from mysqld-max because we
# are using --with-other-libc
BuildMySQL "--enable-shared --with-berkeley-db --with-innodb --with-mysqld-ldflags='-all-static' --with-server-suffix='-Max'" BuildMySQL "--disable-shared --with-other-libc=$OTHER_LIBC_DIR --with-berkeley-db --with-innodb --with-mysqld-ldflags='-all-static' --with-server-suffix='-Max'"
# Save everything for debug # Save everything for debug
# tar cf $RBR/all.tar . # tar cf $RBR/all.tar .
# Save shared libraries and mysqld-max # Save mysqld-max
mv sql/mysqld sql/mysqld-max mv sql/mysqld sql/mysqld-max
nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym
# Save manual to avoid rebuilding
mv Docs/manual.ps Docs/manual.ps.save
make distclean
mv Docs/manual.ps.save Docs/manual.ps
#now build and save shared libraries
BuildMySQL "--enable-shared --enable-thread-safe-client --without-server "
(cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*) (cd libmysql/.libs; tar cf $RBR/shared-libs.tar *.so*)
(cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*) (cd libmysql_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
...@@ -236,7 +250,8 @@ automake ...@@ -236,7 +250,8 @@ automake
BuildMySQL "--disable-shared" \ BuildMySQL "--disable-shared" \
"--with-mysqld-ldflags='-all-static'" \ "--with-mysqld-ldflags='-all-static'" \
"--with-client-ldflags='-all-static'" \ "--with-client-ldflags='-all-static'" \
"--without-berkeley-db --with-innodb" "--with-other-libc=$OTHER_LIBC_DIR" \
"--without-berkeley-db --without-innodb"
nm --numeric-sort sql/mysqld > sql/mysqld.sym nm --numeric-sort sql/mysqld > sql/mysqld.sym
%install -n mysql-%{mysql_version} %install -n mysql-%{mysql_version}
...@@ -319,7 +334,7 @@ chmod -R og-rw $mysql_datadir/mysql ...@@ -319,7 +334,7 @@ chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally. # Restart in the same way that mysqld will be started normally.
/etc/rc.d/init.d/mysql start /etc/rc.d/init.d/mysql start
# Allow mysqld_safe to start mysqld and print a message before we exit # Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2 sleep 2
%post Max %post Max
...@@ -416,7 +431,7 @@ fi ...@@ -416,7 +431,7 @@ fi
%files devel %files devel
%attr(755, root, root) /usr/bin/comp_err %attr(755, root, root) /usr/bin/comp_err
%attr(755, root, root) /usr/include/mysql/ %attr(755, root, root) /usr/include/mysql/
%attr(755, root, root) /usr/lib/mysql/ %attr(755, root, root) /usr/lib/mysql/*.a
%attr(755, root, root) /usr/bin/mysql_config %attr(755, root, root) /usr/bin/mysql_config
%files shared %files shared
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment