~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
  allows_derived= true;
109
109
}
110
110
 
111
 
Lex_input_stream::Lex_input_stream(THD *thd,
 
111
Lex_input_stream::Lex_input_stream(Session *thd,
112
112
                                   const char* buffer,
113
113
                                   unsigned int length)
114
114
: m_thd(thd),
155
155
                    buffer.
156
156
*/
157
157
 
158
 
void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr)
 
158
void Lex_input_stream::body_utf8_start(Session *thd, const char *begin_ptr)
159
159
{
160
160
  assert(begin_ptr);
161
161
  assert(m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length);
238
238
                  operation.
239
239
*/
240
240
 
241
 
void Lex_input_stream::body_utf8_append_literal(THD *thd,
 
241
void Lex_input_stream::body_utf8_append_literal(Session *thd,
242
242
                                                const LEX_STRING *txt,
243
243
                                                const CHARSET_INFO * const txt_cs,
244
244
                                                const char *end_ptr)
277
277
  (We already do too much here)
278
278
*/
279
279
 
280
 
void lex_start(THD *thd)
 
280
void lex_start(Session *thd)
281
281
{
282
282
  LEX *lex= thd->lex;
283
283
 
700
700
 
701
701
int MYSQLlex(void *arg, void *yythd)
702
702
{
703
 
  THD *thd= (THD *)yythd;
 
703
  Session *thd= (Session *)yythd;
704
704
  Lex_input_stream *lip= thd->m_lip;
705
705
  YYSTYPE *yylval=(YYSTYPE*) arg;
706
706
  int token;
759
759
  int   tokval, result_state;
760
760
  unsigned int length;
761
761
  enum my_lex_states state;
762
 
  THD *thd= (THD *)yythd;
 
762
  Session *thd= (Session *)yythd;
763
763
  Lex_input_stream *lip= thd->m_lip;
764
764
  LEX *lex= thd->lex;
765
765
  YYSTYPE *yylval=(YYSTYPE*) arg;
1440
1440
  statements and stored procedures and is compensated by always
1441
1441
  supplying a copy of Alter_info to these functions.
1442
1442
 
1443
 
  @return You need to use check the error in THD for out
 
1443
  @return You need to use check the error in Session for out
1444
1444
  of memory condition after calling this function.
1445
1445
*/
1446
1446
 
1815
1815
uint32_t st_select_lex_node::get_in_sum_expr()           { return 0; }
1816
1816
TableList* st_select_lex_node::get_table_list()     { return 0; }
1817
1817
List<Item>* st_select_lex_node::get_item_list()      { return 0; }
1818
 
TableList *st_select_lex_node::add_table_to_list (THD *thd __attribute__((unused)),
 
1818
TableList *st_select_lex_node::add_table_to_list (Session *thd __attribute__((unused)),
1819
1819
                                                   Table_ident *table __attribute__((unused)),
1820
1820
                                                  LEX_STRING *alias __attribute__((unused)),
1821
1821
                                                  uint32_t table_join_options __attribute__((unused)),
1857
1857
}
1858
1858
 
1859
1859
 
1860
 
bool st_select_lex::add_order_to_list(THD *thd, Item *item, bool asc)
 
1860
bool st_select_lex::add_order_to_list(Session *thd, Item *item, bool asc)
1861
1861
{
1862
1862
  return add_to_list(thd, order_list, item, asc);
1863
1863
}
1864
1864
 
1865
1865
 
1866
 
bool st_select_lex::add_item_to_list(THD *thd __attribute__((unused)),
 
1866
bool st_select_lex::add_item_to_list(Session *thd __attribute__((unused)),
1867
1867
                                     Item *item)
1868
1868
{
1869
1869
  return(item_list.push_back(item));
1870
1870
}
1871
1871
 
1872
1872
 
1873
 
bool st_select_lex::add_group_to_list(THD *thd, Item *item, bool asc)
 
1873
bool st_select_lex::add_group_to_list(Session *thd, Item *item, bool asc)
1874
1874
{
1875
1875
  return add_to_list(thd, group_list, item, asc);
1876
1876
}
1924
1924
}
1925
1925
 
1926
1926
 
1927
 
bool st_select_lex::setup_ref_array(THD *thd, uint32_t order_group_num)
 
1927
bool st_select_lex::setup_ref_array(Session *thd, uint32_t order_group_num)
1928
1928
{
1929
1929
  if (ref_pointer_array)
1930
1930
    return 0;
1994
1994
}
1995
1995
 
1996
1996
 
1997
 
void st_select_lex::print_limit(THD *thd __attribute__((unused)),
 
1997
void st_select_lex::print_limit(Session *thd __attribute__((unused)),
1998
1998
                                String *str,
1999
1999
                                enum_query_type query_type)
2000
2000
{
2035
2035
}
2036
2036
 
2037
2037
/**
2038
 
  @brief Restore the LEX and THD in case of a parse error.
 
2038
  @brief Restore the LEX and Session in case of a parse error.
2039
2039
 
2040
2040
  This is a clean up call that is invoked by the Bison generated
2041
2041
  parser before returning an error from MYSQLparse. If your
2046
2046
  to implement the clean up.
2047
2047
*/
2048
2048
 
2049
 
void st_lex::cleanup_lex_after_parse_error(THD *thd __attribute__((unused)))
 
2049
void st_lex::cleanup_lex_after_parse_error(Session *thd __attribute__((unused)))
2050
2050
{
2051
2051
}
2052
2052
 
2124
2124
 
2125
2125
  NOTE
2126
2126
    LEX object initialized with this constructor can be used as part of
2127
 
    THD object for which one can safely call open_tables(), lock_tables()
 
2127
    Session object for which one can safely call open_tables(), lock_tables()
2128
2128
    and close_thread_tables() functions. But it is not yet ready for
2129
2129
    statement parsing. On should use lex_start() function to prepare LEX
2130
2130
    for this.
2593
2593
 
2594
2594
*/
2595
2595
 
2596
 
static void fix_prepare_info_in_table_list(THD *thd, TableList *tbl)
 
2596
static void fix_prepare_info_in_table_list(Session *thd, TableList *tbl)
2597
2597
{
2598
2598
  for (; tbl; tbl= tbl->next_local)
2599
2599
  {
2650
2650
      thd         current thread.
2651
2651
*/
2652
2652
 
2653
 
void st_select_lex::alloc_index_hints (THD *thd)
 
2653
void st_select_lex::alloc_index_hints (Session *thd)
2654
2654
2655
2655
  index_hints= new (thd->mem_root) List<Index_hint>(); 
2656
2656
}
2670
2670
  RETURN VALUE
2671
2671
    0 on success, non-zero otherwise
2672
2672
*/
2673
 
bool st_select_lex::add_index_hint (THD *thd, char *str, uint32_t length)
 
2673
bool st_select_lex::add_index_hint (Session *thd, char *str, uint32_t length)
2674
2674
{
2675
2675
  return index_hints->push_front (new (thd->mem_root) 
2676
2676
                                 Index_hint(current_index_hint_type,