~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2011-01-26 02:01:07 UTC
  • mto: (2123.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2117.
  • Revision ID: brian@tangent.org-20110126020107-6iyf2cv3d6beo8cs
Remove duplicate code around ident check.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5079
5079
simple_ident_q:
5080
5080
          ident '.' ident
5081
5081
          {
5082
 
            {
5083
 
              Select_Lex *sel= Lex->current_select;
5084
 
              if (sel->no_table_names_allowed)
5085
 
              {
5086
 
                my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
5087
 
                         MYF(0), $1.str, YYSession->where);
5088
 
              }
5089
 
              $$= (sel->parsing_place != IN_HAVING ||
5090
 
                  sel->get_in_sum_expr() > 0) ?
5091
 
                  (Item*) new Item_field(Lex->current_context(),
5092
 
                                         (const char *)NULL, $1.str, $3.str) :
5093
 
                  (Item*) new Item_ref(Lex->current_context(),
5094
 
                                       (const char *)NULL, $1.str, $3.str);
5095
 
            }
 
5082
            $$= parser::buildIdent(YYSession, NULL_LEX_STRING, $1, $3);
5096
5083
          }
5097
5084
        | '.' ident '.' ident
5098
5085
          {
5099
 
            Select_Lex *sel= Lex->current_select;
5100
 
            if (sel->no_table_names_allowed)
5101
 
            {
5102
 
              my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
5103
 
                       MYF(0), $2.str, YYSession->where);
5104
 
            }
5105
 
            $$= (sel->parsing_place != IN_HAVING ||
5106
 
                sel->get_in_sum_expr() > 0) ?
5107
 
                (Item*) new Item_field(Lex->current_context(), NULL, $2.str, $4.str) :
5108
 
                (Item*) new Item_ref(Lex->current_context(),
5109
 
                                     (const char *)NULL, $2.str, $4.str);
 
5086
            $$= parser::buildIdent(YYSession, NULL_LEX_STRING, $2, $4);
5110
5087
          }
5111
5088
        | ident '.' ident '.' ident
5112
5089
          {
5113
 
            Select_Lex *sel= Lex->current_select;
5114
 
            if (sel->no_table_names_allowed)
5115
 
            {
5116
 
              my_error(ER_TABLENAME_NOT_ALLOWED_HERE,
5117
 
                       MYF(0), $3.str, YYSession->where);
5118
 
            }
5119
 
            $$= (sel->parsing_place != IN_HAVING ||
5120
 
                sel->get_in_sum_expr() > 0) ?
5121
 
                (Item*) new Item_field(Lex->current_context(), $1.str, $3.str, $5.str) :
5122
 
                (Item*) new Item_ref(Lex->current_context(), $1.str, $3.str, $5.str);
 
5090
            $$= parser::buildIdent(YYSession, $1, $3, $5);
5123
5091
          }
5124
5092
        ;
5125
5093