~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Brian Aker
  • Date: 2009-12-01 02:39:03 UTC
  • mfrom: (1234.1.4 push)
  • Revision ID: brian@gaz-20091201023903-1id5z7xnup695jaq
Merge of Brian + Jay test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2688
2688
        if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group
2689
2689
            && !join->send_group_parts && !join->having && !jt->select_cond &&
2690
2690
            !(jt->select && jt->select->quick) &&
2691
 
            (jt->table->cursor->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
 
2691
            (jt->table->cursor->getEngine()->check_flag(HTON_BIT_STATS_RECORDS_IS_EXACT)) &&
2692
2692
                  (jt->ref.key < 0))
2693
2693
        {
2694
2694
          /* Join over all rows in table;  Return number of found rows */
3674
3674
  if ((records >= s->found_records || best > s->read_time) &&            // (1)
3675
3675
      ! (s->quick && best_key && s->quick->index == best_key->getKey() &&      // (2)
3676
3676
        best_max_key_part >= s->table->quick_key_parts[best_key->getKey()]) &&// (2)
3677
 
      ! ((s->table->cursor->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) &&   // (3)
 
3677
      ! ((s->table->cursor->getEngine()->check_flag(HTON_BIT_TABLE_SCAN_ON_INDEX)) &&   // (3)
3678
3678
        ! s->table->covering_keys.none() && best_key && !s->quick) && // (3)
3679
3679
      ! (s->table->force_index && best_key && !s->quick))                 // (4)
3680
3680
  {                                             // Check full join
5615
5615
      continue;
5616
5616
    }
5617
5617
    if ((table->cursor->stats.records <= 1) && !s->dependent &&
5618
 
              (table->cursor->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) && 
 
5618
              (table->cursor->getEngine()->check_flag(HTON_BIT_STATS_RECORDS_IS_EXACT)) &&
5619
5619
        !join->no_const_tables)
5620
5620
    {
5621
5621
      set_position(join, const_count++, s, (optimizer::KeyUse*) 0);
5741
5741
        if (s->dependent & ~(found_const_table_map))
5742
5742
          continue;
5743
5743
        if (table->cursor->stats.records <= 1L &&
5744
 
            (table->cursor->ha_table_flags() & HA_STATS_RECORDS_IS_EXACT) &&
 
5744
            (table->cursor->getEngine()->check_flag(HTON_BIT_STATS_RECORDS_IS_EXACT)) &&
5745
5745
                  !table->pos_in_table_list->embedding)
5746
5746
        {                                       // system table
5747
5747
          int tmp= 0;