List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:June 15 2009 3:59pm
Subject:bzr push into mysql-5.0-bugteam branch (gkodinov:2774)
View as plain text  
 2774 Georgi Kodinov	2009-06-15 [merge]
      automerge

    modified:
      mysql-test/t/disabled.def
=== added file 'cmd-line-utils/libedit/README'
--- a/cmd-line-utils/libedit/README	1970-01-01 00:00:00 +0000
+++ b/cmd-line-utils/libedit/README	2009-04-30 11:53:30 +0000
@@ -0,0 +1,50 @@
+An approximate method to merge from upstream is:
+
+	# Fetch latest from upstream (we also include some compat stuff)
+	$ CVS_RSH=ssh; export CVS_RSH
+	$ CVSROOT="anoncvs@stripped:/cvsroot"
+	$ cvs co -d libedit -P src/lib/libedit
+	$ mkdir libedit/np
+	$ for f in src/common/lib/libc/string/strlcat.c \
+	>          src/common/lib/libc/string/strlcpy.c \
+	>          src/include/vis.h \
+	>          src/lib/libc/gen/unvis.c \
+	>          src/lib/libc/gen/vis.c \
+	>          src/tools/compat/fgetln.c
+	> do
+	>   cvs co -P ${f}
+        >   mv ${f} libedit/np
+	> done
+	$ rm -rf src
+	$ cd libedit
+
+	# Remove files we don't need/use
+	$ rm -rf CVS TEST Makefile shlib_version *.[0-9]
+	$ (cd readline; rm -rf CVS Makefile)
+
+	# Rename files to match our naming
+	$ mv makelist makelist.sh
+	$ mv term.h el_term.h
+
+	# Remove NetBSD-specific bits
+	$ for file in $(find . -type f)
+	> do
+	>   cp ${file} ${file}.orig
+	>   sed -e 's/#include "term.h"/#include "el_term.h"/g' \
+	>       -e 's/sig_handler/el_sig_handler/g' \
+	>       -e 's/isprint/el_isprint/g' \
+	>       -e '/^__RCSID/d' \
+	>       ${file}.orig >${file}
+	>   rm ${file}.orig
+	> done
+
+then merge remaining bits by hand.  All MySQL-specific changes should be
+marked with XXXMYSQL to make them easier to identify and merge.  To generate
+a 'clean' diff against upstream you can use the above commands but use
+
+	cvs co -D "2009/02/06 20:09:00" [..]
+
+to fetch the baseline of most recent merge.
+
+Please feed any fixes to Jonathan Perkin <jperkin@stripped> who will endeavour
+to merge them upstream and keep diffs minimal.

=== removed file 'cmd-line-utils/libedit/README'
--- a/cmd-line-utils/libedit/README	2009-02-10 12:39:14 +0000
+++ b/cmd-line-utils/libedit/README	1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-An approximate method to merge from upstream is:
-
-	# Fetch latest from upstream (we also include some compat stuff)
-	$ CVS_RSH=ssh; export CVS_RSH
-	$ CVSROOT="anoncvs@stripped:/cvsroot"
-	$ cvs co -d libedit -P src/lib/libedit
-	$ mkdir libedit/np
-	$ for f in src/common/lib/libc/string/strlcat.c \
-	>          src/common/lib/libc/string/strlcpy.c \
-	>          src/include/vis.h \
-	>          src/lib/libc/gen/unvis.c \
-	>          src/lib/libc/gen/vis.c \
-	>          src/tools/compat/fgetln.c
-	> do
-	>   cvs co -P ${f}
-        >   mv ${f} libedit/np
-	> done
-	$ rm -rf src
-	$ cd libedit
-
-	# Remove files we don't need/use
-	$ rm -rf CVS TEST Makefile shlib_version *.[0-9]
-	$ (cd readline; rm -rf CVS Makefile)
-
-	# Rename files to match our naming
-	$ mv makelist makelist.sh
-	$ mv term.h el_term.h
-
-	# Remove NetBSD-specific bits
-	$ for file in $(find . -type f)
-	> do
-	>   cp ${file} ${file}.orig
-	>   sed -e 's/#include "term.h"/#include "el_term.h"/g' \
-	>       -e 's/sig_handler/el_sig_handler/g' \
-	>       -e 's/isprint/el_isprint/g' \
-	>       -e '/^__RCSID/d' \
-	>       ${file}.orig >${file}
-	>   rm ${file}.orig
-	> done
-
-then merge remaining bits by hand.  All MySQL-specific changes should be
-marked with XXXMYSQL to make them easier to identify and merge.  To generate
-a 'clean' diff against upstream you can use the above commands but use
-
-	cvs co -D "2009/02/06 20:09:00" [..]
-
-to fetch the baseline of most recent merge.
-
-Please feed any fixes to Jonathan Perkin <jperkin@stripped> who will endeavour
-to merge them upstream and keep diffs minimal.

=== added file 'cmd-line-utils/libedit/filecomplete.c'
--- a/cmd-line-utils/libedit/filecomplete.c	1970-01-01 00:00:00 +0000
+++ b/cmd-line-utils/libedit/filecomplete.c	2009-04-30 11:53:30 +0000
@@ -0,0 +1,558 @@
+/*	$NetBSD: filecomplete.c,v 1.13 2009/01/26 17:32:41 apb Exp $	*/
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* AIX requires this to be the first thing in the file.  */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#include "config.h"
+
+/* XXXMYSQL */
+#ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+#else
+# ifdef HAVE_ALLOCA_H
+#  include <alloca.h>
+# else
+#  ifndef _AIX
+extern char *alloca ();
+#  endif
+# endif
+#endif
+
+#if !defined(lint) && !defined(SCCSID)
+#endif /* not lint && not SCCSID */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <dirent.h>
+#include <string.h>
+#include <pwd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <limits.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_VIS_H
+#include <vis.h>
+#else
+#include "np/vis.h"
+#endif
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+#include "el.h"
+#include "fcns.h"		/* for EL_NUM_FCNS */
+#include "histedit.h"
+#include "filecomplete.h"
+
+static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
+    '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
+
+
+/********************************/
+/* completion functions */
+
+/*
+ * does tilde expansion of strings of type ``~user/foo''
+ * if ``user'' isn't valid user name or ``txt'' doesn't start
+ * w/ '~', returns pointer to strdup()ed copy of ``txt''
+ *
+ * it's callers's responsibility to free() returned string
+ */
+char *
+fn_tilde_expand(const char *txt)
+{
+	struct passwd pwres, *pass;
+	char *temp;
+	size_t len = 0;
+	char pwbuf[1024];
+
+	if (txt[0] != '~')
+		return (strdup(txt));
+
+	temp = strchr(txt + 1, '/');
+	if (temp == NULL) {
+		temp = strdup(txt + 1);
+		if (temp == NULL)
+			return NULL;
+	} else {
+		len = temp - txt + 1;	/* text until string after slash */
+		temp = malloc(len);
+		if (temp == NULL)
+			return NULL;
+		(void)strncpy(temp, txt + 1, len - 2);
+		temp[len - 2] = '\0';
+	}
+	/* XXXMYSQL: use non-_r functions for now */
+	if (temp[0] == 0) {
+		pass = getpwuid(getuid());
+	} else {
+		pass = getpwnam(temp);
+	}
+	free(temp);		/* value no more needed */
+	if (pass == NULL)
+		return (strdup(txt));
+
+	/* update pointer txt to point at string immedially following */
+	/* first slash */
+	txt += len;
+
+	temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1);
+	if (temp == NULL)
+		return NULL;
+	(void)sprintf(temp, "%s/%s", pass->pw_dir, txt);
+
+	return (temp);
+}
+
+
+/*
+ * return first found file name starting by the ``text'' or NULL if no
+ * such file can be found
+ * value of ``state'' is ignored
+ *
+ * it's caller's responsibility to free returned string
+ */
+char *
+fn_filename_completion_function(const char *text, int state)
+{
+	static DIR *dir = NULL;
+	static char *filename = NULL, *dirname = NULL, *dirpath = NULL;
+	static size_t filename_len = 0;
+	struct dirent *entry;
+	char *temp;
+	size_t len;
+
+	if (state == 0 || dir == NULL) {
+		temp = strrchr(text, '/');
+		if (temp) {
+			char *nptr;
+			temp++;
+			nptr = realloc(filename, strlen(temp) + 1);
+			if (nptr == NULL) {
+				free(filename);
+				return NULL;
+			}
+			filename = nptr;
+			(void)strcpy(filename, temp);
+			len = temp - text;	/* including last slash */
+			nptr = realloc(dirname, len + 1);
+			if (nptr == NULL) {
+				free(filename);
+				return NULL;
+			}
+			dirname = nptr;
+			(void)strncpy(dirname, text, len);
+			dirname[len] = '\0';
+		} else {
+			if (*text == 0)
+				filename = NULL;
+			else {
+				filename = strdup(text);
+				if (filename == NULL)
+					return NULL;
+			}
+			dirname = NULL;
+		}
+
+		if (dir != NULL) {
+			(void)closedir(dir);
+			dir = NULL;
+		}
+
+		/* support for ``~user'' syntax */
+		free(dirpath);
+
+		if (dirname == NULL && (dirname = strdup("./")) == NULL)
+			return NULL;
+
+		if (*dirname == '~')
+			dirpath = fn_tilde_expand(dirname);
+		else
+			dirpath = strdup(dirname);
+
+		if (dirpath == NULL)
+			return NULL;
+
+		dir = opendir(dirpath);
+		if (!dir)
+			return (NULL);	/* cannot open the directory */
+
+		/* will be used in cycle */
+		filename_len = filename ? strlen(filename) : 0;
+	}
+
+	/* find the match */
+	while ((entry = readdir(dir)) != NULL) {
+		/* skip . and .. */
+		if (entry->d_name[0] == '.' && (!entry->d_name[1]
+		    || (entry->d_name[1] == '.' && !entry->d_name[2])))
+			continue;
+		if (filename_len == 0)
+			break;
+		/* otherwise, get first entry where first */
+		/* filename_len characters are equal	  */
+		if (entry->d_name[0] == filename[0]
+#if HAVE_STRUCT_DIRENT_D_NAMLEN
+		    && entry->d_namlen >= filename_len
+#else
+		    && strlen(entry->d_name) >= filename_len
+#endif
+		    && strncmp(entry->d_name, filename,
+			filename_len) == 0)
+			break;
+	}
+
+	if (entry) {		/* match found */
+
+#if HAVE_STRUCT_DIRENT_D_NAMLEN
+		len = entry->d_namlen;
+#else
+		len = strlen(entry->d_name);
+#endif
+
+		temp = malloc(strlen(dirname) + len + 1);
+		if (temp == NULL)
+			return NULL;
+		(void)sprintf(temp, "%s%s", dirname, entry->d_name);
+	} else {
+		(void)closedir(dir);
+		dir = NULL;
+		temp = NULL;
+	}
+
+	return (temp);
+}
+
+
+static const char *
+append_char_function(const char *name)
+{
+	struct stat stbuf;
+	char *expname = *name == '~' ? fn_tilde_expand(name) : NULL;
+	const char *rs = " ";
+
+	if (stat(expname ? expname : name, &stbuf) == -1)
+		goto out;
+	if (S_ISDIR(stbuf.st_mode))
+		rs = "/";
+out:
+	if (expname)
+		free(expname);
+	return rs;
+}
+/*
+ * returns list of completions for text given
+ * non-static for readline.
+ */
+char ** completion_matches(const char *, char *(*)(const char *, int));
+char **
+completion_matches(const char *text, char *(*genfunc)(const char *, int))
+{
+	char **match_list = NULL, *retstr, *prevstr;
+	size_t match_list_len, max_equal, which, i;
+	size_t matches;
+
+	matches = 0;
+	match_list_len = 1;
+	while ((retstr = (*genfunc) (text, (int)matches)) != NULL) {
+		/* allow for list terminator here */
+		if (matches + 3 >= match_list_len) {
+			char **nmatch_list;
+			while (matches + 3 >= match_list_len)
+				match_list_len <<= 1;
+			nmatch_list = realloc(match_list,
+			    match_list_len * sizeof(char *));
+			if (nmatch_list == NULL) {
+				free(match_list);
+				return NULL;
+			}
+			match_list = nmatch_list;
+
+		}
+		match_list[++matches] = retstr;
+	}
+
+	if (!match_list)
+		return NULL;	/* nothing found */
+
+	/* find least denominator and insert it to match_list[0] */
+	which = 2;
+	prevstr = match_list[1];
+	max_equal = strlen(prevstr);
+	for (; which <= matches; which++) {
+		for (i = 0; i < max_equal &&
+		    prevstr[i] == match_list[which][i]; i++)
+			continue;
+		max_equal = i;
+	}
+
+	retstr = malloc(max_equal + 1);
+	if (retstr == NULL) {
+		free(match_list);
+		return NULL;
+	}
+	(void)strncpy(retstr, match_list[1], max_equal);
+	retstr[max_equal] = '\0';
+	match_list[0] = retstr;
+
+	/* add NULL as last pointer to the array */
+	match_list[matches + 1] = (char *) NULL;
+
+	return (match_list);
+}
+
+/*
+ * Sort function for qsort(). Just wrapper around strcasecmp().
+ */
+static int
+_fn_qsort_string_compare(const void *i1, const void *i2)
+{
+	const char *s1 = ((const char * const *)i1)[0];
+	const char *s2 = ((const char * const *)i2)[0];
+
+	return strcasecmp(s1, s2);
+}
+
+/*
+ * Display list of strings in columnar format on readline's output stream.
+ * 'matches' is list of strings, 'len' is number of strings in 'matches',
+ * 'max' is maximum length of string in 'matches'.
+ */
+void
+fn_display_match_list (EditLine *el, char **matches, int len, int max)
+{
+	int i, idx, limit, count;
+	int screenwidth = el->el_term.t_size.h;
+
+	/*
+	 * Find out how many entries can be put on one line, count
+	 * with two spaces between strings.
+	 */
+	limit = screenwidth / (max + 2);
+	if (limit == 0)
+		limit = 1;
+
+	/* how many lines of output */
+	count = len / limit;
+	if (count * limit < len)
+		count++;
+
+	/* Sort the items if they are not already sorted. */
+	qsort(&matches[1], (size_t)(len - 1), sizeof(char *),
+	    _fn_qsort_string_compare);
+
+	idx = 1;
+	for(; count > 0; count--) {
+		for(i = 0; i < limit && matches[idx]; i++, idx++)
+			(void)fprintf(el->el_outfile, "%-*s  ", max,
+			    matches[idx]);
+		(void)fprintf(el->el_outfile, "\n");
+	}
+}
+
+/*
+ * Complete the word at or before point,
+ * 'what_to_do' says what to do with the completion.
+ * \t   means do standard completion.
+ * `?' means list the possible completions.
+ * `*' means insert all of the possible completions.
+ * `!' means to do standard completion, and list all possible completions if
+ * there is more than one.
+ *
+ * Note: '*' support is not implemented
+ *       '!' could never be invoked
+ */
+int
+fn_complete(EditLine *el,
+	char *(*complet_func)(const char *, int),
+	char **(*attempted_completion_function)(const char *, int, int),
+	const char *word_break, const char *special_prefixes,
+	const char *(*app_func)(const char *), int query_items,
+	int *completion_type, int *over, int *point, int *end)
+{
+	const LineInfo *li;
+	char *temp, **matches;
+	const char *ctemp;
+	size_t len;
+	int what_to_do = '\t';
+	int retval = CC_NORM;
+
+	if (el->el_state.lastcmd == el->el_state.thiscmd)
+		what_to_do = '?';
+
+	/* readline's rl_complete() has to be told what we did... */
+	if (completion_type != NULL)
+		*completion_type = what_to_do;
+
+	if (!complet_func)
+		complet_func = fn_filename_completion_function;
+	if (!app_func)
+		app_func = append_char_function;
+
+	/* We now look backwards for the start of a filename/variable word */
+	li = el_line(el);
+	ctemp = (const char *) li->cursor;
+	while (ctemp > li->buffer
+	    && !strchr(word_break, ctemp[-1])
+	    && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) )
+		ctemp--;
+
+	len = li->cursor - ctemp;
+#if defined(__SSP__) || defined(__SSP_ALL__)
+	temp = malloc(len + 1);
+#else
+	temp = alloca(len + 1);
+#endif
+	(void)strncpy(temp, ctemp, len);
+	temp[len] = '\0';
+
+	/* these can be used by function called in completion_matches() */
+	/* or (*attempted_completion_function)() */
+	if (point != 0)
+		*point = li->cursor - li->buffer;
+	if (end != NULL)
+		*end = li->lastchar - li->buffer;
+
+	if (attempted_completion_function) {
+		int cur_off = li->cursor - li->buffer;
+		matches = (*attempted_completion_function) (temp,
+		    (int)(cur_off - len), cur_off);
+	} else
+		matches = 0;
+	if (!attempted_completion_function || 
+	    (over != NULL && !*over && !matches))
+		matches = completion_matches(temp, complet_func);
+
+	if (over != NULL)
+		*over = 0;
+
+	if (matches) {
+		int i;
+		int matches_num, maxlen, match_len, match_display=1;
+
+		retval = CC_REFRESH;
+		/*
+		 * Only replace the completed string with common part of
+		 * possible matches if there is possible completion.
+		 */
+		if (matches[0][0] != '\0') {
+			el_deletestr(el, (int) len);
+			el_insertstr(el, matches[0]);
+		}
+
+		if (what_to_do == '?')
+			goto display_matches;
+
+		if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) {
+			/*
+			 * We found exact match. Add a space after
+			 * it, unless we do filename completion and the
+			 * object is a directory.
+			 */
+			el_insertstr(el, (*app_func)(matches[0])); 
+		} else if (what_to_do == '!') {
+    display_matches:
+			/*
+			 * More than one match and requested to list possible
+			 * matches.
+			 */
+
+			for(i=1, maxlen=0; matches[i]; i++) {
+				match_len = strlen(matches[i]);
+				if (match_len > maxlen)
+					maxlen = match_len;
+			}
+			matches_num = i - 1;
+				
+			/* newline to get on next line from command line */
+			(void)fprintf(el->el_outfile, "\n");
+
+			/*
+			 * If there are too many items, ask user for display
+			 * confirmation.
+			 */
+			if (matches_num > query_items) {
+				(void)fprintf(el->el_outfile,
+				    "Display all %d possibilities? (y or n) ",
+				    matches_num);
+				(void)fflush(el->el_outfile);
+				if (getc(stdin) != 'y')
+					match_display = 0;
+				(void)fprintf(el->el_outfile, "\n");
+			}
+
+			if (match_display)
+				fn_display_match_list(el, matches, matches_num,
+					maxlen);
+			retval = CC_REDISPLAY;
+		} else if (matches[0][0]) {
+			/*
+			 * There was some common match, but the name was
+			 * not complete enough. Next tab will print possible
+			 * completions.
+			 */
+			el_beep(el);
+		} else {
+			/* lcd is not a valid object - further specification */
+			/* is needed */
+			el_beep(el);
+			retval = CC_NORM;
+		}
+
+		/* free elements of array and the array itself */
+		for (i = 0; matches[i]; i++)
+			free(matches[i]);
+		free(matches);
+		matches = NULL;
+	}
+#if defined(__SSP__) || defined(__SSP_ALL__)
+	free(temp);
+#endif
+	return retval;
+}
+
+/*
+ * el-compatible wrapper around rl_complete; needed for key binding
+ */
+/* ARGSUSED */
+unsigned char
+_el_fn_complete(EditLine *el, int ch __attribute__((__unused__)))
+{
+	return (unsigned char)fn_complete(el, NULL, NULL,
+	    break_chars, NULL, NULL, 100,
+	    NULL, NULL, NULL, NULL);
+}

=== removed file 'cmd-line-utils/libedit/filecomplete.c'
--- a/cmd-line-utils/libedit/filecomplete.c	2009-02-10 12:39:14 +0000
+++ b/cmd-line-utils/libedit/filecomplete.c	1970-01-01 00:00:00 +0000
@@ -1,558 +0,0 @@
-/*	$NetBSD: filecomplete.c,v 1.13 2009/01/26 17:32:41 apb Exp $	*/
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jaromir Dolecek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* AIX requires this to be the first thing in the file.  */
-#if defined (_AIX) && !defined (__GNUC__)
- #pragma alloca
-#endif
-
-#include "config.h"
-
-/* XXXMYSQL */
-#ifdef __GNUC__
-# undef alloca
-# define alloca(n) __builtin_alloca (n)
-#else
-# ifdef HAVE_ALLOCA_H
-#  include <alloca.h>
-# else
-#  ifndef _AIX
-extern char *alloca ();
-#  endif
-# endif
-#endif
-
-#if !defined(lint) && !defined(SCCSID)
-#endif /* not lint && not SCCSID */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <dirent.h>
-#include <string.h>
-#include <pwd.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_VIS_H
-#include <vis.h>
-#else
-#include "np/vis.h"
-#endif
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-#include "el.h"
-#include "fcns.h"		/* for EL_NUM_FCNS */
-#include "histedit.h"
-#include "filecomplete.h"
-
-static char break_chars[] = { ' ', '\t', '\n', '"', '\\', '\'', '`', '@', '$',
-    '>', '<', '=', ';', '|', '&', '{', '(', '\0' };
-
-
-/********************************/
-/* completion functions */
-
-/*
- * does tilde expansion of strings of type ``~user/foo''
- * if ``user'' isn't valid user name or ``txt'' doesn't start
- * w/ '~', returns pointer to strdup()ed copy of ``txt''
- *
- * it's callers's responsibility to free() returned string
- */
-char *
-fn_tilde_expand(const char *txt)
-{
-	struct passwd pwres, *pass;
-	char *temp;
-	size_t len = 0;
-	char pwbuf[1024];
-
-	if (txt[0] != '~')
-		return (strdup(txt));
-
-	temp = strchr(txt + 1, '/');
-	if (temp == NULL) {
-		temp = strdup(txt + 1);
-		if (temp == NULL)
-			return NULL;
-	} else {
-		len = temp - txt + 1;	/* text until string after slash */
-		temp = malloc(len);
-		if (temp == NULL)
-			return NULL;
-		(void)strncpy(temp, txt + 1, len - 2);
-		temp[len - 2] = '\0';
-	}
-	/* XXXMYSQL: use non-_r functions for now */
-	if (temp[0] == 0) {
-		pass = getpwuid(getuid());
-	} else {
-		pass = getpwnam(temp);
-	}
-	free(temp);		/* value no more needed */
-	if (pass == NULL)
-		return (strdup(txt));
-
-	/* update pointer txt to point at string immedially following */
-	/* first slash */
-	txt += len;
-
-	temp = malloc(strlen(pass->pw_dir) + 1 + strlen(txt) + 1);
-	if (temp == NULL)
-		return NULL;
-	(void)sprintf(temp, "%s/%s", pass->pw_dir, txt);
-
-	return (temp);
-}
-
-
-/*
- * return first found file name starting by the ``text'' or NULL if no
- * such file can be found
- * value of ``state'' is ignored
- *
- * it's caller's responsibility to free returned string
- */
-char *
-fn_filename_completion_function(const char *text, int state)
-{
-	static DIR *dir = NULL;
-	static char *filename = NULL, *dirname = NULL, *dirpath = NULL;
-	static size_t filename_len = 0;
-	struct dirent *entry;
-	char *temp;
-	size_t len;
-
-	if (state == 0 || dir == NULL) {
-		temp = strrchr(text, '/');
-		if (temp) {
-			char *nptr;
-			temp++;
-			nptr = realloc(filename, strlen(temp) + 1);
-			if (nptr == NULL) {
-				free(filename);
-				return NULL;
-			}
-			filename = nptr;
-			(void)strcpy(filename, temp);
-			len = temp - text;	/* including last slash */
-			nptr = realloc(dirname, len + 1);
-			if (nptr == NULL) {
-				free(filename);
-				return NULL;
-			}
-			dirname = nptr;
-			(void)strncpy(dirname, text, len);
-			dirname[len] = '\0';
-		} else {
-			if (*text == 0)
-				filename = NULL;
-			else {
-				filename = strdup(text);
-				if (filename == NULL)
-					return NULL;
-			}
-			dirname = NULL;
-		}
-
-		if (dir != NULL) {
-			(void)closedir(dir);
-			dir = NULL;
-		}
-
-		/* support for ``~user'' syntax */
-		free(dirpath);
-
-		if (dirname == NULL && (dirname = strdup("./")) == NULL)
-			return NULL;
-
-		if (*dirname == '~')
-			dirpath = fn_tilde_expand(dirname);
-		else
-			dirpath = strdup(dirname);
-
-		if (dirpath == NULL)
-			return NULL;
-
-		dir = opendir(dirpath);
-		if (!dir)
-			return (NULL);	/* cannot open the directory */
-
-		/* will be used in cycle */
-		filename_len = filename ? strlen(filename) : 0;
-	}
-
-	/* find the match */
-	while ((entry = readdir(dir)) != NULL) {
-		/* skip . and .. */
-		if (entry->d_name[0] == '.' && (!entry->d_name[1]
-		    || (entry->d_name[1] == '.' && !entry->d_name[2])))
-			continue;
-		if (filename_len == 0)
-			break;
-		/* otherwise, get first entry where first */
-		/* filename_len characters are equal	  */
-		if (entry->d_name[0] == filename[0]
-#if HAVE_STRUCT_DIRENT_D_NAMLEN
-		    && entry->d_namlen >= filename_len
-#else
-		    && strlen(entry->d_name) >= filename_len
-#endif
-		    && strncmp(entry->d_name, filename,
-			filename_len) == 0)
-			break;
-	}
-
-	if (entry) {		/* match found */
-
-#if HAVE_STRUCT_DIRENT_D_NAMLEN
-		len = entry->d_namlen;
-#else
-		len = strlen(entry->d_name);
-#endif
-
-		temp = malloc(strlen(dirname) + len + 1);
-		if (temp == NULL)
-			return NULL;
-		(void)sprintf(temp, "%s%s", dirname, entry->d_name);
-	} else {
-		(void)closedir(dir);
-		dir = NULL;
-		temp = NULL;
-	}
-
-	return (temp);
-}
-
-
-static const char *
-append_char_function(const char *name)
-{
-	struct stat stbuf;
-	char *expname = *name == '~' ? fn_tilde_expand(name) : NULL;
-	const char *rs = " ";
-
-	if (stat(expname ? expname : name, &stbuf) == -1)
-		goto out;
-	if (S_ISDIR(stbuf.st_mode))
-		rs = "/";
-out:
-	if (expname)
-		free(expname);
-	return rs;
-}
-/*
- * returns list of completions for text given
- * non-static for readline.
- */
-char ** completion_matches(const char *, char *(*)(const char *, int));
-char **
-completion_matches(const char *text, char *(*genfunc)(const char *, int))
-{
-	char **match_list = NULL, *retstr, *prevstr;
-	size_t match_list_len, max_equal, which, i;
-	size_t matches;
-
-	matches = 0;
-	match_list_len = 1;
-	while ((retstr = (*genfunc) (text, (int)matches)) != NULL) {
-		/* allow for list terminator here */
-		if (matches + 3 >= match_list_len) {
-			char **nmatch_list;
-			while (matches + 3 >= match_list_len)
-				match_list_len <<= 1;
-			nmatch_list = realloc(match_list,
-			    match_list_len * sizeof(char *));
-			if (nmatch_list == NULL) {
-				free(match_list);
-				return NULL;
-			}
-			match_list = nmatch_list;
-
-		}
-		match_list[++matches] = retstr;
-	}
-
-	if (!match_list)
-		return NULL;	/* nothing found */
-
-	/* find least denominator and insert it to match_list[0] */
-	which = 2;
-	prevstr = match_list[1];
-	max_equal = strlen(prevstr);
-	for (; which <= matches; which++) {
-		for (i = 0; i < max_equal &&
-		    prevstr[i] == match_list[which][i]; i++)
-			continue;
-		max_equal = i;
-	}
-
-	retstr = malloc(max_equal + 1);
-	if (retstr == NULL) {
-		free(match_list);
-		return NULL;
-	}
-	(void)strncpy(retstr, match_list[1], max_equal);
-	retstr[max_equal] = '\0';
-	match_list[0] = retstr;
-
-	/* add NULL as last pointer to the array */
-	match_list[matches + 1] = (char *) NULL;
-
-	return (match_list);
-}
-
-/*
- * Sort function for qsort(). Just wrapper around strcasecmp().
- */
-static int
-_fn_qsort_string_compare(const void *i1, const void *i2)
-{
-	const char *s1 = ((const char * const *)i1)[0];
-	const char *s2 = ((const char * const *)i2)[0];
-
-	return strcasecmp(s1, s2);
-}
-
-/*
- * Display list of strings in columnar format on readline's output stream.
- * 'matches' is list of strings, 'len' is number of strings in 'matches',
- * 'max' is maximum length of string in 'matches'.
- */
-void
-fn_display_match_list (EditLine *el, char **matches, int len, int max)
-{
-	int i, idx, limit, count;
-	int screenwidth = el->el_term.t_size.h;
-
-	/*
-	 * Find out how many entries can be put on one line, count
-	 * with two spaces between strings.
-	 */
-	limit = screenwidth / (max + 2);
-	if (limit == 0)
-		limit = 1;
-
-	/* how many lines of output */
-	count = len / limit;
-	if (count * limit < len)
-		count++;
-
-	/* Sort the items if they are not already sorted. */
-	qsort(&matches[1], (size_t)(len - 1), sizeof(char *),
-	    _fn_qsort_string_compare);
-
-	idx = 1;
-	for(; count > 0; count--) {
-		for(i = 0; i < limit && matches[idx]; i++, idx++)
-			(void)fprintf(el->el_outfile, "%-*s  ", max,
-			    matches[idx]);
-		(void)fprintf(el->el_outfile, "\n");
-	}
-}
-
-/*
- * Complete the word at or before point,
- * 'what_to_do' says what to do with the completion.
- * \t   means do standard completion.
- * `?' means list the possible completions.
- * `*' means insert all of the possible completions.
- * `!' means to do standard completion, and list all possible completions if
- * there is more than one.
- *
- * Note: '*' support is not implemented
- *       '!' could never be invoked
- */
-int
-fn_complete(EditLine *el,
-	char *(*complet_func)(const char *, int),
-	char **(*attempted_completion_function)(const char *, int, int),
-	const char *word_break, const char *special_prefixes,
-	const char *(*app_func)(const char *), int query_items,
-	int *completion_type, int *over, int *point, int *end)
-{
-	const LineInfo *li;
-	char *temp, **matches;
-	const char *ctemp;
-	size_t len;
-	int what_to_do = '\t';
-	int retval = CC_NORM;
-
-	if (el->el_state.lastcmd == el->el_state.thiscmd)
-		what_to_do = '?';
-
-	/* readline's rl_complete() has to be told what we did... */
-	if (completion_type != NULL)
-		*completion_type = what_to_do;
-
-	if (!complet_func)
-		complet_func = fn_filename_completion_function;
-	if (!app_func)
-		app_func = append_char_function;
-
-	/* We now look backwards for the start of a filename/variable word */
-	li = el_line(el);
-	ctemp = (const char *) li->cursor;
-	while (ctemp > li->buffer
-	    && !strchr(word_break, ctemp[-1])
-	    && (!special_prefixes || !strchr(special_prefixes, ctemp[-1]) ) )
-		ctemp--;
-
-	len = li->cursor - ctemp;
-#if defined(__SSP__) || defined(__SSP_ALL__)
-	temp = malloc(len + 1);
-#else
-	temp = alloca(len + 1);
-#endif
-	(void)strncpy(temp, ctemp, len);
-	temp[len] = '\0';
-
-	/* these can be used by function called in completion_matches() */
-	/* or (*attempted_completion_function)() */
-	if (point != 0)
-		*point = li->cursor - li->buffer;
-	if (end != NULL)
-		*end = li->lastchar - li->buffer;
-
-	if (attempted_completion_function) {
-		int cur_off = li->cursor - li->buffer;
-		matches = (*attempted_completion_function) (temp,
-		    (int)(cur_off - len), cur_off);
-	} else
-		matches = 0;
-	if (!attempted_completion_function || 
-	    (over != NULL && !*over && !matches))
-		matches = completion_matches(temp, complet_func);
-
-	if (over != NULL)
-		*over = 0;
-
-	if (matches) {
-		int i;
-		int matches_num, maxlen, match_len, match_display=1;
-
-		retval = CC_REFRESH;
-		/*
-		 * Only replace the completed string with common part of
-		 * possible matches if there is possible completion.
-		 */
-		if (matches[0][0] != '\0') {
-			el_deletestr(el, (int) len);
-			el_insertstr(el, matches[0]);
-		}
-
-		if (what_to_do == '?')
-			goto display_matches;
-
-		if (matches[2] == NULL && strcmp(matches[0], matches[1]) == 0) {
-			/*
-			 * We found exact match. Add a space after
-			 * it, unless we do filename completion and the
-			 * object is a directory.
-			 */
-			el_insertstr(el, (*app_func)(matches[0])); 
-		} else if (what_to_do == '!') {
-    display_matches:
-			/*
-			 * More than one match and requested to list possible
-			 * matches.
-			 */
-
-			for(i=1, maxlen=0; matches[i]; i++) {
-				match_len = strlen(matches[i]);
-				if (match_len > maxlen)
-					maxlen = match_len;
-			}
-			matches_num = i - 1;
-				
-			/* newline to get on next line from command line */
-			(void)fprintf(el->el_outfile, "\n");
-
-			/*
-			 * If there are too many items, ask user for display
-			 * confirmation.
-			 */
-			if (matches_num > query_items) {
-				(void)fprintf(el->el_outfile,
-				    "Display all %d possibilities? (y or n) ",
-				    matches_num);
-				(void)fflush(el->el_outfile);
-				if (getc(stdin) != 'y')
-					match_display = 0;
-				(void)fprintf(el->el_outfile, "\n");
-			}
-
-			if (match_display)
-				fn_display_match_list(el, matches, matches_num,
-					maxlen);
-			retval = CC_REDISPLAY;
-		} else if (matches[0][0]) {
-			/*
-			 * There was some common match, but the name was
-			 * not complete enough. Next tab will print possible
-			 * completions.
-			 */
-			el_beep(el);
-		} else {
-			/* lcd is not a valid object - further specification */
-			/* is needed */
-			el_beep(el);
-			retval = CC_NORM;
-		}
-
-		/* free elements of array and the array itself */
-		for (i = 0; matches[i]; i++)
-			free(matches[i]);
-		free(matches);
-		matches = NULL;
-	}
-#if defined(__SSP__) || defined(__SSP_ALL__)
-	free(temp);
-#endif
-	return retval;
-}
-
-/*
- * el-compatible wrapper around rl_complete; needed for key binding
- */
-/* ARGSUSED */
-unsigned char
-_el_fn_complete(EditLine *el, int ch __attribute__((__unused__)))
-{
-	return (unsigned char)fn_complete(el, NULL, NULL,
-	    break_chars, NULL, NULL, 100,
-	    NULL, NULL, NULL, NULL);
-}

=== added file 'cmd-line-utils/libedit/filecomplete.h'
--- a/cmd-line-utils/libedit/filecomplete.h	1970-01-01 00:00:00 +0000
+++ b/cmd-line-utils/libedit/filecomplete.h	2009-04-30 11:53:30 +0000
@@ -0,0 +1,44 @@
+/*	$NetBSD: filecomplete.h,v 1.6 2008/04/29 06:53:01 martin Exp $	*/
+
+/*-
+ * Copyright (c) 1997 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jaromir Dolecek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _FILECOMPLETE_H_
+#define _FILECOMPLETE_H_
+
+int fn_complete(EditLine *,
+    char *(*)(const char *, int),
+    char **(*)(const char *, int, int),
+    const char *, const char *, const char *(*)(const char *), int,
+    int *, int *, int *, int *);
+
+void fn_display_match_list(EditLine *, char **, int, int);
+char *fn_tilde_expand(const char *);
+char *fn_filename_completion_function(const char *, int);
+
+#endif

=== removed file 'cmd-line-utils/libedit/filecomplete.h'
--- a/cmd-line-utils/libedit/filecomplete.h	2009-02-10 12:39:14 +0000
+++ b/cmd-line-utils/libedit/filecomplete.h	1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-/*	$NetBSD: filecomplete.h,v 1.6 2008/04/29 06:53:01 martin Exp $	*/
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jaromir Dolecek.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef _FILECOMPLETE_H_
-#define _FILECOMPLETE_H_
-
-int fn_complete(EditLine *,
-    char *(*)(const char *, int),
-    char **(*)(const char *, int, int),
-    const char *, const char *, const char *(*)(const char *), int,
-    int *, int *, int *, int *);
-
-void fn_display_match_list(EditLine *, char **, int, int);
-char *fn_tilde_expand(const char *);
-char *fn_filename_completion_function(const char *, int);
-
-#endif

=== modified file 'configure.in'
--- a/configure.in	2009-05-08 20:41:48 +0000
+++ b/configure.in	2009-06-11 11:49:04 +0000
@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
 AC_CANONICAL_SYSTEM
 # The Docs Makefile.am parses this line!
 # remember to also change ndb version below and update version.c in ndb
-AM_INIT_AUTOMAKE(mysql, 5.0.83)
+AM_INIT_AUTOMAKE(mysql, 5.0.84)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 PROTOCOL_VERSION=10
@@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_M
 # ndb version
 NDB_VERSION_MAJOR=5
 NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=83
+NDB_VERSION_BUILD=84
 NDB_VERSION_STATUS=""
 
 # Set all version vars based on $VERSION. How do we do this more elegant ?

=== modified file 'mysql-test/Makefile.am'
--- a/mysql-test/Makefile.am	2008-06-17 07:31:29 +0000
+++ b/mysql-test/Makefile.am	2009-02-24 13:54:04 +0000
@@ -33,7 +33,7 @@ endif
 benchdir_root=		$(prefix)
 testdir =	        $(benchdir_root)/mysql-test
 EXTRA_SCRIPTS = 	mysql-test-run-shell.sh install_test_db.sh valgrind.supp $(PRESCRIPTS)
-EXTRA_DIST = 		$(EXTRA_SCRIPTS) suite
+EXTRA_DIST = 		$(EXTRA_SCRIPTS) suite collections
 GENSCRIPTS =		mysql-test-run-shell mysql-test-run install_test_db mtr
 PRESCRIPTS =		mysql-test-run.pl mysql-stress-test.pl
 test_SCRIPTS = 		$(GENSCRIPTS) $(PRESCRIPTS)
@@ -80,6 +80,7 @@ install-data-local:
 		$(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be \
 		$(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le \
 		$(DESTDIR)$(testdir)/lib \
+                $(DESTDIR)$(testdir)/collections \
 		$(DESTDIR)$(testdir)/std_data/funcs_1
 	$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
 	-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t

=== added directory 'mysql-test/collections'
=== added file 'mysql-test/collections/README'
--- a/mysql-test/collections/README	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/README	2009-02-24 10:42:11 +0000
@@ -0,0 +1,30 @@
+This directory contains collections of test runs that we run during our
+integration and release testing. Each file contains zero or more lines,
+with one invocation of mysql-test-run.pl on each. These invocations are
+written so that, with the assumption that perl is in your search path,
+any collection can run as a shell script or a batch file, with the parent
+mysql-test directory being the current working directory.
+
+During integration testing, we choose the collection to run by following
+these steps:
+
+1) We choose the extension to look for, based on these rules:
+   - If we're running a per-push test, we choose ".push" as the extension.
+   - If we're running a daily test, we choose ".daily" as the extension.
+   - If we're running a weekly test, we choose ".weekly" as the extension.
+
+2) If there is a collection that has the same name as the branch we're
+   testing plus the extension as determined in step 1, we choose that
+   collection.
+
+3) If the branch is unknown or we have removed all characters from it
+   and still not found a matching collection, we choose the name "default"
+   plus the extension determined in step 1. If there is no such file,
+   we give up and don't test anything at all.
+
+4) If we haven't found a collection yet, we remove the last character from 
+   the branch name and go back to step 2.
+
+5) The commands from the collection are run line by line via execv() or
+   similar system calls. They are not run as a shell script. Shell 
+   expansions are not guaranteed to work and most likely won't.

=== added file 'mysql-test/collections/default.daily'

=== added file 'mysql-test/collections/default.push'
--- a/mysql-test/collections/default.push	1970-01-01 00:00:00 +0000
+++ b/mysql-test/collections/default.push	2009-02-24 10:42:11 +0000
@@ -0,0 +1,2 @@
+perl mysql-test-run.pl --timer --force --comment=n_stm
+perl mysql-test-run.pl --timer --force --comment=ps_stm --ps-protocol

=== added file 'mysql-test/collections/default.weekly'

=== added file 'mysql-test/include/count_sessions.inc'
--- a/mysql-test/include/count_sessions.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/count_sessions.inc	2009-04-30 13:38:00 +0000
@@ -0,0 +1,21 @@
+# include/count_sessions.inc
+#
+# SUMMARY
+#
+#    Stores the number of current sessions in $count_sessions.
+#
+#
+# USAGE
+#
+#    Please look into include/wait_until_count_sessions.inc
+#    for examples of typical usage.
+#
+#
+# EXAMPLE
+#    backup.test, grant3.test
+#
+#
+# Created: 2009-01-14 mleich
+#
+
+let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);

=== removed file 'mysql-test/include/count_sessions.inc'
--- a/mysql-test/include/count_sessions.inc	2009-02-02 21:20:25 +0000
+++ b/mysql-test/include/count_sessions.inc	1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
-# include/count_sessions.inc
-#
-# SUMMARY
-#
-#    Stores the number of current sessions in $count_sessions.
-#
-#
-# USAGE
-#
-#    Please look into include/wait_until_count_sessions.inc
-#    for examples of typical usage.
-#
-#
-# EXAMPLE
-#    backup.test, grant3.test
-#
-#
-# Created: 2009-01-14 mleich
-#
-
-let $count_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);

=== added file 'mysql-test/include/wait_show_condition.inc'
--- a/mysql-test/include/wait_show_condition.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/wait_show_condition.inc	2009-04-30 10:42:50 +0000
@@ -0,0 +1,78 @@
+# include/wait_show_condition.inc
+#
+# SUMMARY
+#
+#    Waits until the show statement ($show_statement) has at least within one of
+#    the rows of the result set for the field ($field) a value which fulfils
+#    a condition ($condition), or the operation times out.
+#    
+#
+# USAGE
+#
+#    let $show_statement= SHOW PROCESSLIST;
+#    let $field= State;
+#    let $condition= = 'Updating';
+#    --source include/wait_show_condition.inc
+#
+#   OR
+#
+#    let $wait_timeout= 60; # Override default of 30 seconds with 60.
+#    let $show_statement= SHOW PROCESSLIST;
+#    let $field= State;
+#    let $condition= = 'Updating';
+#    --source include/wait_show_condition.inc
+#
+# Please do not use this use routine if you can replace the SHOW statement
+# with a select. In such a case include/wait_condition.inc is recommended.
+#
+# Created: 2009-02-18 mleich
+#
+
+let $max_run_time= 30;
+if ($wait_timeout)
+{
+  let $max_run_time= $wait_timeout;
+}
+# Reset $wait_timeout so that its value won't be used on subsequent
+# calls, and default will be used instead.
+let $wait_timeout= 0;
+
+# The smallest timespan till UNIX_TIMESTAMP() gets incremented is ~0 seconds.
+# We add one second to avoid the case that somebody measures timespans on a
+# real clock with fractions of seconds, detects that n seconds are sufficient,
+# assigns n to this routine and suffers because he sometimes gets n - 1
+# seconds in reality.
+inc $max_run_time;
+
+let $found= 0;
+let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
+while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
+{
+   # Sleep a bit to avoid too heavy load.
+   real_sleep 0.2;
+   let $rowno= 1;
+   let $process_result= 1;
+   while (`SELECT $process_result = 1 AND $found = 0`)
+   {
+      let $field_value= query_get_value($show_statement, $field, $rowno);
+      if (`SELECT '$field_value' $condition`)
+      {
+         let $found= 1;
+      }
+      if (`SELECT '$field_value' = 'No such row'`)
+      {
+         # We are behind the last row of the result set.
+         let $process_result= 0;
+      }
+      inc $rowno;
+   }
+}
+if (!$found)
+{
+  echo # Timeout in include/wait_show_condition.inc for $wait_condition;
+  echo #         show_statement : $show_statement;
+  echo #         field          : $field;
+  echo #         condition      : $condition;
+  echo #         max_run_time   : $max_run_time;
+}
+

=== removed file 'mysql-test/include/wait_show_condition.inc'
--- a/mysql-test/include/wait_show_condition.inc	2009-02-20 09:12:06 +0000
+++ b/mysql-test/include/wait_show_condition.inc	1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
-# include/wait_show_condition.inc
-#
-# SUMMARY
-#
-#    Waits until the show statement ($show_statement) has at least within one of
-#    the rows of the result set for the field ($field) a value which fulfils
-#    a condition ($condition), or the operation times out.
-#    
-#
-# USAGE
-#
-#    let $show_statement= SHOW PROCESSLIST;
-#    let $field= State;
-#    let $condition= = 'Updating';
-#    --source include/wait_show_condition.inc
-#
-#   OR
-#
-#    let $wait_timeout= 60; # Override default of 30 seconds with 60.
-#    let $show_statement= SHOW PROCESSLIST;
-#    let $field= State;
-#    let $condition= = 'Updating';
-#    --source include/wait_show_condition.inc
-#
-# Please do not use this use routine if you can replace the SHOW statement
-# with a select. In such a case include/wait_condition.inc is recommended.
-#
-# Created: 2009-02-18 mleich
-#
-
-let $max_run_time= 30;
-if ($wait_timeout)
-{
-  let $max_run_time= $wait_timeout;
-}
-# Reset $wait_timeout so that its value won't be used on subsequent
-# calls, and default will be used instead.
-let $wait_timeout= 0;
-
-# The smallest timespan till UNIX_TIMESTAMP() gets incremented is ~0 seconds.
-# We add one second to avoid the case that somebody measures timespans on a
-# real clock with fractions of seconds, detects that n seconds are sufficient,
-# assigns n to this routine and suffers because he sometimes gets n - 1
-# seconds in reality.
-inc $max_run_time;
-
-let $found= 0;
-let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
-while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
-{
-   # Sleep a bit to avoid too heavy load.
-   real_sleep 0.2;
-   let $rowno= 1;
-   let $process_result= 1;
-   while (`SELECT $process_result = 1 AND $found = 0`)
-   {
-      let $field_value= query_get_value($show_statement, $field, $rowno);
-      if (`SELECT '$field_value' $condition`)
-      {
-         let $found= 1;
-      }
-      if (`SELECT '$field_value' = 'No such row'`)
-      {
-         # We are behind the last row of the result set.
-         let $process_result= 0;
-      }
-      inc $rowno;
-   }
-}
-if (!$found)
-{
-  echo # Timeout in include/wait_show_condition.inc for $wait_condition;
-  echo #         show_statement : $show_statement;
-  echo #         field          : $field;
-  echo #         condition      : $condition;
-  echo #         max_run_time   : $max_run_time;
-}
-

=== added file 'mysql-test/include/wait_until_count_sessions.inc'
--- a/mysql-test/include/wait_until_count_sessions.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/wait_until_count_sessions.inc	2009-04-30 13:38:00 +0000
@@ -0,0 +1,126 @@
+# include/wait_until_count_sessions.inc
+#
+# SUMMARY
+#
+#    Waits until the passed number ($count_sessions) of concurrent sessions or
+#    a smaller number was observed via
+#       SHOW STATUS LIKE 'Threads_connected'
+#    or the operation times out.
+#    Note:
+#    1. We wait for $current_sessions <= $count_sessions because in the use case
+#       with count_sessions.inc before and wait_until_count_sessions.inc after
+#       the core of the test it could happen that the disconnects of sessions
+#       belonging to the preceeding test are not finished.
+#       sessions at test begin($count_sessions) =  m + n
+#       sessions of the previous test which will be soon disconnected = n (n >= 0)
+#       sessions at test end ($current sessions, assuming the test disconnects
+#          all additional sessions) = m
+#    2. Starting with 5.1 we could also use
+#       SELECT COUNT(*) FROM information_schema.processlist
+#       I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
+#       runs in all versions 5.0+
+#
+#
+# USAGE
+#
+#    let $count_sessions= 3;
+#    --source include/wait_until_count_sessions.inc
+#
+#    OR typical example of a test which uses more than one session
+#       Such a test could harm successing tests if there is no server shutdown
+#       and start between.
+#
+#       If the testing box is slow than the disconnect of sessions belonging to
+#       the current test might happen when the successing test gets executed.
+#       This means the successing test might see activities like unexpected
+#       rows within the general log or the PROCESSLIST.
+#       Example from bug http://bugs.mysql.com/bug.php?id=40377
+#       --- bzr_mysql-6.0-rpl/.../r/log_state.result 
+#       +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
+#       @@ -25,6 +25,7 @@
+#        event_time user_host ... command_type	argument
+#        TIMESTAMP  USER_HOST ... Query	create table t1(f1 int)
+#        TIMESTAMP  USER_HOST ... Query	select * from mysql.general_log
+#       +TIMESTAMP  USER_HOST ... Quit	
+#       ....
+#
+#       What to do?
+#       -----------
+#       <start of test>
+#       # Determine initial number of connections (set $count_sessions)
+#       --source include/count_sessions.inc
+#       ...
+#       connect (con1,.....)
+#       ...
+#       connection default;
+#       ...
+#       disconnect con1;
+#       ...
+#       # Wait until we have reached the initial number of connections
+#       # or more than the sleep time above (10 seconds) has passed.
+#       # $count_sessions
+#       --source include/wait_until_count_sessions.inc
+#       <end of test>
+#
+#       Important note about tests with unfortunate (= not cooperative
+#       to successing tests) architecture:
+#          connection con1;
+#          send SELECT ..., sleep(10)
+#          connection default;
+#          ...
+#          disconnect con1;
+#          <end of test>
+#       should be fixed by
+#          connection con1;
+#          send SELECT ..., sleep(10)
+#          connection default;
+#          ...
+#          connect con1;
+#          reap;
+#          connection default;
+#          disconnect con1;
+#          <end of test>
+#       and not only by appending include/wait_until_count_sessions.inc etc.
+#
+#
+# EXAMPLE
+#
+#    backup.test, grant3.test
+#
+#
+# Created:
+#    2009-01-14 mleich
+# Modified:
+#    2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
+#                                    random PB failures
+#
+
+let $wait_counter= 100;
+if ($wait_timeout)
+{
+   let $wait_counter= `SELECT $wait_timeout * 10`;
+}
+# Reset $wait_timeout so that its value won't be used on subsequent
+# calls, and default will be used instead.
+let $wait_timeout= 0;
+while ($wait_counter)
+{
+   let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
+   let $success= `SELECT $current_sessions <= $count_sessions`;
+   if ($success)
+   {
+      let $wait_counter= 0;
+   }
+   if (!$success)
+   {
+      real_sleep 0.1;
+      dec $wait_counter;
+   }
+}
+if (!$success)
+{
+   --echo # Timeout in wait_until_count_sessions.inc
+   --echo # Number of sessions   expected: <= $count_sessions   found: $current_sessions
+   SHOW PROCESSLIST;
+}
+

=== removed file 'mysql-test/include/wait_until_count_sessions.inc'
--- a/mysql-test/include/wait_until_count_sessions.inc	2009-03-05 13:35:03 +0000
+++ b/mysql-test/include/wait_until_count_sessions.inc	1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-# include/wait_until_count_sessions.inc
-#
-# SUMMARY
-#
-#    Waits until the passed number ($count_sessions) of concurrent sessions or
-#    a smaller number was observed via
-#       SHOW STATUS LIKE 'Threads_connected'
-#    or the operation times out.
-#    Note:
-#    1. We wait for $current_sessions <= $count_sessions because in the use case
-#       with count_sessions.inc before and wait_until_count_sessions.inc after
-#       the core of the test it could happen that the disconnects of sessions
-#       belonging to the preceeding test are not finished.
-#       sessions at test begin($count_sessions) =  m + n
-#       sessions of the previous test which will be soon disconnected = n (n >= 0)
-#       sessions at test end ($current sessions, assuming the test disconnects
-#          all additional sessions) = m
-#    2. Starting with 5.1 we could also use
-#       SELECT COUNT(*) FROM information_schema.processlist
-#       I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
-#       runs in all versions 5.0+
-#
-#
-# USAGE
-#
-#    let $count_sessions= 3;
-#    --source include/wait_until_count_sessions.inc
-#
-#    OR typical example of a test which uses more than one session
-#       Such a test could harm successing tests if there is no server shutdown
-#       and start between.
-#
-#       If the testing box is slow than the disconnect of sessions belonging to
-#       the current test might happen when the successing test gets executed.
-#       This means the successing test might see activities like unexpected
-#       rows within the general log or the PROCESSLIST.
-#       Example from bug http://bugs.mysql.com/bug.php?id=40377
-#       --- bzr_mysql-6.0-rpl/.../r/log_state.result 
-#       +++ bzr_mysql-6.0-rpl/.../r/log_state.reject
-#       @@ -25,6 +25,7 @@
-#        event_time user_host ... command_type	argument
-#        TIMESTAMP  USER_HOST ... Query	create table t1(f1 int)
-#        TIMESTAMP  USER_HOST ... Query	select * from mysql.general_log
-#       +TIMESTAMP  USER_HOST ... Quit	
-#       ....
-#
-#       What to do?
-#       -----------
-#       <start of test>
-#       # Determine initial number of connections (set $count_sessions)
-#       --source include/count_sessions.inc
-#       ...
-#       connect (con1,.....)
-#       ...
-#       connection default;
-#       ...
-#       disconnect con1;
-#       ...
-#       # Wait until we have reached the initial number of connections
-#       # or more than the sleep time above (10 seconds) has passed.
-#       # $count_sessions
-#       --source include/wait_until_count_sessions.inc
-#       <end of test>
-#
-#       Important note about tests with unfortunate (= not cooperative
-#       to successing tests) architecture:
-#          connection con1;
-#          send SELECT ..., sleep(10)
-#          connection default;
-#          ...
-#          disconnect con1;
-#          <end of test>
-#       should be fixed by
-#          connection con1;
-#          send SELECT ..., sleep(10)
-#          connection default;
-#          ...
-#          connect con1;
-#          reap;
-#          connection default;
-#          disconnect con1;
-#          <end of test>
-#       and not only by appending include/wait_until_count_sessions.inc etc.
-#
-#
-# EXAMPLE
-#
-#    backup.test, grant3.test
-#
-#
-# Created:
-#    2009-01-14 mleich
-# Modified:
-#    2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
-#                                    random PB failures
-#
-
-let $wait_counter= 100;
-if ($wait_timeout)
-{
-   let $wait_counter= `SELECT $wait_timeout * 10`;
-}
-# Reset $wait_timeout so that its value won't be used on subsequent
-# calls, and default will be used instead.
-let $wait_timeout= 0;
-while ($wait_counter)
-{
-   let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
-   let $success= `SELECT $current_sessions <= $count_sessions`;
-   if ($success)
-   {
-      let $wait_counter= 0;
-   }
-   if (!$success)
-   {
-      real_sleep 0.1;
-      dec $wait_counter;
-   }
-}
-if (!$success)
-{
-   --echo # Timeout in wait_until_count_sessions.inc
-   --echo # Number of sessions   expected: <= $count_sessions   found: $current_sessions
-   SHOW PROCESSLIST;
-}
-

=== added file 'mysql-test/r/innodb_bug42419.result'
--- a/mysql-test/r/innodb_bug42419.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/innodb_bug42419.result	2009-04-30 10:42:50 +0000
@@ -0,0 +1,17 @@
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+COMMIT;
+SET AUTOCOMMIT = 0;
+CREATE TEMPORARY TABLE t1_tmp ( b INT );
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
+SET AUTOCOMMIT = 0;
+CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
+INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+Reap the server message for connection user2 UPDATE t1 ...
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
+DROP TABLE t1;

=== removed file 'mysql-test/r/innodb_bug42419.result'
--- a/mysql-test/r/innodb_bug42419.result	2009-02-20 09:12:06 +0000
+++ b/mysql-test/r/innodb_bug42419.result	1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-COMMIT;
-SET AUTOCOMMIT = 0;
-CREATE TEMPORARY TABLE t1_tmp ( b INT );
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
-SET AUTOCOMMIT = 0;
-CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
-INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-Reap the server message for connection user2 UPDATE t1 ...
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
-DROP TABLE t1;

=== added file 'mysql-test/t/innodb_bug42419.test'
--- a/mysql-test/t/innodb_bug42419.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/innodb_bug42419.test	2009-04-30 10:42:50 +0000
@@ -0,0 +1,77 @@
+#
+# Testcase for InnoDB
+# Bug#42419 Server crash with "Pure virtual method called" on two concurrent connections
+#
+
+--source include/have_innodb.inc
+
+let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1);
+if (`SELECT $innodb_lock_wait_timeout < 10`)
+{
+   --echo # innodb_lock_wait_timeout must be >= 10 seconds
+   --echo # so that this test can work all time fine on an overloaded testing box
+   SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';
+   exit;
+}
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+# First session
+connection default;
+
+
+--enable_warnings
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
+
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+COMMIT;
+SET AUTOCOMMIT = 0;
+
+CREATE TEMPORARY TABLE t1_tmp ( b INT );
+
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
+
+# Second session
+connect (user2,localhost,root,,,$MASTER_MYPORT,$MASTER_MYSOCK);
+
+SET AUTOCOMMIT = 0;
+
+CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
+INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
+
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
+send
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
+
+# The last update will wait for a lock held by the first session
+
+# First session
+connection default;
+
+# Poll till the UPDATE of the second session waits for lock
+let $show_statement= SHOW PROCESSLIST;
+let $field= State;
+let $condition= = 'Updating';
+--source include/wait_show_condition.inc
+
+# If the testing box is overloadeded and innodb_lock_wait_timeout is too small
+# we might get here ER_LOCK_WAIT_TIMEOUT.
+--error ER_LOCK_DEADLOCK
+INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
+
+# Second session
+connection user2;
+--echo Reap the server message for connection user2 UPDATE t1 ...
+reap;
+
+# The server crashed when executing this UPDATE or the succeeding SQL command.
+UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
+
+connection default;
+disconnect user2;
+DROP TABLE t1;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc

=== removed file 'mysql-test/t/innodb_bug42419.test'
--- a/mysql-test/t/innodb_bug42419.test	2009-02-20 09:12:06 +0000
+++ b/mysql-test/t/innodb_bug42419.test	1970-01-01 00:00:00 +0000
@@ -1,77 +0,0 @@
-#
-# Testcase for InnoDB
-# Bug#42419 Server crash with "Pure virtual method called" on two concurrent connections
-#
-
---source include/have_innodb.inc
-
-let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1);
-if (`SELECT $innodb_lock_wait_timeout < 10`)
-{
-   --echo # innodb_lock_wait_timeout must be >= 10 seconds
-   --echo # so that this test can work all time fine on an overloaded testing box
-   SHOW VARIABLES LIKE 'innodb_lock_wait_timeout';
-   exit;
-}
-
-# Save the initial number of concurrent sessions
---source include/count_sessions.inc
-
-# First session
-connection default;
-
-
---enable_warnings
-CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
-
-INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
-COMMIT;
-SET AUTOCOMMIT = 0;
-
-CREATE TEMPORARY TABLE t1_tmp ( b INT );
-
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
-
-# Second session
-connect (user2,localhost,root,,,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-SET AUTOCOMMIT = 0;
-
-CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
-INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
-
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
-send
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
-
-# The last update will wait for a lock held by the first session
-
-# First session
-connection default;
-
-# Poll till the UPDATE of the second session waits for lock
-let $show_statement= SHOW PROCESSLIST;
-let $field= State;
-let $condition= = 'Updating';
---source include/wait_show_condition.inc
-
-# If the testing box is overloadeded and innodb_lock_wait_timeout is too small
-# we might get here ER_LOCK_WAIT_TIMEOUT.
---error ER_LOCK_DEADLOCK
-INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
-
-# Second session
-connection user2;
---echo Reap the server message for connection user2 UPDATE t1 ...
-reap;
-
-# The server crashed when executing this UPDATE or the succeeding SQL command.
-UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
-
-connection default;
-disconnect user2;
-DROP TABLE t1;
-
-# Wait till all disconnects are completed
---source include/wait_until_count_sessions.inc

=== modified file 'scripts/mysql_find_rows.sh'
--- a/scripts/mysql_find_rows.sh	2006-12-31 00:02:27 +0000
+++ b/scripts/mysql_find_rows.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000, 2004 MySQL AB
 # 
 # This program is free software; you can redistribute it and/or modify

=== modified file 'scripts/mysql_fix_extensions.sh'
--- a/scripts/mysql_fix_extensions.sh	2001-12-24 14:55:47 +0000
+++ b/scripts/mysql_fix_extensions.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # This is a utility for MySQL. It is not needed by any standard part
 # of MySQL.
 

=== modified file 'scripts/mysql_setpermission.sh'
--- a/scripts/mysql_setpermission.sh	2007-08-01 09:58:25 +0000
+++ b/scripts/mysql_setpermission.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ## Emacs, this is -*- perl -*- mode? :-)
 ##
 ##        Permission setter for MySQL

=== modified file 'scripts/mysql_zap.sh'
--- a/scripts/mysql_zap.sh	2006-12-31 00:02:27 +0000
+++ b/scripts/mysql_zap.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2002, 2004 MySQL AB
 # 
 # This program is free software; you can redistribute it and/or modify

=== modified file 'scripts/mysqlaccess.sh'
--- a/scripts/mysqlaccess.sh	2007-01-09 08:32:56 +0000
+++ b/scripts/mysqlaccess.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # ****************************
 package MySQLaccess;
 #use strict;

=== modified file 'sql-bench/as3ap.sh'
--- a/sql-bench/as3ap.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/as3ap.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/bench-count-distinct.sh'
--- a/sql-bench/bench-count-distinct.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/bench-count-distinct.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/bench-init.pl.sh'
--- a/sql-bench/bench-init.pl.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/bench-init.pl.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2003, 2005 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/compare-results.sh'
--- a/sql-bench/compare-results.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/compare-results.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/copy-db.sh'
--- a/sql-bench/copy-db.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/copy-db.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/crash-me.sh'
--- a/sql-bench/crash-me.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/crash-me.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # -*- perl -*-
 # Copyright (C) 2000-2006 MySQL AB
 #

=== modified file 'sql-bench/innotest1.sh'
--- a/sql-bench/innotest1.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest1.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/InnoDB combined database
 #     (c) 2002 Innobase Oy & MySQL AB

=== modified file 'sql-bench/innotest1a.sh'
--- a/sql-bench/innotest1a.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest1a.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/InnoDB combined database
 #     (c) 2002 Innobase Oy & MySQL AB

=== modified file 'sql-bench/innotest1b.sh'
--- a/sql-bench/innotest1b.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest1b.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/InnoDB combined database
 #     (c) 2002 Innobase Oy & MySQL AB

=== modified file 'sql-bench/innotest2.sh'
--- a/sql-bench/innotest2.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest2.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/InnoDB combined database
 #     (c) 2002 Innobase Oy & MySQL AB

=== modified file 'sql-bench/innotest2a.sh'
--- a/sql-bench/innotest2a.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest2a.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/Innobase combined database
 #     (c) 2000 Innobase Oy & MySQL AB

=== modified file 'sql-bench/innotest2b.sh'
--- a/sql-bench/innotest2b.sh	2003-09-25 21:12:24 +0000
+++ b/sql-bench/innotest2b.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 ############################################################################
 #     Stress test for MySQL/Innobase combined database
 #     (c) 2000 Innobase Oy & MySQL AB

=== modified file 'sql-bench/run-all-tests.sh'
--- a/sql-bench/run-all-tests.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/run-all-tests.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/server-cfg.sh'
--- a/sql-bench/server-cfg.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/server-cfg.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # -*- perl -*-
 # Copyright (C) 2000-2006 MySQL AB
 #

=== modified file 'sql-bench/test-ATIS.sh'
--- a/sql-bench/test-ATIS.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-ATIS.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-alter-table.sh'
--- a/sql-bench/test-alter-table.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-alter-table.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-big-tables.sh'
--- a/sql-bench/test-big-tables.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-big-tables.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-connect.sh'
--- a/sql-bench/test-connect.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-connect.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-create.sh'
--- a/sql-bench/test-create.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-create.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-insert.sh'
--- a/sql-bench/test-insert.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-insert.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-select.sh'
--- a/sql-bench/test-select.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-select.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-transactions.sh'
--- a/sql-bench/test-transactions.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-transactions.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or

=== modified file 'sql-bench/test-wisconsin.sh'
--- a/sql-bench/test-wisconsin.sh	2006-12-31 00:02:27 +0000
+++ b/sql-bench/test-wisconsin.sh	2009-05-09 21:43:48 +0000
@@ -1,4 +1,4 @@
-#!@PERL@
+#!/usr/bin/perl
 # Copyright (C) 2000-2001, 2003 MySQL AB
 #
 # This library is free software; you can redistribute it and/or


Attachment: [text/bzr-bundle] bzr/gkodinov@mysql.com-20090615155823-hzxvh0tmjkz12l9s.bundle
Thread
bzr push into mysql-5.0-bugteam branch (gkodinov:2774) Georgi Kodinov15 Jun