~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/subselect.cc

Collection of patches/bug fixes from new-cleanup tree (none of the
Table/other fixes are included).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2120
2120
  assert(0);
2121
2121
}
2122
2122
 
2123
 
int  init_read_record_seq(JOIN_TAB *tab);
2124
 
int join_read_always_key_or_null(JOIN_TAB *tab);
 
2123
int  init_read_record_seq(JoinTable *tab);
 
2124
int join_read_always_key_or_null(JoinTable *tab);
2125
2125
int join_read_next_same_or_null(READ_RECORD *info);
2126
2126
 
2127
2127
int subselect_single_select_engine::exec()
2182
2182
  if (!executed)
2183
2183
  {
2184
2184
    item->reset_value_registration();
2185
 
    JOIN_TAB *changed_tabs[MAX_TABLES];
2186
 
    JOIN_TAB **last_changed_tab= changed_tabs;
 
2185
    JoinTable *changed_tabs[MAX_TABLES];
 
2186
    JoinTable **last_changed_tab= changed_tabs;
2187
2187
    if (item->have_guarded_conds())
2188
2188
    {
2189
2189
      /*
2194
2194
      */
2195
2195
      for (uint32_t i=join->const_tables ; i < join->tables ; i++)
2196
2196
      {
2197
 
        JOIN_TAB *tab=join->join_tab+i;
 
2197
        JoinTable *tab=join->join_tab+i;
2198
2198
        if (tab && tab->keyuse)
2199
2199
        {
2200
2200
          for (uint32_t key_part= 0;
2222
2222
    join->exec();
2223
2223
 
2224
2224
    /* Enable the optimizations back */
2225
 
    for (JOIN_TAB **ptab= changed_tabs; ptab != last_changed_tab; ptab++)
 
2225
    for (JoinTable **ptab= changed_tabs; ptab != last_changed_tab; ptab++)
2226
2226
    {
2227
 
      JOIN_TAB *tab= *ptab;
 
2227
      JoinTable *tab= *ptab;
2228
2228
      tab->read_record.record= 0;
2229
2229
      tab->read_record.ref_length= 0;
2230
2230
      tab->read_first_record= tab->save_read_first_record;
2916
2916
    temporary table has one hash index on all its columns.
2917
2917
  - Create a new result sink that sends the result stream of the subquery to
2918
2918
    the temporary table,
2919
 
  - Create and initialize a new JOIN_TAB, and TABLE_REF objects to perform
 
2919
  - Create and initialize a new JoinTable, and TABLE_REF objects to perform
2920
2920
    lookups into the indexed temporary table.
2921
2921
 
2922
2922
  @notice:
2987
2987
  /* 2. Create/initialize execution related objects. */
2988
2988
 
2989
2989
  /*
2990
 
    Create and initialize the JOIN_TAB that represents an index lookup
 
2990
    Create and initialize the JoinTable that represents an index lookup
2991
2991
    plan operator into the materialized subquery result. Notice that:
2992
 
    - this JOIN_TAB has no corresponding JOIN (and doesn't need one), and
 
2992
    - this JoinTable has no corresponding JOIN (and doesn't need one), and
2993
2993
    - here we initialize only those members that are used by
2994
2994
      subselect_uniquesubquery_engine, so these objects are incomplete.
2995
2995
  */
2996
 
  if (!(tab= (JOIN_TAB*) session->alloc(sizeof(JOIN_TAB))))
 
2996
  if (!(tab= (JoinTable*) session->alloc(sizeof(JoinTable))))
2997
2997
    return(true);
2998
2998
  tab->table= tmp_table;
2999
2999
  tab->ref.key= 0; /* The only temp table index. */