~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

Merged in Eric's whitespace cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
  208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255
63
63
};
64
64
 
65
 
/* 
66
 
  Names of the index hints (for error messages). Keep in sync with 
67
 
  index_hint_type 
 
65
/*
 
66
  Names of the index hints (for error messages). Keep in sync with
 
67
  index_hint_type
68
68
*/
69
69
 
70
70
const char * index_hint_type_name[] =
71
71
{
72
 
  "IGNORE INDEX", 
73
 
  "USE INDEX", 
 
72
  "IGNORE INDEX",
 
73
  "USE INDEX",
74
74
  "FORCE INDEX"
75
75
};
76
76
 
354
354
  }
355
355
 
356
356
  /* release used plugins */
357
 
  plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer, 
 
357
  plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
358
358
                     lex->plugins.elements);
359
359
  reset_dynamic(&lex->plugins);
360
360
 
421
421
  return tmp;
422
422
}
423
423
 
424
 
/* 
425
 
 todo: 
426
 
   There are no dangerous charsets in mysql for function 
427
 
   get_quoted_token yet. But it should be fixed in the 
 
424
/*
 
425
 todo:
 
426
   There are no dangerous charsets in mysql for function
 
427
   get_quoted_token yet. But it should be fixed in the
428
428
   future to operate multichar strings (like ucs2)
429
429
*/
430
430
 
1344
1344
    case MY_LEX_END:
1345
1345
      lip->next_state=MY_LEX_END;
1346
1346
      return(0);                        // We found end of input last time
1347
 
      
 
1347
 
1348
1348
      /* Actually real shouldn't start with . but allow them anyhow */
1349
1349
    case MY_LEX_REAL_OR_POINT:
1350
1350
      if (my_isdigit(cs,lip->yyPeek()))
1653
1653
  // Remove slave structure
1654
1654
  for (; slave; slave= slave->next)
1655
1655
    slave->fast_exclude();
1656
 
  
 
1656
 
1657
1657
}
1658
1658
 
1659
1659
/*
1667
1667
  //exclude from other structures
1668
1668
  if ((*prev= next))
1669
1669
    next->prev= prev;
1670
 
  /* 
1671
 
     We do not need following statements, because prev pointer of first 
 
1670
  /*
 
1671
     We do not need following statements, because prev pointer of first
1672
1672
     list element point to master->slave
1673
1673
     if (master->slave == this)
1674
1674
       master->slave= next;
1683
1683
    st_select_lex_unit::exclude_level()
1684
1684
 
1685
1685
  NOTE: units which belong to current will be brought up on level of
1686
 
  currernt unit 
 
1686
  currernt unit
1687
1687
*/
1688
1688
void st_select_lex_unit::exclude_level()
1689
1689
{
1754
1754
 
1755
1755
 
1756
1756
/*
1757
 
  st_select_lex_node::mark_as_dependent mark all st_select_lex struct from 
 
1757
  st_select_lex_node::mark_as_dependent mark all st_select_lex struct from
1758
1758
  this to 'last' as dependent
1759
1759
 
1760
1760
  SYNOPSIS
1761
 
    last - pointer to last st_select_lex struct, before wich all 
 
1761
    last - pointer to last st_select_lex struct, before wich all
1762
1762
           st_select_lex have to be marked as dependent
1763
1763
 
1764
1764
  NOTE
1803
1803
uint32_t st_select_lex_node::get_in_sum_expr()           { return 0; }
1804
1804
TableList* st_select_lex_node::get_table_list()     { return 0; }
1805
1805
List<Item>* st_select_lex_node::get_item_list()      { return 0; }
1806
 
TableList *st_select_lex_node::add_table_to_list (Session *, Table_ident *, LEX_STRING *, uint32_t, 
 
1806
TableList *st_select_lex_node::add_table_to_list (Session *, Table_ident *, LEX_STRING *, uint32_t,
1807
1807
                                                  thr_lock_type, List<Index_hint> *, LEX_STRING *)
1808
1808
{
1809
1809
  return 0;
1873
1873
bool st_select_lex::set_braces(bool value)
1874
1874
{
1875
1875
  braces= value;
1876
 
  return 0; 
 
1876
  return 0;
1877
1877
}
1878
1878
 
1879
1879
 
1974
1974
      str->append(',');
1975
1975
  }
1976
1976
}
1977
 
 
 
1977
 
1978
1978
 
1979
1979
void st_select_lex::print_limit(Session *, String *str,
1980
1980
                                enum_query_type query_type)
2100
2100
 
2101
2101
  my_init_dynamic_array2(&plugins, sizeof(plugin_ref),
2102
2102
                         plugins_static_buffer,
2103
 
                         INITIAL_LEX_PLUGIN_LIST_SIZE, 
 
2103
                         INITIAL_LEX_PLUGIN_LIST_SIZE,
2104
2104
                         INITIAL_LEX_PLUGIN_LIST_SIZE);
2105
2105
  reset_query_tables_list(true);
2106
2106
}
2160
2160
  and will initialize the destination with the default
2161
2161
  database of the stored routine, rather than the default
2162
2162
  database of the connection it is parsed in.
2163
 
  E.g. if one has no current database selected, or current database 
 
2163
  E.g. if one has no current database selected, or current database
2164
2164
  set to 'bar' and then issues:
2165
2165
 
2166
2166
  CREATE PROCEDURE foo.p1() BEGIN SELECT * FROM t1 END//
2194
2194
 
2195
2195
  val= sl->select_limit ? sl->select_limit->val_uint() : HA_POS_ERROR;
2196
2196
  select_limit_val= (ha_rows)val;
2197
 
  /* 
 
2197
  /*
2198
2198
    Check for overflow : ha_rows can be smaller then uint64_t if
2199
2199
    BIG_TABLES is off.
2200
2200
    */
2245
2245
    */
2246
2246
    if ((*link_to_local= test(select_lex.table_list.first)))
2247
2247
    {
2248
 
      select_lex.context.table_list= 
 
2248
      select_lex.context.table_list=
2249
2249
        select_lex.context.first_name_resolution_table= first->next_local;
2250
2250
      select_lex.table_list.first= (unsigned char*) (first->next_local);
2251
2251
      select_lex.table_list.elements--; //safety
2445
2445
 
2446
2446
  DESCRIPTION
2447
2447
    Used in filling up the tagged hints list.
2448
 
    This list is filled by first setting the kind of the hint as a 
 
2448
    This list is filled by first setting the kind of the hint as a
2449
2449
    context variable and then adding hints of the current kind.
2450
2450
    Then the context variable index_hint_type can be reset to the
2451
2451
    next hint type.
2452
2452
*/
2453
2453
void st_select_lex::set_index_hint_type(enum index_hint_type type_arg,
2454
2454
                                        index_clause_map clause)
2455
 
 
2455
{
2456
2456
  current_index_hint_type= type_arg;
2457
2457
  current_index_hint_clause= clause;
2458
2458
}
2467
2467
*/
2468
2468
 
2469
2469
void st_select_lex::alloc_index_hints (Session *session)
2470
 
2471
 
  index_hints= new (session->mem_root) List<Index_hint>(); 
 
2470
{
 
2471
  index_hints= new (session->mem_root) List<Index_hint>();
2472
2472
}
2473
2473
 
2474
2474
 
2475
2475
 
2476
2476
/*
2477
 
  adds an element to the array storing index usage hints 
 
2477
  adds an element to the array storing index usage hints
2478
2478
  (ADD/FORCE/IGNORE INDEX).
2479
2479
 
2480
2480
  SYNOPSIS
2488
2488
*/
2489
2489
bool st_select_lex::add_index_hint (Session *session, char *str, uint32_t length)
2490
2490
{
2491
 
  return index_hints->push_front (new (session->mem_root) 
 
2491
  return index_hints->push_front (new (session->mem_root)
2492
2492
                                 Index_hint(current_index_hint_type,
2493
2493
                                            current_index_hint_clause,
2494
2494
                                            str, length));