List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:June 5 2009 9:29pm
Subject:bzr commit into mysql-5.0-bugteam branch (azundris:2766)
View as plain text  
#At file:///misc/mysql/forest/32149/50-32149/ based on revid:azundris@stripped

 2766 Tatiana A. Nurnberg	2009-06-05 [merge]
      auto-merge

    added:
      mysql-test/r/sp-fib.result
      mysql-test/t/sp-fib.test
    modified:
      client/mysqldump.c
      client/mysqltest.c
      cmd-line-utils/readline/bind.c
      cmd-line-utils/readline/chardefs.h
      cmd-line-utils/readline/display.c
      dbug/user.r
      mysql-test/r/innodb_mysql.result
      mysql-test/r/sp.result
      mysql-test/t/innodb_mysql.test
      mysql-test/t/sp.test
      sql/item.cc
      strings/ctype.c
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c	2009-03-19 13:58:56 +0000
+++ b/client/mysqldump.c	2009-06-05 16:23:44 +0000
@@ -3122,7 +3122,7 @@ static my_bool dump_all_views_in_db(char
     for (numrows= 0 ; (table= getTableName(1)); )
     {
       char *end= strmov(afterdot, table);
-      if (include_table((uchar*) hash_key,end - hash_key))
+      if (include_table(hash_key,end - hash_key))
       {
         numrows++;
         dynstr_append_checked(&query, quote_name(table, table_buff, 1));
@@ -3143,7 +3143,7 @@ static my_bool dump_all_views_in_db(char
   while ((table= getTableName(0)))
   {
     char *end= strmov(afterdot, table);
-    if (include_table((uchar*) hash_key, end - hash_key))
+    if (include_table(hash_key, end - hash_key))
       get_view_structure(table, database);
   }
   if (opt_xml)

=== modified file 'client/mysqltest.c'
--- a/client/mysqltest.c	2009-04-09 08:58:18 +0000
+++ b/client/mysqltest.c	2009-06-05 14:59:23 +0000
@@ -1340,23 +1340,25 @@ static int run_tool(const char *tool_pat
   not present.
 */
 
-int diff_check()
+int diff_check(const char *diff_name)
 {
- char buf[512]= {0};
- FILE *res_file;
- const char *cmd = "diff -v";
- int have_diff = 0;
+  char buf[512]= {0};
+  FILE *res_file;
+  char cmd[128];
+  my_snprintf (cmd, sizeof(cmd), "%s -v", diff_name);
+  int have_diff = 0;
 
   if (!(res_file= popen(cmd, "r")))
     die("popen(\"%s\", \"r\") failed", cmd);
 
-/* if diff is not present, nothing will be in stdout to increment have_diff */
+  /* if diff is not present, nothing will be in
+   * stdout to increment have_diff */
   if (fgets(buf, sizeof(buf), res_file))
   {
     have_diff += 1;
   } 
- pclose(res_file);
- return have_diff;
+  pclose(res_file);
+  return have_diff;
 }
 
 /*
@@ -1377,28 +1379,33 @@ void show_diff(DYNAMIC_STRING* ds,
 {
 
   DYNAMIC_STRING ds_tmp;
-  int have_diff = 0;
+  const char *diff_name = 0;
 
   if (init_dynamic_string(&ds_tmp, "", 256, 256))
     die("Out of memory");
-  
+
   /* determine if we have diff on Windows
-     needs special processing due to return values
-     on that OS
-     This test is only done on Windows since it's only needed there
-     in order to correctly detect non-availibility of 'diff', and
-     the way it's implemented does not work with default 'diff' on Solaris.
-  */
+    needs special processing due to return values
+    on that OS
+    This test is only done on Windows since it's only needed there
+    in order to correctly detect non-availibility of 'diff', and
+    the way it's implemented does not work with default 'diff' on Solaris.
+    */
 #ifdef __WIN__
-  have_diff = diff_check();
+  if (diff_check("diff"))
+    diff_name = "diff";
+  else if (diff_check("mtrdiff"))
+    diff_name = "mtrdiff";
+  else
+    diff_name = 0;
 #else
-  have_diff = 1;
+  diff_name = "diff";           // Otherwise always assume it's called diff
 #endif
 
-  if (have_diff)
+  if (diff_name)
   {
     /* First try with unified diff */
-    if (run_tool("diff",
+    if (run_tool(diff_name,
                  &ds_tmp, /* Get output from diff in ds_tmp */
                  "-u",
                  filename1,
@@ -1409,7 +1416,7 @@ void show_diff(DYNAMIC_STRING* ds,
       dynstr_set(&ds_tmp, "");
 
       /* Fallback to context diff with "diff -c" */
-      if (run_tool("diff",
+      if (run_tool(diff_name,
                    &ds_tmp, /* Get output from diff in ds_tmp */
                    "-c",
                    filename1,
@@ -1417,42 +1424,42 @@ void show_diff(DYNAMIC_STRING* ds,
                    "2>&1",
                    NULL) > 1) /* Most "diff" tools return >1 if error */
       {
-        have_diff= 0;
-      }  
+        diff_name= 0;
+      }
     }
   }
 
-if (!(have_diff))
+  if (!(diff_name))
   {
     /*
       Fallback to dump both files to result file and inform
       about installing "diff"
-    */
-      
-      dynstr_set(&ds_tmp, "");
+      */
+
+    dynstr_set(&ds_tmp, "");
 
-      dynstr_append(&ds_tmp,
-"\n"
-"The two files differ but it was not possible to execute 'diff' in\n"
-"order to show only the difference, tried both 'diff -u' or 'diff -c'.\n"
-"Instead the whole content of the two files was shown for you to diff manually. ;)\n\n"
-"To get a better report you should install 'diff' on your system, which you\n"
-"for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n"
+    dynstr_append(&ds_tmp,
+      "\n"
+      "The two files differ but it was not possible to execute 'diff' in\n"
+      "order to show only the difference, tried both 'diff -u' or 'diff -c'.\n"
+      "Instead the whole content of the two files was shown for you to diff manually. ;)\n\n"
+      "To get a better report you should install 'diff' on your system, which you\n"
+      "for example can get from http://www.gnu.org/software/diffutils/diffutils.html\n"
 #ifdef __WIN__
-"or http://gnuwin32.sourceforge.net/packages/diffutils.htm\n"
+      "or http://gnuwin32.sourceforge.net/packages/diffutils.htm\n"
 #endif
-"\n");
+      "\n");
 
-      dynstr_append(&ds_tmp, " --- ");
-      dynstr_append(&ds_tmp, filename1);
-      dynstr_append(&ds_tmp, " >>>\n");
-      cat_file(&ds_tmp, filename1);
-      dynstr_append(&ds_tmp, "<<<\n --- ");
-      dynstr_append(&ds_tmp, filename1);
-      dynstr_append(&ds_tmp, " >>>\n");
-      cat_file(&ds_tmp, filename2);
-      dynstr_append(&ds_tmp, "<<<<\n");
-  } 
+    dynstr_append(&ds_tmp, " --- ");
+    dynstr_append(&ds_tmp, filename1);
+    dynstr_append(&ds_tmp, " >>>\n");
+    cat_file(&ds_tmp, filename1);
+    dynstr_append(&ds_tmp, "<<<\n --- ");
+    dynstr_append(&ds_tmp, filename1);
+    dynstr_append(&ds_tmp, " >>>\n");
+    cat_file(&ds_tmp, filename2);
+    dynstr_append(&ds_tmp, "<<<<\n");
+  }
 
   if (ds)
   {
@@ -1464,7 +1471,7 @@ if (!(have_diff))
     /* Print diff directly to stdout */
     fprintf(stderr, "%s\n", ds_tmp.str);
   }
- 
+
   dynstr_free(&ds_tmp);
 
 }

=== modified file 'cmd-line-utils/readline/bind.c'
--- a/cmd-line-utils/readline/bind.c	2008-01-03 13:26:41 +0000
+++ b/cmd-line-utils/readline/bind.c	2009-06-05 16:23:44 +0000
@@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type
     {
       unsigned char ic = keyseq[i];
 
-      if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
+      if (META_BYTE (ic) && _rl_convert_meta_chars_to_ascii)
 	{
 	  if (map[ESC].type == ISKMAP)
 	    {

=== modified file 'cmd-line-utils/readline/chardefs.h'
--- a/cmd-line-utils/readline/chardefs.h	2007-11-19 13:38:08 +0000
+++ b/cmd-line-utils/readline/chardefs.h	2009-06-05 15:14:56 +0000
@@ -59,7 +59,8 @@
 #define largest_char 255		    /* Largest character value. */
 
 #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
-#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
+#define META_BYTE(c) ((c) > meta_character_threshold)
+#define META_CHAR(c) (META_BYTE(c) && (c) <= largest_char)
 
 #define CTRL(c) ((c) & control_character_mask)
 #define META(c) ((c) | meta_character_bit)

=== modified file 'cmd-line-utils/readline/display.c'
--- a/cmd-line-utils/readline/display.c	2008-01-03 13:26:41 +0000
+++ b/cmd-line-utils/readline/display.c	2009-06-05 15:14:56 +0000
@@ -1888,7 +1888,7 @@ rl_character_len (c, pos)
 
   uc = (unsigned char)c;
 
-  if (META_CHAR (uc))
+  if (META_BYTE (uc))
     return ((_rl_output_meta_chars == 0) ? 4 : 1);
 
   if (uc == '\t')

=== modified file 'dbug/user.r'
--- a/dbug/user.r	2008-03-28 18:02:27 +0000
+++ b/dbug/user.r	2009-06-05 12:05:26 +0000
@@ -32,6 +32,7 @@
 .\"           === Set line length
 .\".ll 6.5i
 .TL
+.warn 0
 D B U G
 .P 0
 C Program Debugging Package

=== modified file 'mysql-test/r/innodb_mysql.result'
--- a/mysql-test/r/innodb_mysql.result	2009-05-19 06:32:21 +0000
+++ b/mysql-test/r/innodb_mysql.result	2009-06-04 09:52:40 +0000
@@ -1303,4 +1303,16 @@ t1	CREATE TABLE `t1` (
   CONSTRAINT `f2_ref` FOREIGN KEY (`f2`) REFERENCES `t1` (`f1`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1
 DROP TABLE t1;
+#
+# Bug #36995: valgrind error in remove_const during subquery executions
+#
+create table t1 (a bit(1) not null,b int) engine=myisam;
+create table t2 (c int) engine=innodb;
+explain
+select b from t1 where a not in (select b from t1,t2 group by a) group by a;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tables
+2	DEPENDENT SUBQUERY	t1	system	NULL	NULL	NULL	NULL	0	const row not found
+2	DEPENDENT SUBQUERY	t2	ALL	NULL	NULL	NULL	NULL	1	
+DROP TABLE t1,t2;
 End of 5.0 tests

=== added file 'mysql-test/r/sp-fib.result'
--- a/mysql-test/r/sp-fib.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/sp-fib.result	2009-06-04 11:38:53 +0000
@@ -0,0 +1,46 @@
+drop table if exists t3;
+create table t3 ( f bigint unsigned not null );
+drop procedure if exists fib;
+create procedure fib(n int unsigned)
+begin
+if n > 1 then
+begin
+declare x, y bigint unsigned;
+declare c cursor for select f from t3 order by f desc limit 2;
+open c;
+fetch c into y;
+fetch c into x;
+close c;
+insert into t3 values (x+y);
+call fib(n-1);
+end;
+end if;
+end|
+set @@max_sp_recursion_depth= 20|
+insert into t3 values (0), (1)|
+call fib(3)|
+select * from t3 order by f asc|
+f
+0
+1
+1
+2
+delete from t3|
+insert into t3 values (0), (1)|
+call fib(10)|
+select * from t3 order by f asc|
+f
+0
+1
+1
+2
+3
+5
+8
+13
+21
+34
+55
+drop table t3|
+drop procedure fib|
+set @@max_sp_recursion_depth= 0|

=== modified file 'mysql-test/r/sp.result'
--- a/mysql-test/r/sp.result	2009-03-31 08:38:33 +0000
+++ b/mysql-test/r/sp.result	2009-06-04 11:38:53 +0000
@@ -1337,52 +1337,6 @@ drop procedure opp|
 drop procedure ip|
 show procedure status like '%p%'|
 Db	Name	Type	Definer	Modified	Created	Security_type	Comment
-drop table if exists t3|
-create table t3 ( f bigint unsigned not null )|
-drop procedure if exists fib|
-create procedure fib(n int unsigned)
-begin
-if n > 1 then
-begin
-declare x, y bigint unsigned;
-declare c cursor for select f from t3 order by f desc limit 2;
-open c;
-fetch c into y;
-fetch c into x;
-close c;
-insert into t3 values (x+y);
-call fib(n-1);
-end;
-end if;
-end|
-set @@max_sp_recursion_depth= 20|
-insert into t3 values (0), (1)|
-call fib(3)|
-select * from t3 order by f asc|
-f
-0
-1
-1
-2
-delete from t3|
-insert into t3 values (0), (1)|
-call fib(10)|
-select * from t3 order by f asc|
-f
-0
-1
-1
-2
-3
-5
-8
-13
-21
-34
-55
-drop table t3|
-drop procedure fib|
-set @@max_sp_recursion_depth= 0|
 drop procedure if exists bar|
 create procedure bar(x char(16), y int)
 comment "111111111111" sql security invoker

=== modified file 'mysql-test/t/innodb_mysql.test'
--- a/mysql-test/t/innodb_mysql.test	2009-05-19 06:32:21 +0000
+++ b/mysql-test/t/innodb_mysql.test	2009-06-04 09:52:40 +0000
@@ -1063,4 +1063,14 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug #36995: valgrind error in remove_const during subquery executions
+--echo #
+
+create table t1 (a bit(1) not null,b int) engine=myisam;
+create table t2 (c int) engine=innodb;
+explain
+select b from t1 where a not in (select b from t1,t2 group by a) group by a;
+DROP TABLE t1,t2;
+
 --echo End of 5.0 tests

=== added file 'mysql-test/t/sp-fib.test'
--- a/mysql-test/t/sp-fib.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/sp-fib.test	2009-06-04 11:38:53 +0000
@@ -0,0 +1,60 @@
+# Fibonacci, for recursion test. (Yet Another Numerical series :)
+# Split from main.sp due to problems reported in Bug#15866
+
+--disable_warnings
+drop table if exists t3;
+--enable_warnings
+create table t3 ( f bigint unsigned not null );
+
+# We deliberately do it the awkward way, fetching the last two
+# values from the table, in order to exercise various statements
+# and table accesses at each turn.
+--disable_warnings
+drop procedure if exists fib;
+--enable_warnings
+
+# Now for multiple statements...
+delimiter |;
+
+create procedure fib(n int unsigned)
+begin
+  if n > 1 then
+    begin
+      declare x, y bigint unsigned;
+      declare c cursor for select f from t3 order by f desc limit 2;
+
+      open c;
+      fetch c into y;
+      fetch c into x;
+      close c;
+      insert into t3 values (x+y);
+      call fib(n-1);
+    end;
+  end if;
+end|
+
+# Enable recursion
+set @@max_sp_recursion_depth= 20|
+
+# Minimum test: recursion of 3 levels
+
+insert into t3 values (0), (1)|
+
+call fib(3)|
+
+select * from t3 order by f asc|
+
+delete from t3|
+
+# The original test, 20 levels, ran into memory limits on some machines
+# and builds. Try 10 instead...
+
+insert into t3 values (0), (1)|
+
+call fib(10)|
+
+select * from t3 order by f asc|
+drop table t3|
+drop procedure fib|
+set @@max_sp_recursion_depth= 0|
+

=== modified file 'mysql-test/t/sp.test'
--- a/mysql-test/t/sp.test	2009-03-31 08:38:33 +0000
+++ b/mysql-test/t/sp.test	2009-06-04 11:38:53 +0000
@@ -1560,61 +1560,6 @@ drop procedure ip|
 show procedure status like '%p%'|
 
 
-# Fibonacci, for recursion test. (Yet Another Numerical series :)
-#
---disable_warnings
-drop table if exists t3|
---enable_warnings
-create table t3 ( f bigint unsigned not null )|
-
-# We deliberately do it the awkward way, fetching the last two
-# values from the table, in order to exercise various statements
-# and table accesses at each turn.
---disable_warnings
-drop procedure if exists fib|
---enable_warnings
-create procedure fib(n int unsigned)
-begin
-  if n > 1 then
-    begin
-      declare x, y bigint unsigned;
-      declare c cursor for select f from t3 order by f desc limit 2;
-
-      open c;
-      fetch c into y;
-      fetch c into x;
-      close c;
-      insert into t3 values (x+y);
-      call fib(n-1);
-    end;
-  end if;
-end|
-
-# Enable recursion
-set @@max_sp_recursion_depth= 20|
-
-# Minimum test: recursion of 3 levels
-
-insert into t3 values (0), (1)|
-
-call fib(3)|
-
-select * from t3 order by f asc|
-
-delete from t3|
-
-# The original test, 20 levels, ran into memory limits on some machines
-# and builds. Try 10 instead...
-
-insert into t3 values (0), (1)|
-
-call fib(10)|
-
-select * from t3 order by f asc|
-drop table t3|
-drop procedure fib|
-set @@max_sp_recursion_depth= 0|
-
 #
 # Comment & suid
 #

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2009-05-18 18:43:06 +0000
+++ b/sql/item.cc	2009-06-04 09:52:40 +0000
@@ -409,6 +409,7 @@ Item::Item(THD *thd, Item *item):
   name(item->name),
   orig_name(item->orig_name),
   max_length(item->max_length),
+  name_length(item->name_length),
   marker(item->marker),
   decimals(item->decimals),
   maybe_null(item->maybe_null),
@@ -416,7 +417,9 @@ Item::Item(THD *thd, Item *item):
   unsigned_flag(item->unsigned_flag),
   with_sum_func(item->with_sum_func),
   fixed(item->fixed),
+  is_autogenerated_name(item->is_autogenerated_name),
   collation(item->collation),
+  with_subselect(item->with_subselect),
   cmp_context(item->cmp_context)
 {
   next= thd->free_list;				// Put in free list

=== modified file 'strings/ctype.c'
--- a/strings/ctype.c	2008-12-23 14:08:04 +0000
+++ b/strings/ctype.c	2009-06-05 12:05:26 +0000
@@ -327,7 +327,10 @@ my_string_repertoire(CHARSET_INFO *cs, c
   {
     my_wc_t wc;
     int chlen;
-    for (; (chlen= cs->cset->mb_wc(cs, &wc, str, strend)) > 0; str+= chlen)
+    for (; (chlen= cs->cset->mb_wc(cs, &wc, 
+                                   (const unsigned char *) str, 
+                                   (const unsigned char *) strend)) > 0; 
+         str+= chlen)
     {
       if (wc > 0x7F)
         return MY_REPERTOIRE_UNICODE30;


Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090605212937-9kcqi5zjat2f2awm.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (azundris:2766) Tatiana A. Nurnberg5 Jun