~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Olaf van der Spek
  • Date: 2011-09-19 09:17:51 UTC
  • mto: This revision was merged to the branch mainline in revision 2430.
  • Revision ID: olafvdspek@gmail.com-20110919091751-mhc0p991s2igp6hd
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
  return true;
368
368
}
369
369
 
370
 
Item *buildIdent(LEX *lex,
371
 
                 const lex_string_t &schema_name,
372
 
                 const lex_string_t &table_name,
373
 
                 const lex_string_t &field_name)
 
370
Item *buildIdent(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name, const lex_string_t &field_name)
374
371
{
375
372
  Select_Lex *sel= lex->current_select;
376
373
 
377
374
  if (table_name.length and sel->no_table_names_allowed)
378
375
  {
379
 
    my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
380
 
             MYF(0), table_name.str, lex->session->where());
 
376
    my_error(ER_TABLENAME_NOT_ALLOWED_HERE, MYF(0), table_name.str, lex->session->where());
381
377
  }
382
378
 
383
 
  Item *item= (sel->parsing_place != IN_HAVING or
384
 
               sel->get_in_sum_expr() > 0) ?
385
 
    (Item*) new Item_field(lex->current_context(), schema_name.str, table_name.str, field_name.str) :
386
 
    (Item*) new Item_ref(lex->current_context(), schema_name.str, table_name.str, field_name.str);
387
 
 
388
 
  return item;
 
379
  return sel->parsing_place != IN_HAVING || sel->get_in_sum_expr() > 0
 
380
    ? (Item*) new Item_field(lex->current_context(), schema_name.str, table_name.str, field_name.str) 
 
381
    : (Item*) new Item_ref(lex->current_context(), schema_name.str, table_name.str, field_name.str);
389
382
}
390
383
 
391
384
Item *buildTableWild(LEX *lex, const lex_string_t &schema_name, const lex_string_t &table_name)