~brianaker/drizzle/regression-622465

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2011-01-11 21:28:17 UTC
  • mfrom: (2068.6.2 alter-table)
  • Revision ID: brian@gir-3-20110111212817-tbi3ij8zqn8r2k97
Merge in parser work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
395
395
%pure_parser                                    /* We have threads */
396
396
 
397
397
/*
398
 
  Currently there are 88 shift/reduce conflicts.
 
398
  Currently there are 70 shift/reduce conflicts.
399
399
  We should not introduce new conflicts any more.
400
400
*/
401
 
%expect 75
 
401
%expect 70
402
402
 
403
403
/*
404
404
   Comments for TOKENS.
2537
2537
select_options:
2538
2538
          /* empty*/
2539
2539
        | select_option_list
2540
 
          {
2541
 
            if (Lex->current_select->options & SELECT_DISTINCT &&
2542
 
                Lex->current_select->options & SELECT_ALL)
2543
 
            {
2544
 
              my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
2545
 
              DRIZZLE_YYABORT;
2546
 
            }
2547
 
          }
 
2540
          { }
2548
2541
        ;
2549
2542
 
2550
2543
select_option_list:
2552
2545
        | select_option
2553
2546
        ;
2554
2547
 
 
2548
select_option_distinct_or_all:
 
2549
          DISTINCT
 
2550
          {
 
2551
            Lex->current_select->options|= SELECT_DISTINCT; 
 
2552
 
 
2553
            if (Lex->current_select->options & SELECT_DISTINCT && Lex->current_select->options & SELECT_ALL)
 
2554
            {
 
2555
              my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
 
2556
              DRIZZLE_YYABORT;
 
2557
            }
 
2558
          }
 
2559
        | ALL
 
2560
          {
 
2561
            Lex->current_select->options|= SELECT_ALL; 
 
2562
 
 
2563
            if (Lex->current_select->options & SELECT_DISTINCT && Lex->current_select->options & SELECT_ALL)
 
2564
            {
 
2565
              my_error(ER_WRONG_USAGE, MYF(0), "ALL", "DISTINCT");
 
2566
              DRIZZLE_YYABORT;
 
2567
            }
 
2568
          }
 
2569
        ;
 
2570
 
 
2571
select_option_small_or_big:
 
2572
          SQL_SMALL_RESULT
 
2573
          {
 
2574
            Lex->current_select->options|= SELECT_SMALL_RESULT;
 
2575
 
 
2576
            if (Lex->current_select->options & SELECT_SMALL_RESULT && Lex->current_select->options & SELECT_BIG_RESULT)
 
2577
            {
 
2578
              my_error(ER_WRONG_USAGE, MYF(0), "SELECT_SMALL_RESULT", "SELECT_SMALL_RESULT");
 
2579
              DRIZZLE_YYABORT;
 
2580
            }
 
2581
          }
 
2582
        | SQL_BIG_RESULT
 
2583
          {
 
2584
            Lex->current_select->options|= SELECT_BIG_RESULT;
 
2585
 
 
2586
            if (Lex->current_select->options & SELECT_SMALL_RESULT && Lex->current_select->options & SELECT_BIG_RESULT)
 
2587
            {
 
2588
              my_error(ER_WRONG_USAGE, MYF(0), "SELECT_SMALL_RESULT", "SELECT_SMALL_RESULT");
 
2589
              DRIZZLE_YYABORT;
 
2590
            }
 
2591
          }
 
2592
        ;
 
2593
 
 
2594
 
2555
2595
select_option:
2556
2596
          STRAIGHT_JOIN { Lex->current_select->options|= SELECT_STRAIGHT_JOIN; }
2557
 
        | DISTINCT         { Lex->current_select->options|= SELECT_DISTINCT; }
2558
 
        | SQL_SMALL_RESULT { Lex->current_select->options|= SELECT_SMALL_RESULT; }
2559
 
        | SQL_BIG_RESULT   { Lex->current_select->options|= SELECT_BIG_RESULT; }
2560
2597
        | SQL_BUFFER_RESULT
2561
2598
          {
2562
2599
            if (check_simple_select(YYSession))
2563
2600
              DRIZZLE_YYABORT;
2564
2601
            Lex->current_select->options|= OPTION_BUFFER_RESULT;
2565
2602
          }
 
2603
        | select_option_small_or_big
 
2604
          { }
 
2605
        | select_option_distinct_or_all
 
2606
          { }
2566
2607
        | SQL_CALC_FOUND_ROWS
2567
2608
          {
2568
2609
            if (check_simple_select(YYSession))
2569
2610
              DRIZZLE_YYABORT;
2570
2611
            Lex->current_select->options|= OPTION_FOUND_ROWS;
2571
2612
          }
2572
 
        | ALL { Lex->current_select->options|= SELECT_ALL; }
2573
2613
        ;
2574
2614
 
2575
2615
select_lock_type:
5957
5997
        | DATA_SYM                 {}
5958
5998
        | DATABASES                {}
5959
5999
        | DATETIME_SYM             {}
5960
 
        | DATE_SYM                 {}
 
6000
        | DATE_SYM                 {} /* Create conflict */
5961
6001
        | DAY_SYM                  {}
5962
6002
        | DISABLE_SYM              {}
5963
6003
        | DISCARD                  {}
6015
6055
        | PROCESS                  {}
6016
6056
        | PROCESSLIST_SYM          {}
6017
6057
        | QUARTER_SYM              {}
6018
 
        | QUERY_SYM                {}
 
6058
        | QUERY_SYM                {} // Causes conflict
6019
6059
        | REDUNDANT_SYM            {}
6020
6060
        | REPEATABLE_SYM           {}
6021
6061
        | RETURNS_SYM              {}
6031
6071
        | SIMPLE_SYM               {}
6032
6072
        | SHARE_SYM                {}
6033
6073
        | SNAPSHOT_SYM             {}
6034
 
        | SQL_BUFFER_RESULT        {}
6035
6074
        | STATUS_SYM               {}
6036
6075
        | STRING_SYM               {}
6037
6076
        | SUBDATE_SYM              {}
6049
6088
        | UNCOMMITTED_SYM          {}
6050
6089
        | UNDOFILE_SYM             {}
6051
6090
        | UNKNOWN_SYM              {}
 
6091
        | UUID_SYM                 {}
6052
6092
        | USER                     {}
6053
6093
        | VARIABLES                {}
6054
6094
        | VALUE_SYM                {}