Commit fa38c84b authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

merge

parents 4508fbb5 668d09cc
...@@ -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 #####
......
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
...@@ -48998,6 +48998,7 @@ users use this code as the rest of the code and because of this we are ...@@ -48998,6 +48998,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
...@@ -49051,7 +49052,23 @@ not yet 100% confident in this code. ...@@ -49051,7 +49052,23 @@ 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.
@item
Fixed binary builds to use @code{--enable-local-infile}.
@item
Update source to work with new @code{bison} version.
@item
Updated shell scripts to new agree with new POSIX standard.
@item
Fixed bug where @code{DATE_FORMAT()} returned empty string when used
with @code{GROUP BY}.
@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
...@@ -49066,6 +49083,8 @@ Added options to make @code{LOAD DATA LOCAL INFILE} more secure. ...@@ -49066,6 +49083,8 @@ Added options to make @code{LOAD DATA LOCAL INFILE} more secure.
MySQL binary release 3.23.48 for Linux contained a new glibc library, which MySQL binary release 3.23.48 for Linux contained a new glibc library, which
has serious problems under high load and RedHat 7.2. The 3.23.49 binary has serious problems under high load and RedHat 7.2. The 3.23.49 binary
release doesn't have this problem. release doesn't have this problem.
@item
Fixed shutdown problem on NT.
@end itemize @end itemize
@node News-3.23.48, News-3.23.47, News-3.23.49, News-3.23.x @node News-3.23.48, News-3.23.47, News-3.23.49, News-3.23.x
...@@ -12,6 +12,13 @@ rm -f $loglist ...@@ -12,6 +12,13 @@ rm -f $loglist
trap 'rm -f $t; exit 1' 1 2 3 13 15 trap 'rm -f $t; exit 1' 1 2 3 13 15
# Use the standard -k option if it works;
# otherwise fall back on the traditional notation.
if sort -k 1,1 /dev/null
then sort_2_etc='-k 2'
else sort_2_etc='+1'
fi
# Check to make sure we haven't duplicated a log record entry, and build # Check to make sure we haven't duplicated a log record entry, and build
# the list of log record types that the test suite uses. # the list of log record types that the test suite uses.
for i in $DIR; do for i in $DIR; do
...@@ -19,13 +26,14 @@ for i in $DIR; do ...@@ -19,13 +26,14 @@ for i in $DIR; do
for f in ../$i/*.src; do for f in ../$i/*.src; do
# Grab the PREFIX; there should only be one per file, and # Grab the PREFIX; there should only be one per file, and
# so it's okay to just take the first. # so it's okay to just take the first.
grep '^PREFIX' $f | head -1 grep '^PREFIX' $f | sed q
egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \ egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \
awk '{print $1 "\t" $2 "\t" $3}' awk '{print $1 "\t" $2 "\t" $3}'
done done
done > $loglist done > $loglist
grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | sort +1 -n | \ grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | \
sort $sort_2_etc -n | \
uniq -d -f 1 > $t uniq -d -f 1 > $t
[ -s $t ] && { [ -s $t ] && {
echo "DUPLICATE LOG VALUES:" echo "DUPLICATE LOG VALUES:"
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <signal.h> #include <signal.h>
#include <violite.h> #include <violite.h>
const char *VER="11.20"; const char *VER="11.21";
/* Don't try to make a nice table if the data is too big */ /* Don't try to make a nice table if the data is too big */
#define MAX_COLUMN_LENGTH 1024 #define MAX_COLUMN_LENGTH 1024
...@@ -1886,10 +1886,17 @@ com_tee(String *buffer, char *line __attribute__((unused))) ...@@ -1886,10 +1886,17 @@ com_tee(String *buffer, char *line __attribute__((unused)))
{ {
while (isspace(*param)) while (isspace(*param))
param++; param++;
end=strmake(file_name, param, sizeof(file_name)-1); end= strend(param);
while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1]))) while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1])))
end--; end--;
end[0]=0; end[0]= 0;
if ((*(end - 1) == '"' && *param == '"') ||
(*(end - 1) == '\'' && *param == '\''))
{
*--end= 0;
param++;
}
strmake(file_name, param, sizeof(file_name) - 1);
strmov(outfile, file_name); strmov(outfile, file_name);
} }
if (!strlen(outfile)) if (!strlen(outfile))
...@@ -1897,11 +1904,10 @@ com_tee(String *buffer, char *line __attribute__((unused))) ...@@ -1897,11 +1904,10 @@ com_tee(String *buffer, char *line __attribute__((unused)))
printf("No outfile specified!\n"); printf("No outfile specified!\n");
return 0; return 0;
} }
if (!opt_outfile) if (opt_outfile)
{ end_tee();
init_tee(); init_tee();
opt_outfile=1; opt_outfile= 1;
}
tee_fprintf(stdout, "Logging to file '%s'\n", outfile); tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
return 0; return 0;
} }
......
...@@ -426,6 +426,7 @@ fi ...@@ -426,6 +426,7 @@ fi
NOINST_LDFLAGS= NOINST_LDFLAGS=
AC_ARG_WITH(other-libc, AC_ARG_WITH(other-libc,
[ --with-other-libc=/path/to/other/libc/dir Link against libc and other standard libraries installed in the specified non-standard location overriding default. Originally added to be able to link against glibc 2.2 without making the user upgrade the standard libc installation ], [ --with-other-libc=/path/to/other/libc/dir Link against libc and other standard libraries installed in the specified non-standard location overriding default. Originally added to be able to link against glibc 2.2 without making the user upgrade the standard libc installation ],
[ [
...@@ -440,7 +441,26 @@ AC_ARG_WITH(other-libc, ...@@ -440,7 +441,26 @@ AC_ARG_WITH(other-libc,
#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
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 " 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"
...@@ -591,6 +611,8 @@ AC_ARG_ENABLE(local-infile, ...@@ -591,6 +611,8 @@ AC_ARG_ENABLE(local-infile,
[ ENABLED_LOCAL_INFILE=no ] [ ENABLED_LOCAL_INFILE=no ]
) )
AC_SUBST(ENABLE_LOCAL_INFILE)
# 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,6 +2136,12 @@ then ...@@ -2114,6 +2136,12 @@ 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)
...@@ -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 @@ dict_create_foreign_constraints( ...@@ -1987,7 +1987,7 @@ dict_create_foreign_constraints(
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);
......
...@@ -1338,7 +1338,7 @@ mysql_init(MYSQL *mysql) ...@@ -1338,7 +1338,7 @@ mysql_init(MYSQL *mysql)
/* /*
Only enable LOAD DATA INFILE by default if configured with Only enable LOAD DATA INFILE by default if configured with
--with-enabled-local-inflile --enable-local-infile
*/ */
#ifdef ENABLED_LOCAL_INFILE #ifdef ENABLED_LOCAL_INFILE
mysql->options.client_flag|= CLIENT_LOCAL_FILES; mysql->options.client_flag|= CLIENT_LOCAL_FILES;
......
...@@ -79,8 +79,10 @@ sleep_until_file_created () ...@@ -79,8 +79,10 @@ sleep_until_file_created ()
# No paths below as we can't be sure where the program is! # No paths below as we can't be sure where the program is!
BASENAME=`which basename | head -1` SED=sed
DIFF=`which diff | head -1`
BASENAME=`which basename | $SED q`
DIFF=`which diff | $SED q`
CAT=cat CAT=cat
CUT=cut CUT=cut
HEAD=head HEAD=head
...@@ -88,13 +90,12 @@ TAIL=tail ...@@ -88,13 +90,12 @@ TAIL=tail
ECHO=echo # use internal echo if possible ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible EXPR=expr # use internal if possible
FIND=find FIND=find
GCOV=`which gcov | head -1` GCOV=`which gcov | $SED q`
PRINTF=printf PRINTF=printf
RM=rm RM=rm
TIME=time TIME=time
TR=tr TR=tr
XARGS=`which xargs | head -1` XARGS=`which xargs | $SED q`
SED=sed
# Are we using a source or a binary distribution? # Are we using a source or a binary distribution?
...@@ -166,6 +167,7 @@ MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd ...@@ -166,6 +167,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 +252,9 @@ while test $# -gt 0; do ...@@ -250,6 +252,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"
...@@ -1248,11 +1253,16 @@ then ...@@ -1248,11 +1253,16 @@ then
if [ x$RECORD = x1 ]; then if [ x$RECORD = x1 ]; then
$ECHO "Will not run in record mode without a specific test case." $ECHO "Will not run in record mode without a specific test case."
else else
if [ -z "$USER_TEST" ]
then
for tf in $TESTDIR/*.$TESTSUFFIX for tf in $TESTDIR/*.$TESTSUFFIX
do do
run_testcase $tf run_testcase $tf
done done
$RM -f $TIMEFILE # Remove for full test $RM -f $TIMEFILE # Remove for full test
else
$USER_TEST
fi
fi fi
else else
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
......
...@@ -62,3 +62,16 @@ create table t1 (date date); ...@@ -62,3 +62,16 @@ create table t1 (date date);
insert into t1 values ("2000-08-10"),("2000-08-11"); insert into t1 values ("2000-08-10"),("2000-08-11");
select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1; select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
drop table t1; drop table t1;
#
# Test problem with DATE_FORMAT
#
CREATE TABLE t1(AFIELD INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
INSERT INTO t1 VALUES(1);
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
drop table t1,t2;
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
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)
...@@ -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);
......
...@@ -291,7 +291,7 @@ do ...@@ -291,7 +291,7 @@ do
I=1 I=1
while test "$I" -le "$numofproces" while test "$I" -le "$numofproces"
do do
PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'`
for T in $PROC for T in $PROC
do do
break break
......
...@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome. ...@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file # Documentation continued at end of file
my $VERSION = "1.14"; my $VERSION = "1.15";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp"; my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
...@@ -562,7 +562,7 @@ sub copy_files { ...@@ -562,7 +562,7 @@ sub copy_files {
# add recursive option for scp # add recursive option for scp
push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/; push @cp, "-r" if $^O =~ /m^(solaris|linux|freebsd)$/ && $method =~ /^scp\b/;
my @non_raid = grep { $_ !~ m:\d\d/: } @$files; my @non_raid = grep { ! m:/\d{2}/[^/]+$: } @$files;
# add files to copy and the destination directory # add files to copy and the destination directory
safe_system( @cp, @non_raid, $target ); safe_system( @cp, @non_raid, $target );
......
...@@ -958,7 +958,7 @@ sub version ...@@ -958,7 +958,7 @@ sub version
{ {
if ($dir && -e "$dir/bin/solcon") if ($dir && -e "$dir/bin/solcon")
{ {
$version=`$dir/bin/solcon -e"ver" $main::opt_user $main::opt_password | grep Server | head -1`; $version=`$dir/bin/solcon -e"ver" $main::opt_user $main::opt_password | grep Server | sed q`;
if ($? == 0) if ($? == 0)
{ {
chomp($version); chomp($version);
......
...@@ -672,7 +672,7 @@ String *Item_func_date_format::val_str(String *str) ...@@ -672,7 +672,7 @@ String *Item_func_date_format::val_str(String *str)
else else
size=format_length(format); size=format_length(format);
if (format == str) if (format == str)
str= &str_value; // Save result here str= &value; // Save result here
if (str->alloc(size)) if (str->alloc(size))
{ {
null_value=1; null_value=1;
......
...@@ -333,6 +333,7 @@ class Item_func_date_format :public Item_str_func ...@@ -333,6 +333,7 @@ class Item_func_date_format :public Item_str_func
{ {
int fixed_length; int fixed_length;
const bool date_or_time; const bool date_or_time;
String value;
public: public:
Item_func_date_format(Item *a,Item *b,bool date_or_time_arg) Item_func_date_format(Item *a,Item *b,bool date_or_time_arg)
:Item_str_func(a,b),date_or_time(date_or_time_arg) {} :Item_str_func(a,b),date_or_time(date_or_time_arg) {}
......
...@@ -482,13 +482,27 @@ static void close_connections(void) ...@@ -482,13 +482,27 @@ static void close_connections(void)
} }
} }
#ifdef __NT__ #ifdef __NT__
if ( hPipe != INVALID_HANDLE_VALUE ) if ( hPipe != INVALID_HANDLE_VALUE )
{ {
HANDLE hTempPipe = &hPipe; HANDLE temp;
DBUG_PRINT( "quit", ("Closing named pipes") ); DBUG_PRINT( "quit", ("Closing named pipes") );
hPipe = INVALID_HANDLE_VALUE;
DisconnectNamedPipe( hTempPipe ); /* Create connection to the handle named pipe handler to break the loop */
CloseHandle( hTempPipe ); if ((temp = CreateFile(szPipeName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL )) != INVALID_HANDLE_VALUE)
{
WaitNamedPipe(szPipeName, 1000);
DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
CancelIo(temp);
DisconnectNamedPipe(temp);
CloseHandle(temp);
}
} }
#endif #endif
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
...@@ -1906,6 +1920,14 @@ The server will not act as a slave."); ...@@ -1906,6 +1920,14 @@ The server will not act as a slave.");
if (opt_slow_log) if (opt_slow_log)
open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log", open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
LOG_NORMAL); LOG_NORMAL);
#ifdef __WIN__
#define MYSQL_ERR_FILE "mysql.err"
if (!opt_console)
{
freopen(MYSQL_ERR_FILE,"a+",stdout);
freopen(MYSQL_ERR_FILE,"a+",stderr);
}
#endif
if (ha_init()) if (ha_init())
{ {
sql_print_error("Can't init databases"); sql_print_error("Can't init databases");
...@@ -1931,13 +1953,8 @@ The server will not act as a slave."); ...@@ -1931,13 +1953,8 @@ The server will not act as a slave.");
ft_init_stopwords(ft_precompiled_stopwords); ft_init_stopwords(ft_precompiled_stopwords);
#ifdef __WIN__ #ifdef __WIN__
#define MYSQL_ERR_FILE "mysql.err"
if (!opt_console) if (!opt_console)
{
freopen(MYSQL_ERR_FILE,"a+",stdout);
freopen(MYSQL_ERR_FILE,"a+",stderr);
FreeConsole(); // Remove window FreeConsole(); // Remove window
}
#endif #endif
/* /*
...@@ -2023,7 +2040,7 @@ The server will not act as a slave."); ...@@ -2023,7 +2040,7 @@ The server will not act as a slave.");
#ifdef __NT__ #ifdef __NT__
if (hPipe == INVALID_HANDLE_VALUE && !have_tcpip) if (hPipe == INVALID_HANDLE_VALUE && !have_tcpip)
{ {
sql_print_error("TCP/IP must be installed on Win98 platforms"); sql_print_error("TCP/IP or Named Pipes should be installed on NT OS");
} }
else else
{ {
...@@ -2082,15 +2099,21 @@ The server will not act as a slave."); ...@@ -2082,15 +2099,21 @@ The server will not act as a slave.");
#ifdef EXTRA_DEBUG2 #ifdef EXTRA_DEBUG2
sql_print_error("After lock_thread_count"); sql_print_error("After lock_thread_count");
#endif #endif
#else #endif /* __WIN__ */
#if !defined(EMBEDDED_LIBRARY)
/* Wait until cleanup is done */
(void) pthread_mutex_lock(&LOCK_thread_count);
while (!ready_to_exit)
{
pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
}
(void) pthread_mutex_unlock(&LOCK_thread_count);
#if defined(__WIN__) && !defined(EMBEDDED_LIBRARY)
if (Service.IsNT()) if (Service.IsNT())
{ {
if(start_mode) if(start_mode)
{
if (WaitForSingleObject(hEventShutdown,1000)==WAIT_TIMEOUT)
Service.Stop(); Service.Stop();
}
else else
{ {
Service.SetShutdownEvent(0); Service.SetShutdownEvent(0);
...@@ -2103,21 +2126,6 @@ The server will not act as a slave."); ...@@ -2103,21 +2126,6 @@ The server will not act as a slave.");
if(hEventShutdown) CloseHandle(hEventShutdown); if(hEventShutdown) CloseHandle(hEventShutdown);
} }
#endif #endif
#endif
#ifdef HAVE_OPENSSL
my_free((gptr)ssl_acceptor_fd,MYF(MY_ALLOW_ZERO_PTR));
#endif /* HAVE_OPENSSL */
/* Wait until cleanup is done */
(void) pthread_mutex_lock(&LOCK_thread_count);
DBUG_PRINT("quit", ("Got thread_count mutex for clean up wait"));
while (!ready_to_exit)
{
DBUG_PRINT("quit", ("not yet ready to exit"));
pthread_cond_wait(&COND_thread_count,&LOCK_thread_count);
}
DBUG_PRINT("quit", ("ready to exit"));
(void) pthread_mutex_unlock(&LOCK_thread_count);
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(0); exit(0);
return(0); /* purecov: deadcode */ return(0); /* purecov: deadcode */
......
...@@ -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);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
extern void yyerror(const char*); extern void yyerror(const char*);
int yylex(void *yylval); int yylex(void *yylval);
#define yyoverflow(A,B,C,D,E,F) if (my_yyoverflow((B),(D),(F))) { yyerror((char*) (A)); return 2; } #define yyoverflow(A,B,C,D,E,F) if (my_yyoverflow((B),(D),(int*) (F))) { yyerror((char*) (A)); return 2; }
inline Item *or_or_concat(Item* A, Item* B) inline Item *or_or_concat(Item* A, Item* B)
{ {
......
...@@ -576,6 +576,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, ...@@ -576,6 +576,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
delete outparam->file; delete outparam->file;
outparam->file=0; // For easyer errorchecking outparam->file=0; // For easyer errorchecking
outparam->db_stat=0; outparam->db_stat=0;
hash_free(&outparam->name_hash);
free_root(&outparam->mem_root,MYF(0)); free_root(&outparam->mem_root,MYF(0));
my_free(outparam->table_name,MYF(MY_ALLOW_ZERO_PTR)); my_free(outparam->table_name,MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN (error); DBUG_RETURN (error);
......
...@@ -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,26 +206,36 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \ ...@@ -202,26 +206,36 @@ 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" = "/"
then then
echo "RPM_BUILD_ROOT has stupid value" echo "RPM_BUILD_ROOT has insecure value"
exit 1 exit 1
fi 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,6 +250,7 @@ automake ...@@ -236,6 +250,7 @@ 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'" \
"--with-other-libc=$OTHER_LIBC_DIR" \
"--without-berkeley-db --with-innodb" "--without-berkeley-db --with-innodb"
nm --numeric-sort sql/mysqld > sql/mysqld.sym nm --numeric-sort sql/mysqld > sql/mysqld.sym
...@@ -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
...@@ -439,6 +454,10 @@ fi ...@@ -439,6 +454,10 @@ fi
%changelog %changelog
* Fri Feb 15 2002 Sasha
- changed build to use --with-other-libc
* Mon Oct 8 2001 Monty * Mon Oct 8 2001 Monty
- Added embedded server as a separate RPM - Added embedded server as a separate RPM
......
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