~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

Merge of HA_CREATE_INFO simplifications.

AKA... proto now working better!

You start these things... and then you wonder. What problem did I start out
today to solve? Was the store_lock() issues, or was it related to 
TableIdentifiers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
911
911
 
912
912
%type <num>
913
913
        type int_type real_type order_dir field_def
914
 
        if_exists opt_table_options table_options
915
 
        table_option opt_if_not_exists
 
914
        if_exists opt_table_options
 
915
        opt_if_not_exists
916
916
        opt_temporary all_or_any opt_distinct
917
917
        union_option
918
918
        start_transaction_opts opt_chain opt_release
1142
1142
              DRIZZLE_YYABORT;
1143
1143
            lex->col_list.empty();
1144
1144
            statement->change=NULL;
1145
 
            statement->create_info.options=$2 | $4;
 
1145
            statement->is_if_not_exists= $4;
1146
1146
            statement->create_info.db_type= NULL;
1147
1147
            statement->create_info.default_table_charset= NULL;
1148
1148
            lex->name.str= 0;
1150
1150
            message::Table *proto= &statement->create_table_proto;
1151
1151
            
1152
1152
            proto->set_name($5->table.str);
1153
 
            if($2 & HA_LEX_CREATE_TMP_TABLE)
 
1153
            if($2)
1154
1154
              proto->set_type(message::Table::TEMPORARY);
1155
1155
            else
1156
1156
              proto->set_type(message::Table::STANDARD);
1196
1196
            lex->statement= statement;
1197
1197
            if (lex->statement == NULL)
1198
1198
              DRIZZLE_YYABORT;
1199
 
            statement->create_info.options=$3;
 
1199
            statement->is_if_not_exists= $3;
1200
1200
          }
1201
1201
          opt_create_database_options
1202
1202
          {
1214
1214
            LEX *lex= session->lex;
1215
1215
            statement::CreateTable *statement= (statement::CreateTable *)Lex->statement;
1216
1216
 
1217
 
            statement->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
 
1217
            statement->is_create_table_like= true;
1218
1218
            if (!lex->select_lex.add_table_to_list(session, $2, NULL, 0, TL_READ))
1219
1219
              DRIZZLE_YYABORT;
1220
1220
          }
1224
1224
            LEX *lex= session->lex;
1225
1225
            statement::CreateTable *statement= (statement::CreateTable *)Lex->statement;
1226
1226
 
1227
 
            statement->create_info.options|= HA_LEX_CREATE_TABLE_LIKE;
 
1227
            statement->is_create_table_like= true;
1228
1228
            if (!lex->select_lex.add_table_to_list(session, $3, NULL, 0, TL_READ))
1229
1229
              DRIZZLE_YYABORT;
1230
1230
          }
1304
1304
        ;
1305
1305
 
1306
1306
opt_table_options:
1307
 
          /* empty */ { $$= 0; }
1308
 
        | table_options  { $$= $1;}
1309
 
        ;
1310
 
 
1311
 
table_options:
1312
 
          table_option { $$=$1; }
1313
 
        | table_option table_options { $$= $1 | $2; }
1314
 
        ;
1315
 
 
1316
 
table_option:
1317
 
          TEMPORARY_SYM { $$=HA_LEX_CREATE_TMP_TABLE; }
 
1307
          /* empty */ { $$= false; }
 
1308
        | TEMPORARY_SYM { $$= true; }
1318
1309
        ;
1319
1310
 
1320
1311
opt_if_not_exists:
1321
 
          /* empty */ { $$= 0; }
1322
 
        | IF not EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
 
1312
          /* empty */ { $$= false; }
 
1313
        | IF not EXISTS { $$= true; }
1323
1314
        ;
1324
1315
 
1325
1316
opt_create_table_options:
5053
5044
            Lex->statement= statement;
5054
5045
            if (Lex->statement == NULL)
5055
5046
              DRIZZLE_YYABORT;
5056
 
            statement->create_info.options=$3;
 
5047
            statement->is_if_not_exists= $3;
5057
5048
            Lex->name= $4;
5058
5049
          }
5059
5050
        | CREATE TABLE_SYM table_ident