~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Mark Atwood
  • Date: 2011-06-22 20:04:22 UTC
  • mfrom: (2318.6.39 rf)
  • Revision ID: me@mark.atwood.name-20110622200422-609npl456o0e5p32
mergeĀ lp:~olafvdspek/drizzle/refactor13

Show diffs side-by-side

added added

removed removed

Lines of Context:
1148
1148
row_format_or_text:
1149
1149
          row_format
1150
1150
          {
1151
 
            $$.str= YYSession->strmake($1.str, $1.length);
 
1151
            $$.str= YYSession->mem.strmake($1.str, $1.length);
1152
1152
            $$.length= $1.length;
1153
1153
          }
1154
1154
        ;
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
            {
3569
3565
                sel->master_unit()->global_parameters=
3570
3566
                   sel->master_unit()->fake_select_lex;
3571
3567
            }
3572
 
            if ($2->init_nested_join(Lex.session))
3573
 
              DRIZZLE_YYABORT;
 
3568
            $2->init_nested_join(*Lex.session);
3574
3569
            $$= 0;
3575
3570
            /* incomplete derived tables return NULL, we must be
3576
3571
               nested in select_derived rule to be here. */
3691
3686
select_derived:
3692
3687
          get_select_lex
3693
3688
          {
3694
 
            if ($1->init_nested_join(Lex.session))
3695
 
              DRIZZLE_YYABORT;
 
3689
            $1->init_nested_join(*Lex.session);
3696
3690
          }
3697
3691
          derived_table_list
3698
3692
          {
3956
3950
 
3957
3951
group_list:
3958
3952
          group_list ',' order_ident order_dir
3959
 
          { if (YYSession->add_group_to_list($3,(bool) $4)) DRIZZLE_YYABORT; }
 
3953
          { YYSession->add_group_to_list($3,(bool) $4); }
3960
3954
        | order_ident order_dir
3961
 
          { if (YYSession->add_group_to_list($1,(bool) $2)) DRIZZLE_YYABORT; }
 
3955
          { YYSession->add_group_to_list($1,(bool) $2); }
3962
3956
        ;
3963
3957
 
3964
3958
olap_opt:
3998
3992
alter_order_item:
3999
3993
          simple_ident order_dir
4000
3994
          {
4001
 
            bool ascending= ($2 == 1) ? true : false;
4002
 
            if (YYSession->add_order_to_list($1, ascending))
4003
 
              DRIZZLE_YYABORT;
 
3995
            bool ascending= $2 == 1;
 
3996
            YYSession->add_order_to_list($1, ascending);
4004
3997
          }
4005
3998
        ;
4006
3999
 
4025
4018
order_list:
4026
4019
          order_list ',' order_ident order_dir
4027
4020
          {
4028
 
            if (YYSession->add_order_to_list($3,(bool) $4))
4029
 
              DRIZZLE_YYABORT;
 
4021
            YYSession->add_order_to_list($3,(bool) $4);
4030
4022
          }
4031
4023
        | order_ident order_dir
4032
4024
          {
4033
 
            if (YYSession->add_order_to_list($1,(bool) $2))
4034
 
              DRIZZLE_YYABORT;
 
4025
            YYSession->add_order_to_list($1,(bool) $2);
4035
4026
          }
4036
4027
        ;
4037
4028
 
4466
4457
update_elem:
4467
4458
          simple_ident equal expr_or_default
4468
4459
          {
4469
 
            if (YYSession->add_item_to_list($1) || YYSession->add_value_to_list($3))
4470
 
              DRIZZLE_YYABORT;
 
4460
            YYSession->add_item_to_list($1);
 
4461
                        YYSession->add_value_to_list($3);
4471
4462
          }
4472
4463
        ;
4473
4464
 
4535
4526
show_param:
4536
4527
           DATABASES show_wild
4537
4528
           {
4538
 
             if (not show::buildScemas(YYSession))
4539
 
               DRIZZLE_YYABORT;
 
4529
             if (not show::buildSchemas(YYSession))
 
4530
                                DRIZZLE_YYABORT;
4540
4531
           }
4541
4532
           /* SHOW TABLES */
4542
4533
         | TABLES opt_db show_wild
5201
5192
          IDENT_sys    { $$=$1; }
5202
5193
        | keyword
5203
5194
          {
5204
 
            $$.str= YYSession->strmake($1.str, $1.length);
 
5195
            $$.str= YYSession->mem.strmake($1.str, $1.length);
5205
5196
            $$.length= $1.length;
5206
5197
          }
5207
5198
        ;
5483
5474
internal_variable_ident:
5484
5475
          keyword_exception_for_variable
5485
5476
          {
5486
 
            $$.str= YYSession->strmake($1.str, $1.length);
 
5477
            $$.str= YYSession->mem.strmake($1.str, $1.length);
5487
5478
            $$.length= $1.length;
5488
5479
          }
5489
5480
        | IDENT_sys    { $$=$1; }