~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Padraig O'Sullivan
  • Date: 2009-08-07 18:03:24 UTC
  • mto: (1115.3.4 captain)
  • mto: This revision was merged to the branch mainline in revision 1117.
  • Revision ID: osullivan.padraig@gmail.com-20090807180324-b93afsws66vuyk2z
Applied Jay's suggestion of not having the type of the statement passed in
to the SqlCommand constructor. Made the type variable of the derived classes
a static const private member since the type never changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1077
1077
            {
1078
1078
              session->lex->sql_command= SQLCOM_EMPTY_QUERY;
1079
1079
              session->lex->command= 
1080
 
                new(std::nothrow) command::EmptyQuery(SQLCOM_EMPTY_QUERY,
1081
 
                                                      YYSession);
 
1080
                new(std::nothrow) command::EmptyQuery(YYSession);
1082
1081
              if (session->lex->command == NULL)
1083
1082
                DRIZZLE_YYABORT;
1084
1083
            }
2377
2376
          {
2378
2377
            LEX *lex=Lex;
2379
2378
            lex->sql_command = SQLCOM_CHECKSUM;
2380
 
            lex->command= new(std::nothrow) command::Checksum(SQLCOM_CHECKSUM,
2381
 
                                                              YYSession);
 
2379
            lex->command= new(std::nothrow) command::Checksum(YYSession);
2382
2380
            if (lex->command == NULL)
2383
2381
              DRIZZLE_YYABORT;
2384
2382
          }
4622
4620
          {
4623
4621
            LEX *lex= Lex;
4624
4622
            lex->sql_command= SQLCOM_DELETE;
4625
 
            lex->command= new(std::nothrow) command::Delete(SQLCOM_DELETE,
4626
 
                                                            YYSession);
 
4623
            lex->command= new(std::nothrow) command::Delete(YYSession);
4627
4624
            if (lex->command == NULL)
4628
4625
              DRIZZLE_YYABORT;
4629
4626
            mysql_init_select(lex);
4743
4740
            Lex->show_engine= $2; 
4744
4741
            Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS;
4745
4742
            Lex->command= 
4746
 
              new(std::nothrow) command::ShowEngineStatus(SQLCOM_SHOW_ENGINE_STATUS,
4747
 
                                                          YYSession);
 
4743
              new(std::nothrow) command::ShowEngineStatus(YYSession);
4748
4744
            if (Lex->command == NULL)
4749
4745
              DRIZZLE_YYABORT;
4750
4746
          }
4795
4791
        | WARNINGS opt_limit_clause_init
4796
4792
          { 
4797
4793
            Lex->sql_command = SQLCOM_SHOW_WARNS;
4798
 
            Lex->command= new(std::nothrow) command::ShowWarnings(SQLCOM_SHOW_WARNS,
4799
 
                                                                  YYSession);
 
4794
            Lex->command= new(std::nothrow) command::ShowWarnings(YYSession);
4800
4795
            if (Lex->command == NULL)
4801
4796
              DRIZZLE_YYABORT;
4802
4797
          }
4803
4798
        | ERRORS opt_limit_clause_init
4804
4799
          { 
4805
4800
            Lex->sql_command = SQLCOM_SHOW_ERRORS;
4806
 
            Lex->command= new(std::nothrow) command::ShowErrors(SQLCOM_SHOW_ERRORS,
4807
 
                                                                YYSession);
 
4801
            Lex->command= new(std::nothrow) command::ShowErrors(YYSession);
4808
4802
            if (Lex->command == NULL)
4809
4803
              DRIZZLE_YYABORT;
4810
4804
          }
4813
4807
            LEX *lex= Lex;
4814
4808
            lex->sql_command= SQLCOM_SHOW_STATUS;
4815
4809
            lex->command=
4816
 
              new(std::nothrow) command::ShowStatus(SQLCOM_SHOW_STATUS,
4817
 
                                                    YYSession,
 
4810
              new(std::nothrow) command::ShowStatus(YYSession,
4818
4811
                                                    &LOCK_status);
4819
4812
            if (lex->command == NULL)
4820
4813
              DRIZZLE_YYABORT;
4826
4819
          { 
4827
4820
            Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;
4828
4821
            Lex->command= 
4829
 
              new(std::nothrow) command::ShowProcesslist(SQLCOM_SHOW_PROCESSLIST,
4830
 
                                                         YYSession);
 
4822
              new(std::nothrow) command::ShowProcesslist(YYSession);
4831
4823
            if (Lex->command == NULL)
4832
4824
              DRIZZLE_YYABORT;
4833
4825
          }
4854
4846
          {
4855
4847
            LEX *lex= Lex;
4856
4848
            lex->sql_command = SQLCOM_SHOW_CREATE;
4857
 
            lex->command= new(std::nothrow) command::ShowCreate(SQLCOM_SHOW_CREATE,
4858
 
                                                                YYSession);
 
4849
            lex->command= new(std::nothrow) command::ShowCreate(YYSession);
4859
4850
            if (lex->command == NULL)
4860
4851
              DRIZZLE_YYABORT;
4861
4852
            if (!lex->select_lex.add_table_to_list(YYSession, $3, NULL,0))
5023
5014
          {
5024
5015
            LEX *lex=Lex;
5025
5016
            lex->sql_command= SQLCOM_LOAD;
5026
 
            lex->command= new(std::nothrow) command::Load(SQLCOM_LOAD,
5027
 
                                                          YYSession);
 
5017
            lex->command= new(std::nothrow) command::Load(YYSession);
5028
5018
            if (lex->command == NULL)
5029
5019
              DRIZZLE_YYABORT;
5030
5020
            lex->lock_option= $4;
5904
5894
          {
5905
5895
            LEX *lex=Lex;
5906
5896
            lex->sql_command= SQLCOM_COMMIT;
5907
 
            lex->command= new(std::nothrow) command::Commit(SQLCOM_COMMIT,
5908
 
                                                            YYSession);
 
5897
            lex->command= new(std::nothrow) command::Commit(YYSession);
5909
5898
            if (lex->command == NULL)
5910
5899
              DRIZZLE_YYABORT;
5911
5900
            lex->tx_chain= $3; 
5918
5907
          {
5919
5908
            LEX *lex=Lex;
5920
5909
            lex->sql_command= SQLCOM_ROLLBACK;
5921
 
            lex->command= new(std::nothrow) command::Rollback(SQLCOM_ROLLBACK,
5922
 
                                                              YYSession);
 
5910
            lex->command= new(std::nothrow) command::Rollback(YYSession);
5923
5911
            if (lex->command == NULL)
5924
5912
              DRIZZLE_YYABORT;
5925
5913
            lex->tx_chain= $3;