summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-03-06 19:53:31 +0200
committerunknown <monty@hundin.mysql.fi>2002-03-06 19:53:31 +0200
commitb707a1ab6b3e1c1fed2570f91da0e22715542493 (patch)
tree2b4665ab89a9c440f5e2f451d1d745df1c15288d
parenta5deff2bc90a17f4c3c19937b08660a78a085060 (diff)
parentd6998363afc004fd92248af521ed40fa52027954 (diff)
downloadmariadb-git-b707a1ab6b3e1c1fed2570f91da0e22715542493.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union Build-tools/Do-all-build-steps: Auto merged Build-tools/Do-compile: Auto merged Build-tools/Do-rpm: Auto merged Docs/manual.texi: Auto merged include/hash.h: Auto merged include/my_sys.h: Auto merged innobase/dict/dict0dict.c: Auto merged libmysql/libmysql.c: Auto merged mysql-test/t/type_date.test: Auto merged mysys/array.c: Auto merged mysys/hash.c: Auto merged mysys/mf_qsort.c: Auto merged scripts/mysqld_safe.sh: Auto merged scripts/mysqlhotcopy.sh: Auto merged sql/item_timefunc.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql-bench/server-cfg.sh: Auto merged strings/Makefile.am: Auto merged
-rwxr-xr-xBuild-tools/Do-all-build-steps2
-rwxr-xr-xBuild-tools/Do-compile6
-rwxr-xr-xBuild-tools/Do-linux-build18
-rwxr-xr-xBuild-tools/Do-rpm16
-rw-r--r--Docs/glibc-2.2.5.patch73
-rw-r--r--Docs/linuxthreads.txt17
-rw-r--r--Docs/manual.texi21
-rwxr-xr-xbdb/dist/s_recover12
-rw-r--r--client/mysql.cc22
-rw-r--r--configure.in43
-rw-r--r--include/hash.h5
-rw-r--r--include/my_sys.h14
-rw-r--r--innobase/dict/dict0dict.c2
-rw-r--r--libmysql/libmysql.c2
-rw-r--r--mysql-test/mysql-test-run.sh30
-rw-r--r--mysql-test/t/type_date.test13
-rw-r--r--mysys/array.c8
-rw-r--r--mysys/hash.c6
-rw-r--r--scripts/mysqld_safe.sh2
-rw-r--r--scripts/mysqlhotcopy.sh4
-rw-r--r--sql-bench/server-cfg.sh2
-rw-r--r--sql/item_timefunc.cc2
-rw-r--r--sql/item_timefunc.h1
-rw-r--r--sql/mysqld.cc86
-rw-r--r--sql/nt_servc.cc4
-rw-r--r--sql/sql_yacc.yy2
-rw-r--r--sql/table.cc1
-rw-r--r--strings/Makefile.am3
-rw-r--r--support-files/mysql.spec.sh29
29 files changed, 354 insertions, 92 deletions
diff --git a/Build-tools/Do-all-build-steps b/Build-tools/Do-all-build-steps
index a9989aae768..8ff8851aecd 100755
--- a/Build-tools/Do-all-build-steps
+++ b/Build-tools/Do-all-build-steps
@@ -76,7 +76,7 @@ gmake -j 2
time gmake -j 2 distcheck \
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
END
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 39af865a68e..dc08478aa43 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -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_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_distribution);
@@ -147,6 +147,10 @@ if ($opt_stage <= 1)
{
$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)
{
$opt_config_options.= " --disable-shared"; # Default for binary versions
diff --git a/Build-tools/Do-linux-build b/Build-tools/Do-linux-build
new file mode 100755
index 00000000000..e5b0a49fe75
--- /dev/null
+++ b/Build-tools/Do-linux-build
@@ -0,0 +1,18 @@
+#! /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
diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm
index 6ce8c9c3e45..92d47a8b871 100755
--- a/Build-tools/Do-rpm
+++ b/Build-tools/Do-rpm
@@ -40,7 +40,21 @@ owner=my
# Hard path!!
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"
###### Perl STUFF #####
diff --git a/Docs/glibc-2.2.5.patch b/Docs/glibc-2.2.5.patch
new file mode 100644
index 00000000000..c6bc2bf39a8
--- /dev/null
+++ b/Docs/glibc-2.2.5.patch
@@ -0,0 +1,73 @@
+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
+
diff --git a/Docs/linuxthreads.txt b/Docs/linuxthreads.txt
new file mode 100644
index 00000000000..30270125c0d
--- /dev/null
+++ b/Docs/linuxthreads.txt
@@ -0,0 +1,17 @@
+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
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 2874d484bb7..ba636ec78de 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -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.
@menu
+* News-3.23.50:: Changes in release 3.23.50
* News-3.23.49:: Changes in release 3.23.49
* News-3.23.48:: Changes in release 3.23.48
* News-3.23.47:: Changes in release 3.23.47
@@ -49051,7 +49052,23 @@ not yet 100% confident in this code.
* News-3.23.0:: Changes in release 3.23.0
@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
@itemize @bullet
@item
@@ -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
has serious problems under high load and RedHat 7.2. The 3.23.49 binary
release doesn't have this problem.
+@item
+Fixed shutdown problem on NT.
@end itemize
@node News-3.23.48, News-3.23.47, News-3.23.49, News-3.23.x
diff --git a/bdb/dist/s_recover b/bdb/dist/s_recover
index 0e8b3731c77..b0593cfc052 100755
--- a/bdb/dist/s_recover
+++ b/bdb/dist/s_recover
@@ -12,6 +12,13 @@ rm -f $loglist
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
# the list of log record types that the test suite uses.
for i in $DIR; do
@@ -19,13 +26,14 @@ for i in $DIR; do
for f in ../$i/*.src; do
# Grab the PREFIX; there should only be one per file, and
# so it's okay to just take the first.
- grep '^PREFIX' $f | head -1
+ grep '^PREFIX' $f | sed q
egrep '^DEPRECATED[ ]|^BEGIN[ ]' $f | \
awk '{print $1 "\t" $2 "\t" $3}'
done
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
[ -s $t ] && {
echo "DUPLICATE LOG VALUES:"
diff --git a/client/mysql.cc b/client/mysql.cc
index 769b4490096..941f06af529 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -38,7 +38,7 @@
#include <signal.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 */
#define MAX_COLUMN_LENGTH 1024
@@ -1886,10 +1886,17 @@ com_tee(String *buffer, char *line __attribute__((unused)))
{
while (isspace(*param))
param++;
- end=strmake(file_name, param, sizeof(file_name)-1);
+ end= strend(param);
while (end > file_name && (isspace(end[-1]) || iscntrl(end[-1])))
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);
}
if (!strlen(outfile))
@@ -1897,11 +1904,10 @@ com_tee(String *buffer, char *line __attribute__((unused)))
printf("No outfile specified!\n");
return 0;
}
- if (!opt_outfile)
- {
- init_tee();
- opt_outfile=1;
- }
+ if (opt_outfile)
+ end_tee();
+ init_tee();
+ opt_outfile= 1;
tee_fprintf(stdout, "Logging to file '%s'\n", outfile);
return 0;
}
diff --git a/configure.in b/configure.in
index f8f5d88369b..e30eb049cb3 100644
--- a/configure.in
+++ b/configure.in
@@ -426,6 +426,7 @@ fi
NOINST_LDFLAGS=
+
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 ],
[
@@ -439,8 +440,27 @@ AC_ARG_WITH(other-libc,
#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
#since gcc cannot now recognize that our headers are libc, we work around
-#by telling it to be permissive
- LDFLAGS="$LDFLAGS -static -L$other_libc_lib "
+#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 "
+ fi
+
with_mysqld_ldflags="-all-static"
with_client_ldflags="-all-static"
NOINST_LDFLAGS="-all-static"
@@ -591,6 +611,8 @@ AC_ARG_ENABLE(local-infile,
[ ENABLED_LOCAL_INFILE=no ]
)
+AC_SUBST(ENABLE_LOCAL_INFILE)
+
# Use Paul Eggerts macros from GNU tar to check for large file support.
MYSQL_SYS_LARGEFILE
@@ -2114,6 +2136,12 @@ then
linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
AC_DEFINE(THREAD_SAFE_CLIENT)
fi
+
+if test "$static_nss" = "1"
+then
+ CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS"
+fi
+
AC_SUBST(CLIENT_LIBS)
AC_SUBST(sql_client_dirs)
AC_SUBST(linked_client_targets)
@@ -2254,6 +2282,17 @@ EOF
LIBS="$MT_LD_ADD $LIBS"
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(thread_dirs)
AC_SUBST(server_scripts)
diff --git a/include/hash.h b/include/hash.h
index 8ca8d9fde02..e9c8c73c05b 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -43,9 +43,10 @@ typedef struct st_hash {
uint (*calc_hashnr)(const byte *key,uint length);
} 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,
- void (*free_element)(void*), uint flags);
+ void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
void hash_free(HASH *tree);
byte *hash_element(HASH *hash,uint idx);
gptr hash_search(HASH *info,const byte *key,uint length);
diff --git a/include/my_sys.h b/include/my_sys.h
index 61f93d665cd..45da9129aef 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -127,6 +127,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#ifdef SAFEMALLOC
#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_checkmalloc() _sanity( __FILE__, __LINE__ )
#define my_free(PTR,FLAG) _myfree( PTR, __FILE__, __LINE__,FLAG)
@@ -136,6 +137,9 @@ extern int NEAR my_errno; /* Last error in mysys */
#define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
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
#define my_checkmalloc() (0)
#undef TERMINATE
@@ -143,11 +147,15 @@ extern ulonglong safemalloc_mem_limit;
#define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC
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 void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern my_string my_strdup(const char *from,myf MyFlags);
#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
#ifdef HAVE_ALLOCA
#define my_alloca(SZ) alloca((size_t) (SZ))
@@ -661,8 +669,10 @@ extern my_bool real_open_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,
int mode, myf MyFlags);
-extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size,
- uint init_alloc,uint alloc_increment);
+#define init_dynamic_array(A,B,C,D) _init_dynamic_array(A,B,C,D CALLER_INFO)
+#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 byte *alloc_dynamic(DYNAMIC_ARRAY *array);
extern byte *pop_dynamic(DYNAMIC_ARRAY*);
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index efdac031423..91bc770320f 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -1987,7 +1987,7 @@ loop:
ptr = dict_accept(ptr, (char *) "FOREIGN", &success);
if (!isspace(*ptr)) {
- return(DB_CANNOT_ADD_CONSTRAINT);
+ goto loop;
}
ptr = dict_accept(ptr, (char *) "KEY", &success);
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 4e4518bbe10..2fecbe1c66f 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1338,7 +1338,7 @@ mysql_init(MYSQL *mysql)
/*
Only enable LOAD DATA INFILE by default if configured with
- --with-enabled-local-inflile
+ --enable-local-infile
*/
#ifdef ENABLED_LOCAL_INFILE
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 465c1cfdaa2..ec7627e46bf 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -79,8 +79,10 @@ sleep_until_file_created ()
# No paths below as we can't be sure where the program is!
-BASENAME=`which basename | head -1`
-DIFF=`which diff | head -1`
+SED=sed
+
+BASENAME=`which basename | $SED q`
+DIFF=`which diff | $SED q`
CAT=cat
CUT=cut
HEAD=head
@@ -88,13 +90,12 @@ TAIL=tail
ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible
FIND=find
-GCOV=`which gcov | head -1`
+GCOV=`which gcov | $SED q`
PRINTF=printf
RM=rm
TIME=time
TR=tr
-XARGS=`which xargs | head -1`
-SED=sed
+XARGS=`which xargs | $SED q`
# Are we using a source or a binary distribution?
@@ -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_USER=root
NO_SLAVE=0
+USER_TEST=
EXTRA_MASTER_OPT=""
EXTRA_MYSQL_TEST_OPT=""
@@ -250,6 +252,9 @@ while test $# -gt 0; do
EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1"
SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
;;
+ --user-test=*)
+ USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
+ ;;
--mysqld=*)
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
@@ -1248,11 +1253,16 @@ then
if [ x$RECORD = x1 ]; then
$ECHO "Will not run in record mode without a specific test case."
else
- for tf in $TESTDIR/*.$TESTSUFFIX
- do
- run_testcase $tf
- done
- $RM -f $TIMEFILE # Remove for full test
+ if [ -z "$USER_TEST" ]
+ then
+ for tf in $TESTDIR/*.$TESTSUFFIX
+ do
+ run_testcase $tf
+ done
+ $RM -f $TIMEFILE # Remove for full test
+ else
+ $USER_TEST
+ fi
fi
else
while [ ! -z "$1" ]; do
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 0d2e18bcc94..68c2d55aac9 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -62,3 +62,16 @@ create table t1 (date date);
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;
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;
diff --git a/mysys/array.c b/mysys/array.c
index 408747366d3..8bc19b07d4e 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -28,12 +28,12 @@
even if space allocation failed
*/
-my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
- uint init_alloc, uint alloc_increment)
+my_bool _init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
+ uint init_alloc, uint alloc_increment CALLER_INFO_PROTO)
{
DBUG_ENTER("init_dynamic_array");
if (!alloc_increment)
- {
+ {
alloc_increment=max((8192-MALLOC_OVERHEAD)/element_size,16);
if (init_alloc > 8 && 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,
array->max_element=init_alloc;
array->alloc_increment=alloc_increment;
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;
DBUG_RETURN(TRUE);
diff --git a/mysys/hash.c b/mysys/hash.c
index 0b326ebc508..b3769d1dfb2 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -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);
-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,
- void (*free_element)(void*),uint flags)
+ void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
{
DBUG_ENTER("hash_init");
DBUG_PRINT("enter",("hash: %lx size: %d",hash,size));
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 */
DBUG_RETURN(TRUE);
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 5504d929ede..e6ecbf6f729 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -291,7 +291,7 @@ do
I=1
while test "$I" -le "$numofproces"
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
do
break
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 063ff8be750..642b1fb78c9 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
-my $VERSION = "1.14";
+my $VERSION = "1.15";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
@@ -562,7 +562,7 @@ sub copy_files {
# add recursive option for scp
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
safe_system( @cp, @non_raid, $target );
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index b8c37e5922e..a4e74fcb4f9 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -958,7 +958,7 @@ sub version
{
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)
{
chomp($version);
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 8f55a02b020..9a003b79609 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -672,7 +672,7 @@ String *Item_func_date_format::val_str(String *str)
else
size=format_length(format);
if (format == str)
- str= &str_value; // Save result here
+ str= &value; // Save result here
if (str->alloc(size))
{
null_value=1;
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 32b85e7f028..aa4140192ab 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -333,6 +333,7 @@ class Item_func_date_format :public Item_str_func
{
int fixed_length;
const bool date_or_time;
+ String value;
public:
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) {}
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 187a4732aa0..961651bec3b 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -482,14 +482,28 @@ static void close_connections(void)
}
}
#ifdef __NT__
- if ( hPipe != INVALID_HANDLE_VALUE )
+if ( hPipe != INVALID_HANDLE_VALUE )
+{
+ HANDLE temp;
+ DBUG_PRINT( "quit", ("Closing named pipes") );
+
+ /* Create connection to the handle named pipe handler to break the loop */
+ if ((temp = CreateFile(szPipeName,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ 0,
+ NULL )) != INVALID_HANDLE_VALUE)
{
- HANDLE hTempPipe = &hPipe;
- DBUG_PRINT( "quit", ("Closing named pipes") );
- hPipe = INVALID_HANDLE_VALUE;
- DisconnectNamedPipe( hTempPipe );
- CloseHandle( hTempPipe );
+ WaitNamedPipe(szPipeName, 1000);
+ DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
+ SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
+ CancelIo(temp);
+ DisconnectNamedPipe(temp);
+ CloseHandle(temp);
}
+ }
#endif
#ifdef HAVE_SYS_UN_H
if (unix_sock != INVALID_SOCKET)
@@ -1906,6 +1920,14 @@ The server will not act as a slave.");
if (opt_slow_log)
open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
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())
{
sql_print_error("Can't init databases");
@@ -1931,13 +1953,8 @@ The server will not act as a slave.");
ft_init_stopwords(ft_precompiled_stopwords);
#ifdef __WIN__
-#define MYSQL_ERR_FILE "mysql.err"
if (!opt_console)
- {
- freopen(MYSQL_ERR_FILE,"a+",stdout);
- freopen(MYSQL_ERR_FILE,"a+",stderr);
- FreeConsole(); // Remove window
- }
+ FreeConsole(); // Remove window
#endif
/*
@@ -2023,7 +2040,7 @@ The server will not act as a slave.");
#ifdef __NT__
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
{
@@ -2082,42 +2099,33 @@ The server will not act as a slave.");
#ifdef EXTRA_DEBUG2
sql_print_error("After lock_thread_count");
#endif
-#else
-#if !defined(EMBEDDED_LIBRARY)
- if (Service.IsNT())
+#endif /* __WIN__ */
+
+ /* 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(start_mode)
- {
- if (WaitForSingleObject(hEventShutdown,1000)==WAIT_TIMEOUT)
- Service.Stop();
- }
+ Service.Stop();
else
{
Service.SetShutdownEvent(0);
if(hEventShutdown) CloseHandle(hEventShutdown);
}
- }
- else
- {
+ }
+ else
+ {
Service.SetShutdownEvent(0);
if(hEventShutdown) CloseHandle(hEventShutdown);
- }
-#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);
exit(0);
return(0); /* purecov: deadcode */
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index 6930800982e..8c705a94f55 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -28,7 +28,7 @@ NTService::NTService()
//time-out variables
nStartTimeOut = 15000;
- nStopTimeOut = 15000;
+ nStopTimeOut = 86400000;
nPauseTimeOut = 5000;
nResumeTimeOut = 5000;
@@ -253,7 +253,7 @@ void NTService::ServiceMain(DWORD argc, LPTSTR *argv)
WaitForSingleObject (pService->hExitEvent, INFINITE);
// wait for thread to exit
- if (WaitForSingleObject (pService->hThreadHandle, 1000) == WAIT_TIMEOUT)
+ if (WaitForSingleObject (pService->hThreadHandle, INFINITE) == WAIT_TIMEOUT)
CloseHandle(pService->hThreadHandle);
pService->Exit(0);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b12dd07777f..f01c2892edc 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -32,7 +32,7 @@
extern void yyerror(const char*);
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)
{
diff --git a/sql/table.cc b/sql/table.cc
index 9aae9e17e5a..b1cd63d465a 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -576,6 +576,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
delete outparam->file;
outparam->file=0; // For easyer errorchecking
outparam->db_stat=0;
+ hash_free(&outparam->name_hash);
free_root(&outparam->mem_root,MYF(0));
my_free(outparam->table_name,MYF(MY_ALLOW_ZERO_PTR));
DBUG_RETURN (error);
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 3bce48045b3..a29c5a3365d 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -51,7 +51,8 @@ EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \
strmake.c strnmov.c strmov.c strnlen.c \
bmove_upp-sparc.s strappend-sparc.s strend-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\
__math.h time.h __time.h unistd.h __unistd.h types.h \
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index f619bc0ee7b..291da106bc5 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -74,6 +74,7 @@ Group: Applications/Databases
Summary(pt_BR): MySQL - Cliente
Group(pt_BR): Aplicações/Banco_de_Dados
Obsoletes: mysql-client
+Provides: mysql-client
%description client
This package contains the standard MySQL clients.
@@ -90,6 +91,7 @@ Summary: MySQL - Benchmarks and test system
Group: Applications/Databases
Summary(pt_BR): MySQL - Medições de desempenho
Group(pt_BR): Aplicações/Banco_de_Dados
+Provides: mysql-bench
Obsoletes: mysql-bench
%description bench
@@ -107,6 +109,7 @@ Summary: MySQL - Development header files and libraries
Group: Applications/Databases
Summary(pt_BR): MySQL - Medições de desempenho
Group(pt_BR): Aplicações/Banco_de_Dados
+Provides: mysql-devel
Obsoletes: mysql-devel
%description devel
@@ -132,6 +135,7 @@ languages and applications need to dynamically load and use MySQL.
Release: %{release}
Summary: MySQL - server with Berkeley DB and Innodb support
Group: Applications/Databases
+Provides: mysql-Max
Obsoletes: mysql-Max
%description Max
@@ -202,26 +206,36 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
# Use the build root for temporary storage of the shared libraries.
+OTHER_LIBC_DIR=/usr/local/mysql-glibc
RBR=$RPM_BUILD_ROOT
MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
if test -z "$RBR" -o "$RBR" = "/"
then
- echo "RPM_BUILD_ROOT has stupid value"
+ echo "RPM_BUILD_ROOT has insecure value"
exit 1
fi
rm -rf $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
# tar cf $RBR/all.tar .
-# Save shared libraries and mysqld-max
+# Save mysqld-max
mv sql/mysqld sql/mysqld-max
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_r/.libs; tar rf $RBR/shared-libs.tar *.so*)
@@ -236,6 +250,7 @@ automake
BuildMySQL "--disable-shared" \
"--with-mysqld-ldflags='-all-static'" \
"--with-client-ldflags='-all-static'" \
+ "--with-other-libc=$OTHER_LIBC_DIR" \
"--without-berkeley-db --with-innodb"
nm --numeric-sort sql/mysqld > sql/mysqld.sym
@@ -416,7 +431,7 @@ fi
%files devel
%attr(755, root, root) /usr/bin/comp_err
%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
%files shared
@@ -439,6 +454,10 @@ fi
%changelog
+* Fri Feb 15 2002 Sasha
+
+- changed build to use --with-other-libc
+
* Mon Oct 8 2001 Monty
- Added embedded server as a separate RPM