~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2009-02-07 22:33:25 UTC
  • Revision ID: brian@tangent.org-20090207223325-5ipgldvw1pkghboq
typdef class removal (just... use the name of the class).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1429
1429
{
1430
1430
}
1431
1431
 
1432
 
void Select_Lex_unit::init_query()
 
1432
void Select_Lex_Unit::init_query()
1433
1433
{
1434
1434
  Select_Lex_Node::init_query();
1435
1435
  linkage= GLOBAL_OPTIONS_TYPE;
1606
1606
  Exclude level of current unit from tree of SELECTs
1607
1607
 
1608
1608
  SYNOPSYS
1609
 
    Select_Lex_unit::exclude_level()
 
1609
    Select_Lex_Unit::exclude_level()
1610
1610
 
1611
1611
  NOTE: units which belong to current will be brought up on level of
1612
1612
  currernt unit
1613
1613
*/
1614
 
void Select_Lex_unit::exclude_level()
 
1614
void Select_Lex_Unit::exclude_level()
1615
1615
{
1616
 
  Select_Lex_UNIT *units= 0, **units_last= &units;
 
1616
  Select_Lex_Unit *units= 0, **units_last= &units;
1617
1617
  for (Select_Lex *sl= first_select(); sl; sl= sl->next_select())
1618
1618
  {
1619
1619
    // unlink current level from global SELECTs list
1621
1621
      sl->link_next->link_prev= sl->link_prev;
1622
1622
 
1623
1623
    // bring up underlay levels
1624
 
    Select_Lex_UNIT **last= 0;
1625
 
    for (Select_Lex_UNIT *u= sl->first_inner_unit(); u; u= u->next_unit())
 
1624
    Select_Lex_Unit **last= 0;
 
1625
    for (Select_Lex_Unit *u= sl->first_inner_unit(); u; u= u->next_unit())
1626
1626
    {
1627
1627
      u->master= master;
1628
 
      last= (Select_Lex_UNIT**)&(u->next);
 
1628
      last= (Select_Lex_Unit**)&(u->next);
1629
1629
    }
1630
1630
    if (last)
1631
1631
    {
1637
1637
  {
1638
1638
    // include brought up levels in place of current
1639
1639
    (*prev)= units;
1640
 
    (*units_last)= (Select_Lex_UNIT*)next;
 
1640
    (*units_last)= (Select_Lex_Unit*)next;
1641
1641
    if (next)
1642
1642
      next->prev= (Select_Lex_Node**)units_last;
1643
1643
    units->prev= prev;
1656
1656
  Exclude subtree of current unit from tree of SELECTs
1657
1657
 
1658
1658
  SYNOPSYS
1659
 
    Select_Lex_unit::exclude_tree()
 
1659
    Select_Lex_Unit::exclude_tree()
1660
1660
*/
1661
 
void Select_Lex_unit::exclude_tree()
 
1661
void Select_Lex_Unit::exclude_tree()
1662
1662
{
1663
1663
  for (Select_Lex *sl= first_select(); sl; sl= sl->next_select())
1664
1664
  {
1667
1667
      sl->link_next->link_prev= sl->link_prev;
1668
1668
 
1669
1669
    // unlink underlay levels
1670
 
    for (Select_Lex_UNIT *u= sl->first_inner_unit(); u; u= u->next_unit())
 
1670
    for (Select_Lex_Unit *u= sl->first_inner_unit(); u; u= u->next_unit())
1671
1671
    {
1672
1672
      u->exclude_level();
1673
1673
    }
1706
1706
      // Select is dependent of outer select
1707
1707
      s->uncacheable= (s->uncacheable & ~UNCACHEABLE_UNITED) |
1708
1708
                       UNCACHEABLE_DEPENDENT;
1709
 
      Select_Lex_UNIT *munit= s->master_unit();
 
1709
      Select_Lex_Unit *munit= s->master_unit();
1710
1710
      munit->uncacheable= (munit->uncacheable & ~UNCACHEABLE_UNITED) |
1711
1711
                       UNCACHEABLE_DEPENDENT;
1712
1712
      for (Select_Lex *sl= munit->first_select(); sl ; sl= sl->next_select())
1754
1754
}
1755
1755
 
1756
1756
 
1757
 
Select_Lex_unit* Select_Lex_unit::master_unit()
 
1757
Select_Lex_Unit* Select_Lex_Unit::master_unit()
1758
1758
{
1759
1759
    return this;
1760
1760
}
1761
1761
 
1762
1762
 
1763
 
Select_Lex* Select_Lex_unit::outer_select()
 
1763
Select_Lex* Select_Lex_Unit::outer_select()
1764
1764
{
1765
1765
  return (Select_Lex*) master;
1766
1766
}
1784
1784
}
1785
1785
 
1786
1786
 
1787
 
Select_Lex_unit* Select_Lex::master_unit()
 
1787
Select_Lex_Unit* Select_Lex::master_unit()
1788
1788
{
1789
 
  return (Select_Lex_unit*) master;
 
1789
  return (Select_Lex_Unit*) master;
1790
1790
}
1791
1791
 
1792
1792
 
1846
1846
}
1847
1847
 
1848
1848
 
1849
 
void Select_Lex_unit::print(String *str, enum_query_type query_type)
 
1849
void Select_Lex_Unit::print(String *str, enum_query_type query_type)
1850
1850
{
1851
1851
  bool union_all= !union_distinct;
1852
1852
  for (Select_Lex *sl= first_select(); sl; sl= sl->next_select())
1905
1905
void Select_Lex::print_limit(Session *, String *str,
1906
1906
                                enum_query_type query_type)
1907
1907
{
1908
 
  Select_Lex_UNIT *unit= master_unit();
 
1908
  Select_Lex_Unit *unit= master_unit();
1909
1909
  Item_subselect *item= unit->item;
1910
1910
 
1911
1911
  if (item && unit->global_parameters == this)
2105
2105
  initialize limit counters
2106
2106
 
2107
2107
  SYNOPSIS
2108
 
    Select_Lex_unit::set_limit()
 
2108
    Select_Lex_Unit::set_limit()
2109
2109
    values      - Select_Lex with initial values for counters
2110
2110
*/
2111
2111
 
2112
 
void Select_Lex_unit::set_limit(Select_Lex *sl)
 
2112
void Select_Lex_Unit::set_limit(Select_Lex *sl)
2113
2113
{
2114
2114
  ha_rows select_limit_val;
2115
2115
  uint64_t val;
2284
2284
  {
2285
2285
    derived_tables= 0;
2286
2286
    /* cleunup underlying units (units of VIEW) */
2287
 
    for (Select_Lex_UNIT *un= select_lex.first_inner_unit();
 
2287
    for (Select_Lex_Unit *un= select_lex.first_inner_unit();
2288
2288
         un;
2289
2289
         un= un->next_unit())
2290
2290
      un->cleanup();
2331
2331
 
2332
2332
  Select_Lex::print is in sql_select.cc
2333
2333
 
2334
 
  Select_Lex_unit::prepare, Select_Lex_unit::exec,
2335
 
  Select_Lex_unit::cleanup, Select_Lex_unit::reinit_exec_mechanism,
2336
 
  Select_Lex_unit::change_result
 
2334
  Select_Lex_Unit::prepare, Select_Lex_Unit::exec,
 
2335
  Select_Lex_Unit::cleanup, Select_Lex_Unit::reinit_exec_mechanism,
 
2336
  Select_Lex_Unit::change_result
2337
2337
  are in sql_union.cc
2338
2338
*/
2339
2339