~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

Merged trunk, fixed some leftover InnoDB ICP code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
 
392
392
%pure_parser                                    /* We have threads */
393
393
/*
394
 
  Currently there are 90 shift/reduce conflicts.
 
394
  Currently there are 88 shift/reduce conflicts.
395
395
  We should not introduce new conflicts any more.
396
396
*/
397
 
%expect 90
 
397
%expect 88
398
398
 
399
399
/*
400
400
   Comments for TOKENS.
1005
1005
        opt_binary
1006
1006
        ref_list opt_match_clause opt_on_update_delete use
1007
1007
        opt_delete_options opt_delete_option varchar
1008
 
        opt_outer table_list table_name table_alias_ref_list table_alias_ref
 
1008
        opt_outer table_list table_name
1009
1009
        opt_option opt_place
1010
1010
        opt_attribute opt_attribute_list attribute
1011
1011
        flush_options flush_option
1012
1012
        equal optional_braces
1013
1013
        opt_mi_check_type opt_to mi_check_types normal_join
1014
1014
        table_to_table_list table_to_table opt_table_list opt_as
1015
 
        single_multi table_wild_list table_wild_one opt_wild
 
1015
        single_multi
1016
1016
        union_clause union_list
1017
1017
        precision subselect_start
1018
1018
        subselect_end select_var_list select_var_list_init opt_len
4368
4368
          }
4369
4369
        ;
4370
4370
 
4371
 
table_alias_ref_list:
4372
 
          table_alias_ref
4373
 
        | table_alias_ref_list ',' table_alias_ref
4374
 
        ;
4375
 
 
4376
 
table_alias_ref:
4377
 
          table_ident
4378
 
          {
4379
 
            if (!Lex->current_select->add_table_to_list(YYSession, $1, NULL,
4380
 
                                           TL_OPTION_UPDATING | TL_OPTION_ALIAS,
4381
 
                                           Lex->lock_option ))
4382
 
              DRIZZLE_YYABORT;
4383
 
          }
4384
 
        ;
4385
 
 
4386
4371
if_exists:
4387
4372
          /* empty */ { $$= 0; }
4388
4373
        | IF EXISTS { $$= 1; }
4552
4537
/* Update rows in a table */
4553
4538
 
4554
4539
update:
4555
 
          UPDATE_SYM
 
4540
          UPDATE_SYM opt_ignore table_ident
4556
4541
          {
4557
4542
            LEX *lex= Lex;
4558
4543
            mysql_init_select(lex);
4559
4544
            lex->sql_command= SQLCOM_UPDATE;
4560
4545
            lex->lock_option= TL_UNLOCK; /* Will be set later */
4561
4546
            lex->duplicates= DUP_ERROR; 
 
4547
            if (!lex->select_lex.add_table_to_list(YYSession, $3, NULL,0))
 
4548
              DRIZZLE_YYABORT;
4562
4549
          }
4563
 
          opt_ignore join_table_list
4564
4550
          SET update_list
4565
4551
          {
4566
4552
            LEX *lex= Lex;
4567
 
            if (lex->select_lex.table_list.elements > 1)
4568
 
              lex->sql_command= SQLCOM_UPDATE_MULTI;
4569
 
            else if (lex->select_lex.get_table_list()->derived)
 
4553
            if (lex->select_lex.get_table_list()->derived)
4570
4554
            {
4571
4555
              /* it is single table update and it is update of derived table */
4572
4556
              my_error(ER_NON_UPDATABLE_TABLE, MYF(0),
4635
4619
          }
4636
4620
          where_clause opt_order_clause
4637
4621
          delete_limit_clause {}
4638
 
        | table_wild_list
4639
 
          { mysql_init_multi_delete(Lex); }
4640
 
          FROM join_table_list where_clause
4641
 
          {
4642
 
            if (multi_delete_set_locks_and_link_aux_tables(Lex))
4643
 
              DRIZZLE_YYABORT;
4644
 
          }
4645
 
        | FROM table_alias_ref_list
4646
 
          { mysql_init_multi_delete(Lex); }
4647
 
          USING join_table_list where_clause
4648
 
          {
4649
 
            if (multi_delete_set_locks_and_link_aux_tables(Lex))
4650
 
              DRIZZLE_YYABORT;
4651
 
          }
4652
 
        ;
4653
 
 
4654
 
table_wild_list:
4655
 
          table_wild_one
4656
 
        | table_wild_list ',' table_wild_one
4657
 
        ;
4658
 
 
4659
 
table_wild_one:
4660
 
          ident opt_wild
4661
 
          {
4662
 
            if (!Lex->current_select->add_table_to_list(YYSession,
4663
 
                    new Table_ident($1), NULL,
4664
 
                    TL_OPTION_UPDATING | TL_OPTION_ALIAS,
4665
 
                    Lex->lock_option))
4666
 
              DRIZZLE_YYABORT;
4667
 
          }
4668
 
        | ident '.' ident opt_wild
4669
 
          {
4670
 
            if (!Lex->current_select->add_table_to_list(YYSession,
4671
 
                    new Table_ident($1, $3), NULL,
4672
 
                    TL_OPTION_UPDATING | TL_OPTION_ALIAS,
4673
 
                    Lex->lock_option))
4674
 
              DRIZZLE_YYABORT;
4675
 
          }
4676
 
        ;
4677
 
 
4678
 
opt_wild:
4679
 
          /* empty */ {}
4680
 
        | '.' '*' {}
4681
4622
        ;
4682
4623
 
4683
4624
opt_delete_options: