~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2008-11-26 21:37:50 UTC
  • Revision ID: brian@tangent.org-20081126213750-m96j23htwfymuwlt
Collection of dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
4718
4718
        break;
4719
4719
      }
4720
4720
    }
4721
 
    else if (table_name && item->type() == Item::REF_ITEM &&
4722
 
             ((Item_ref *)item)->ref_type() == Item_ref::VIEW_REF)
4723
 
    {
4724
 
      /*
4725
 
        TODO:Here we process prefixed view references only. What we should 
4726
 
        really do is process all types of Item_refs. But this will currently 
4727
 
        lead to a clash with the way references to outer SELECTs (from the 
4728
 
        HAVING clause) are handled in e.g. :
4729
 
        SELECT 1 FROM t1 AS t1_o GROUP BY a
4730
 
          HAVING (SELECT t1_o.a FROM t1 AS t1_i GROUP BY t1_i.a LIMIT 1).
4731
 
        Processing all Item_refs here will cause t1_o.a to resolve to itself.
4732
 
        We still need to process the special case of Item_direct_view_ref 
4733
 
        because in the context of views they have the same meaning as 
4734
 
        Item_field for tables.
4735
 
      */
4736
 
      Item_ident *item_ref= (Item_ident *) item;
4737
 
      if (item_ref->name && item_ref->table_name &&
4738
 
          !my_strcasecmp(system_charset_info, item_ref->name, field_name) &&
4739
 
          !my_strcasecmp(table_alias_charset, item_ref->table_name,
4740
 
                         table_name) &&
4741
 
          (!db_name || (item_ref->db_name && 
4742
 
                        !strcmp (item_ref->db_name, db_name))))
4743
 
      {
4744
 
        found= li.ref();
4745
 
        *counter= i;
4746
 
        *resolution= RESOLVED_IGNORING_ALIAS;
4747
 
        break;
4748
 
      }
4749
 
    }
4750
4721
  }
4751
4722
  if (!found)
4752
4723
  {