~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 00:17:02 UTC
  • mto: (2123.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2117.
  • Revision ID: brian@tangent.org-20110126001702-z90yag1liwpo162u
Merge in field ident wrap from parser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5124
5124
        ;
5125
5125
 
5126
5126
field_ident:
5127
 
          ident { $$=$1;}
 
5127
          ident 
 
5128
          {
 
5129
            $$=$1;
 
5130
          }
5128
5131
        | ident '.' ident '.' ident
5129
5132
          {
5130
 
            TableList *table=
5131
 
              reinterpret_cast<TableList*>(Lex->current_select->table_list.first);
5132
 
            if (my_strcasecmp(table_alias_charset, $1.str, table->getSchemaName()))
5133
 
            {
5134
 
              my_error(ER_WRONG_DB_NAME, MYF(0), $1.str);
5135
 
              DRIZZLE_YYABORT;
5136
 
            }
5137
 
            if (my_strcasecmp(table_alias_charset, $3.str,
5138
 
                              table->getTableName()))
5139
 
            {
5140
 
              my_error(ER_WRONG_TABLE_NAME, MYF(0), $3.str);
5141
 
              DRIZZLE_YYABORT;
5142
 
            }
 
5133
            if (not parser::checkFieldIdent(YYSession, $1, $3))
 
5134
              DRIZZLE_YYABORT;
 
5135
 
5143
5136
            $$=$5;
5144
5137
          }
5145
5138
        | ident '.' ident
5146
5139
          {
5147
 
            TableList *table=
5148
 
              reinterpret_cast<TableList*>(Lex->current_select->table_list.first);
5149
 
            if (my_strcasecmp(table_alias_charset, $1.str, table->alias))
5150
 
            {
5151
 
              my_error(ER_WRONG_TABLE_NAME, MYF(0), $1.str);
 
5140
            if (not parser::checkFieldIdent(YYSession, $1))
5152
5141
              DRIZZLE_YYABORT;
5153
 
            }
 
5142
 
5154
5143
            $$=$3;
5155
5144
          }
5156
 
        | '.' ident { $$=$2;} /* For Delphi */
 
5145
        | '.' ident 
 
5146
          { /* For Delphi */
 
5147
            $$=$2;
 
5148
          }
5157
5149
        ;
5158
5150
 
5159
5151
table_ident: