~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Lee Bieber
  • Date: 2011-03-22 17:41:09 UTC
  • mfrom: (2241.2.18 refactor2)
  • Revision ID: kalebral@gmail.com-20110322174109-1bsfvv4q1dnfd089
Merge Olaf - more code refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <drizzled/message/alter_table.pb.h>
45
45
#include <drizzled/item/subselect.h>
46
46
#include <drizzled/table_ident.h>
 
47
#include <drizzled/var.h>
47
48
 
48
49
int yylex(union ParserType *yylval, drizzled::Session *session);
49
50
 
3372
3373
            DRIZZLE_YYABORT_UNLESS($1 && $3);
3373
3374
            DRIZZLE_YYABORT_UNLESS( not Lex.is_cross );
3374
3375
            /* Change the current name resolution context to a local context. */
3375
 
            if (push_new_name_resolution_context(YYSession, $1, $3))
3376
 
              DRIZZLE_YYABORT;
 
3376
            push_new_name_resolution_context(*YYSession, *$1, *$3);
3377
3377
            Lex.current_select->parsing_place= IN_ON;
3378
3378
          }
3379
3379
          expr
3387
3387
          {
3388
3388
            DRIZZLE_YYABORT_UNLESS($1 && $3);
3389
3389
            /* Change the current name resolution context to a local context. */
3390
 
            if (push_new_name_resolution_context(YYSession, $1, $3))
3391
 
              DRIZZLE_YYABORT;
 
3390
            push_new_name_resolution_context(*YYSession, *$1, *$3);
3392
3391
            Lex.current_select->parsing_place= IN_ON;
3393
3392
          }
3394
3393
          expr
3417
3416
          {
3418
3417
            DRIZZLE_YYABORT_UNLESS($1 && $5);
3419
3418
            /* Change the current name resolution context to a local context. */
3420
 
            if (push_new_name_resolution_context(YYSession, $1, $5))
3421
 
              DRIZZLE_YYABORT;
 
3419
            push_new_name_resolution_context(*YYSession, *$1, *$5);
3422
3420
            Lex.current_select->parsing_place= IN_ON;
3423
3421
          }
3424
3422
          expr
3453
3451
          {
3454
3452
            DRIZZLE_YYABORT_UNLESS($1 && $5);
3455
3453
            /* Change the current name resolution context to a local context. */
3456
 
            if (push_new_name_resolution_context(YYSession, $1, $5))
3457
 
              DRIZZLE_YYABORT;
 
3454
            push_new_name_resolution_context(*YYSession, *$1, *$5);
3458
3455
            Lex.current_select->parsing_place= IN_ON;
3459
3456
          }
3460
3457
          expr
4299
4296
        | '(' fields ')' insert_values {}
4300
4297
        | SET_SYM
4301
4298
          {
4302
 
            if (not (Lex.insert_list = new List_item) ||
4303
 
                Lex.many_values.push_back(Lex.insert_list))
4304
 
              DRIZZLE_YYABORT;
 
4299
            Lex.insert_list = new List_item;
 
4300
            Lex.many_values.push_back(Lex.insert_list);
4305
4301
          }
4306
4302
          ident_eq_list
4307
4303
        ;
4339
4335
ident_eq_value:
4340
4336
          simple_ident equal expr_or_default
4341
4337
          {
4342
 
            if (Lex.field_list.push_back($1) ||
4343
 
                Lex.insert_list->push_back($3))
4344
 
              DRIZZLE_YYABORT;
 
4338
            Lex.field_list.push_back($1);
 
4339
            Lex.insert_list->push_back($3);
4345
4340
          }
4346
4341
        ;
4347
4342
 
4363
4358
          }
4364
4359
          opt_values ')'
4365
4360
          {
4366
 
            if (Lex.many_values.push_back(Lex.insert_list))
4367
 
              DRIZZLE_YYABORT;
 
4361
            Lex.many_values.push_back(Lex.insert_list);
4368
4362
          }
4369
4363
        ;
4370
4364
 
4376
4370
values:
4377
4371
          values ','  expr_or_default
4378
4372
          {
4379
 
            if (Lex.insert_list->push_back($3))
4380
 
              DRIZZLE_YYABORT;
 
4373
            Lex.insert_list->push_back($3);
4381
4374
          }
4382
4375
        | expr_or_default
4383
4376
          {
4384
 
            if (Lex.insert_list->push_back($1))
4385
 
              DRIZZLE_YYABORT;
 
4377
            Lex.insert_list->push_back($1);
4386
4378
          }
4387
4379
        ;
4388
4380
 
4447
4439
insert_update_elem:
4448
4440
          simple_ident equal expr_or_default
4449
4441
          {
4450
 
          if (Lex.update_list.push_back($1) ||
4451
 
              Lex.value_list.push_back($3))
4452
 
              DRIZZLE_YYABORT;
 
4442
                        Lex.update_list.push_back($1);
 
4443
            Lex.value_list.push_back($3);
4453
4444
          }
4454
4445
        ;
4455
4446
 
4462
4453
            init_select(&Lex);
4463
4454
            Lex.lock_option= TL_WRITE_DEFAULT;
4464
4455
            Lex.select_lex.init_order();
4465
 
 
4466
 
            if (!Lex.current_select->add_table_to_list(YYSession, $4, NULL, TL_OPTION_UPDATING,
4467
 
                                           Lex.lock_option))
4468
 
              DRIZZLE_YYABORT;
 
4456
            Lex.current_select->add_table_to_list(YYSession, $4, NULL, TL_OPTION_UPDATING, Lex.lock_option);
4469
4457
          }
4470
4458
          where_clause opt_order_clause
4471
4459
          delete_limit_clause {}