List:Commits« Previous MessageNext Message »
From:Evgeny Potemkin Date:May 28 2011 8:56am
Subject:bzr commit into mysql-trunk branch (evgeny.potemkin:3003)
View as plain text  
#At file:///work/bzrroot/11791677-bug/ based on revid:evgeny.potemkin@stripped

 3003 Evgeny Potemkin	2011-05-28 [merge]
      Manual merge.

    modified:
      mysql-test/r/derived.result
      mysql-test/t/derived.test
      sql/sql_select.cc
      sql/table.cc
      unittest/gunit/sql_list-t.cc
=== modified file 'mysql-test/r/derived.result'
--- a/mysql-test/r/derived.result	2011-05-28 08:39:37 +0000
+++ b/mysql-test/r/derived.result	2011-05-28 08:56:48 +0000
@@ -1329,6 +1329,64 @@ DROP TABLE t1,t2,t3;
 DROP VIEW v1,v2,v3,v4,v6,v7;
 #
 #
+# BUG#11783262: CRASH IN ITEM_FIELD::ITEM_FIELD IN ITEM.CC ON SUBQUERY
+#               IN FROM WITH WL5274 
+#
+CREATE TABLE t1 (
+col_int_key INT,
+col_time_key time,
+col_varchar_key VARCHAR(1),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=INNODB;
+SELECT alias1.col_time_key AS field1
+FROM ( ( SELECT SQ1_alias1.* FROM t1 AS SQ1_alias1 ) AS alias1
+INNER JOIN t1 AS alias2
+ON (alias2.col_int_key = alias1.col_int_key)
+)
+WHERE alias1.col_int_key = 207
+ORDER BY alias1.col_varchar_key, field1;
+field1
+DROP TABLE t1;
+#
+# Bug#11807437: VALGRIND WARNING IN MYSQL_DERIVED_OPTIMIZE() LINE 293
+#
+CREATE TABLE t1 (
+f1 int(11) DEFAULT NULL
+);
+SELECT 1
+FROM (
+SELECT 1, 2 FROM DUAL
+WHERE EXISTS  (
+SELECT f1
+FROM  t1
+)) AS tt
+;
+1
+DROP TABLE t1;
+#
+#
+# Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN MC_REPLACE_STRMEM.C:493) 
+#
+CREATE TABLE t1 (
+pk INT NOT NULL AUTO_INCREMENT,
+col_int_key INT,
+col_time_key time,
+col_varchar_key VARCHAR(1),
+PRIMARY KEY (pk),
+KEY col_int_key (col_int_key),
+KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=InnoDB;
+SELECT tt.col_time_key
+FROM ( ( SELECT * FROM t1 ) AS tt
+INNER JOIN t1
+ON (t1.col_int_key = tt.col_int_key)
+)
+WHERE tt.col_int_key = 207
+ORDER BY tt.col_varchar_key, tt.pk ASC, 1;
+col_time_key
+DROP TABLE t1;
+#
 # Bug#11791677 - ASSERTION FAILED IN JOIN_MATERIALIZE_TABLE IN
 #                SQL_SELECT.CC ON NESTED SUBQUERY 
 #

=== modified file 'mysql-test/t/derived.test'
--- a/mysql-test/t/derived.test	2011-05-28 08:39:37 +0000
+++ b/mysql-test/t/derived.test	2011-05-28 08:56:48 +0000
@@ -694,6 +694,67 @@ DROP VIEW v1,v2,v3,v4,v6,v7;
 --echo #
 
 --echo #
+--echo # BUG#11783262: CRASH IN ITEM_FIELD::ITEM_FIELD IN ITEM.CC ON SUBQUERY
+--echo #               IN FROM WITH WL5274 
+--echo #
+
+CREATE TABLE t1 (
+  col_int_key INT,
+  col_time_key time,
+  col_varchar_key VARCHAR(1),
+  KEY col_int_key (col_int_key),
+  KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=INNODB;
+SELECT alias1.col_time_key AS field1
+FROM ( ( SELECT SQ1_alias1.* FROM t1 AS SQ1_alias1 ) AS alias1
+  INNER JOIN t1 AS alias2
+  ON (alias2.col_int_key = alias1.col_int_key)
+  )
+WHERE alias1.col_int_key = 207
+ORDER BY alias1.col_varchar_key, field1;
+
+DROP TABLE t1; 
+--echo #
+--echo # Bug#11807437: VALGRIND WARNING IN MYSQL_DERIVED_OPTIMIZE() LINE 293
+--echo #
+CREATE TABLE t1 (
+  f1 int(11) DEFAULT NULL
+);
+
+SELECT 1
+FROM (
+  SELECT 1, 2 FROM DUAL
+  WHERE EXISTS  (
+    SELECT f1
+    FROM  t1
+    )) AS tt
+;
+
+DROP TABLE t1;
+--echo #
+
+--echo #
+--echo # Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN MC_REPLACE_STRMEM.C:493) 
+--echo #
+CREATE TABLE t1 (
+  pk INT NOT NULL AUTO_INCREMENT,
+  col_int_key INT,
+  col_time_key time,
+  col_varchar_key VARCHAR(1),
+  PRIMARY KEY (pk),
+  KEY col_int_key (col_int_key),
+  KEY col_varchar_key (col_varchar_key,col_int_key)
+) ENGINE=InnoDB;
+SELECT tt.col_time_key
+FROM ( ( SELECT * FROM t1 ) AS tt
+  INNER JOIN t1
+  ON (t1.col_int_key = tt.col_int_key)
+  )
+WHERE tt.col_int_key = 207
+ORDER BY tt.col_varchar_key, tt.pk ASC, 1;
+
+DROP TABLE t1;
+--echo #
 --echo # Bug#11791677 - ASSERTION FAILED IN JOIN_MATERIALIZE_TABLE IN
 --echo #                SQL_SELECT.CC ON NESTED SUBQUERY 
 --echo #

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-05-28 08:39:37 +0000
+++ b/sql/sql_select.cc	2011-05-28 08:56:48 +0000
@@ -1853,6 +1853,7 @@ JOIN::optimize()
       zero_result_cause=  select_lex->having_value == Item::COND_FALSE ?
                            "Impossible HAVING" : "Impossible WHERE";
       tables= 0;
+      best_rowcount= 0;
       goto setup_subq_exit;
     }
   }
@@ -1898,6 +1899,7 @@ JOIN::optimize()
     */
     if ((res=opt_sum_query(select_lex->leaf_tables, all_fields, conds)))
     {
+      best_rowcount= 0;
       if (res == HA_ERR_KEY_NOT_FOUND)
       {
         DBUG_PRINT("info",("No matching min/max row"));
@@ -1921,6 +1923,7 @@ JOIN::optimize()
       DBUG_PRINT("info",("Select tables optimized away"));
       zero_result_cause= "Select tables optimized away";
       tables_list= 0;				// All tables resolved
+      best_rowcount= 1;
       const_tables= tables;
       /*
         Extract all table-independent conditions and replace the WHERE
@@ -15391,6 +15394,7 @@ void setup_tmp_table_column_bitmaps(TABL
   table->s->all_set= table->def_read_set;
   bitmap_set_all(&table->s->all_set);
   table->default_column_bitmaps();
+  table->s->column_bitmap_size= bitmap_buffer_size(field_count);
 }
 
 

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2011-02-17 12:14:26 +0000
+++ b/sql/table.cc	2011-05-25 12:09:53 +0000
@@ -775,7 +775,7 @@ void KEY_PART_INFO::init_flags()
 void KEY_PART_INFO::init_from_field(Field *fld)
 {
   field= fld;
-  fieldnr= field->field_index;
+  fieldnr= field->field_index + 1;
   null_bit= field->null_bit;
   null_offset= (uint) (field->null_ptr - (uchar*) field->table->record[0]);
   offset= field->offset(field->table->record[0]);

=== modified file 'unittest/gunit/sql_list-t.cc'
--- a/unittest/gunit/sql_list-t.cc	2011-02-17 12:14:26 +0000
+++ b/unittest/gunit/sql_list-t.cc	2011-03-18 09:04:08 +0000
@@ -218,7 +218,7 @@ TEST(SqlIlistTest, Iterate)
 
 static int cmp_test(void *a, void *b, void *c)
 {
-  EXPECT_EQ((unsigned int)c, 0xFEE1BEEF);
+  EXPECT_EQ(c, (void *)0xFEE1BEEF);
   return (*(int*)a < *(int*)b) ? -1 : (*(int*)a > *(int*)b) ? 1 : 0;
 }
 

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into mysql-trunk branch (evgeny.potemkin:3003) Evgeny Potemkin31 May