List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:December 8 2010 12:57pm
Subject:bzr commit into mysql-trunk-bugfixing branch (Georgi.Kodinov:3427)
View as plain text  
#At file:///Users/kgeorge/mysql/work/B57954-trunk-bugfixing/ based on revid:marc.alff@stripped

 3427 Georgi Kodinov	2010-12-08 [merge]
      merge

    modified:
      mysql-test/r/archive.result
      mysql-test/r/func_group_innodb.result
      mysql-test/t/archive.test
      mysql-test/t/func_group_innodb.test
      mysys/mf_pack.c
      sql/item_sum.cc
      sql/item_sum.h
      sql/opt_range.cc
      sql/opt_sum.cc
      sql/sql_select.cc
      storage/archive/ha_archive.cc
=== modified file 'mysql-test/r/archive.result'
--- a/mysql-test/r/archive.result	2010-10-25 09:20:53 +0000
+++ b/mysql-test/r/archive.result	2010-12-08 12:55:40 +0000
@@ -12801,3 +12801,9 @@ t1	CREATE TABLE `t1` (
   `a` int(11) DEFAULT NULL
 ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
 DROP TABLE t1;
+#
+# BUG#58205 - Valgrind failure in fn_format when called from
+#             archive_discover
+#
+CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE;
+DROP TABLE `a/../`;

=== modified file 'mysql-test/r/func_group_innodb.result'
--- a/mysql-test/r/func_group_innodb.result	2010-11-29 13:30:18 +0000
+++ b/mysql-test/r/func_group_innodb.result	2010-12-08 12:55:40 +0000
@@ -145,3 +145,50 @@ select count(*), min(7), max(7) from t2m
 count(*)	min(7)	max(7)
 0	NULL	NULL
 drop table t1m, t1i, t2m, t2i;
+#
+# Bug #57954: BIT_AND function returns incorrect results when 
+#   semijoin=on
+CREATE TABLE c (
+pk INT,
+col_varchar_key VARCHAR(1),
+PRIMARY KEY (pk),
+KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO c VALUES (11,NULL);
+INSERT INTO c VALUES (16,'c');
+CREATE TABLE bb (
+pk INT,
+col_varchar_key VARCHAR(1),
+PRIMARY KEY (pk),
+KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO bb VALUES (10,NULL);
+SELECT straight_join BIT_AND(c.pk)
+FROM
+bb, c
+WHERE c.col_varchar_key='ABC'
+ORDER BY c.pk;
+BIT_AND(c.pk)
+18446744073709551615
+DROP TABLE c,bb;
+#
+# Bug #58050: BIT_OR and BIT_XOR return incorrect results when 
+#  semijoin=on
+#
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1);
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, 1, NULL);
+SELECT t1.* FROM t1  JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+pk	b	c
+SELECT BIT_OR(t1.b)  FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_OR(t1.b)
+0
+SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_AND(t1.b)
+18446744073709551615
+SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+BIT_XOR(t1.b)
+0
+DROP TABLE t1, t2;
+End of 5.5 tests

=== modified file 'mysql-test/t/archive.test'
--- a/mysql-test/t/archive.test	2010-10-25 09:20:53 +0000
+++ b/mysql-test/t/archive.test	2010-12-08 12:55:40 +0000
@@ -1722,3 +1722,11 @@ INSERT INTO t1 VALUES (2);
 SELECT * FROM t1 ORDER BY a;
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
+
+--echo #
+--echo # BUG#58205 - Valgrind failure in fn_format when called from
+--echo #             archive_discover
+--echo #
+CREATE TABLE `a/../`(a INT) ENGINE=ARCHIVE;
+remove_file $MYSQLD_DATADIR/test/a@002f@002e@002e@stripped;
+DROP TABLE `a/../`;

=== modified file 'mysql-test/t/func_group_innodb.test'
--- a/mysql-test/t/func_group_innodb.test	2006-05-22 11:27:58 +0000
+++ b/mysql-test/t/func_group_innodb.test	2010-12-08 12:28:06 +0000
@@ -83,3 +83,53 @@ explain select count(*), min(7), max(7) 
 select count(*), min(7), max(7) from t2m, t1i;
 
 drop table t1m, t1i, t2m, t2i;
+
+
+--echo #
+--echo # Bug #57954: BIT_AND function returns incorrect results when 
+--echo #   semijoin=on
+
+CREATE TABLE c (
+  pk INT,
+  col_varchar_key VARCHAR(1),
+  PRIMARY KEY (pk),
+  KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO c VALUES (11,NULL);
+INSERT INTO c VALUES (16,'c');
+CREATE TABLE bb (
+  pk INT,
+  col_varchar_key VARCHAR(1),
+  PRIMARY KEY (pk),
+  KEY col_varchar_key (col_varchar_key)
+) ENGINE=InnoDB;
+INSERT INTO bb VALUES (10,NULL);
+
+SELECT straight_join BIT_AND(c.pk)
+FROM
+  bb, c
+  WHERE c.col_varchar_key='ABC'
+ORDER BY c.pk;
+
+DROP TABLE c,bb;
+
+--echo #
+--echo # Bug #58050: BIT_OR and BIT_XOR return incorrect results when 
+--echo #  semijoin=on
+--echo #
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, 1, 1);
+
+CREATE TABLE t2 (pk INT PRIMARY KEY, b INT, c INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1, 1, NULL);
+
+SELECT t1.* FROM t1  JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_OR(t1.b)  FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_AND(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+SELECT BIT_XOR(t1.b) FROM t1 JOIN t2 ON t1.c=t2.c WHERE t1.pk=1;
+
+DROP TABLE t1, t2;
+
+
+--echo End of 5.5 tests

=== modified file 'mysys/mf_pack.c'
--- a/mysys/mf_pack.c	2010-07-15 13:47:50 +0000
+++ b/mysys/mf_pack.c	2010-12-01 12:56:46 +0000
@@ -192,7 +192,8 @@ size_t cleanup_dirname(register char *to
 	  end_parentdir=pos;
 	  while (pos >= start && *pos != FN_LIBCHAR)	/* remove prev dir */
 	    pos--;
-	  if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0)
+          if (pos[1] == FN_HOMELIB ||
+              (pos > start && memcmp(pos, parent, length) == 0))
 	  {					/* Don't remove ~user/ */
 	    pos=strmov(end_parentdir+1,parent);
 	    *pos=FN_LIBCHAR;

=== modified file 'sql/item_sum.cc'
--- a/sql/item_sum.cc	2010-12-07 16:16:29 +0000
+++ b/sql/item_sum.cc	2010-12-08 12:55:40 +0000
@@ -2238,7 +2238,7 @@ void Item_sum_avg::reset_field()
 
 void Item_sum_bit::reset_field()
 {
-  reset();
+  reset_and_add();
   int8store(result_field->ptr, bits);
 }
 

=== modified file 'sql/item_sum.h'
--- a/sql/item_sum.h	2010-12-07 16:16:29 +0000
+++ b/sql/item_sum.h	2010-12-08 12:55:40 +0000
@@ -406,14 +406,22 @@ public:  
   Item_sum(THD *thd, Item_sum *item);
   enum Type type() const { return SUM_FUNC_ITEM; }
   virtual enum Sumfunctype sum_func () const=0;
-  inline bool reset() { aggregator_clear(); return aggregator_add(); };
+  /**
+    Resets the aggregate value to its default and aggregates the current
+    value of its attribute(s).
+  */  
+  inline bool reset_and_add() 
+  { 
+    aggregator_clear(); 
+    return aggregator_add(); 
+  };
 
   /*
     Called when new group is started and results are being saved in
-    a temporary table. Similar to reset(), but must also store value in
-    result_field. Like reset() it is supposed to reset start value to
-    default.
-    This set of methods (reult_field(), reset_field, update_field()) of
+    a temporary table. Similarly to reset_and_add() it resets the 
+    value to its default and aggregates the value of its 
+    attribute(s), but must also store it in result_field. 
+    This set of methods (result_item(), reset_field, update_field()) of
     Item_sum is used only if quick_group is not null. Otherwise
     copy_or_same() is used to obtain a copy of this item.
   */
@@ -455,7 +463,7 @@ public:  
     set_aggregator(with_distinct ?
                    Aggregator::DISTINCT_AGGREGATOR :
                    Aggregator::SIMPLE_AGGREGATOR);
-    reset();
+    aggregator_clear();
   }
   virtual void make_unique() { force_copy_fields= TRUE; }
   Item *get_tmp_table_item(THD *thd);

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2010-12-06 13:12:51 +0000
+++ b/sql/opt_range.cc	2010-12-08 12:55:40 +0000
@@ -11611,7 +11611,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_
 
   min_functions_it->rewind();
   while ((min_func= (*min_functions_it)++))
-    min_func->reset();
+    min_func->reset_and_add();
 }
 
 
@@ -11643,7 +11643,7 @@ void QUICK_GROUP_MIN_MAX_SELECT::update_
 
   max_functions_it->rewind();
   while ((max_func= (*max_functions_it)++))
-    max_func->reset();
+    max_func->reset_and_add();
 }
 
 

=== modified file 'sql/opt_sum.cc'
--- a/sql/opt_sum.cc	2010-08-04 10:34:01 +0000
+++ b/sql/opt_sum.cc	2010-12-08 12:55:40 +0000
@@ -424,7 +424,7 @@ int opt_sum_query(TABLE_LIST *tables, Li
           item_sum->aggregator_clear();
         }
         else
-          item_sum->reset();
+          item_sum->reset_and_add();
         item_sum->make_const();
         recalc_const_item= 1;
         break;

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-12-06 13:12:51 +0000
+++ b/sql/sql_select.cc	2010-12-08 12:55:40 +0000
@@ -21831,7 +21831,7 @@ init_sum_functions(Item_sum **func_ptr, 
 {
   for (; func_ptr != end_ptr ;func_ptr++)
   {
-    if ((*func_ptr)->reset())
+    if ((*func_ptr)->reset_and_add())
       return 1;
   }
   /* If rollup, calculate the upper sum levels */

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2010-10-07 12:47:15 +0000
+++ b/storage/archive/ha_archive.cc	2010-12-08 12:55:40 +0000
@@ -20,6 +20,7 @@
 #include "sql_priv.h"
 #include "probes_mysql.h"
 #include "sql_class.h"                          // SSV
+#include "sql_table.h"
 #include <myisam.h>
 
 #include "ha_archive.h"
@@ -256,7 +257,7 @@ int archive_discover(handlerton *hton, T
   char *frm_ptr;
   MY_STAT file_stat; 
 
-  fn_format(az_file, name, db, ARZ, MY_REPLACE_EXT | MY_UNPACK_FILENAME);
+  build_table_filename(az_file, sizeof(az_file) - 1, db, name, ARZ, 0);
 
   if (!(my_stat(az_file, &file_stat, MYF(0))))
     goto err;

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-trunk-bugfixing branch (Georgi.Kodinov:3427) Georgi Kodinov8 Dec