~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-08-06 15:04:21 UTC
  • mfrom: (1093.1.52 captain)
  • Revision ID: brian@gaz-20090806150421-w8yrasl1m8exorxs
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
#include <mysys/thr_lock.h>
89
89
#include <drizzled/message/table.pb.h>
90
90
#include <drizzled/command.h>
 
91
#include <drizzled/command/checksum.h>
 
92
#include <drizzled/command/commit.h>
 
93
#include <drizzled/command/empty_query.h>
 
94
#include <drizzled/command/load.h>
 
95
#include <drizzled/command/rollback.h>
 
96
#include <drizzled/command/select.h>
 
97
#include <drizzled/command/show_create.h>
 
98
#include <drizzled/command/show_engine_status.h>
 
99
#include <drizzled/command/show_errors.h>
 
100
#include <drizzled/command/show_processlist.h>
91
101
#include <drizzled/command/show_status.h>
92
 
#include <drizzled/command/select.h>
 
102
#include <drizzled/command/show_warnings.h>
93
103
 
94
104
using namespace drizzled;
95
105
 
1065
1075
            else
1066
1076
            {
1067
1077
              session->lex->sql_command= SQLCOM_EMPTY_QUERY;
 
1078
              session->lex->command= 
 
1079
                new(std::nothrow) command::EmptyQuery(SQLCOM_EMPTY_QUERY,
 
1080
                                                      YYSession);
 
1081
              if (session->lex->command == NULL)
 
1082
                DRIZZLE_YYABORT;
1068
1083
            }
1069
1084
          }
1070
1085
        | verb_clause END_OF_INPUT {}
2361
2376
          {
2362
2377
            LEX *lex=Lex;
2363
2378
            lex->sql_command = SQLCOM_CHECKSUM;
 
2379
            lex->command= new(std::nothrow) command::Checksum(SQLCOM_CHECKSUM,
 
2380
                                                              YYSession);
 
2381
            if (lex->command == NULL)
 
2382
              DRIZZLE_YYABORT;
2364
2383
          }
2365
2384
          table_list opt_checksum_type
2366
2385
          {}
4718
4737
          { 
4719
4738
            Lex->show_engine= $2; 
4720
4739
            Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS;
 
4740
            Lex->command= 
 
4741
              new(std::nothrow) command::ShowEngineStatus(SQLCOM_SHOW_ENGINE_STATUS,
 
4742
                                                          YYSession);
 
4743
            if (Lex->command == NULL)
 
4744
              DRIZZLE_YYABORT;
4721
4745
          }
4722
4746
        | opt_full COLUMNS from_or_in table_ident opt_db show_wild
4723
4747
          {
4764
4788
              DRIZZLE_YYABORT;
4765
4789
          }
4766
4790
        | WARNINGS opt_limit_clause_init
4767
 
          { Lex->sql_command = SQLCOM_SHOW_WARNS;}
 
4791
          { 
 
4792
            Lex->sql_command = SQLCOM_SHOW_WARNS;
 
4793
            Lex->command= new(std::nothrow) command::ShowWarnings(SQLCOM_SHOW_WARNS,
 
4794
                                                                  YYSession);
 
4795
            if (Lex->command == NULL)
 
4796
              DRIZZLE_YYABORT;
 
4797
          }
4768
4798
        | ERRORS opt_limit_clause_init
4769
 
          { Lex->sql_command = SQLCOM_SHOW_ERRORS;}
 
4799
          { 
 
4800
            Lex->sql_command = SQLCOM_SHOW_ERRORS;
 
4801
            Lex->command= new(std::nothrow) command::ShowErrors(SQLCOM_SHOW_ERRORS,
 
4802
                                                                YYSession);
 
4803
            if (Lex->command == NULL)
 
4804
              DRIZZLE_YYABORT;
 
4805
          }
4770
4806
        | opt_var_type STATUS_SYM show_wild
4771
4807
          {
4772
4808
            LEX *lex= Lex;
4782
4818
              DRIZZLE_YYABORT;
4783
4819
          }
4784
4820
        | opt_full PROCESSLIST_SYM
4785
 
          { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
 
4821
          { 
 
4822
            Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;
 
4823
            Lex->command= 
 
4824
              new(std::nothrow) command::ShowProcesslist(SQLCOM_SHOW_PROCESSLIST,
 
4825
                                                         YYSession);
 
4826
            if (Lex->command == NULL)
 
4827
              DRIZZLE_YYABORT;
 
4828
          }
4786
4829
        | opt_var_type  VARIABLES show_wild
4787
4830
          {
4788
4831
            LEX *lex= Lex;
4806
4849
          {
4807
4850
            LEX *lex= Lex;
4808
4851
            lex->sql_command = SQLCOM_SHOW_CREATE;
 
4852
            lex->command= new(std::nothrow) command::ShowCreate(SQLCOM_SHOW_CREATE,
 
4853
                                                                YYSession);
 
4854
            if (lex->command == NULL)
 
4855
              DRIZZLE_YYABORT;
4809
4856
            if (!lex->select_lex.add_table_to_list(YYSession, $3, NULL,0))
4810
4857
              DRIZZLE_YYABORT;
4811
4858
          }
4971
5018
          {
4972
5019
            LEX *lex=Lex;
4973
5020
            lex->sql_command= SQLCOM_LOAD;
 
5021
            lex->command= new(std::nothrow) command::Load(SQLCOM_LOAD,
 
5022
                                                          YYSession);
 
5023
            if (lex->command == NULL)
 
5024
              DRIZZLE_YYABORT;
4974
5025
            lex->lock_option= $4;
4975
5026
            lex->duplicates= DUP_ERROR;
4976
5027
            lex->ignore= 0;
5848
5899
          {
5849
5900
            LEX *lex=Lex;
5850
5901
            lex->sql_command= SQLCOM_COMMIT;
 
5902
            lex->command= new(std::nothrow) command::Commit(SQLCOM_COMMIT,
 
5903
                                                            YYSession);
 
5904
            if (lex->command == NULL)
 
5905
              DRIZZLE_YYABORT;
5851
5906
            lex->tx_chain= $3; 
5852
5907
            lex->tx_release= $4;
5853
5908
          }
5858
5913
          {
5859
5914
            LEX *lex=Lex;
5860
5915
            lex->sql_command= SQLCOM_ROLLBACK;
 
5916
            lex->command= new(std::nothrow) command::Rollback(SQLCOM_ROLLBACK,
 
5917
                                                              YYSession);
 
5918
            if (lex->command == NULL)
 
5919
              DRIZZLE_YYABORT;
5861
5920
            lex->tx_chain= $3; 
5862
5921
            lex->tx_release= $4;
5863
5922
          }