~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-08-03 15:50:04 UTC
  • mfrom: (1106.3.2 heap)
  • Revision ID: brian@gaz-20090803155004-tq6ec51i68ay1aye
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
874
874
        IDENT IDENT_QUOTED TEXT_STRING DECIMAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM
875
875
        LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text
876
876
        IDENT_sys TEXT_STRING_sys TEXT_STRING_literal
877
 
        opt_component key_cache_name
 
877
        opt_component
878
878
        BIN_NUM TEXT_STRING_filesystem ident_or_empty
879
879
        opt_constraint constraint opt_ident
880
880
 
994
994
%type <NONE>
995
995
        query verb_clause create select drop insert replace insert2
996
996
        insert_values update delete truncate rename
997
 
        show describe load alter optimize keycache flush
 
997
        show describe load alter optimize flush
998
998
        begin commit rollback savepoint release
999
999
        analyze check start checksum
1000
1000
        field_list field_list_item field_spec kill column_def key_def
1001
 
        keycache_list assign_to_keycache
1002
1001
        select_item_list select_item values_list no_braces
1003
1002
        opt_limit_clause delete_limit_clause fields opt_values values
1004
1003
        opt_precision opt_ignore opt_column
1092
1091
        | kill
1093
1092
        | load
1094
1093
        | optimize
1095
 
        | keycache
1096
1094
        | release
1097
1095
        | rename
1098
1096
        | replace
2454
2452
          }
2455
2453
        ;
2456
2454
 
2457
 
keycache:
2458
 
          CACHE_SYM INDEX_SYM keycache_list IN_SYM key_cache_name
2459
 
          {
2460
 
            LEX *lex=Lex;
2461
 
            lex->sql_command= SQLCOM_ASSIGN_TO_KEYCACHE;
2462
 
            lex->ident= $5;
2463
 
          }
2464
 
        ;
2465
 
 
2466
 
keycache_list:
2467
 
          assign_to_keycache
2468
 
        | keycache_list ',' assign_to_keycache
2469
 
        ;
2470
 
 
2471
 
assign_to_keycache:
2472
 
          table_ident cache_keys_spec
2473
 
          {
2474
 
            if (!Lex->current_select->add_table_to_list(YYSession, $1, NULL,
2475
 
                   0, TL_READ, Lex->current_select->pop_index_hints()))
2476
 
              DRIZZLE_YYABORT;
2477
 
          }
2478
 
        ;
2479
 
 
2480
 
key_cache_name:
2481
 
          ident    { $$= $1; }
2482
 
        | DEFAULT  { $$ = default_key_cache_base; }
2483
 
        ;
2484
 
 
2485
 
cache_keys_spec:
2486
 
          {
2487
 
            Lex->select_lex.alloc_index_hints(YYSession);
2488
 
            Lex->current_select->set_index_hint_type(INDEX_HINT_USE,
2489
 
                                                     INDEX_HINT_MASK_ALL);
2490
 
          }
2491
 
          cache_key_list_or_empty
2492
 
        ;
2493
 
 
2494
 
cache_key_list_or_empty:
2495
 
          /* empty */ { }
2496
 
        | key_or_index '(' opt_key_usage_list ')'
2497
 
        ;
2498
 
 
2499
2455
/*
2500
2456
  Select : retrieve data from table
2501
2457
*/
5880
5836
              $$.base_name= null_lex_str;
5881
5837
            }
5882
5838
          }
5883
 
        | ident '.' ident
5884
 
          {
5885
 
            if (check_reserved_words(&$1))
5886
 
            {
5887
 
              my_parse_error(ER(ER_SYNTAX_ERROR));
5888
 
              DRIZZLE_YYABORT;
5889
 
            }
5890
 
            {
5891
 
              sys_var *tmp=find_sys_var(YYSession, $3.str, $3.length);
5892
 
              if (!tmp)
5893
 
                DRIZZLE_YYABORT;
5894
 
              if (!tmp->is_struct())
5895
 
                my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
5896
 
              $$.var= tmp;
5897
 
              $$.base_name= $1;
5898
 
            }
5899
 
          }
5900
 
        | DEFAULT '.' ident
5901
 
          {
5902
 
            sys_var *tmp=find_sys_var(YYSession, $3.str, $3.length);
5903
 
            if (!tmp)
5904
 
              DRIZZLE_YYABORT;
5905
 
            if (!tmp->is_struct())
5906
 
              my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), $3.str);
5907
 
            $$.var= tmp;
5908
 
            $$.base_name.str=    (char*) "default";
5909
 
            $$.base_name.length= 7;
5910
 
          }
5911
5839
        ;
5912
5840
 
5913
5841
isolation_types: