~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-06-05 23:10:06 UTC
  • mto: This revision was merged to the branch mainline in revision 1055.
  • Revision ID: brian@gaz-20090605231006-01nyw7pfpj2z2v8p
Remove guts in parser for LOCK TABLE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
897
897
        union_option
898
898
        start_transaction_opts opt_chain opt_release
899
899
        union_opt select_derived_init option_type2
900
 
        /* opt_lock_timeout_value */
901
900
 
902
901
%type <m_fk_option>
903
902
        delete_option
917
916
%type <lock_type>
918
917
        load_data_lock
919
918
 
920
 
%type <table_lock_info>
921
 
        table_lock_info
922
 
 
923
919
%type <item>
924
920
        literal text_literal insert_ident order_ident
925
921
        simple_ident expr opt_expr opt_else sum_expr in_sum_expr
1005
1001
        select_item_list select_item values_list no_braces
1006
1002
        opt_limit_clause delete_limit_clause fields opt_values values
1007
1003
        opt_precision opt_ignore opt_column
1008
 
        set lock unlock string_list
1009
 
        opt_binary table_lock_list table_lock
 
1004
        set unlock string_list
 
1005
        opt_binary
1010
1006
        ref_list opt_match_clause opt_on_update_delete use
1011
1007
        opt_delete_options opt_delete_option varchar
1012
1008
        opt_outer table_list table_name table_alias_ref_list table_alias_ref
1094
1090
        | insert
1095
1091
        | kill
1096
1092
        | load
1097
 
        | lock
1098
1093
        | optimize
1099
1094
        | keycache
1100
1095
        | release
5867
5862
        | BINARY { $$=new Item_string("binary", 6, system_charset_info); }
5868
5863
        ;
5869
5864
 
5870
 
/* Lock function */
5871
 
 
5872
 
lock:
5873
 
          LOCK_SYM
5874
 
          {
5875
 
            /*
5876
 
              Transactional locks can be taken only if all requested locks
5877
 
              are transactional. Initialize lex->lock_transactional as
5878
 
              TRUE. Any non-transactional lock request turns this to FALSE.
5879
 
              Table specific variables keep track of the locking method
5880
 
              requested for the table. This is used to warn about a
5881
 
              changed locking method later.
5882
 
            */
5883
 
            Lex->lock_transactional= true;
5884
 
          }
5885
 
          table_or_tables
5886
 
          {
5887
 
            LEX *lex= Lex;
5888
 
            lex->sql_command= SQLCOM_LOCK_TABLES;
5889
 
          }
5890
 
          table_lock_list
5891
 
          {}
5892
 
        ;
5893
 
 
5894
5865
table_or_tables:
5895
5866
          TABLE_SYM
5896
5867
        | TABLES
5897
5868
        ;
5898
5869
 
5899
 
table_lock_list:
5900
 
          table_lock
5901
 
        | table_lock_list ',' table_lock
5902
 
        ;
5903
 
 
5904
 
table_lock:
5905
 
        table_ident opt_table_alias table_lock_info
5906
 
        {
5907
 
          TableList *tlist;
5908
 
          if (!(tlist= Select->add_table_to_list(YYSession, $1, $2, 0,
5909
 
                                                 $3.lock_type)))
5910
 
            DRIZZLE_YYABORT; /* purecov: inspected */
5911
 
          tlist->lock_timeout= $3.lock_timeout;
5912
 
          /* Store the requested lock method for later warning. */
5913
 
          tlist->lock_transactional= $3.lock_transactional;
5914
 
          /* Compute the resulting lock method for all tables. */
5915
 
          if (!$3.lock_transactional)
5916
 
            Lex->lock_transactional= false;
5917
 
        }
5918
 
        ;
5919
 
 
5920
 
table_lock_info:
5921
 
        READ_SYM
5922
 
        {
5923
 
          $$.lock_type=          TL_READ_NO_INSERT;
5924
 
          $$.lock_timeout=       -1;
5925
 
          $$.lock_transactional= false;
5926
 
        }
5927
 
        | WRITE_SYM
5928
 
        {
5929
 
          $$.lock_type=          TL_WRITE_DEFAULT;
5930
 
          $$.lock_timeout=       -1;
5931
 
          $$.lock_transactional= false;
5932
 
        }
5933
 
        | READ_SYM LOCAL_SYM
5934
 
        {
5935
 
          $$.lock_type=          TL_READ;
5936
 
          $$.lock_timeout=       -1;
5937
 
          $$.lock_transactional= false;
5938
 
        }
5939
 
        ;
5940
 
 
5941
 
/*
5942
 
  We have a timeout resolution of milliseconds. The WAIT argument is in
5943
 
  seconds with decimal fragments for sub-second resolution. E.g. 22.5, 0.015
5944
 
*/
5945
 
/* opt_lock_timeout_value: */
5946
 
        /* empty { $$= -1; } */
5947
 
        /* | NUM       { $$= (int) (atof($1.str) * 1000.0 + 0.5); } */
5948
 
 
5949
5870
unlock:
5950
5871
          UNLOCK_SYM
5951
5872
          {