~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: devananda
  • Date: 2009-06-30 14:27:54 UTC
  • mfrom: (1030.2.4 trunk)
  • mto: (1093.1.7 captain)
  • mto: This revision was merged to the branch mainline in revision 1095.
  • Revision ID: devananda.vdv@gmail.com-20090630142754-vm9w374yxkf1pikc
mergeĀ fromĀ lp

Show diffs side-by-side

added added

removed removed

Lines of Context:
715
715
%token  REMOVE_SYM
716
716
%token  RENAME
717
717
%token  REORGANIZE_SYM
718
 
%token  REPAIR
719
718
%token  REPEATABLE_SYM                /* SQL-2003-N */
720
719
%token  REPEAT_SYM                    /* MYSQL-FUNC */
721
720
%token  REPLACE                       /* MYSQL-FUNC */
993
992
        insert_values update delete truncate rename
994
993
        show describe load alter optimize keycache flush
995
994
        begin commit rollback savepoint release
996
 
        repair analyze check start checksum
 
995
        analyze check start checksum
997
996
        field_list field_list_item field_spec kill column_def key_def
998
997
        keycache_list assign_to_keycache
999
998
        select_item_list select_item values_list no_braces
1092
1091
        | keycache
1093
1092
        | release
1094
1093
        | rename
1095
 
        | repair
1096
1094
        | replace
1097
1095
        | rollback
1098
1096
        | savepoint
1136
1134
            else
1137
1135
              proto->set_type(drizzled::message::Table::STANDARD);
1138
1136
 
 
1137
            {
 
1138
              drizzled::message::Table::StorageEngine *protoengine;
 
1139
              protoengine= proto->mutable_engine();
 
1140
              StorageEngine *engine= ha_default_storage_engine(session);
 
1141
 
 
1142
              protoengine->set_name(engine->getName());
 
1143
            }
1139
1144
          }
1140
1145
          create2
1141
1146
          {
1313
1318
          {
1314
1319
            Lex->create_info.db_type= $3;
1315
1320
            Lex->create_info.used_fields|= HA_CREATE_USED_ENGINE;
 
1321
 
 
1322
            {
 
1323
              drizzled::message::Table::StorageEngine *protoengine;
 
1324
              protoengine= Lex->create_table_proto->mutable_engine();
 
1325
 
 
1326
              protoengine->set_name($3->getName());
 
1327
            }
1316
1328
          }
1317
1329
        | MAX_ROWS opt_equal ulonglong_num
1318
1330
          {
2094
2106
            lex->create_info.row_type= ROW_TYPE_NOT_USED;
2095
2107
            lex->alter_info.reset();
2096
2108
            lex->alter_info.build_method= $2;
 
2109
 
 
2110
            lex->create_table_proto= new drizzled::message::Table();
2097
2111
          }
2098
2112
          alter_commands
2099
2113
          {}
2352
2366
        | EXTENDED_SYM  { Lex->check_opt.flags= T_EXTEND; }
2353
2367
        ;
2354
2368
 
2355
 
repair:
2356
 
          REPAIR table_or_tables
2357
 
          {
2358
 
            LEX *lex=Lex;
2359
 
            lex->sql_command = SQLCOM_REPAIR;
2360
 
            lex->check_opt.init();
2361
 
          }
2362
 
          table_list opt_mi_repair_type
2363
 
          {}
2364
 
        ;
2365
 
 
2366
 
opt_mi_repair_type:
2367
 
          /* empty */ { Lex->check_opt.flags = T_MEDIUM; }
2368
 
        | mi_repair_types {}
2369
 
        ;
2370
 
 
2371
 
mi_repair_types:
2372
 
          mi_repair_type {}
2373
 
        | mi_repair_type mi_repair_types {}
2374
 
        ;
2375
 
 
2376
 
mi_repair_type:
2377
 
          QUICK        { Lex->check_opt.flags|= T_QUICK; }
2378
 
        | EXTENDED_SYM { Lex->check_opt.flags|= T_EXTEND; }
2379
 
        | USE_FRM      { Lex->check_opt.use_frm= true; }
2380
 
        ;
2381
2369
 
2382
2370
analyze:
2383
2371
          ANALYZE_SYM table_or_tables
4771
4759
           {
4772
4760
             LEX *lex= Lex;
4773
4761
             lex->sql_command= SQLCOM_SHOW_DATABASES;
4774
 
             if (prepare_schema_table(YYSession, lex, 0, SCH_SCHEMATA))
 
4762
             if (prepare_schema_table(YYSession, lex, 0, "SCHEMATA"))
4775
4763
               DRIZZLE_YYABORT;
4776
4764
           }
4777
4765
         | opt_full TABLES opt_db show_wild
4779
4767
             LEX *lex= Lex;
4780
4768
             lex->sql_command= SQLCOM_SHOW_TABLES;
4781
4769
             lex->select_lex.db= $3;
4782
 
             if (prepare_schema_table(YYSession, lex, 0, SCH_TABLE_NAMES))
 
4770
             if (prepare_schema_table(YYSession, lex, 0, "TABLE_NAMES"))
4783
4771
               DRIZZLE_YYABORT;
4784
4772
           }
4785
4773
         | TABLE_SYM STATUS_SYM opt_db show_wild
4787
4775
             LEX *lex= Lex;
4788
4776
             lex->sql_command= SQLCOM_SHOW_TABLE_STATUS;
4789
4777
             lex->select_lex.db= $3;
4790
 
             if (prepare_schema_table(YYSession, lex, 0, SCH_TABLES))
 
4778
             if (prepare_schema_table(YYSession, lex, 0, "TABLES"))
4791
4779
               DRIZZLE_YYABORT;
4792
4780
           }
4793
4781
        | OPEN_SYM TABLES opt_db show_wild
4795
4783
            LEX *lex= Lex;
4796
4784
            lex->sql_command= SQLCOM_SHOW_OPEN_TABLES;
4797
4785
            lex->select_lex.db= $3;
4798
 
            if (prepare_schema_table(YYSession, lex, 0, SCH_OPEN_TABLES))
 
4786
            if (prepare_schema_table(YYSession, lex, 0, "OPEN_TABLES"))
4799
4787
              DRIZZLE_YYABORT;
4800
4788
          }
4801
4789
        | ENGINE_SYM known_storage_engines STATUS_SYM /* This should either go... well it should go */
4802
4790
          { 
4803
 
            Lex->create_info.db_type= $2; 
 
4791
            Lex->show_engine= $2; 
4804
4792
            Lex->sql_command= SQLCOM_SHOW_ENGINE_STATUS;
4805
4793
          }
4806
4794
        | opt_full COLUMNS from_or_in table_ident opt_db show_wild
4809
4797
            lex->sql_command= SQLCOM_SHOW_FIELDS;
4810
4798
            if ($5)
4811
4799
              $4->change_db($5);
4812
 
            if (prepare_schema_table(YYSession, lex, $4, SCH_COLUMNS))
 
4800
            if (prepare_schema_table(YYSession, lex, $4, "COLUMNS"))
4813
4801
              DRIZZLE_YYABORT;
4814
4802
          }
4815
4803
        | keys_or_index from_or_in table_ident opt_db where_clause
4818
4806
            lex->sql_command= SQLCOM_SHOW_KEYS;
4819
4807
            if ($4)
4820
4808
              $3->change_db($4);
4821
 
            if (prepare_schema_table(YYSession, lex, $3, SCH_STATISTICS))
 
4809
            if (prepare_schema_table(YYSession, lex, $3, "STATISTICS"))
4822
4810
              DRIZZLE_YYABORT;
4823
4811
          }
4824
4812
        | COUNT_SYM '(' '*' ')' WARNINGS
4834
4822
            LEX *lex= Lex;
4835
4823
            lex->sql_command= SQLCOM_SHOW_STATUS;
4836
4824
            lex->option_type= $1;
4837
 
            if (prepare_schema_table(YYSession, lex, 0, SCH_STATUS))
 
4825
            if (prepare_schema_table(YYSession, lex, 0, "STATUS"))
4838
4826
              DRIZZLE_YYABORT;
4839
4827
          }
4840
4828
        | opt_full PROCESSLIST_SYM
4844
4832
            LEX *lex= Lex;
4845
4833
            lex->sql_command= SQLCOM_SHOW_VARIABLES;
4846
4834
            lex->option_type= $1;
4847
 
            if (prepare_schema_table(YYSession, lex, 0, SCH_VARIABLES))
 
4835
            if (prepare_schema_table(YYSession, lex, 0, "VARIABLES"))
4848
4836
              DRIZZLE_YYABORT;
4849
4837
          }
4850
4838
        | CREATE DATABASE opt_if_not_exists ident
4904
4892
            lex->sql_command= SQLCOM_SHOW_FIELDS;
4905
4893
            lex->select_lex.db= 0;
4906
4894
            lex->verbose= 0;
4907
 
            if (prepare_schema_table(YYSession, lex, $2, SCH_COLUMNS))
 
4895
            if (prepare_schema_table(YYSession, lex, $2, "COLUMNS"))
4908
4896
              DRIZZLE_YYABORT;
4909
4897
          }
4910
4898
          opt_describe_column {}
5497
5485
        | OPTIONS_SYM           {}
5498
5486
        | PORT_SYM              {}
5499
5487
        | REMOVE_SYM            {}
5500
 
        | REPAIR                {}
5501
5488
        | RESET_SYM             {}
5502
5489
        | ROLLBACK_SYM          {}
5503
5490
        | SAVEPOINT_SYM         {}