]> git.pld-linux.org Git - packages/mysql.git/blame - mysql-bk-20071202.patch
- update from bk (future 4.1.24)
[packages/mysql.git] / mysql-bk-20071202.patch
Content-type: text/html ]> git.pld-linux.org Git - packages/mysql.git/blame - mysql-bk-20071202.patch


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 6) line 1, <$fd> line 4970.
This page took 0.357209 seconds and 4 git commands to generate.
CommitLineData
3f28115d
AM
1diff -urN mysql-4.1.23/BK/keys mysql-4.1/BK/keys
2--- mysql-4.1.23/BK/keys 2007-12-02 20:38:52.000000000 +0100
3+++ mysql-4.1/BK/keys 2007-11-29 23:23:39.000000000 +0100
4@@ -1,2 +1,2 @@
5 ROOTKEY=3985cf0cwNRCED_XNSCA7RvkLPer2Q
6-TIPKEY=466e5874F5N8tMqwd_kEmlTPE9UlnA
7+TIPKEY=47448694WzdmhSoqwUkknsFfid9jmw
8diff -urN mysql-4.1.23/client/mysqldump.c mysql-4.1/client/mysqldump.c
9--- mysql-4.1.23/client/mysqldump.c 2007-12-02 20:38:26.000000000 +0100
10+++ mysql-4.1/client/mysqldump.c 2007-10-04 08:27:01.000000000 +0200
11@@ -2428,6 +2428,18 @@
12 need the REPEATABLE READ level (not anything lower, for example READ
13 COMMITTED would give one new consistent read per dumped table).
14 */
15+ if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data)
16+ {
17+ fprintf(stderr, "-- %s: the combination of --single-transaction and "
18+ "--master-data requires a MySQL server version of at least 4.1 "
19+ "(current server's version is %s). %s\n",
20+ ignore_errors ? "Warning" : "Error",
21+ mysql_con->server_version ? mysql_con->server_version : "unknown",
22+ ignore_errors ? "Continuing due to --force, backup may not be consistent across all tables!" : "Aborting.");
23+ if (!ignore_errors)
24+ exit(EX_MYSQLERR);
25+ }
26+
27 return (mysql_query_with_error_report(mysql_con, 0,
28 "SET SESSION TRANSACTION ISOLATION "
29 "LEVEL REPEATABLE READ") ||
30diff -urN mysql-4.1.23/client/mysqltest.c mysql-4.1/client/mysqltest.c
31--- mysql-4.1.23/client/mysqltest.c 2007-12-02 20:38:52.000000000 +0100
32+++ mysql-4.1/client/mysqltest.c 2007-06-01 19:57:26.000000000 +0200
33@@ -1125,6 +1125,50 @@
34 }
35
36
37+/*
38+ Remove surrounding chars from string
39+
40+ Return 1 if first character is found but not last
41+*/
42+static int strip_surrounding(char* str, char c1, char c2)
43+{
44+ char* ptr= str;
45+
46+ /* Check if the first non space character is c1 */
47+ while(*ptr && my_isspace(charset_info, *ptr))
48+ ptr++;
49+ if (*ptr == c1)
50+ {
51+ /* Replace it with a space */
52+ *ptr= ' ';
53+
54+ /* Last non space charecter should be c2 */
55+ ptr= strend(str)-1;
56+ while(*ptr && my_isspace(charset_info, *ptr))
57+ ptr--;
58+ if (*ptr == c2)
59+ {
60+ /* Replace it with \0 */
61+ *ptr= 0;
62+ }
63+ else
64+ {
65+ /* Mismatch detected */
66+ return 1;
67+ }
68+ }
69+ return 0;
70+}
71+
72+
73+static void strip_parentheses(struct st_command *command)
74+{
75+ if (strip_surrounding(command->first_argument, '(', ')'))
76+ die("%.*s - argument list started with '%c' must be ended with '%c'",
77+ command->first_word_len, command->query, '(', ')');
78+}
79+
80+
81 static byte *get_var_key(const byte* var, uint* len,
82 my_bool __attribute__((unused)) t)
83 {
84@@ -1380,12 +1424,11 @@
85 init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
86 do_eval(&ds_query, query, end, FALSE);
87
88- if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
89- !(res = mysql_store_result(mysql)))
90- {
91+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
92 die("Error running query '%s': %d %s", ds_query.str,
93 mysql_errno(mysql), mysql_error(mysql));
94- }
95+ if (!(res= mysql_store_result(mysql)))
96+ die("Query '%s' didn't return a result set", ds_query.str);
97 dynstr_free(&ds_query);
98
99 if ((row = mysql_fetch_row(res)) && row[0])
100@@ -1440,6 +1483,130 @@
101 }
102
103
104+/*
105+ Set variable from the result of a field in a query
106+
107+ This function is useful when checking for a certain value
108+ in the output from a query that can't be restricted to only
109+ return some values. A very good example of that is most SHOW
110+ commands.
111+
112+ SYNOPSIS
113+ var_set_query_get_value()
114+
115+ DESCRIPTION
116+ let $variable= query_get_value(<query to run>,<column name>,<row no>);
117+
118+ <query to run> - The query that should be sent to the server
119+ <column name> - Name of the column that holds the field be compared
120+ against the expected value
121+ <row no> - Number of the row that holds the field to be
122+ compared against the expected value
123+
124+*/
125+
126+void var_set_query_get_value(struct st_command *command, VAR *var)
127+{
128+ ulong row_no;
129+ int col_no= -1;
130+ MYSQL_RES* res;
131+ MYSQL* mysql= &cur_con->mysql;
132+
133+ static DYNAMIC_STRING ds_query;
134+ static DYNAMIC_STRING ds_col;
135+ static DYNAMIC_STRING ds_row;
136+ const struct command_arg query_get_value_args[] = {
137+ "query", ARG_STRING, TRUE, &ds_query, "Query to run",
138+ "column name", ARG_STRING, TRUE, &ds_col, "Name of column",
139+ "row number", ARG_STRING, TRUE, &ds_row, "Number for row",
140+ };
141+
142+ DBUG_ENTER("var_set_query_get_value");
143+ LINT_INIT(res);
144+
145+ strip_parentheses(command);
146+ DBUG_PRINT("info", ("query: %s", command->query));
147+ check_command_args(command, command->first_argument, query_get_value_args,
148+ sizeof(query_get_value_args)/sizeof(struct command_arg),
149+ ',');
150+
151+ DBUG_PRINT("info", ("query: %s", ds_query.str));
152+ DBUG_PRINT("info", ("col: %s", ds_col.str));
153+
154+ /* Convert row number to int */
155+ if (!str2int(ds_row.str, 10, (long) 0, (long) INT_MAX, &row_no))
156+ die("Invalid row number: '%s'", ds_row.str);
157+ DBUG_PRINT("info", ("row: %s, row_no: %ld", ds_row.str, row_no));
158+ dynstr_free(&ds_row);
159+
160+ /* Remove any surrounding "'s from the query - if there is any */
161+ if (strip_surrounding(ds_query.str, '"', '"'))
162+ die("Mismatched \"'s around query '%s'", ds_query.str);
163+
164+ /* Run the query */
165+ if (mysql_real_query(mysql, ds_query.str, ds_query.length))
166+ die("Error running query '%s': %d %s", ds_query.str,
167+ mysql_errno(mysql), mysql_error(mysql));
168+ if (!(res= mysql_store_result(mysql)))
169+ die("Query '%s' didn't return a result set", ds_query.str);
170+
171+ {
172+ /* Find column number from the given column name */
173+ uint i;
174+ uint num_fields= mysql_num_fields(res);
175+ MYSQL_FIELD *fields= mysql_fetch_fields(res);
176+
177+ for (i= 0; i < num_fields; i++)
178+ {
179+ if (strcmp(fields[i].name, ds_col.str) == 0 &&
180+ strlen(fields[i].name) == ds_col.length)
181+ {
182+ col_no= i;
183+ break;
184+ }
185+ }
186+ if (col_no == -1)
187+ {
188+ mysql_free_result(res);
189+ die("Could not find column '%s' in the result of '%s'",
190+ ds_col.str, ds_query.str);
191+ }
192+ DBUG_PRINT("info", ("Found column %d with name '%s'",
193+ i, fields[i].name));
194+ }
195+ dynstr_free(&ds_col);
196+
197+ {
198+ /* Get the value */
199+ MYSQL_ROW row;
200+ ulong rows= 0;
201+ const char* value= "No such row";
202+
203+ while ((row= mysql_fetch_row(res)))
204+ {
205+ if (++rows == row_no)
206+ {
207+
208+ DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
209+ row_no, col_no, row[col_no]));
210+ /* Found the row to get */
211+ if (row[col_no])
212+ value= row[col_no];
213+ else
214+ value= "NULL";
215+
216+ break;
217+ }
218+ }
219+ eval_expr(var, value, 0);
220+ }
221+ dynstr_free(&ds_query);
222+ mysql_free_result(res);
223+
224+ DBUG_VOID_RETURN;
225+}
226+
227+
228 void var_copy(VAR *dest, VAR *src)
229 {
230 dest->int_val= src->int_val;
231@@ -1463,26 +1630,47 @@
232
233 void eval_expr(VAR *v, const char *p, const char **p_end)
234 {
235- static int MIN_VAR_ALLOC= 32; /* MASV why 32? */
236- VAR *vp;
237+
238+ DBUG_ENTER("eval_expr");
239+ DBUG_PRINT("enter", ("p: '%s'", p));
240+
241 if (*p == '$')
242 {
243+ VAR *vp;
244 if ((vp= var_get(p, p_end, 0, 0)))
245- {
246 var_copy(v, vp);
247- return;
248- }
249+ DBUG_VOID_RETURN;
250 }
251- else if (*p == '`')
252+
253+ if (*p == '`')
254 {
255 var_query_set(v, p, p_end);
256+ DBUG_VOID_RETURN;
257 }
258- else
259+
260+ {
261+ /* Check if this is a "let $var= query_get_value()" */
262+ const char* get_value_str= "query_get_value";
263+ const size_t len= strlen(get_value_str);
264+ if (strncmp(p, get_value_str, len)==0)
265+ {
266+ struct st_command command;
267+ memset(&command, 0, sizeof(command));
268+ command.query= (char*)p;
269+ command.first_word_len= len;
270+ command.first_argument= command.query + len;
271+ command.end= (char*)*p_end;
272+ var_set_query_get_value(&command, v);
273+ DBUG_VOID_RETURN;
274+ }
275+ }
276+
277 {
278 int new_val_len = (p_end && *p_end) ?
279 (int) (*p_end - p) : (int) strlen(p);
280 if (new_val_len + 1 >= v->alloced_len)
281 {
282+ static int MIN_VAR_ALLOC= 32;
283 v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
284 MIN_VAR_ALLOC : new_val_len + 1;
285 if (!(v->str_val =
286@@ -1495,9 +1683,10 @@
287 memcpy(v->str_val, p, new_val_len);
288 v->str_val[new_val_len] = 0;
289 v->int_val=atoi(p);
290+ DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
291 v->int_dirty=0;
292 }
293- return;
294+ DBUG_VOID_RETURN;
295 }
296
297
298@@ -3432,7 +3621,6 @@
299 int con_port= port;
300 char *con_options;
301 bool con_ssl= 0, con_compress= 0;
302- char *ptr;
303
304 static DYNAMIC_STRING ds_connection_name;
305 static DYNAMIC_STRING ds_host;
306@@ -3460,20 +3648,7 @@
307 DBUG_ENTER("do_connect");
308 DBUG_PRINT("enter",("connect: %s", command->first_argument));
309
310- /* Remove parenteses around connect arguments */
311- if ((ptr= strstr(command->first_argument, "(")))
312- {
313- /* Replace it with a space */
314- *ptr= ' ';
315- if ((ptr= strstr(command->first_argument, ")")))
316- {
317- /* Replace it with \0 */
318- *ptr= 0;
319- }
320- else
321- die("connect - argument list started with '(' must be ended with ')'");
322- }
323-
324+ strip_parentheses(command);
325 check_command_args(command, command->first_argument, connect_args,
326 sizeof(connect_args)/sizeof(struct command_arg),
327 ',');
328@@ -4173,16 +4348,12 @@
329 DBUG_RETURN(0);
330 }
331 if (!(*command_ptr= command=
332- (struct st_command*) my_malloc(sizeof(*command), MYF(MY_WME))) ||
333+ (struct st_command*) my_malloc(sizeof(*command),
334+ MYF(MY_WME|MY_ZEROFILL))) ||
335 insert_dynamic(&q_lines, (gptr) &command))
336 die(NullS);
337-
338- command->require_file[0]= 0;
339- command->first_word_len= 0;
340- command->query_len= 0;
341-
342 command->type= Q_UNKNOWN;
343- command->query_buf= command->query= 0;
344+
345 read_command_buf[0]= 0;
346 if (read_line(read_command_buf, sizeof(read_command_buf)))
347 {
348diff -urN mysql-4.1.23/cmd-line-utils/libedit/el_term.h mysql-4.1/cmd-line-utils/libedit/el_term.h
349--- mysql-4.1.23/cmd-line-utils/libedit/el_term.h 2007-12-02 20:38:26.000000000 +0100
350+++ mysql-4.1/cmd-line-utils/libedit/el_term.h 2007-06-04 16:42:35.000000000 +0200
351@@ -90,6 +90,16 @@
352 extern char* tgetstr(char*, char**);
353 #endif
354
355+
356+#if !HAVE_DECL_TGOTO
357+/*
358+ 'tgoto' is not declared in the system header files, this causes
359+ problems on 64-bit systems. The function returns a 64 bit pointer
360+ but caller see it as "int" and it's thus truncated to 32-bit
361+*/
362+extern char* tgoto(const char*, int, int);
363+#endif
364+
365 protected void term_move_to_line(EditLine *, int);
366 protected void term_move_to_char(EditLine *, int);
367 protected void term_clear_EOL(EditLine *, int);
368diff -urN mysql-4.1.23/configure.in mysql-4.1/configure.in
369--- mysql-4.1.23/configure.in 2007-12-02 20:38:26.000000000 +0100
370+++ mysql-4.1/configure.in 2007-06-18 22:10:51.000000000 +0200
371@@ -5,7 +5,7 @@
372 AC_CANONICAL_SYSTEM
373 # The Docs Makefile.am parses this line!
374 # remember to also change ndb version below and update version.c in ndb
375-AM_INIT_AUTOMAKE(mysql, 4.1.23)
376+AM_INIT_AUTOMAKE(mysql, 4.1.24)
377 AM_CONFIG_HEADER(config.h)
378
379 PROTOCOL_VERSION=10
380@@ -21,7 +21,7 @@
381 # ndb version
382 NDB_VERSION_MAJOR=4
383 NDB_VERSION_MINOR=1
384-NDB_VERSION_BUILD=23
385+NDB_VERSION_BUILD=24
386 NDB_VERSION_STATUS=""
387
388 # Set all version vars based on $VERSION. How do we do this more elegant ?
389@@ -1960,6 +1960,19 @@
390 fi
391 AC_SUBST(TERMCAP_LIB)
392
393+# Check if the termcap function 'tgoto' is already declared in
394+# system header files or if it need to be declared locally
395+AC_CHECK_DECLS(tgoto,,,[
396+#ifdef HAVE_CURSES_H
397+# include <curses.h>
398+#elif HAVE_NCURSES_H
399+# include <ncurses.h>
400+#endif
401+#ifdef HAVE_TERM_H
402+# include <term.h>
403+#endif
404+])
405+
406 LIBEDIT_LOBJECTS=""
407 AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
408 AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
409diff -urN mysql-4.1.23/Docs/INSTALL-BINARY mysql-4.1/Docs/INSTALL-BINARY
410--- mysql-4.1.23/Docs/INSTALL-BINARY 1970-01-01 01:00:00.000000000 +0100
411+++ mysql-4.1/Docs/INSTALL-BINARY 2007-11-02 01:29:32.000000000 +0100
412@@ -0,0 +1,8 @@
413+
414+You can find information about how to install binary distributions at
415+
416+ http://dev.mysql.com/doc/refman/4.1/en/quick-standard-installation.html
417+
418+The MySQL Reference Manual is also available in various formats on
419+http://dev.mysql.com/doc; if you're interested in the DocBook XML
420+sources go to http://svn.mysql.com.
421diff -urN mysql-4.1.23/Docs/Makefile.am mysql-4.1/Docs/Makefile.am
422--- mysql-4.1.23/Docs/Makefile.am 2007-12-02 20:38:26.000000000 +0100
423+++ mysql-4.1/Docs/Makefile.am 2007-11-02 13:13:51.000000000 +0100
424@@ -14,14 +14,7 @@
425 # along with this program; if not, write to the Free Software
426 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
427
428-noinst_SCRIPTS = Support/generate-text-files.pl
429-
430-EXTRA_DIST = $(noinst_SCRIPTS) mysql.info INSTALL-BINARY
431-
432-TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE \
433- INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
434-
435-all-local: $(TXT_FILES)
436+EXTRA_DIST = mysql.info INSTALL-BINARY
437
438 # make sure that "make install" installs the info page, too
439 # automake only seems to take care of this automatically,
440@@ -33,26 +26,5 @@
441 uninstall-local:
442 @RM@ -f $(DESTDIR)$(infodir)/mysql.info
443
444-# This target is not used in builds, just for convinience
445-CLEAN_FILES: $(TXT_FILES)
446- touch $(TXT_FILES)
447-
448-GT = $(srcdir)/Support/generate-text-files.pl
449-
450-../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT)
451- perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@
452-
453-../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT)
454- perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@
455-
456-# We put the description for the binary installation here so that
457-# people who download source wont have to see it. It is moved up to
458-# the toplevel by the script that makes the binary tar files.
459-INSTALL-BINARY: $(srcdir)/mysql.info $(GT)
460- perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@
461-
462-../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT)
463- perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@
464-
465 # Don't update the files from bitkeeper
466 %::SCCS/s.%
467diff -urN mysql-4.1.23/Docs/mysql.info mysql-4.1/Docs/mysql.info
468--- mysql-4.1.23/Docs/mysql.info 2007-12-02 20:38:26.000000000 +0100
469+++ mysql-4.1/Docs/mysql.info 2007-11-02 01:31:55.000000000 +0100
470@@ -1,27 +1,4 @@
471-This is mysql.info, produced by makeinfo version 4.8 from manual.texi.
472
473-START-INFO-DIR-ENTRY
474-* mysql: (mysql). MySQL documentation.
475-END-INFO-DIR-ENTRY
476-
477-\1f
478-File: mysql.info, Node: Top, Next: (dir), Prev: (dir), Up: (dir)
479-
480-This is an empty placeholder file for the MySQL manual.
481-
482-The MySQL manual is now maintained in a separate BitKeeper source tree!
483-Please see `http://www.mysql.com/doc/en/Installing_source_tree.html'
484-for more info on how to work with BitKeeper.
485-
486-This file will be replaced with the current `mysql.info' when building
487-the official source distribution.
488-
489-You can find a specific manual for any older version of MySQL in the
490-binary or source distribution for that version.
491-
492-
493-\1f
494-Tag Table:
495-Node: Top\7f166
496-\1f
497-End Tag Table
498+The MySQL Reference Manual is available in various formats on
499+http://dev.mysql.com/doc; if you're interested in the DocBook XML
500+sources go to http://svn.mysql.com.
501diff -urN mysql-4.1.23/Docs/Support/generate-text-files.pl mysql-4.1/Docs/Support/generate-text-files.pl
502--- mysql-4.1.23/Docs/Support/generate-text-files.pl 2007-12-02 20:38:25.000000000 +0100
503+++ mysql-4.1/Docs/Support/generate-text-files.pl 1970-01-01 01:00:00.000000000 +0100
504@@ -1,43 +0,0 @@
505-#!/usr/bin/perl -w -*- perl -*-
506-# Generate text files from top directory from the manual.
507-
508-$from = shift(@ARGV);
509-$fnode = shift(@ARGV);
510-$tnode = shift(@ARGV);
511-
512-open(IN, "$from") || die "Cannot open $from: $!";
513-
514-$in = 0;
515-
516-while (<IN>)
517-{
518- if ($in)
519- {
520- if (/Node: $tnode,/ || /\[index/)
521- {
522- $in = 0;
523- }
524- elsif (/^File: mysql.info/ || (/^\1f/))
525- {
526- # Just Skip node beginnings
527- }
528- else
529- {
530- print;
531- }
532- }
533- else
534- {
535- if (/Node: $fnode,/)
536- {
537- $in = 1;
538- # Skip first empty line
539- <IN>;
540- }
541- }
542-}
543-
544-close(IN);
545-
546-die "Could not find node \"$tnode\"" if ($in == 1);
547-exit 0;
548diff -urN mysql-4.1.23/heap/hp_delete.c mysql-4.1/heap/hp_delete.c
549--- mysql-4.1.23/heap/hp_delete.c 2007-12-02 20:38:25.000000000 +0100
550+++ mysql-4.1/heap/hp_delete.c 2007-09-13 12:39:15.000000000 +0200
551@@ -73,10 +73,7 @@
552 int res;
553
554 if (flag)
555- {
556 info->last_pos= NULL; /* For heap_rnext/heap_rprev */
557- info->lastkey_len= 0;
558- }
559
560 custom_arg.keyseg= keyinfo->seg;
561 custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
562diff -urN mysql-4.1.23/heap/hp_rfirst.c mysql-4.1/heap/hp_rfirst.c
563--- mysql-4.1.23/heap/hp_rfirst.c 2007-12-02 20:38:51.000000000 +0100
564+++ mysql-4.1/heap/hp_rfirst.c 2007-09-13 12:39:15.000000000 +0200
565@@ -36,6 +36,17 @@
566 sizeof(byte*));
567 info->current_ptr = pos;
568 memcpy(record, pos, (size_t)share->reclength);
569+ /*
570+ If we're performing index_first on a table that was taken from
571+ table cache, info->lastkey_len is initialized to previous query.
572+ Thus we set info->lastkey_len to proper value for subsequent
573+ heap_rnext() calls.
574+ This is needed for DELETE queries only, otherwise this variable is
575+ not used.
576+ Note that the same workaround may be needed for heap_rlast(), but
577+ for now heap_rlast() is never used for DELETE queries.
578+ */
579+ info->lastkey_len= 0;
580 info->update = HA_STATE_AKTIV;
581 }
582 else
583diff -urN mysql-4.1.23/heap/hp_rnext.c mysql-4.1/heap/hp_rnext.c
584--- mysql-4.1.23/heap/hp_rnext.c 2007-12-02 20:38:52.000000000 +0100
585+++ mysql-4.1/heap/hp_rnext.c 2007-09-13 12:39:15.000000000 +0200
586@@ -34,11 +34,40 @@
587 heap_rb_param custom_arg;
588
589 if (info->last_pos)
590+ {
591+ /*
592+ We enter this branch for non-DELETE queries after heap_rkey()
593+ or heap_rfirst(). As last key position (info->last_pos) is available,
594+ we only need to climb the tree using tree_search_next().
595+ */
596 pos = tree_search_next(&keyinfo->rb_tree, &info->last_pos,
597 offsetof(TREE_ELEMENT, left),
598 offsetof(TREE_ELEMENT, right));
599+ }
600+ else if (!info->lastkey_len)
601+ {
602+ /*
603+ We enter this branch only for DELETE queries after heap_rfirst(). E.g.
604+ DELETE FROM t1 WHERE a<10. As last key position is not available
605+ (last key is removed by heap_delete()), we must restart search as it
606+ is done in heap_rfirst().
607+
608+ It should be safe to handle this situation without this branch. That is
609+ branch below should find smallest element in a tree as lastkey_len is
610+ zero. tree_search_edge() is a kind of optimisation here as it should be
611+ faster than tree_search_key().
612+ */
613+ pos= tree_search_edge(&keyinfo->rb_tree, info->parents,
614+ &info->last_pos, offsetof(TREE_ELEMENT, left));
615+ }
616 else
617 {
618+ /*
619+ We enter this branch only for DELETE queries after heap_rkey(). E.g.
620+ DELETE FROM t1 WHERE a=10. As last key position is not available
621+ (last key is removed by heap_delete()), we must restart search as it
622+ is done in heap_rkey().
623+ */
624 custom_arg.keyseg = keyinfo->seg;
625 custom_arg.key_length = info->lastkey_len;
626 custom_arg.search_flag = SEARCH_SAME | SEARCH_FIND;
627diff -urN mysql-4.1.23/include/my_global.h mysql-4.1/include/my_global.h
628--- mysql-4.1.23/include/my_global.h 2007-12-02 20:38:51.000000000 +0100
629+++ mysql-4.1/include/my_global.h 2007-06-22 14:12:39.000000000 +0200
630@@ -828,7 +828,12 @@
631 typedef unsigned long ulong; /* Short for unsigned long */
632 #endif
633 #ifndef longlong_defined
634-#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
635+/*
636+ Using [unsigned] long long is preferable as [u]longlong because we use
637+ [unsigned] long long unconditionally in many places,
638+ for example in constants with [U]LL suffix.
639+*/
640+#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
641 typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
642 typedef long long int longlong;
643 #else
644diff -urN mysql-4.1.23/include/mysql_com.h mysql-4.1/include/mysql_com.h
645--- mysql-4.1.23/include/mysql_com.h 2007-12-02 20:38:25.000000000 +0100
646+++ mysql-4.1/include/mysql_com.h 2007-11-09 13:05:01.000000000 +0100
647@@ -291,6 +291,11 @@
648 int net_real_write(NET *net,const char *packet,unsigned long len);
649 unsigned long my_net_read(NET *net);
650
651+#ifdef _global_h
652+void net_set_write_timeout(NET *net, uint timeout);
653+void net_set_read_timeout(NET *net, uint timeout);
654+#endif
655+
656 /*
657 The following function is not meant for normal usage
658 Currently it's used internally by manager.c
659diff -urN mysql-4.1.23/include/my_sys.h mysql-4.1/include/my_sys.h
660--- mysql-4.1.23/include/my_sys.h 2007-12-02 20:38:51.000000000 +0100
661+++ mysql-4.1/include/my_sys.h 2007-10-24 13:09:29.000000000 +0200
662@@ -784,6 +784,8 @@
663 extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
664 extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
665 uint cs_flags, myf my_flags);
666+extern CHARSET_INFO *get_compatible_charset_with_ctype(CHARSET_INFO
667+ *original_cs);
668 extern void free_charsets(void);
669 extern char *get_charsets_dir(char *buf);
670 extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
671diff -urN mysql-4.1.23/INSTALL-SOURCE mysql-4.1/INSTALL-SOURCE
672--- mysql-4.1.23/INSTALL-SOURCE 1970-01-01 01:00:00.000000000 +0100
673+++ mysql-4.1/INSTALL-SOURCE 2007-11-02 01:29:32.000000000 +0100
674@@ -0,0 +1,8 @@
675+
676+You can find information about how to install from a source distributions at
677+
678+ http://dev.mysql.com/doc/refman/4.1/en/installing-source.html
679+
680+The MySQL Reference Manual is also available in various formats on
681+http://dev.mysql.com/doc; if you're interested in the DocBook XML
682+sources go to http://svn.mysql.com.
683diff -urN mysql-4.1.23/INSTALL-WIN-SOURCE mysql-4.1/INSTALL-WIN-SOURCE
684--- mysql-4.1.23/INSTALL-WIN-SOURCE 1970-01-01 01:00:00.000000000 +0100
685+++ mysql-4.1/INSTALL-WIN-SOURCE 2007-11-02 12:36:29.000000000 +0100
686@@ -0,0 +1,9 @@
687+
688+You can find information about how to install from a Windows source
689+distributions at
690+
691+ http://dev.mysql.com/doc/refman/4.1/en/windows-source-build.html
692+
693+The MySQL Reference Manual is also available in various formats on
694+http://dev.mysql.com/doc; if you're interested in the DocBook XML
695+sources go to http://svn.mysql.com.
696diff -urN mysql-4.1.23/libmysqld/ha_blackhole.cc mysql-4.1/libmysqld/ha_blackhole.cc
697--- mysql-4.1.23/libmysqld/ha_blackhole.cc 2007-12-02 20:38:51.000000000 +0100
698+++ mysql-4.1/libmysqld/ha_blackhole.cc 1970-01-01 01:00:00.000000000 +0100
699@@ -1,192 +0,0 @@
700-/* Copyright (C) 2005 MySQL AB
701-
702- This program is free software; you can redistribute it and/or modify
703- it under the terms of the GNU General Public License as published by
704- the Free Software Foundation; either version 2 of the License, or
705- (at your option) any later version.
706-
707- This program is distributed in the hope that it will be useful,
708- but WITHOUT ANY WARRANTY; without even the implied warranty of
709- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
710- GNU General Public License for more details.
711-
712- You should have received a copy of the GNU General Public License
713- along with this program; if not, write to the Free Software
714- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
715-
716-
717-#ifdef USE_PRAGMA_IMPLEMENTATION
718-#pragma implementation // gcc: Class implementation
719-#endif
720-
721-#include "mysql_priv.h"
722-#ifdef HAVE_BLACKHOLE_DB
723-#include "ha_blackhole.h"
724-
725-
726-const char **ha_blackhole::bas_ext() const
727-{
728- static const char *ext[]= { NullS };
729- return ext;
730-}
731-
732-int ha_blackhole::open(const char *name, int mode, uint test_if_locked)
733-{
734- DBUG_ENTER("ha_blackhole::open");
735- thr_lock_init(&thr_lock);
736- thr_lock_data_init(&thr_lock,&lock,NULL);
737- DBUG_RETURN(0);
738-}
739-
740-int ha_blackhole::close(void)
741-{
742- DBUG_ENTER("ha_blackhole::close");
743- thr_lock_delete(&thr_lock);
744- DBUG_RETURN(0);
745-}
746-
747-int ha_blackhole::create(const char *name, TABLE *table_arg,
748- HA_CREATE_INFO *create_info)
749-{
750- DBUG_ENTER("ha_blackhole::create");
751- DBUG_RETURN(0);
752-}
753-
754-const char *ha_blackhole::index_type(uint key_number)
755-{
756- DBUG_ENTER("ha_blackhole::index_type");
757- DBUG_RETURN((table->key_info[key_number].flags & HA_FULLTEXT) ?
758- "FULLTEXT" :
759- (table->key_info[key_number].flags & HA_SPATIAL) ?
760- "SPATIAL" :
761- (table->key_info[key_number].algorithm == HA_KEY_ALG_RTREE) ?
762- "RTREE" :
763- "BTREE");
764-}
765-
766-int ha_blackhole::write_row(byte * buf)
767-{
768- DBUG_ENTER("ha_blackhole::write_row");
769- DBUG_RETURN(0);
770-}
771-
772-int ha_blackhole::rnd_init(bool scan)
773-{
774- DBUG_ENTER("ha_blackhole::rnd_init");
775- DBUG_RETURN(0);
776-}
777-
778-
779-int ha_blackhole::rnd_next(byte *buf)
780-{
781- DBUG_ENTER("ha_blackhole::rnd_next");
782- DBUG_RETURN(HA_ERR_END_OF_FILE);
783-}
784-
785-
786-int ha_blackhole::rnd_pos(byte * buf, byte *pos)
787-{
788- DBUG_ENTER("ha_blackhole::rnd_pos");
789- DBUG_ASSERT(0);
790- DBUG_RETURN(0);
791-}
792-
793-
794-void ha_blackhole::position(const byte *record)
795-{
796- DBUG_ENTER("ha_blackhole::position");
797- DBUG_ASSERT(0);
798- DBUG_VOID_RETURN;
799-}
800-
801-
802-int ha_blackhole::info(uint flag)
803-{
804- DBUG_ENTER("ha_blackhole::info");
805-
806- records= 0;
807- deleted= 0;
808- errkey= 0;
809- mean_rec_length= 0;
810- data_file_length= 0;
811- index_file_length= 0;
812- max_data_file_length= 0;
813- delete_length= 0;
814- if (flag & HA_STATUS_AUTO)
815- auto_increment_value= 1;
816- DBUG_RETURN(0);
817-}
818-
819-int ha_blackhole::external_lock(THD *thd, int lock_type)
820-{
821- DBUG_ENTER("ha_blackhole::external_lock");
822- DBUG_RETURN(0);
823-}
824-
825-
826-uint ha_blackhole::lock_count(void) const
827-{
828- DBUG_ENTER("ha_blackhole::lock_count");
829- DBUG_RETURN(0);
830-}
831-
832-THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd,
833- THR_LOCK_DATA **to,
834- enum thr_lock_type lock_type)
835-{
836- DBUG_ENTER("ha_blackhole::store_lock");
837- DBUG_RETURN(to);
838-}
839-
840-
841-int ha_blackhole::index_read(byte * buf, const byte * key,
842- uint key_len, enum ha_rkey_function find_flag)
843-{
844- DBUG_ENTER("ha_blackhole::index_read");
845- DBUG_RETURN(0);
846-}
847-
848-
849-int ha_blackhole::index_read_idx(byte * buf, uint idx, const byte * key,
850- uint key_len, enum ha_rkey_function find_flag)
851-{
852- DBUG_ENTER("ha_blackhole::index_read_idx");
853- DBUG_RETURN(HA_ERR_END_OF_FILE);
854-}
855-
856-
857-int ha_blackhole::index_read_last(byte * buf, const byte * key, uint key_len)
858-{
859- DBUG_ENTER("ha_blackhole::index_read_last");
860- DBUG_RETURN(HA_ERR_END_OF_FILE);
861-}
862-
863-
864-int ha_blackhole::index_next(byte * buf)
865-{
866- DBUG_ENTER("ha_blackhole::index_next");
867- DBUG_RETURN(HA_ERR_END_OF_FILE);
868-}
869-
870-
871-int ha_blackhole::index_prev(byte * buf)
872-{
873- DBUG_ENTER("ha_blackhole::index_prev");
874- DBUG_RETURN(HA_ERR_END_OF_FILE);
875-}
876-
877-
878-int ha_blackhole::index_first(byte * buf)
879-{
880- DBUG_ENTER("ha_blackhole::index_first");
881- DBUG_RETURN(HA_ERR_END_OF_FILE);
882-}
883-
884-
885-int ha_blackhole::index_last(byte * buf)
886-{
887- DBUG_ENTER("ha_blackhole::index_last");
888- DBUG_RETURN(HA_ERR_END_OF_FILE);
889-}
890-
891-#endif /* HAVE_BLACKHOLE_DB */
892diff -urN mysql-4.1.23/libmysql_r/client_settings.h mysql-4.1/libmysql_r/client_settings.h
893--- mysql-4.1.23/libmysql_r/client_settings.h 2007-12-02 20:38:26.000000000 +0100
894+++ mysql-4.1/libmysql_r/client_settings.h 1970-01-01 01:00:00.000000000 +0100
895@@ -1,66 +0,0 @@
896-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
897-
898- This program is free software; you can redistribute it and/or modify
899- it under the terms of the GNU General Public License as published by
900- the Free Software Foundation; either version 2 of the License, or
901- (at your option) any later version.
902-
903- This program is distributed in the hope that it will be useful,
904- but WITHOUT ANY WARRANTY; without even the implied warranty of
905- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
906- GNU General Public License for more details.
907-
908- You should have received a copy of the GNU General Public License
909- along with this program; if not, write to the Free Software
910- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
911-
912-extern uint mysql_port;
913-extern my_string mysql_unix_port;
914-
915-#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
916- CLIENT_TRANSACTIONS | \
917- CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
918-
919-sig_handler pipe_sig_handler(int sig);
920-void read_user_name(char *name);
921-my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
922-
923-/*
924- Let the user specify that we don't want SIGPIPE; This doesn't however work
925- with threaded applications as we can have multiple read in progress.
926-*/
927-
928-#if !defined(__WIN__) && defined(SIGPIPE) && !defined(THREAD)
929-#define init_sigpipe_variables sig_return old_signal_handler=(sig_return) 0;
930-#define set_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) old_signal_handler=signal(SIGPIPE,pipe_sig_handler)
931-#define reset_sigpipe(mysql) if ((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE) signal(SIGPIPE,old_signal_handler);
932-#else
933-#define init_sigpipe_variables
934-#define set_sigpipe(mysql)
935-#define reset_sigpipe(mysql)
936-#endif
937-
938-void mysql_read_default_options(struct st_mysql_options *options,
939- const char *filename,const char *group);
940-void mysql_detach_stmt_list(LIST **stmt_list);
941-MYSQL * STDCALL
942-cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
943- const char *passwd, const char *db,
944- uint port, const char *unix_socket,ulong client_flag);
945-
946-void cli_mysql_close(MYSQL *mysql);
947-
948-MYSQL_FIELD * cli_list_fields(MYSQL *mysql);
949-my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
950-MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
951- uint fields);
952-int cli_stmt_execute(MYSQL_STMT *stmt);
953-int cli_read_binary_rows(MYSQL_STMT *stmt);
954-int cli_unbuffered_fetch(MYSQL *mysql, char **row);
955-const char * cli_read_statistics(MYSQL *mysql);
956-int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd);
957-
958-#ifdef EMBEDDED_LIBRARY
959-int init_embedded_server(int argc, char **argv, char **groups);
960-void end_embedded_server();
961-#endif /*EMBEDDED_LIBRARY*/
962diff -urN mysql-4.1.23/myisam/ft_boolean_search.c mysql-4.1/myisam/ft_boolean_search.c
963--- mysql-4.1.23/myisam/ft_boolean_search.c 2007-12-02 20:38:25.000000000 +0100
964+++ mysql-4.1/myisam/ft_boolean_search.c 2007-10-30 11:46:42.000000000 +0100
965@@ -446,7 +446,8 @@
966 {
967 if (cs->coll->instr(cs, p0, e0 - p0, s1, e1 - s1, m, 2) != 2)
968 return(0);
969- if ((!s_after || p0 + m[1].beg == s0 || !true_word_char(cs, p0[m[1].beg-1])) &&
970+ if ((!s_after || p0 + m[1].beg == s0 ||
971+ !true_word_char(cs, p0[(int) m[1].beg - 1])) &&
972 (!e_before || p0 + m[1].end == e0 || !true_word_char(cs, p0[m[1].end])))
973 return(1);
974 p0+= m[1].beg;
975diff -urN mysql-4.1.23/myisam/mi_check.c mysql-4.1/myisam/mi_check.c
976--- mysql-4.1.23/myisam/mi_check.c 2007-12-02 20:38:51.000000000 +0100
977+++ mysql-4.1/myisam/mi_check.c 2007-11-07 09:55:27.000000000 +0100
978@@ -940,7 +940,7 @@
979 ha_rows records,del_blocks;
980 my_off_t used,empty,pos,splits,start_recpos,
981 del_length,link_used,start_block;
982- byte *record,*to;
983+ byte *record= 0, *to;
984 char llbuff[22],llbuff2[22],llbuff3[22];
985 ha_checksum intern_record_checksum;
986 ha_checksum key_checksum[MI_MAX_POSSIBLE_KEY];
987@@ -957,7 +957,7 @@
988 puts("- check record links");
989 }
990
991- if (!(record= (byte*) my_malloc(info->s->base.pack_reclength,MYF(0))))
992+ if (!mi_alloc_rec_buff(info, -1, &record))
993 {
994 mi_check_print_error(param,"Not enough memory for record");
995 DBUG_RETURN(-1);
996@@ -1364,12 +1364,12 @@
997 printf("Lost space: %12s Linkdata: %10s\n",
998 llstr(empty,llbuff),llstr(link_used,llbuff2));
999 }
1000- my_free((gptr) record,MYF(0));
1001+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
1002 DBUG_RETURN (error);
1003 err:
1004 mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff));
1005 err2:
1006- my_free((gptr) record,MYF(0));
1007+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
1008 param->testflag|=T_RETRY_WITHOUT_QUICK;
1009 DBUG_RETURN(1);
1010 } /* chk_data_link */
1011@@ -1428,8 +1428,7 @@
1012 MYF(MY_WME | MY_WAIT_IF_FULL)))
1013 goto err;
1014 info->opt_flag|=WRITE_CACHE_USED;
1015- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
1016- MYF(0))) ||
1017+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record) ||
1018 !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
1019 {
1020 mi_check_print_error(param, "Not enough memory for extra record");
1021@@ -1631,7 +1630,8 @@
1022 }
1023 my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
1024 MYF(MY_ALLOW_ZERO_PTR));
1025- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
1026+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
1027+ MYF(MY_ALLOW_ZERO_PTR));
1028 my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
1029 VOID(end_io_cache(&param->read_cache));
1030 info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
1031@@ -2129,8 +2129,7 @@
1032 info->opt_flag|=WRITE_CACHE_USED;
1033 info->rec_cache.file=info->dfile; /* for sort_delete_record */
1034
1035- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
1036- MYF(0))) ||
1037+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record) ||
1038 !mi_alloc_rec_buff(info, -1, &sort_param.rec_buff))
1039 {
1040 mi_check_print_error(param, "Not enough memory for extra record");
1041@@ -2415,7 +2414,8 @@
1042
1043 my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff),
1044 MYF(MY_ALLOW_ZERO_PTR));
1045- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
1046+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
1047+ MYF(MY_ALLOW_ZERO_PTR));
1048 my_free((gptr) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR));
1049 my_free((gptr) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR));
1050 my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
1051@@ -2493,6 +2493,7 @@
1052 SORT_INFO sort_info;
1053 ulonglong key_map=share->state.key_map;
1054 pthread_attr_t thr_attr;
1055+ ulong max_pack_reclength;
1056 DBUG_ENTER("mi_repair_parallel");
1057
1058 start_records=info->state->records;
1059@@ -2649,10 +2650,13 @@
1060
1061 del=info->state->del;
1062 param->glob_crc=0;
1063-
1064+ /* for compressed tables */
1065+ max_pack_reclength= share->base.pack_reclength;
1066+ if (share->options & HA_OPTION_COMPRESS_RECORD)
1067+ set_if_bigger(max_pack_reclength, share->max_pack_length);
1068 if (!(sort_param=(MI_SORT_PARAM *)
1069 my_malloc((uint) share->base.keys *
1070- (sizeof(MI_SORT_PARAM) + share->base.pack_reclength),
1071+ (sizeof(MI_SORT_PARAM) + max_pack_reclength),
1072 MYF(MY_ZEROFILL))))
1073 {
1074 mi_check_print_error(param,"Not enough memory for key!");
1075@@ -2704,7 +2708,7 @@
1076 sort_param[i].max_pos=sort_param[i].pos=share->pack.header_length;
1077
1078 sort_param[i].record= (((char *)(sort_param+share->base.keys))+
1079- (share->base.pack_reclength * i));
1080+ (max_pack_reclength * i));
1081 if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
1082 {
1083 mi_check_print_error(param,"Not enough memory!");
1084@@ -4320,7 +4324,7 @@
1085 void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
1086 my_bool repair_only)
1087 {
1088- byte *record;
1089+ byte *record= 0;
1090 DBUG_ENTER("update_auto_increment_key");
1091
1092 if (!info->s->base.auto_key ||
1093@@ -4340,8 +4344,7 @@
1094 We have to use an allocated buffer instead of info->rec_buff as
1095 _mi_put_key_in_record() may use info->rec_buff
1096 */
1097- if (!(record= (byte*) my_malloc((uint) info->s->base.pack_reclength,
1098- MYF(0))))
1099+ if (!mi_alloc_rec_buff(info, -1, &record))
1100 {
1101 mi_check_print_error(param,"Not enough memory for extra record");
1102 DBUG_VOID_RETURN;
1103@@ -4353,7 +4356,7 @@
1104 if (my_errno != HA_ERR_END_OF_FILE)
1105 {
1106 mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
1107- my_free((char*) record, MYF(0));
1108+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
1109 mi_check_print_error(param,"%d when reading last record",my_errno);
1110 DBUG_VOID_RETURN;
1111 }
1112@@ -4369,7 +4372,7 @@
1113 set_if_bigger(info->s->state.auto_increment,auto_increment);
1114 }
1115 mi_extra(info,HA_EXTRA_NO_KEYREAD,0);
1116- my_free((char*) record, MYF(0));
1117+ my_free(mi_get_rec_buff_ptr(info, record), MYF(0));
1118 update_state_info(param, info, UPDATE_AUTO_INC);
1119 DBUG_VOID_RETURN;
1120 }
1121diff -urN mysql-4.1.23/myisam/mi_dynrec.c mysql-4.1/myisam/mi_dynrec.c
1122--- mysql-4.1.23/myisam/mi_dynrec.c 2007-12-02 20:38:26.000000000 +0100
1123+++ mysql-4.1/myisam/mi_dynrec.c 2007-11-12 10:00:21.000000000 +0100
1124@@ -145,6 +145,29 @@
1125 DBUG_ENTER("write_dynamic_record");
1126
1127 flag=0;
1128+
1129+ /*
1130+ Check if we have enough room for the new record.
1131+ First we do simplified check to make usual case faster.
1132+ Then we do more precise check for the space left.
1133+ Though it still is not absolutely precise, as
1134+ we always use MI_MAX_DYN_BLOCK_HEADER while it can be
1135+ less in the most of the cases.
1136+ */
1137+
1138+ if (unlikely(info->s->base.max_data_file_length -
1139+ info->state->data_file_length <
1140+ reclength + MI_MAX_DYN_BLOCK_HEADER))
1141+ {
1142+ if (info->s->base.max_data_file_length - info->state->data_file_length +
1143+ info->state->empty - info->state->del * MI_MAX_DYN_BLOCK_HEADER <
1144+ reclength + MI_MAX_DYN_BLOCK_HEADER)
1145+ {
1146+ my_errno=HA_ERR_RECORD_FILE_FULL;
1147+ DBUG_RETURN(1);
1148+ }
1149+ }
1150+
1151 do
1152 {
1153 if (_mi_find_writepos(info,reclength,&filepos,&length))
1154@@ -577,6 +600,51 @@
1155 DBUG_ENTER("update_dynamic_record");
1156
1157 flag=block_info.second_read=0;
1158+ /*
1159+ Check if we have enough room for the record.
1160+ First we do simplified check to make usual case faster.
1161+ Then we do more precise check for the space left.
1162+ Though it still is not absolutely precise, as
1163+ we always use MI_MAX_DYN_BLOCK_HEADER while it can be
1164+ less in the most of the cases.
1165+ */
1166+
1167+ /*
1168+ compare with just the reclength as we're going
1169+ to get some space from the old replaced record
1170+ */
1171+ if (unlikely(info->s->base.max_data_file_length -
1172+ info->state->data_file_length < reclength))
1173+ {
1174+ /*
1175+ let's read the old record's block to find out the length of the
1176+ old record
1177+ */
1178+ if ((error=_mi_get_block_info(&block_info,info->dfile,filepos))
1179+ & (BLOCK_DELETED | BLOCK_ERROR | BLOCK_SYNC_ERROR | BLOCK_FATAL_ERROR))
1180+ {
1181+ DBUG_PRINT("error",("Got wrong block info"));
1182+ if (!(error & BLOCK_FATAL_ERROR))
1183+ my_errno=HA_ERR_WRONG_IN_RECORD;
1184+ goto err;
1185+ }
1186+
1187+ /*
1188+ if new record isn't longer, we can go on safely
1189+ */
1190+ if (block_info.rec_len < reclength)
1191+ {
1192+ if (info->s->base.max_data_file_length - info->state->data_file_length +
1193+ info->state->empty - info->state->del * MI_MAX_DYN_BLOCK_HEADER <
1194+ reclength - block_info.rec_len + MI_MAX_DYN_BLOCK_HEADER)
1195+ {
1196+ my_errno=HA_ERR_RECORD_FILE_FULL;
1197+ goto err;
1198+ }
1199+ }
1200+ block_info.second_read=0;
1201+ }
1202+
1203 while (reclength > 0)
1204 {
1205 if (filepos != info->s->state.dellink)
1206diff -urN mysql-4.1.23/myisam/mi_open.c mysql-4.1/myisam/mi_open.c
1207--- mysql-4.1.23/myisam/mi_open.c 2007-12-02 20:38:26.000000000 +0100
1208+++ mysql-4.1/myisam/mi_open.c 2007-11-07 09:55:27.000000000 +0100
1209@@ -659,8 +659,11 @@
1210 /* to simplify initial init of info->rec_buf in mi_open and mi_extra */
1211 if (length == (ulong) -1)
1212 {
1213- length= max(info->s->base.pack_reclength,
1214- info->s->base.max_key_length);
1215+ if (info->s->options & HA_OPTION_COMPRESS_RECORD)
1216+ length= max(info->s->base.pack_reclength, info->s->max_pack_length);
1217+ else
1218+ length= info->s->base.pack_reclength;
1219+ length= max(length, info->s->base.max_key_length);
1220 /* Avoid unnecessary realloc */
1221 if (newptr && length == old_length)
1222 return newptr;
1223diff -urN mysql-4.1.23/myisam/mi_packrec.c mysql-4.1/myisam/mi_packrec.c
1224--- mysql-4.1.23/myisam/mi_packrec.c 2007-12-02 20:38:27.000000000 +0100
1225+++ mysql-4.1/myisam/mi_packrec.c 2007-11-07 09:55:27.000000000 +0100
1226@@ -164,7 +164,6 @@
1227 share->pack.header_length= uint4korr(header+4);
1228 share->min_pack_length=(uint) uint4korr(header+8);
1229 share->max_pack_length=(uint) uint4korr(header+12);
1230- set_if_bigger(share->base.pack_reclength,share->max_pack_length);
1231 elements=uint4korr(header+16);
1232 intervall_length=uint4korr(header+20);
1233 trees=uint2korr(header+24);
1234diff -urN mysql-4.1.23/myisam/mi_rkey.c mysql-4.1/myisam/mi_rkey.c
1235--- mysql-4.1.23/myisam/mi_rkey.c 2007-12-02 20:38:26.000000000 +0100
1236+++ mysql-4.1/myisam/mi_rkey.c 2007-08-01 11:54:13.000000000 +0200
1237@@ -95,42 +95,63 @@
1238 myisam_read_vec[search_flag], info->s->state.key_root[inx]))
1239 {
1240 /*
1241- If we searching for a partial key (or using >, >=, < or <=) and
1242- the data is outside of the data file, we need to continue searching
1243- for the first key inside the data file
1244+ Found a key, but it might not be usable. We cannot use rows that
1245+ are inserted by other threads after we got our table lock
1246+ ("concurrent inserts"). The record may not even be present yet.
1247+ Keys are inserted into the index(es) before the record is
1248+ inserted into the data file. When we got our table lock, we
1249+ saved the current data_file_length. Concurrent inserts always go
1250+ to the end of the file. So we can test if the found key
1251+ references a new record.
1252 */
1253- if (info->lastpos >= info->state->data_file_length &&
1254- (search_flag != HA_READ_KEY_EXACT ||
1255- last_used_keyseg != keyinfo->seg + keyinfo->keysegs))
1256+ if (info->lastpos >= info->state->data_file_length)
1257 {
1258- do
1259+ /* The key references a concurrently inserted record. */
1260+ if (search_flag == HA_READ_KEY_EXACT &&
1261+ last_used_keyseg == keyinfo->seg + keyinfo->keysegs)
1262+ {
1263+ /* Simply ignore the key if it matches exactly. (Bug #29838) */
1264+ my_errno= HA_ERR_KEY_NOT_FOUND;
1265+ info->lastpos= HA_OFFSET_ERROR;
1266+ }
1267+ else
1268 {
1269- uint not_used[2];
1270- /*
1271- Skip rows that are inserted by other threads since we got a lock
1272- Note that this can only happen if we are not searching after an
1273- full length exact key, because the keys are sorted
1274- according to position
1275- */
1276- if (_mi_search_next(info, keyinfo, info->lastkey,
1277- info->lastkey_length,
1278- myisam_readnext_vec[search_flag],
1279- info->s->state.key_root[inx]))
1280- break;
1281 /*
1282- Check that the found key does still match the search.
1283- _mi_search_next() delivers the next key regardless of its
1284- value.
1285+ If searching for a partial key (or using >, >=, < or <=) and
1286+ the data is outside of the data file, we need to continue
1287+ searching for the first key inside the data file.
1288 */
1289- if (search_flag == HA_READ_KEY_EXACT &&
1290- ha_key_cmp(keyinfo->seg, key_buff, info->lastkey, use_key_length,
1291- SEARCH_FIND, not_used))
1292+ do
1293 {
1294- my_errno= HA_ERR_KEY_NOT_FOUND;
1295- info->lastpos= HA_OFFSET_ERROR;
1296- break;
1297- }
1298- } while (info->lastpos >= info->state->data_file_length);
1299+ uint not_used[2];
1300+ /*
1301+ Skip rows that are inserted by other threads since we got
1302+ a lock. Note that this can only happen if we are not
1303+ searching after a full length exact key, because the keys
1304+ are sorted according to position.
1305+ */
1306+ if (_mi_search_next(info, keyinfo, info->lastkey,
1307+ info->lastkey_length,
1308+ myisam_readnext_vec[search_flag],
1309+ info->s->state.key_root[inx]))
1310+ break; /* purecov: inspected */
1311+ /*
1312+ Check that the found key does still match the search.
1313+ _mi_search_next() delivers the next key regardless of its
1314+ value.
1315+ */
1316+ if (search_flag == HA_READ_KEY_EXACT &&
1317+ ha_key_cmp(keyinfo->seg, key_buff, info->lastkey,
1318+ use_key_length, SEARCH_FIND, not_used))
1319+ {
1320+ /* purecov: begin inspected */
1321+ my_errno= HA_ERR_KEY_NOT_FOUND;
1322+ info->lastpos= HA_OFFSET_ERROR;
1323+ break;
1324+ /* purecov: end */
1325+ }
1326+ } while (info->lastpos >= info->state->data_file_length);
1327+ }
1328 }
1329 }
1330 }
1331diff -urN mysql-4.1.23/myisam/myisamchk.c mysql-4.1/myisam/myisamchk.c
1332--- mysql-4.1.23/myisam/myisamchk.c 2007-12-02 20:38:51.000000000 +0100
1333+++ mysql-4.1/myisam/myisamchk.c 2007-11-07 09:55:27.000000000 +0100
1334@@ -338,7 +338,7 @@
1335 (gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
1336 REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1337 {"stats_method", OPT_STATS_METHOD,
1338- "Specifies how index statistics collection code should threat NULLs. "
1339+ "Specifies how index statistics collection code should treat NULLs. "
1340 "Possible values of name are \"nulls_unequal\" (default behavior for 4.1/5.0), "
1341 "\"nulls_equal\" (emulate 4.0 behavior), and \"nulls_ignored\".",
1342 (gptr*) &myisam_stats_method_str, (gptr*) &myisam_stats_method_str, 0,
1343@@ -453,7 +453,7 @@
1344 MySQL faster. You can check the calculated distribution\n\
1345 by using '--description --verbose table_name'.\n\
1346 --stats_method=name Specifies how index statistics collection code should\n\
1347- threat NULLs. Possible values of name are \"nulls_unequal\"\n\
1348+ treat NULLs. Possible values of name are \"nulls_unequal\"\n\
1349 (default for 4.1/5.0), \"nulls_equal\" (emulate 4.0), and \n\
1350 \"nulls_ignored\".\n\
1351 -d, --description Prints some information about table.\n\
1352@@ -1543,8 +1543,8 @@
1353 mi_check_print_error(param,"Not enough memory for key block");
1354 goto err;
1355 }
1356- if (!(sort_param.record=(byte*) my_malloc((uint) share->base.pack_reclength,
1357- MYF(0))))
1358+
1359+ if (!mi_alloc_rec_buff(info, -1, &sort_param.record))
1360 {
1361 mi_check_print_error(param,"Not enough memory for record");
1362 goto err;
1363@@ -1639,7 +1639,8 @@
1364 {
1365 my_afree((gptr) temp_buff);
1366 }
1367- my_free(sort_param.record,MYF(MY_ALLOW_ZERO_PTR));
1368+ my_free(mi_get_rec_buff_ptr(info, sort_param.record),
1369+ MYF(MY_ALLOW_ZERO_PTR));
1370 info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
1371 VOID(end_io_cache(&info->rec_cache));
1372 my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR));
1373diff -urN mysql-4.1.23/myisam/rt_index.c mysql-4.1/myisam/rt_index.c
1374--- mysql-4.1.23/myisam/rt_index.c 2007-12-02 20:38:51.000000000 +0100
1375+++ mysql-4.1/myisam/rt_index.c 2007-10-05 12:40:31.000000000 +0200
1376@@ -485,15 +485,16 @@
1377 uint key_length, uchar *page_buf, uint nod_flag)
1378 {
1379 double increase;
1380- double best_incr = DBL_MAX;
1381+ double best_incr;
1382 double area;
1383 double best_area;
1384- uchar *best_key;
1385+ uchar *best_key= NULL;
1386 uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
1387 uchar *last = rt_PAGE_END(page_buf);
1388
1389 LINT_INIT(best_area);
1390 LINT_INIT(best_key);
1391+ LINT_INIT(best_incr);
1392
1393 for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
1394 {
1395@@ -502,22 +503,13 @@
1396 &area)) == -1.0)
1397 return NULL;
1398 /* The following should be safe, even if we compare doubles */
1399- if (increase < best_incr)
1400+ if (!best_key || increase < best_incr ||
1401+ ((increase == best_incr) && (area < best_area)))
1402 {
1403 best_key = k;
1404 best_area = area;
1405 best_incr = increase;
1406 }
1407- else
1408- {
1409- /* The following should be safe, even if we compare doubles */
1410- if ((increase == best_incr) && (area < best_area))
1411- {
1412- best_key = k;
1413- best_area = area;
1414- best_incr = increase;
1415- }
1416- }
1417 }
1418 return best_key;
1419 }
1420diff -urN mysql-4.1.23/myisam/rt_mbr.c mysql-4.1/myisam/rt_mbr.c
1421--- mysql-4.1.23/myisam/rt_mbr.c 2007-12-02 20:38:25.000000000 +0100
1422+++ mysql-4.1/myisam/rt_mbr.c 2007-10-05 12:40:31.000000000 +0200
1423@@ -525,7 +525,10 @@
1424 }
1425
1426 /*
1427-Calculates MBR_AREA(a+b) - MBR_AREA(a)
1428+ Calculates MBR_AREA(a+b) - MBR_AREA(a)
1429+ Note: when 'a' and 'b' objects are far from each other,
1430+ the area increase can be really big, so this function
1431+ can return 'inf' as a result.
1432 */
1433 double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b,
1434 uint key_length, double *ab_area)
1435diff -urN mysql-4.1.23/myisam/sort.c mysql-4.1/myisam/sort.c
1436--- mysql-4.1.23/myisam/sort.c 2007-12-02 20:38:26.000000000 +0100
1437+++ mysql-4.1/myisam/sort.c 2007-10-11 12:28:08.000000000 +0200
1438@@ -559,9 +559,10 @@
1439 if (!mergebuf)
1440 {
1441 length=param->sort_buffer_length;
1442- while (length >= MIN_SORT_MEMORY && !mergebuf)
1443+ while (length >= MIN_SORT_MEMORY)
1444 {
1445- mergebuf=my_malloc(length, MYF(0));
1446+ if ((mergebuf= my_malloc(length, MYF(0))))
1447+ break;
1448 length=length*3/4;
1449 }
1450 if (!mergebuf)
1451@@ -897,6 +898,7 @@
1452
1453 count=error=0;
1454 maxcount=keys/((uint) (Tb-Fb) +1);
1455+ DBUG_ASSERT(maxcount > 0);
1456 LINT_INIT(to_start_filepos);
1457 if (to_file)
1458 to_start_filepos=my_b_tell(to_file);
1459diff -urN mysql-4.1.23/mysql-test/include/ctype_common.inc mysql-4.1/mysql-test/include/ctype_common.inc
1460--- mysql-4.1.23/mysql-test/include/ctype_common.inc 2007-12-02 20:38:26.000000000 +0100
1461+++ mysql-4.1/mysql-test/include/ctype_common.inc 2007-10-04 07:19:59.000000000 +0200
1462@@ -51,6 +51,15 @@
1463 SELECT c1 as want1result from t1 where c1 like 'location%';
1464 DROP TABLE t1;
1465
1466+#
1467+# Bug #31070: crash during conversion of charsets
1468+#
1469+create table t1 (a set('a') not null);
1470+insert into t1 values (),();
1471+select cast(a as char(1)) from t1;
1472+select a sounds like a from t1;
1473+drop table t1;
1474+
1475 DROP DATABASE d1;
1476 # Restore settings
1477 USE test;
1478diff -urN mysql-4.1.23/mysql-test/lib/mtr_misc.pl mysql-4.1/mysql-test/lib/mtr_misc.pl
1479--- mysql-4.1.23/mysql-test/lib/mtr_misc.pl 2007-12-02 20:38:50.000000000 +0100
1480+++ mysql-4.1/mysql-test/lib/mtr_misc.pl 2007-08-29 14:39:39.000000000 +0200
1481@@ -5,6 +5,7 @@
1482 # same name.
1483
1484 use strict;
1485+use File::Find;
1486
1487 sub mtr_full_hostname ();
1488 sub mtr_short_hostname ();
1489@@ -17,6 +18,7 @@
1490 sub mtr_exe_exists(@);
1491 sub mtr_exe_maybe_exists(@);
1492 sub mtr_copy_dir($$);
1493+sub mtr_rmtree($);
1494 sub mtr_same_opts($$);
1495 sub mtr_cmp_opts($$);
1496
1497@@ -202,6 +204,64 @@
1498 }
1499
1500
1501+sub mtr_rmtree($) {
1502+ my ($dir)= @_;
1503+ my $need_file_find= 0;
1504+ mtr_verbose("mtr_rmtree: $dir");
1505+
1506+ {
1507+ # Try to use File::Path::rmtree. Recent versions
1508+ # handles removal of directories and files that don't
1509+ # have full permissions, while older versions
1510+ # may have a problem with that and we use our own version
1511+
1512+ local $SIG{__WARN__}= sub {
1513+ $need_file_find= 1;
1514+ mtr_warning($_[0]);
1515+ };
1516+ rmtree($dir);
1517+ }
1518+ if ( $need_file_find ) {
1519+ mtr_warning("rmtree($dir) failed, trying with File::Find...");
1520+
1521+ my $errors= 0;
1522+
1523+ # chmod
1524+ find( {
1525+ no_chdir => 1,
1526+ wanted => sub {
1527+ chmod(0777, $_)
1528+ or mtr_warning("couldn't chmod(0777, $_): $!") and $errors++;
1529+ }
1530+ },
1531+ $dir
1532+ );
1533+
1534+ # rm
1535+ finddepth( {
1536+ no_chdir => 1,
1537+ wanted => sub {
1538+ my $file= $_;
1539+ # Use special underscore (_) filehandle, caches stat info
1540+ if (!-l $file and -d _ ) {
1541+ rmdir($file) or
1542+ mtr_warning("couldn't rmdir($file): $!") and $errors++;
1543+ } else {
1544+ unlink($file)
1545+ or mtr_warning("couldn't unlink($file): $!") and $errors++;
1546+ }
1547+ }
1548+ },
1549+ $dir
1550+ );
1551+
1552+ mtr_error("Failed to remove '$dir'") if $errors;
1553+
1554+ mtr_report("OK, that worked!");
1555+ }
1556+}
1557+
1558+
1559 sub mtr_same_opts ($$) {
1560 my $l1= shift;
1561 my $l2= shift;
1562diff -urN mysql-4.1.23/mysql-test/mysql-test-run.pl mysql-4.1/mysql-test/mysql-test-run.pl
1563--- mysql-4.1.23/mysql-test/mysql-test-run.pl 2007-12-02 20:38:25.000000000 +0100
1564+++ mysql-4.1/mysql-test/mysql-test-run.pl 2007-11-07 09:55:27.000000000 +0100
1565@@ -1880,6 +1880,21 @@
1566 ($lib_udf_example ? dirname($lib_udf_example) : "") .
1567 ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
1568
1569+ # ----------------------------------------------------
1570+ # Setup env so childs can execute myisampack and myisamchk
1571+ # ----------------------------------------------------
1572+ $ENV{'MYISAMCHK'}= mtr_native_path(mtr_exe_exists(
1573+ vs_config_dirs('storage/myisam', 'myisamchk'),
1574+ vs_config_dirs('myisam', 'myisamchk'),
1575+ "$path_client_bindir/myisamchk",
1576+ "$glob_basedir/storage/myisam/myisamchk",
1577+ "$glob_basedir/myisam/myisamchk"));
1578+ $ENV{'MYISAMPACK'}= mtr_native_path(mtr_exe_exists(
1579+ vs_config_dirs('storage/myisam', 'myisampack'),
1580+ vs_config_dirs('myisam', 'myisampack'),
1581+ "$path_client_bindir/myisampack",
1582+ "$glob_basedir/storage/myisam/myisampack",
1583+ "$glob_basedir/myisam/myisampack"));
1584
1585 # ----------------------------------------------------
1586 # We are nice and report a bit about our settings
1587@@ -1988,7 +2003,7 @@
1588 {
1589 # Remove the directory which the link points at
1590 mtr_verbose("Removing " . readlink($opt_vardir));
1591- rmtree(readlink($opt_vardir));
1592+ mtr_rmtree(readlink($opt_vardir));
1593
1594 # Remove the "var" symlink
1595 mtr_verbose("unlink($opt_vardir)");
1596@@ -2016,7 +2031,7 @@
1597 foreach my $bin ( glob("$opt_vardir/*") )
1598 {
1599 mtr_verbose("Removing bin $bin");
1600- rmtree($bin);
1601+ mtr_rmtree($bin);
1602 }
1603 }
1604 }
1605@@ -2024,7 +2039,7 @@
1606 {
1607 # Remove the entire "var" dir
1608 mtr_verbose("Removing $opt_vardir/");
1609- rmtree("$opt_vardir/");
1610+ mtr_rmtree("$opt_vardir/");
1611 }
1612
1613 if ( $opt_mem )
1614@@ -2033,7 +2048,7 @@
1615 # remove the $opt_mem dir to assure the symlink
1616 # won't point at an old directory
1617 mtr_verbose("Removing $opt_mem");
1618- rmtree($opt_mem);
1619+ mtr_rmtree($opt_mem);
1620 }
1621
1622 }
1623@@ -2046,11 +2061,11 @@
1624 # Remove the var/ dir in mysql-test dir if any
1625 # this could be an old symlink that shouldn't be there
1626 mtr_verbose("Removing $default_vardir");
1627- rmtree($default_vardir);
1628+ mtr_rmtree($default_vardir);
1629
1630 # Remove the "var" dir
1631 mtr_verbose("Removing $opt_vardir/");
1632- rmtree("$opt_vardir/");
1633+ mtr_rmtree("$opt_vardir/");
1634 }
1635 }
1636
1637@@ -2143,16 +2158,23 @@
1638 close FILE;
1639 }
1640
1641- chmod(oct("0755"), $test_file);
1642- unlink($test_file);
1643+ # Some filesystems( for example CIFS) allows reading a file
1644+ # although mode was set to 0000, but in that case a stat on
1645+ # the file will not return 0000
1646+ my $file_mode= (stat($test_file))[2] & 07777;
1647
1648 $ENV{'MYSQL_TEST_ROOT'}= "NO";
1649- if ($result eq "MySQL")
1650+ mtr_verbose("result: $result, file_mode: $file_mode");
1651+ if ($result eq "MySQL" && $file_mode == 0)
1652 {
1653 mtr_warning("running this script as _root_ will cause some " .
1654 "tests to be skipped");
1655 $ENV{'MYSQL_TEST_ROOT'}= "YES";
1656 }
1657+
1658+ chmod(oct("0755"), $test_file);
1659+ unlink($test_file);
1660+
1661 }
1662
1663
1664@@ -2956,7 +2978,7 @@
1665 {
1666 my $data_dir= $slave->[$idx]->{'path_myddir'};
1667 my $name= basename($data_dir);
1668- rmtree($data_dir);
1669+ mtr_rmtree($data_dir);
1670 mtr_copy_dir("$path_snapshot/$name", $data_dir);
1671 }
1672 }
1673@@ -3099,9 +3121,12 @@
1674 {
1675 my ($tinfo)= @_;
1676
1677+ # Set default message
1678+ $tinfo->{'comment'}= "Detected by testcase(no log file)";
1679+
1680 # Open mysqltest.log
1681- my $F= IO::File->new($path_timefile) or
1682- mtr_error("can't open file \"$path_timefile\": $!");
1683+ my $F= IO::File->new($path_timefile)
1684+ or return;
1685 my $reason;
1686
1687 while ( my $line= <$F> )
1688@@ -3154,8 +3179,8 @@
1689 my ($tinfo)= @_;
1690
1691 # Open mysqltest.log
1692- my $F= IO::File->new($path_timefile) or
1693- mtr_error("can't open file \"$path_timefile\": $!");
1694+ my $F= IO::File->new($path_timefile)
1695+ or return;
1696
1697 while ( my $line= <$F> )
1698 {
1699@@ -3300,7 +3325,7 @@
1700 sub save_installed_db () {
1701
1702 mtr_report("Saving snapshot of installed databases");
1703- rmtree($path_snapshot);
1704+ mtr_rmtree($path_snapshot);
1705
1706 foreach my $data_dir (@data_dir_lst)
1707 {
1708@@ -3347,7 +3372,7 @@
1709 {
1710 my $name= basename($data_dir);
1711 save_files_before_restore($test_name, $data_dir);
1712- rmtree("$data_dir");
1713+ mtr_rmtree("$data_dir");
1714 mtr_copy_dir("$path_snapshot/$name", "$data_dir");
1715 }
1716
1717@@ -3357,7 +3382,7 @@
1718 {
1719 foreach my $ndbd (@{$cluster->{'ndbds'}})
1720 {
1721- rmtree("$ndbd->{'path_fs'}" );
1722+ mtr_rmtree("$ndbd->{'path_fs'}" );
1723 }
1724 }
1725 }
1726@@ -3815,6 +3840,9 @@
1727 $wait_for_pid_file= 0;
1728 }
1729
1730+ # Remove the pidfile
1731+ unlink($mysqld->{'path_pid'});
1732+
1733 if ( defined $exe )
1734 {
1735 $pid= mtr_spawn($exe, $args, "",
1736diff -urN mysql-4.1.23/mysql-test/r/almost_full.result mysql-4.1/mysql-test/r/almost_full.result
1737--- mysql-4.1.23/mysql-test/r/almost_full.result 1970-01-01 01:00:00.000000000 +0100
1738+++ mysql-4.1/mysql-test/r/almost_full.result 2007-11-12 10:00:21.000000000 +0100
1739@@ -0,0 +1,29 @@
1740+drop table if exists t1;
1741+set global myisam_data_pointer_size=2;
1742+CREATE TABLE t1 (a int auto_increment primary key not null, b longtext) ENGINE=MyISAM;
1743+DELETE FROM t1 WHERE a=1 or a=5;
1744+INSERT INTO t1 SET b=repeat('a',600);
1745+ERROR HY000: The table 't1' is full
1746+CHECK TABLE t1 EXTENDED;
1747+Table Op Msg_type Msg_text
1748+test.t1 check warning Datafile is almost full, 65448 of 65534 used
1749+test.t1 check status OK
1750+UPDATE t1 SET b=repeat('a', 800) where a=10;
1751+ERROR HY000: The table 't1' is full
1752+CHECK TABLE t1 EXTENDED;
1753+Table Op Msg_type Msg_text
1754+test.t1 check warning Datafile is almost full, 65448 of 65534 used
1755+test.t1 check status OK
1756+INSERT INTO t1 SET b=repeat('a',400);
1757+CHECK TABLE t1 EXTENDED;
1758+Table Op Msg_type Msg_text
1759+test.t1 check warning Datafile is almost full, 65448 of 65534 used
1760+test.t1 check status OK
1761+DELETE FROM t1 WHERE a=2 or a=6;
1762+UPDATE t1 SET b=repeat('a', 600) where a=11;
1763+CHECK TABLE t1 EXTENDED;
1764+Table Op Msg_type Msg_text
1765+test.t1 check warning Datafile is almost full, 65448 of 65534 used
1766+test.t1 check status OK
1767+drop table t1;
1768+set global myisam_data_pointer_size=default;
1769diff -urN mysql-4.1.23/mysql-test/r/bigint.result mysql-4.1/mysql-test/r/bigint.result
1770--- mysql-4.1.23/mysql-test/r/bigint.result 2007-12-02 20:38:25.000000000 +0100
1771+++ mysql-4.1/mysql-test/r/bigint.result 2007-11-12 12:51:40.000000000 +0100
1772@@ -135,3 +135,9 @@
1773 value64 value32 value64 value32
1774 9223372036854775807 2 9223372036854775807 4
1775 drop table t1, t2;
1776+create table t1 (sint64 bigint not null);
1777+insert into t1 values (-9223372036854775808);
1778+select * from t1;
1779+sint64
1780+-9223372036854775808
1781+drop table t1;
1782diff -urN mysql-4.1.23/mysql-test/r/ctype_big5.result mysql-4.1/mysql-test/r/ctype_big5.result
1783--- mysql-4.1.23/mysql-test/r/ctype_big5.result 2007-12-02 20:38:51.000000000 +0100
1784+++ mysql-4.1/mysql-test/r/ctype_big5.result 2007-10-04 07:19:59.000000000 +0200
1785@@ -52,6 +52,17 @@
1786 want1result
1787 location
1788 DROP TABLE t1;
1789+create table t1 (a set('a') not null);
1790+insert into t1 values (),();
1791+select cast(a as char(1)) from t1;
1792+cast(a as char(1))
1793+
1794+
1795+select a sounds like a from t1;
1796+a sounds like a
1797+1
1798+1
1799+drop table t1;
1800 DROP DATABASE d1;
1801 USE test;
1802 SET character_set_server= @safe_character_set_server;
1803diff -urN mysql-4.1.23/mysql-test/r/ctype_euckr.result mysql-4.1/mysql-test/r/ctype_euckr.result
1804--- mysql-4.1.23/mysql-test/r/ctype_euckr.result 2007-12-02 20:38:26.000000000 +0100
1805+++ mysql-4.1/mysql-test/r/ctype_euckr.result 2007-10-04 07:19:59.000000000 +0200
1806@@ -52,6 +52,17 @@
1807 want1result
1808 location
1809 DROP TABLE t1;
1810+create table t1 (a set('a') not null);
1811+insert into t1 values (),();
1812+select cast(a as char(1)) from t1;
1813+cast(a as char(1))
1814+
1815+
1816+select a sounds like a from t1;
1817+a sounds like a
1818+1
1819+1
1820+drop table t1;
1821 DROP DATABASE d1;
1822 USE test;
1823 SET character_set_server= @safe_character_set_server;
1824diff -urN mysql-4.1.23/mysql-test/r/ctype_gb2312.result mysql-4.1/mysql-test/r/ctype_gb2312.result
1825--- mysql-4.1.23/mysql-test/r/ctype_gb2312.result 2007-12-02 20:38:26.000000000 +0100
1826+++ mysql-4.1/mysql-test/r/ctype_gb2312.result 2007-10-04 07:19:59.000000000 +0200
1827@@ -52,6 +52,17 @@
1828 want1result
1829 location
1830 DROP TABLE t1;
1831+create table t1 (a set('a') not null);
1832+insert into t1 values (),();
1833+select cast(a as char(1)) from t1;
1834+cast(a as char(1))
1835+
1836+
1837+select a sounds like a from t1;
1838+a sounds like a
1839+1
1840+1
1841+drop table t1;
1842 DROP DATABASE d1;
1843 USE test;
1844 SET character_set_server= @safe_character_set_server;
1845diff -urN mysql-4.1.23/mysql-test/r/ctype_gbk.result mysql-4.1/mysql-test/r/ctype_gbk.result
1846--- mysql-4.1.23/mysql-test/r/ctype_gbk.result 2007-12-02 20:38:51.000000000 +0100
1847+++ mysql-4.1/mysql-test/r/ctype_gbk.result 2007-10-04 07:19:59.000000000 +0200
1848@@ -52,6 +52,17 @@
1849 want1result
1850 location
1851 DROP TABLE t1;
1852+create table t1 (a set('a') not null);
1853+insert into t1 values (),();
1854+select cast(a as char(1)) from t1;
1855+cast(a as char(1))
1856+
1857+
1858+select a sounds like a from t1;
1859+a sounds like a
1860+1
1861+1
1862+drop table t1;
1863 DROP DATABASE d1;
1864 USE test;
1865 SET character_set_server= @safe_character_set_server;
1866diff -urN mysql-4.1.23/mysql-test/r/ctype_uca.result mysql-4.1/mysql-test/r/ctype_uca.result
1867--- mysql-4.1.23/mysql-test/r/ctype_uca.result 2007-12-02 20:38:51.000000000 +0100
1868+++ mysql-4.1/mysql-test/r/ctype_uca.result 2007-10-04 07:19:59.000000000 +0200
1869@@ -2371,6 +2371,17 @@
1870 want1result
1871 location
1872 DROP TABLE t1;
1873+create table t1 (a set('a') not null);
1874+insert into t1 values (),();
1875+select cast(a as char(1)) from t1;
1876+cast(a as char(1))
1877+
1878+
1879+select a sounds like a from t1;
1880+a sounds like a
1881+1
1882+1
1883+drop table t1;
1884 DROP DATABASE d1;
1885 USE test;
1886 SET character_set_server= @safe_character_set_server;
1887diff -urN mysql-4.1.23/mysql-test/r/ctype_ucs.result mysql-4.1/mysql-test/r/ctype_ucs.result
1888--- mysql-4.1.23/mysql-test/r/ctype_ucs.result 2007-12-02 20:38:27.000000000 +0100
1889+++ mysql-4.1/mysql-test/r/ctype_ucs.result 2007-10-24 13:09:29.000000000 +0200
1890@@ -803,4 +803,10 @@
1891 ????????
1892 ????????????????
1893 drop table bug20536;
1894+CREATE TABLE t1(a TEXT CHARSET ucs2 COLLATE ucs2_unicode_ci);
1895+INSERT INTO t1 VALUES('abcd');
1896+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abcd' IN BOOLEAN MODE);
1897+a
1898+abcd
1899+DROP TABLE t1;
1900 End of 4.1 tests
1901diff -urN mysql-4.1.23/mysql-test/r/delete.result mysql-4.1/mysql-test/r/delete.result
1902--- mysql-4.1.23/mysql-test/r/delete.result 2007-12-02 20:38:52.000000000 +0100
1903+++ mysql-4.1/mysql-test/r/delete.result 2007-09-10 14:26:49.000000000 +0200
1904@@ -193,4 +193,15 @@
1905 @a
1906 1
1907 drop table t1;
1908+CREATE TABLE t1 (
1909+`date` date ,
1910+`time` time ,
1911+`seq` int(10) unsigned NOT NULL auto_increment,
1912+PRIMARY KEY (`seq`),
1913+KEY `seq` (`seq`),
1914+KEY `time` (`time`),
1915+KEY `date` (`date`)
1916+);
1917+DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1;
1918+drop table t1;
1919 End of 4.1 tests
1920diff -urN mysql-4.1.23/mysql-test/r/fulltext.result mysql-4.1/mysql-test/r/fulltext.result
1921--- mysql-4.1.23/mysql-test/r/fulltext.result 2007-12-02 20:38:25.000000000 +0100
1922+++ mysql-4.1/mysql-test/r/fulltext.result 2007-10-30 11:46:42.000000000 +0100
1923@@ -454,3 +454,9 @@
1924 SELECT * FROM t1 WHERE MATCH(a) AGAINST('test');
1925 ERROR HY000: Can't find FULLTEXT index matching the column list
1926 DROP TABLE t1;
1927+CREATE TABLE t1(a TEXT);
1928+INSERT INTO t1 VALUES(' aaaaa aaaa');
1929+SELECT * FROM t1 WHERE MATCH(a) AGAINST ('"aaaa"' IN BOOLEAN MODE);
1930+a
1931+ aaaaa aaaa
1932+DROP TABLE t1;
1933diff -urN mysql-4.1.23/mysql-test/r/func_str.result mysql-4.1/mysql-test/r/func_str.result
1934--- mysql-4.1.23/mysql-test/r/func_str.result 2007-12-02 20:38:26.000000000 +0100
1935+++ mysql-4.1/mysql-test/r/func_str.result 2007-10-30 09:35:02.000000000 +0100
1936@@ -711,9 +711,9 @@
1937 show create table t1;
1938 Table Create Table
1939 t1 CREATE TABLE `t1` (
1940- `bin(130)` char(64) NOT NULL default '',
1941- `oct(130)` char(64) NOT NULL default '',
1942- `conv(130,16,10)` char(64) NOT NULL default '',
1943+ `bin(130)` char(64) default NULL,
1944+ `oct(130)` char(64) default NULL,
1945+ `conv(130,16,10)` char(64) default NULL,
1946 `hex(130)` char(6) NOT NULL default '',
1947 `char(130)` char(1) NOT NULL default '',
1948 `format(130,10)` char(4) NOT NULL default '',
1949@@ -1076,4 +1076,16 @@
1950 Warnings:
1951 Note 1003 select decode(test.t1.f1,'zxcv') AS `enc` from test.t1
1952 drop table t1;
1953+create table t1 (a bigint not null)engine=myisam;
1954+insert into t1 set a = 1024*1024*1024*4;
1955+delete from t1 order by (inet_ntoa(a)) desc limit 10;
1956+drop table t1;
1957+create table t1 (a char(36) not null)engine=myisam;
1958+insert ignore into t1 set a = ' ';
1959+insert ignore into t1 set a = ' ';
1960+select * from t1 order by (oct(a));
1961+a
1962+
1963+
1964+drop table t1;
1965 End of 4.1 tests
1966diff -urN mysql-4.1.23/mysql-test/r/gis.result mysql-4.1/mysql-test/r/gis.result
1967--- mysql-4.1.23/mysql-test/r/gis.result 2007-12-02 20:38:26.000000000 +0100
1968+++ mysql-4.1/mysql-test/r/gis.result 2007-10-03 10:35:33.000000000 +0200
1969@@ -724,4 +724,10 @@
1970 a
1971 NULL
1972 DROP TABLE t1;
1973+CREATE TABLE `t1` ( `col9` set('a'), `col89` date);
1974+INSERT INTO `t1` VALUES ('','0000-00-00');
1975+select geomfromtext(col9,col89) as a from t1;
1976+a
1977+NULL
1978+DROP TABLE t1;
1979 End of 4.1 tests
1980diff -urN mysql-4.1.23/mysql-test/r/gis-rtree.result mysql-4.1/mysql-test/r/gis-rtree.result
1981--- mysql-4.1.23/mysql-test/r/gis-rtree.result 2007-12-02 20:38:27.000000000 +0100
1982+++ mysql-4.1/mysql-test/r/gis-rtree.result 2007-10-05 12:40:31.000000000 +0200
1983@@ -1420,3 +1420,34 @@
1984 Table Op Msg_type Msg_text
1985 test.t1 check status OK
1986 DROP TABLE t1;
1987+create table t1 (a geometry not null, spatial index(a));
1988+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072)));
1989+insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284)));
1990+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0)));
1991+insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53)));
1992+insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111)));
1993+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241)));
1994+insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111)));
1995+insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251)));
1996+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231)));
1997+insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260)));
1998+insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236)));
1999+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125)));
2000+insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275)));
2001+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29)));
2002+insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86)));
2003+insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270)));
2004+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19)));
2005+insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255)));
2006+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130)));
2007+insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39)));
2008+insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159)));
2009+insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270)));
2010+insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82)));
2011+insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34)));
2012+insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53)));
2013+insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183)));
2014+insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192)));
2015+insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159)));
2016+insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178)));
2017+drop table t1;
2018diff -urN mysql-4.1.23/mysql-test/r/group_by.result mysql-4.1/mysql-test/r/group_by.result
2019--- mysql-4.1.23/mysql-test/r/group_by.result 2007-12-02 20:38:25.000000000 +0100
2020+++ mysql-4.1/mysql-test/r/group_by.result 2007-07-31 07:45:59.000000000 +0200
2021@@ -818,3 +818,20 @@
2022 2
2023 1
2024 DROP TABLE t1;
2025+CREATE TABLE t1 (
2026+f1 int(10) unsigned NOT NULL auto_increment primary key,
2027+f2 varchar(100) NOT NULL default ''
2028+);
2029+CREATE TABLE t2 (
2030+f1 varchar(10) NOT NULL default '',
2031+f2 char(3) NOT NULL default '',
2032+PRIMARY KEY (`f1`),
2033+KEY `k1` (`f2`,`f1`)
2034+);
2035+INSERT INTO t1 values(NULL, '');
2036+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
2037+SELECT SQL_BUFFER_RESULT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
2038+avg(t2.f1)
2039+SELECT avg(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
2040+avg(t2.f1)
2041+DROP TABLE t1, t2;
2042diff -urN mysql-4.1.23/mysql-test/r/having.result mysql-4.1/mysql-test/r/having.result
2043--- mysql-4.1.23/mysql-test/r/having.result 2007-12-02 20:38:27.000000000 +0100
2044+++ mysql-4.1/mysql-test/r/having.result 2007-07-21 07:55:59.000000000 +0200
2045@@ -158,3 +158,22 @@
2046 id select_type table type possible_keys key key_len ref rows Extra
2047 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
2048 DROP table t1;
2049+CREATE TABLE t1 (a int PRIMARY KEY);
2050+CREATE TABLE t2 (b int PRIMARY KEY, a int);
2051+CREATE TABLE t3 (b int, flag int);
2052+INSERT INTO t1 VALUES (1);
2053+INSERT INTO t2 VALUES (1,1), (2,1), (3,1);
2054+INSERT INTO t3(b,flag) VALUES (2, 1);
2055+SELECT t1.a
2056+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
2057+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
2058+a
2059+SELECT DISTINCT t1.a, MAX(t3.flag)
2060+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
2061+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
2062+a MAX(t3.flag)
2063+SELECT DISTINCT t1.a
2064+FROM t1 INNER JOIN t2 ON t1.a=t2.a LEFT JOIN t3 ON t2.b=t3.b
2065+GROUP BY t1.a, t2.b HAVING MAX(t3.flag)=0;
2066+a
2067+DROP TABLE t1,t2,t3;
2068diff -urN mysql-4.1.23/mysql-test/r/heap_btree.result mysql-4.1/mysql-test/r/heap_btree.result
2069--- mysql-4.1.23/mysql-test/r/heap_btree.result 2007-12-02 20:38:25.000000000 +0100
2070+++ mysql-4.1/mysql-test/r/heap_btree.result 2007-09-13 12:39:15.000000000 +0200
2071@@ -307,4 +307,11 @@
2072 ) ENGINE= MEMORY DEFAULT CHARSET= utf8;
2073 INSERT INTO t1 VALUES('1'), ('2');
2074 DROP TABLE t1;
2075+CREATE TABLE t1 (a INT, KEY USING BTREE(a)) ENGINE=MEMORY;
2076+INSERT INTO t1 VALUES(1),(2),(2);
2077+DELETE FROM t1 WHERE a=2;
2078+SELECT * FROM t1;
2079+a
2080+1
2081+DROP TABLE t1;
2082 End of 4.1 tests
2083diff -urN mysql-4.1.23/mysql-test/r/innodb_mysql.result mysql-4.1/mysql-test/r/innodb_mysql.result
2084--- mysql-4.1.23/mysql-test/r/innodb_mysql.result 2007-12-02 20:38:27.000000000 +0100
2085+++ mysql-4.1/mysql-test/r/innodb_mysql.result 2007-10-04 12:22:30.000000000 +0200
2086@@ -182,4 +182,40 @@
2087 id select_type table type possible_keys key key_len ref rows Extra
2088 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2089 DROP TABLE t1;
2090+CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8;
2091+INSERT INTO t1 VALUES ('uk'),('bg');
2092+SELECT * FROM t1 WHERE a = 'uk';
2093+a
2094+uk
2095+DELETE FROM t1 WHERE a = 'uk';
2096+SELECT * FROM t1 WHERE a = 'uk';
2097+a
2098+UPDATE t1 SET a = 'us' WHERE a = 'uk';
2099+SELECT * FROM t1 WHERE a = 'uk';
2100+a
2101+CREATE TABLE t2 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
2102+INSERT INTO t2 VALUES ('uk'),('bg');
2103+SELECT * FROM t2 WHERE a = 'uk';
2104+a
2105+uk
2106+DELETE FROM t2 WHERE a = 'uk';
2107+SELECT * FROM t2 WHERE a = 'uk';
2108+a
2109+INSERT INTO t2 VALUES ('uk');
2110+UPDATE t2 SET a = 'us' WHERE a = 'uk';
2111+SELECT * FROM t2 WHERE a = 'uk';
2112+a
2113+CREATE TABLE t3 (a CHAR(2), KEY (a)) ENGINE = MyISAM;
2114+INSERT INTO t3 VALUES ('uk'),('bg');
2115+SELECT * FROM t3 WHERE a = 'uk';
2116+a
2117+uk
2118+DELETE FROM t3 WHERE a = 'uk';
2119+SELECT * FROM t3 WHERE a = 'uk';
2120+a
2121+INSERT INTO t3 VALUES ('uk');
2122+UPDATE t3 SET a = 'us' WHERE a = 'uk';
2123+SELECT * FROM t3 WHERE a = 'uk';
2124+a
2125+DROP TABLE t1,t2,t3;
2126 End of 4.1 tests
2127diff -urN mysql-4.1.23/mysql-test/r/insert_select.result mysql-4.1/mysql-test/r/insert_select.result
2128--- mysql-4.1.23/mysql-test/r/insert_select.result 2007-12-02 20:38:27.000000000 +0100
2129+++ mysql-4.1/mysql-test/r/insert_select.result 2007-07-31 07:45:59.000000000 +0200
2130@@ -690,3 +690,29 @@
2131 INSERT INTO t1 values (1), (2);
2132 INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
2133 DROP TABLE t1;
2134+CREATE TABLE t1 (
2135+f1 int(10) unsigned NOT NULL auto_increment PRIMARY KEY,
2136+f2 varchar(100) NOT NULL default ''
2137+);
2138+CREATE TABLE t2 (
2139+f1 varchar(10) NOT NULL default '',
2140+f2 char(3) NOT NULL default '',
2141+PRIMARY KEY (`f1`),
2142+KEY `k1` (`f2`, `f1`)
2143+);
2144+INSERT INTO t1 values(NULL, '');
2145+INSERT INTO `t2` VALUES ('486878','WDT'),('486910','WDT');
2146+SELECT COUNT(*) FROM t1;
2147+COUNT(*)
2148+1
2149+SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
2150+min(t2.f1)
2151+INSERT INTO t1 (f2)
2152+SELECT min(t2.f1) FROM t1, t2 where t2.f2 = 'SIR' GROUP BY t1.f1;
2153+SELECT COUNT(*) FROM t1;
2154+COUNT(*)
2155+1
2156+SELECT * FROM t1;
2157+f1 f2
2158+1
2159+DROP TABLE t1, t2;
2160diff -urN mysql-4.1.23/mysql-test/r/loaddata.result mysql-4.1/mysql-test/r/loaddata.result
2161--- mysql-4.1.23/mysql-test/r/loaddata.result 2007-12-02 20:38:27.000000000 +0100
2162+++ mysql-4.1/mysql-test/r/loaddata.result 2007-07-03 18:44:26.000000000 +0200
2163@@ -1,4 +1,4 @@
2164-drop table if exists t1;
2165+drop table if exists t1,t2;
2166 create table t1 (a date, b date, c date not null, d date);
2167 load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
2168 Warnings:
2169@@ -85,3 +85,57 @@
2170 a"b cd"ef
2171 a"b c"d"e
2172 drop table t1;
2173+CREATE TABLE t1 (
2174+id INT AUTO_INCREMENT PRIMARY KEY,
2175+c1 VARCHAR(255)
2176+);
2177+CREATE TABLE t2 (
2178+id INT,
2179+c2 VARCHAR(255)
2180+);
2181+INSERT INTO t1 (c1) VALUES
2182+('r'), ('rr'), ('rrr'), ('rrrr'),
2183+('.r'), ('.rr'), ('.rrr'), ('.rrrr'),
2184+('r.'), ('rr.'), ('rrr.'), ('rrrr.'),
2185+('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.');
2186+SELECT * FROM t1;
2187+id c1
2188+1 r
2189+2 rr
2190+3 rrr
2191+4 rrrr
2192+5 .r
2193+6 .rr
2194+7 .rrr
2195+8 .rrrr
2196+9 r.
2197+10 rr.
2198+11 rrr.
2199+12 rrrr.
2200+13 .r.
2201+14 .rr.
2202+15 .rrr.
2203+16 .rrrr.
2204+SELECT * INTO OUTFILE 'MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1;
2205+r1r rrrr
2206+r2r rrrrrr
2207+r3r rrrrrrrr
2208+r4r rrrrrrrrrr
2209+r5r r.rrr
2210+r6r r.rrrrr
2211+r7r r.rrrrrrr
2212+r8r r.rrrrrrrrr
2213+r9r rrr.r
2214+r10r rrrrr.r
2215+r11r rrrrrrr.r
2216+r12r rrrrrrrrr.r
2217+r13r r.rr.r
2218+r14r r.rrrr.r
2219+r15r r.rrrrrr.r
2220+r16r r.rrrrrrrr.r
2221+LOAD DATA INFILE 'MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r';
2222+SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
2223+id c1 c2
2224+SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2;
2225+id c1 c2
2226+DROP TABLE t1,t2;
2227diff -urN mysql-4.1.23/mysql-test/r/myisampack.result mysql-4.1/mysql-test/r/myisampack.result
2228--- mysql-4.1.23/mysql-test/r/myisampack.result 1970-01-01 01:00:00.000000000 +0100
2229+++ mysql-4.1/mysql-test/r/myisampack.result 2007-11-07 09:55:27.000000000 +0100
2230@@ -0,0 +1,29 @@
2231+CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE,
2232+c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY);
2233+INSERT INTO t1 VALUES
2234+(-3.31168791059336e-06,-3.19054655887874e-06,-1.06528081684847e-05,-1.227278240089e-06,-1.66718069164799e-06,-2.59038972510885e-06,-2.83145227805303e-06,-4.09678491270648e-07,-2.22610091291797e-06,6),
2235+(0.0030743000272545,2.53222044316438e-05,2.78674650061845e-05,1.95914465544536e-05,1.7347572525984e-05,1.87513810069614e-05,1.69882826885005e-05,2.44449336987598e-05,1.89914629921774e-05,9),
2236+(2.85229319423495e-05,3.05970988282259e-05,3.77161100113133e-05,2.3055238978766e-05,2.08241267364615e-05,2.28009504270553e-05,2.12070165658947e-05,2.84350091565409e-05,2.3366822910704e-05,3),
2237+(0,0,0,0,0,0,0,0,0,12),
2238+(3.24544577570754e-05,3.44619021870993e-05,4.37561613201124e-05,2.57556808726748e-05,2.3195354640561e-05,2.58532400758869e-05,2.34934241667179e-05,3.1621640063232e-05,2.58229982746189e-05,19),
2239+(2.53222044316438e-05,0.00445071933455582,2.97447268116016e-05,2.12379514059868e-05,1.86777776502663e-05,2.0170058676712e-05,1.8946030385445e-05,2.66040037173511e-05,2.09161899668946e-05,20),
2240+(3.03462382611645e-05,3.26517930083994e-05,3.5242025468662e-05,2.53219745106391e-05,2.24384532945004e-05,2.4052346047657e-05,2.23865572957053e-05,3.1634313969082e-05,2.48285463481801e-05,21),
2241+(1.95914465544536e-05,2.12379514059868e-05,2.27808649037128e-05,0.000341724375366877,1.4512761275113e-05,1.56475828693953e-05,1.44372366441415e-05,2.07952121981765e-05,1.61488256935919e-05,28),
2242+(1.7347572525984e-05,1.86777776502663e-05,2.04116907052727e-05,1.4512761275113e-05,0.000432162526082388,1.38116514014465e-05,1.2712914948904e-05,1.82503165178506e-05,1.43043075345922e-05,30),
2243+(1.68339762136661e-05,1.77836497166611e-05,2.36328309295222e-05,1.30183423732016e-05,1.18674654241553e-05,1.32467273128652e-05,1.24581739117775e-05,1.55624190959406e-05,1.33010638508213e-05,31),
2244+(1.89643062824415e-05,2.06997140070717e-05,2.29045490159364e-05,1.57918175731019e-05,1.39864987449492e-05,1.50580274578455e-05,1.45908734129609e-05,1.95329296993327e-05,1.5814709481221e-05,32),
2245+(1.69882826885005e-05,1.8946030385445e-05,2.00820439721439e-05,1.44372366441415e-05,1.2712914948904e-05,1.35209686474184e-05,0.00261563314789896,1.78285095864627e-05,1.46699314500019e-05,34),
2246+(2.0278186540684e-05,2.18923409729654e-05,2.39981539939738e-05,1.71774589459438e-05,1.54654355357383e-05,1.62731485707636e-05,1.49253140625051e-05,2.18229800160297e-05,1.71923561673718e-05,35),
2247+(2.44449336987598e-05,2.66040037173511e-05,2.84860148925308e-05,2.07952121981765e-05,1.82503165178506e-05,1.97667730441441e-05,1.78285095864627e-05,0.00166478601822712,2.0299952103232e-05,36),
2248+(1.89914629921774e-05,2.09161899668946e-05,2.26026841007872e-05,1.61488256935919e-05,1.43043075345922e-05,1.52609063290127e-05,1.46699314500019e-05,2.0299952103232e-05,0.00306670170971682,39),
2249+(0,0,0,0,0,0,0,0,0,41),
2250+(0,0,0,0,0,0,0,0,0,17),
2251+(0,0,0,0,0,0,0,0,0,18),
2252+(2.51880677333017e-05,2.63051795435778e-05,2.79874748974906e-05,2.02888886670845e-05,1.8178636318197e-05,1.91308527003585e-05,1.83260023644133e-05,2.4422300558171e-05,1.96411467520551e-05,44),
2253+(2.22402118719591e-05,2.37546284320705e-05,2.58463051055541e-05,1.83391609130854e-05,1.6300720519646e-05,1.74559091886791e-05,1.63733785575587e-05,2.26616253279828e-05,1.79541237435621e-05,45),
2254+(3.01092775359837e-05,3.23865212934412e-05,4.09444584045994e-05,0,2.15470966302776e-05,2.39082636344032e-05,2.28296706429177e-05,2.9007671511595e-05,2.44201138973326e-05,46);
2255+FLUSH TABLES;
2256+CHECK TABLE t1 EXTENDED;
2257+Table Op Msg_type Msg_text
2258+test.t1 check status OK
2259+DROP TABLE t1;
2260diff -urN mysql-4.1.23/mysql-test/r/mysqltest.result mysql-4.1/mysql-test/r/mysqltest.result
2261--- mysql-4.1.23/mysql-test/r/mysqltest.result 2007-12-02 20:38:26.000000000 +0100
2262+++ mysql-4.1/mysql-test/r/mysqltest.result 2007-06-19 11:06:02.000000000 +0200
2263@@ -330,6 +330,7 @@
2264
2265 In loop
2266 here is the sourced script
2267+here is the sourced script
2268 mysqltest: At line 1: Missing argument to sleep
2269 mysqltest: At line 1: Missing argument to real_sleep
2270 mysqltest: At line 1: Invalid argument to sleep "abc"
2271@@ -655,4 +656,43 @@
2272 INSERT INTO t1 SELECT f1 - 512 FROM t1;
2273 SELECT * FROM t1;
2274 DROP TABLE t1;
2275+CREATE TABLE t1(
2276+a int, b varchar(255), c datetime
2277+);
2278+SHOW COLUMNS FROM t1;
2279+Field Type Null Key Default Extra
2280+a int(11) YES NULL
2281+b varchar(255) YES NULL
2282+c datetime YES NULL
2283+statement=SHOW COLUMNS FROM t1 row_number=1, column_name="Type", Value=int(11)
2284+statement="SHOW COLUMNS FROM t1" row_number=1, column_name="Type", Value=int(11)
2285+statement=SHOW COLUMNS FROM t1 row_number=1, column_name=Default, Value=NULL
2286+value= ->A B<-
2287+value= 1
2288+mysqltest: At line 1: query_get_value - argument list started with '(' must be ended with ')'
2289+mysqltest: At line 1: Missing required argument 'query' to command 'query_get_value'
2290+mysqltest: At line 1: Missing required argument 'column name' to command 'query_get_value'
2291+mysqltest: At line 1: Missing required argument 'row number' to command 'query_get_value'
2292+value= No such row
2293+value= No such row
2294+mysqltest: At line 1: Invalid row number: 'notnumber'
2295+mysqltest: At line 1: Could not find column 'column_not_exists' in the result of 'SHOW COLUMNS FROM t1'
2296+mysqltest: At line 1: Query 'SET @A = 1' didn't return a result set
2297+mysqltest: At line 1: Could not find column '1 AS B' in the result of 'SELECT 1 AS A'
2298+value= No such row
2299+mysqltest: At line 1: Error running query 'SHOW COLNS FROM t1': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLNS FROM t1' at line 1
2300+
2301+Field Type Null Key Default Extra
2302+a int(11) YES -><- NULL
2303+b varchar(255) YES -><- NULL
2304+c datetime YES -><- NULL
2305+
2306+Number of columns with Default NULL: 3
2307+
2308+SHOW COLUMNS FROM t1;
2309+Field Type Null Key Default Extra
2310+a int(11) YES NULL
2311+b varchar(255) YES NULL
2312+c datetime YES NULL
2313+drop table t1;
2314 End of tests
2315diff -urN mysql-4.1.23/mysql-test/r/repair.result mysql-4.1/mysql-test/r/repair.result
2316--- mysql-4.1.23/mysql-test/r/repair.result 2007-12-02 20:38:25.000000000 +0100
2317+++ mysql-4.1/mysql-test/r/repair.result 2007-10-17 08:29:45.000000000 +0200
2318@@ -83,3 +83,30 @@
2319 SET myisam_repair_threads=@@global.myisam_repair_threads;
2320 SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
2321 DROP TABLE t1;
2322+CREATE TABLE t1(a CHAR(255), KEY(a));
2323+SET myisam_sort_buffer_size=4496;
2324+INSERT INTO t1 VALUES
2325+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2326+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2327+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2328+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2329+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2330+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2331+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2332+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2333+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2334+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2335+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2336+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2337+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2338+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2339+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
2340+('0'),('0'),('0'),('0'),('0'),('0'),('0');
2341+SET myisam_repair_threads=2;
2342+REPAIR TABLE t1;
2343+Table Op Msg_type Msg_text
2344+test.t1 repair status OK
2345+SET myisam_repair_threads=@@global.myisam_repair_threads;
2346+SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
2347+DROP TABLE t1;
2348+End of 4.1 tests
2349diff -urN mysql-4.1.23/mysql-test/r/rpl_change_master.result mysql-4.1/mysql-test/r/rpl_change_master.result
2350--- mysql-4.1.23/mysql-test/r/rpl_change_master.result 2007-12-02 20:38:25.000000000 +0100
2351+++ mysql-4.1/mysql-test/r/rpl_change_master.result 2007-06-19 12:19:19.000000000 +0200
2352@@ -15,12 +15,74 @@
2353 n
2354 1
2355 show slave status;
2356-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
2357-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 273 slave-relay-bin.000002 258 master-bin.000001 No No 0 0 214 317 None 0 No #
2358+Slave_IO_State #
2359+Master_Host 127.0.0.1
2360+Master_User root
2361+Master_Port MASTER_MYPORT
2362+Connect_Retry 1
2363+Master_Log_File master-bin.000001
2364+Read_Master_Log_Pos 273
2365+Relay_Log_File slave-relay-bin.000002
2366+Relay_Log_Pos 258
2367+Relay_Master_Log_File master-bin.000001
2368+Slave_IO_Running No
2369+Slave_SQL_Running No
2370+Replicate_Do_DB
2371+Replicate_Ignore_DB
2372+Replicate_Do_Table
2373+Replicate_Ignore_Table
2374+Replicate_Wild_Do_Table
2375+Replicate_Wild_Ignore_Table
2376+Last_Errno 0
2377+Last_Error
2378+Skip_Counter 0
2379+Exec_Master_Log_Pos 214
2380+Relay_Log_Space 317
2381+Until_Condition None
2382+Until_Log_File
2383+Until_Log_Pos 0
2384+Master_SSL_Allowed No
2385+Master_SSL_CA_File
2386+Master_SSL_CA_Path
2387+Master_SSL_Cert
2388+Master_SSL_Cipher
2389+Master_SSL_Key
2390+Seconds_Behind_Master #
2391 change master to master_user='root';
2392 show slave status;
2393-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
2394-# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 214 # # master-bin.000001 No No 0 0 214 # None 0 No #
2395+Slave_IO_State #
2396+Master_Host 127.0.0.1
2397+Master_User root
2398+Master_Port MASTER_MYPORT
2399+Connect_Retry 1
2400+Master_Log_File master-bin.000001
2401+Read_Master_Log_Pos 214
2402+Relay_Log_File #
2403+Relay_Log_Pos #
2404+Relay_Master_Log_File master-bin.000001
2405+Slave_IO_Running No
2406+Slave_SQL_Running No
2407+Replicate_Do_DB
2408+Replicate_Ignore_DB
2409+Replicate_Do_Table
2410+Replicate_Ignore_Table
2411+Replicate_Wild_Do_Table
2412+Replicate_Wild_Ignore_Table
2413+Last_Errno 0
2414+Last_Error
2415+Skip_Counter 0
2416+Exec_Master_Log_Pos 214
2417+Relay_Log_Space #
2418+Until_Condition None
2419+Until_Log_File
2420+Until_Log_Pos 0
2421+Master_SSL_Allowed No
2422+Master_SSL_CA_File
2423+Master_SSL_CA_Path
2424+Master_SSL_Cert
2425+Master_SSL_Cipher
2426+Master_SSL_Key
2427+Seconds_Behind_Master #
2428 select release_lock("a");
2429 release_lock("a")
2430 1
2431diff -urN mysql-4.1.23/mysql-test/r/select.result mysql-4.1/mysql-test/r/select.result
2432--- mysql-4.1.23/mysql-test/r/select.result 2007-12-02 20:38:26.000000000 +0100
2433+++ mysql-4.1/mysql-test/r/select.result 2007-11-07 16:45:01.000000000 +0100
2434@@ -2835,4 +2835,12 @@
2435 FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
2436 8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
2437 drop table t1;
2438+CREATE TABLE t1 (c0 int);
2439+CREATE TABLE t2 (c0 int);
2440+INSERT INTO t1 VALUES(@@connect_timeout);
2441+INSERT INTO t2 VALUES(@@connect_timeout);
2442+SELECT * FROM t1 JOIN t2 ON t1.c0 = t2.c0 WHERE (t1.c0 <=> @@connect_timeout);
2443+c0 c0
2444+X X
2445+DROP TABLE t1, t2;
2446 End of 4.1 tests
2447diff -urN mysql-4.1.23/mysql-test/r/subselect.result mysql-4.1/mysql-test/r/subselect.result
2448--- mysql-4.1.23/mysql-test/r/subselect.result 2007-12-02 20:38:27.000000000 +0100
2449+++ mysql-4.1/mysql-test/r/subselect.result 2007-06-06 15:29:14.000000000 +0200
2450@@ -2834,6 +2834,8 @@
2451 4
2452 DROP TABLE t1,t2,t3;
2453 purge master logs before (select adddate(current_timestamp(), interval -4 day));
2454+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select adddate(current_timestamp(), interval -4 day))' at line 1
2455+purge master logs before adddate(current_timestamp(), interval -4 day);
2456 CREATE TABLE t1 (f1 INT);
2457 CREATE TABLE t2 (f2 INT);
2458 INSERT INTO t1 VALUES (1);
2459diff -urN mysql-4.1.23/mysql-test/r/symlink.result mysql-4.1/mysql-test/r/symlink.result
2460--- mysql-4.1.23/mysql-test/r/symlink.result 2007-12-02 20:38:26.000000000 +0100
2461+++ mysql-4.1/mysql-test/r/symlink.result 2007-11-12 18:51:47.000000000 +0100
2462@@ -90,6 +90,12 @@
2463 `b` int(11) default NULL
2464 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
2465 drop table t1;
2466+CREATE TABLE t1(a INT)
2467+DATA DIRECTORY='TEST_DIR/master-data/mysql'
2468+INDEX DIRECTORY='TEST_DIR/master-data/mysql';
2469+RENAME TABLE t1 TO user;
2470+ERROR HY000: Can't create/write to file 'TEST_DIR/master-data/mysql/user.MYI' (Errcode: 17)
2471+DROP TABLE t1;
2472 show create table t1;
2473 Table Create Table
2474 t1 CREATE TABLE `t1` (
2475diff -urN mysql-4.1.23/mysql-test/r/type_enum.result mysql-4.1/mysql-test/r/type_enum.result
2476--- mysql-4.1.23/mysql-test/r/type_enum.result 2007-12-02 20:38:26.000000000 +0100
2477+++ mysql-4.1/mysql-test/r/type_enum.result 2007-06-27 00:41:47.000000000 +0200
2478@@ -1778,4 +1778,27 @@
2479 create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','\ 1\ 2\ 3\ 4\ 5\ 6\a\b
2480