~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Olaf van der Spek
  • Date: 2011-06-21 19:11:23 UTC
  • mto: This revision was merged to the branch mainline in revision 2346.
  • Revision ID: olafvdspek@gmail.com-20110621191123-hddduaww44ntgdx5
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
2319
2319
        | select_item
2320
2320
        | '*'
2321
2321
          {
2322
 
            if (YYSession->add_item_to_list( new Item_field(&YYSession->lex().current_select->context, NULL, NULL, "*")))
2323
 
              DRIZZLE_YYABORT;
2324
 
 
2325
 
            (YYSession->lex().current_select->with_wild)++;
 
2322
            YYSession->add_item_to_list( new Item_field(&YYSession->lex().current_select->context, NULL, NULL, "*"));
 
2323
            YYSession->lex().current_select->with_wild++;
2326
2324
          }
2327
2325
        ;
2328
2326
 
2329
2327
select_item:
2330
2328
          remember_name table_wild remember_end
2331
2329
          {
2332
 
            if (YYSession->add_item_to_list($2))
2333
 
              DRIZZLE_YYABORT;
 
2330
            YYSession->add_item_to_list($2);
2334
2331
          }
2335
2332
        | remember_name expr remember_end select_alias
2336
2333
          {
2337
2334
            assert($1 < $3);
2338
2335
 
2339
 
            if (YYSession->add_item_to_list($2))
2340
 
              DRIZZLE_YYABORT;
 
2336
            YYSession->add_item_to_list($2);
2341
2337
 
2342
2338
            if ($4.str)
2343
2339
            {
3954
3950
 
3955
3951
group_list:
3956
3952
          group_list ',' order_ident order_dir
3957
 
          { if (YYSession->add_group_to_list($3,(bool) $4)) DRIZZLE_YYABORT; }
 
3953
          { YYSession->add_group_to_list($3,(bool) $4); }
3958
3954
        | order_ident order_dir
3959
 
          { if (YYSession->add_group_to_list($1,(bool) $2)) DRIZZLE_YYABORT; }
 
3955
          { YYSession->add_group_to_list($1,(bool) $2); }
3960
3956
        ;
3961
3957
 
3962
3958
olap_opt:
3996
3992
alter_order_item:
3997
3993
          simple_ident order_dir
3998
3994
          {
3999
 
            bool ascending= ($2 == 1) ? true : false;
4000
 
            if (YYSession->add_order_to_list($1, ascending))
4001
 
              DRIZZLE_YYABORT;
 
3995
            bool ascending= $2 == 1;
 
3996
            YYSession->add_order_to_list($1, ascending);
4002
3997
          }
4003
3998
        ;
4004
3999
 
4023
4018
order_list:
4024
4019
          order_list ',' order_ident order_dir
4025
4020
          {
4026
 
            if (YYSession->add_order_to_list($3,(bool) $4))
4027
 
              DRIZZLE_YYABORT;
 
4021
            YYSession->add_order_to_list($3,(bool) $4);
4028
4022
          }
4029
4023
        | order_ident order_dir
4030
4024
          {
4031
 
            if (YYSession->add_order_to_list($1,(bool) $2))
4032
 
              DRIZZLE_YYABORT;
 
4025
            YYSession->add_order_to_list($1,(bool) $2);
4033
4026
          }
4034
4027
        ;
4035
4028
 
4464
4457
update_elem:
4465
4458
          simple_ident equal expr_or_default
4466
4459
          {
4467
 
            if (YYSession->add_item_to_list($1) || YYSession->add_value_to_list($3))
4468
 
              DRIZZLE_YYABORT;
 
4460
            YYSession->add_item_to_list($1);
 
4461
                        YYSession->add_value_to_list($3);
4469
4462
          }
4470
4463
        ;
4471
4464
 
4533
4526
show_param:
4534
4527
           DATABASES show_wild
4535
4528
           {
4536
 
             if (not show::buildScemas(YYSession))
4537
 
               DRIZZLE_YYABORT;
 
4529
             if (not show::buildSchemas(YYSession))
 
4530
                                DRIZZLE_YYABORT;
4538
4531
           }
4539
4532
           /* SHOW TABLES */
4540
4533
         | TABLES opt_db show_wild