~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-10-20 20:41:00 UTC
  • mfrom: (1863 staging)
  • mto: This revision was merged to the branch mainline in revision 1871.
  • Revision ID: barry.leslie@primebase.com-20101020204100-oyj6p5cfssjw3p62
Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
521
521
%token  ESCAPED
522
522
%token  ESCAPE_SYM                    /* SQL-2003-R */
523
523
%token  EXCLUSIVE_SYM
 
524
%token  EXECUTE_SYM
524
525
%token  EXISTS                        /* SQL-2003-R */
525
526
%token  EXTENDED_SYM
526
527
%token  EXTRACT_SYM                   /* SQL-2003-N */
802
803
        IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
803
804
        opt_component
804
805
        BIN_NUM TEXT_STRING_filesystem ident_or_empty
 
806
        execute_var_or_string
805
807
        opt_constraint constraint opt_ident
806
808
 
807
809
%type <lex_str_ptr>
935
937
        statement
936
938
        opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
937
939
        init_key_options key_options key_opts key_opt key_using_alg
 
940
        execute
938
941
END_OF_INPUT
939
942
 
940
943
%type <index_hint> index_hint_type
1004
1007
        | delete
1005
1008
        | describe
1006
1009
        | drop
 
1010
        | execute
1007
1011
        | flush
1008
1012
        | insert
1009
1013
        | kill
3719
3723
/* Warning - may return NULL in case of incomplete SELECT */
3720
3724
table_factor:
3721
3725
          {
3722
 
            Select_Lex *sel= Lex->current_select;
3723
 
            sel->table_join_options= 0;
3724
3726
          }
3725
3727
          table_ident opt_table_alias opt_key_definition
3726
3728
          {
3727
3729
            if (!($$= Lex->current_select->add_table_to_list(YYSession, $2, $3,
3728
 
                             Lex->current_select->get_table_join_options(),
 
3730
                             0,
3729
3731
                             Lex->lock_option,
3730
3732
                             Lex->current_select->pop_index_hints())))
3731
3733
              DRIZZLE_YYABORT;
4462
4464
          /* empty */ { $$= 0; }
4463
4465
        | TEMPORARY_SYM { $$= 1; }
4464
4466
        ;
 
4467
 
 
4468
/*
 
4469
  Execute a string as dynamic SQL.
 
4470
  */
 
4471
 
 
4472
execute:
 
4473
       EXECUTE_SYM
 
4474
       {
 
4475
          LEX *lex= Lex;
 
4476
          statement::Execute *statement= new(std::nothrow) statement::Execute(YYSession);
 
4477
          lex->statement= statement;
 
4478
          if (lex->statement == NULL)
 
4479
            DRIZZLE_YYABORT;
 
4480
       }
 
4481
       execute_var_or_string
 
4482
 
 
4483
 
 
4484
execute_var_or_string:
 
4485
         ident_or_text
 
4486
         {
 
4487
          statement::Execute *statement= (statement::Execute *)Lex->statement;
 
4488
          statement->setQuery($1);
 
4489
         }
 
4490
        | '@' ident_or_text
 
4491
        {
 
4492
          statement::Execute *statement= (statement::Execute *)Lex->statement;
 
4493
          statement->setVar();
 
4494
          statement->setQuery($2);
 
4495
        }
 
4496
 
4465
4497
/*
4466
4498
** Insert : add new data to table
4467
4499
*/