~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.cc

  • Committer: Brian Aker
  • Date: 2010-10-27 21:19:18 UTC
  • mto: This revision was merged to the branch mainline in revision 1886.
  • Revision ID: brian@tangent.org-20101027211918-1xnp5koya8stw35j
Additional documenation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
*/
45
45
static bool add_to_list(Session *session, SQL_LIST &list, Item *item, bool asc)
46
46
{
47
 
  Order *order;
48
 
  if (!(order = (Order *) session->alloc(sizeof(Order))))
 
47
  order_st *order;
 
48
  if (!(order = (order_st *) session->alloc(sizeof(order_st))))
49
49
    return(1);
50
50
  order->item_ptr= item;
51
51
  order->item= &order->item_ptr;
206
206
  Because of this, it's critical to not do too much things here.
207
207
  (We already do too much here)
208
208
*/
209
 
void LEX::start(Session *arg)
210
 
{
211
 
  lex_start(arg);
212
 
}
213
 
 
214
209
void lex_start(Session *session)
215
210
{
216
211
  LEX *lex= session->lex;
270
265
  lex->reset();
271
266
}
272
267
 
273
 
void LEX::end()
 
268
void lex_end(LEX *lex)
274
269
{
275
 
  if (yacc_yyss)
276
 
  {
277
 
    free(yacc_yyss);
278
 
    free(yacc_yyvs);
279
 
    yacc_yyss= 0;
280
 
    yacc_yyvs= 0;
281
 
  }
282
 
 
283
 
  delete result;
284
 
 
285
 
  result= 0;
286
 
  setCacheable(true);
287
 
 
288
 
  delete statement;
289
 
  statement= NULL;
 
270
  if (lex->yacc_yyss)
 
271
  {
 
272
    free(lex->yacc_yyss);
 
273
    free(lex->yacc_yyvs);
 
274
    lex->yacc_yyss= 0;
 
275
    lex->yacc_yyvs= 0;
 
276
  }
 
277
 
 
278
  delete lex->result;
 
279
 
 
280
  lex->result= 0;
 
281
  lex->setCacheable(true);
 
282
 
 
283
  if (lex->statement) 
 
284
  {
 
285
    delete lex->statement;
 
286
    lex->statement= NULL;
 
287
  }
290
288
}
291
289
 
292
290
static int find_keyword(Lex_input_stream *lip, uint32_t len, bool function)
1734
1732
      str->append(STRING_WITH_LEN(" order by "));
1735
1733
      fake_select_lex->print_order(
1736
1734
        str,
1737
 
        (Order *) fake_select_lex->order_list.first,
 
1735
        (order_st *) fake_select_lex->order_list.first,
1738
1736
        query_type);
1739
1737
    }
1740
1738
    fake_select_lex->print_limit(session, str, query_type);
1742
1740
}
1743
1741
 
1744
1742
void Select_Lex::print_order(String *str,
1745
 
                                Order *order,
 
1743
                                order_st *order,
1746
1744
                                enum_query_type query_type)
1747
1745
{
1748
1746
  for (; order; order= order->next)