List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:December 17 2010 12:58pm
Subject:bzr push into mysql-trunk-bugfixing branch (jorgen.loland:3443 to 3444)
Bug#58985
View as plain text  
 3444 Jorgen Loland	2010-12-17 [merge]
      BUG#58985: Merge 5.5-bt -> trunk-bf

    modified:
      sql/opt_range.h
      sql/sql_select.cc
 3443 Georgi Kodinov	2010-12-17 [merge]
      merge

    modified:
      mysql-test/t/ctype_utf8.test
      mysql-test/t/func_misc.test
      mysql-test/t/partition_innodb.test
=== modified file 'sql/opt_range.h'
--- a/sql/opt_range.h	2010-11-23 11:04:47 +0000
+++ b/sql/opt_range.h	2010-12-17 12:58:04 +0000
@@ -345,6 +345,13 @@ public:
   */
   virtual bool is_keys_used(const MY_BITMAP *fields);
 
+  /**
+    Simple sanity check that the quick select has been set up
+    correctly. Function is overridden by quick selects that merge
+    indices.
+   */
+  virtual bool is_valid() { return index != MAX_KEY; };
+
   /*
     rowid of last row retrieved by this quick select. This is used only when
     doing ROR-index_merge selects
@@ -592,6 +599,22 @@ public:
 
   bool clustered_pk_range() { return test(pk_quick_select); }
 
+  virtual bool is_valid()
+  {
+    List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
+    QUICK_RANGE_SELECT *quick;
+    bool valid= true;
+    while ((quick= it++))
+    {
+      if (!quick->is_valid())
+      {
+        valid= false;
+        break;
+      }
+    }
+    return valid;
+  }
+
   /* used to get rows collected in Unique */
   READ_RECORD read_record;
 };
@@ -645,6 +668,22 @@ public:
   */
   List<QUICK_RANGE_SELECT> quick_selects;
 
+  virtual bool is_valid()
+  {
+    List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
+    QUICK_RANGE_SELECT *quick;
+    bool valid= true;
+    while ((quick= it++))
+    {
+      if (!quick->is_valid())
+      {
+        valid= false;
+        break;
+      }
+    }
+    return valid;
+  }
+
   /*
     Merged quick select that uses Clustered PK, if there is one. This quick
     select is not used for row retrieval, it is used for row retrieval.
@@ -696,6 +735,22 @@ public:
 
   List<QUICK_SELECT_I> quick_selects; /* Merged quick selects */
 
+  virtual bool is_valid()
+  {
+    List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
+    QUICK_SELECT_I *quick;
+    bool valid= true;
+    while ((quick= it++))
+    {
+      if (!quick->is_valid())
+      {
+        valid= false;
+        break;
+      }
+    }
+    return valid;
+  }
+
   QUEUE queue;    /* Priority queue for merge operation */
   MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-12-17 11:28:59 +0000
+++ b/sql/sql_select.cc	2010-12-17 12:58:04 +0000
@@ -9703,6 +9703,7 @@ static bool make_join_select(JOIN *join,
               ((tab->type != JT_CONST && tab->type != JT_REF) ||
                (uint)tab->ref.key == tab->quick->index))
           {
+            DBUG_ASSERT(tab->quick->is_valid());
 	    sel->quick=tab->quick;		// Use value from get_quick_...
 	    sel->quick_keys.clear_all();
 	    sel->needed_reg.clear_all();

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-bugfixing branch (jorgen.loland:3443 to 3444)Bug#58985Jorgen Loland17 Dec