~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-08-20 00:06:57 UTC
  • mfrom: (1115.3.6 captain)
  • Revision ID: brian@gaz-20090820000657-hw5twz33bw30lz4j
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/statement.h>
 
91
#include <drizzled/statement/alter_schema.h>
 
92
#include <drizzled/statement/analyze.h>
 
93
#include <drizzled/statement/change_schema.h>
 
94
#include <drizzled/statement/check.h>
91
95
#include <drizzled/statement/checksum.h>
92
96
#include <drizzled/statement/commit.h>
 
97
#include <drizzled/statement/create_schema.h>
93
98
#include <drizzled/statement/delete.h>
 
99
#include <drizzled/statement/drop_schema.h>
 
100
#include <drizzled/statement/drop_table.h>
94
101
#include <drizzled/statement/empty_query.h>
 
102
#include <drizzled/statement/flush.h>
 
103
#include <drizzled/statement/kill.h>
95
104
#include <drizzled/statement/load.h>
 
105
#include <drizzled/statement/optimize.h>
96
106
#include <drizzled/statement/rollback.h>
97
107
#include <drizzled/statement/select.h>
 
108
#include <drizzled/statement/set_option.h>
98
109
#include <drizzled/statement/show_create.h>
99
110
#include <drizzled/statement/show_create_schema.h>
100
111
#include <drizzled/statement/show_engine_status.h>
102
113
#include <drizzled/statement/show_processlist.h>
103
114
#include <drizzled/statement/show_status.h>
104
115
#include <drizzled/statement/show_warnings.h>
 
116
#include <drizzled/statement/truncate.h>
105
117
#include <drizzled/statement/unlock_tables.h>
 
118
#include <drizzled/statement/update.h>
106
119
 
107
120
using namespace drizzled;
108
121
 
1200
1213
          {
1201
1214
            LEX *lex=Lex;
1202
1215
            lex->sql_command=SQLCOM_CREATE_DB;
 
1216
            lex->statement= new(std::nothrow) statement::CreateSchema(YYSession);
 
1217
            if (lex->statement == NULL)
 
1218
              DRIZZLE_YYABORT;
1203
1219
            lex->name= $4;
1204
1220
            lex->create_info.options=$3;
1205
1221
          }
2087
2103
          {
2088
2104
            LEX *lex=Lex;
2089
2105
            lex->sql_command=SQLCOM_ALTER_DB;
 
2106
            lex->statement= new(std::nothrow) statement::AlterSchema(YYSession);
 
2107
            if (lex->statement == NULL)
 
2108
              DRIZZLE_YYABORT;
2090
2109
            lex->name= $3;
2091
2110
            if (lex->name.str == NULL &&
2092
2111
                lex->copy_db_to(&lex->name.str, &lex->name.length))
2344
2363
          {
2345
2364
            LEX *lex=Lex;
2346
2365
            lex->sql_command = SQLCOM_ANALYZE;
 
2366
            lex->statement= new(std::nothrow) statement::Analyze(YYSession);
 
2367
            if (lex->statement == NULL)
 
2368
              DRIZZLE_YYABORT;
2347
2369
            lex->check_opt.init();
2348
2370
          }
2349
2371
          table_list
2356
2378
            LEX *lex=Lex;
2357
2379
 
2358
2380
            lex->sql_command = SQLCOM_CHECK;
 
2381
            lex->statement= new(std::nothrow) statement::Check(YYSession);
 
2382
            if (lex->statement == NULL)
 
2383
              DRIZZLE_YYABORT;
2359
2384
            lex->check_opt.init();
2360
2385
          }
2361
2386
          table_list opt_mi_check_type
2385
2410
          {
2386
2411
            LEX *lex=Lex;
2387
2412
            lex->sql_command = SQLCOM_OPTIMIZE;
 
2413
            lex->statement= new(std::nothrow) statement::Optimize(YYSession);
 
2414
            if (lex->statement == NULL)
 
2415
              DRIZZLE_YYABORT;
2388
2416
            lex->check_opt.init();
2389
2417
          }
2390
2418
          table_list
4298
4326
          {
4299
4327
            LEX *lex=Lex;
4300
4328
            lex->sql_command = SQLCOM_DROP_TABLE;
 
4329
            lex->statement= new(std::nothrow) statement::DropTable(YYSession);
 
4330
            if (lex->statement == NULL)
 
4331
              DRIZZLE_YYABORT;
4301
4332
            lex->drop_temporary= $2;
4302
4333
            lex->drop_if_exists= $4;
4303
4334
          }
4320
4351
          {
4321
4352
            LEX *lex=Lex;
4322
4353
            lex->sql_command= SQLCOM_DROP_DB;
 
4354
            lex->statement= new(std::nothrow) statement::DropSchema(YYSession);
 
4355
            if (lex->statement == NULL)
 
4356
              DRIZZLE_YYABORT;
4323
4357
            lex->drop_if_exists=$3;
4324
4358
            lex->name= $4;
4325
4359
          }
4510
4544
            LEX *lex= Lex;
4511
4545
            mysql_init_select(lex);
4512
4546
            lex->sql_command= SQLCOM_UPDATE;
 
4547
            lex->statement= new(std::nothrow) statement::Update(YYSession);
 
4548
            if (lex->statement == NULL)
 
4549
              DRIZZLE_YYABORT;
4513
4550
            lex->lock_option= TL_UNLOCK; /* Will be set later */
4514
4551
            lex->duplicates= DUP_ERROR; 
4515
4552
            if (!lex->select_lex.add_table_to_list(YYSession, $3, NULL,0))
4607
4644
          {
4608
4645
            LEX* lex= Lex;
4609
4646
            lex->sql_command= SQLCOM_TRUNCATE;
 
4647
            lex->statement= new(std::nothrow) statement::Truncate(YYSession);
 
4648
            if (lex->statement == NULL)
 
4649
              DRIZZLE_YYABORT;
4610
4650
            lex->select_lex.options= 0;
4611
4651
            lex->select_lex.init_order();
4612
4652
          }
4895
4935
          {
4896
4936
            LEX *lex=Lex;
4897
4937
            lex->sql_command= SQLCOM_FLUSH;
 
4938
            lex->statement= new(std::nothrow) statement::Flush(YYSession);
 
4939
            if (lex->statement == NULL)
 
4940
              DRIZZLE_YYABORT;
4898
4941
            lex->type= 0;
4899
4942
          }
4900
4943
          flush_options
4932
4975
            lex->value_list.empty();
4933
4976
            lex->value_list.push_front($3);
4934
4977
            lex->sql_command= SQLCOM_KILL;
 
4978
            lex->statement= new(std::nothrow) statement::Kill(YYSession);
 
4979
            if (lex->statement == NULL)
 
4980
              DRIZZLE_YYABORT;
4935
4981
          }
4936
4982
        ;
4937
4983
 
4948
4994
          {
4949
4995
            LEX *lex=Lex;
4950
4996
            lex->sql_command=SQLCOM_CHANGE_DB;
 
4997
            lex->statement= new(std::nothrow) statement::ChangeSchema(YYSession);
 
4998
            if (lex->statement == NULL)
 
4999
              DRIZZLE_YYABORT;
4951
5000
            lex->select_lex.db= $2.str;
4952
5001
          }
4953
5002
        ;
5656
5705
          {
5657
5706
            LEX *lex=Lex;
5658
5707
            lex->sql_command= SQLCOM_SET_OPTION;
 
5708
            lex->statement= new(std::nothrow) statement::SetOption(YYSession);
 
5709
            if (lex->statement == NULL)
 
5710
              DRIZZLE_YYABORT;
5659
5711
            mysql_init_select(lex);
5660
5712
            lex->option_type=OPT_SESSION;
5661
5713
            lex->var_list.empty();