1190
1186
opt_create_database_options:
1192
1188
| default_collation_schema {}
1189
| opt_database_custom_options {}
1192
opt_database_custom_options:
1193
custom_database_option
1194
| custom_database_option ',' opt_database_custom_options
1197
custom_database_option:
1200
statement::CreateSchema *statement= (statement::CreateSchema *)Lex->statement;
1201
drizzled::message::Schema::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
1203
opt->set_name($1.str);
1205
| ident_or_text equal ident_or_text
1207
statement::CreateSchema *statement= (statement::CreateSchema *)Lex->statement;
1208
drizzled::message::Schema::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
1210
opt->set_name($1.str);
1211
opt->set_state($3.str);
1213
| ident_or_text equal ulonglong_num
1215
statement::CreateSchema *statement= (statement::CreateSchema *)Lex->statement;
1216
char number_as_string[22];
1218
snprintf(number_as_string, sizeof(number_as_string), "%"PRIu64, $3);
1220
drizzled::message::Schema::Engine::Option *opt= statement->schema_message.mutable_engine()->add_options();
1222
opt->set_name($1.str);
1223
opt->set_state(number_as_string);
1195
1227
opt_table_options:
1216
1248
create_table_option
1217
1249
| create_table_option create_table_options
1218
1250
| create_table_option ',' create_table_options
1221
1252
create_table_option:
1222
ENGINE_SYM opt_equal ident_or_text
1253
custom_engine_option;
1255
custom_engine_option:
1256
ENGINE_SYM equal ident_or_text
1224
1258
statement::CreateTable *statement= (statement::CreateTable *)Lex->statement;
1225
1259
message::Table::StorageEngine *protoengine;
1247
1281
statement->create_info.used_fields|= HA_CREATE_USED_AUTO;
1248
1282
tableopts->set_auto_increment_value($3);
1250
| ROW_FORMAT_SYM opt_equal row_types
1252
statement::CreateTable *statement= (statement::CreateTable *)Lex->statement;
1253
message::Table::TableOptions *table_options= statement->createTableMessage().mutable_options();
1255
statement->create_info.row_type= $3;
1256
statement->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
1257
statement->alter_info.flags.set(ALTER_ROW_FORMAT);
1259
switch(statement->create_info.row_type)
1261
case ROW_TYPE_DEFAULT:
1262
/* No use setting a default row type... just adds redundant info to message */
1264
case ROW_TYPE_FIXED:
1265
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_FIXED);
1267
case ROW_TYPE_DYNAMIC:
1268
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_DYNAMIC);
1270
case ROW_TYPE_COMPRESSED:
1271
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_COMPRESSED);
1273
case ROW_TYPE_REDUNDANT:
1274
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_REDUNDANT);
1276
case ROW_TYPE_COMPACT:
1277
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_COMPACT);
1280
table_options->set_row_type(message::Table::TableOptions::ROW_TYPE_PAGE);
1284
| ident_or_text equal ident_or_text
1286
message::Table::StorageEngine *protoengine;
1287
protoengine= ((statement::CreateTable *)Lex->statement)->create_table_message.mutable_engine();
1289
drizzled::message::Table::StorageEngine::EngineOption *opt= protoengine->add_options();
1291
opt->set_name($1.str);
1292
opt->set_state($3.str);
1294
| ident_or_text equal ulonglong_num
1296
char number_as_string[22];
1297
snprintf(number_as_string, sizeof(number_as_string), "%"PRIu64, $3);
1299
message::Table::StorageEngine *protoengine;
1300
protoengine= ((statement::CreateTable *)Lex->statement)->create_table_message.mutable_engine();
1302
drizzled::message::Table::StorageEngine::EngineOption *opt= protoengine->add_options();
1303
opt->set_name($1.str);
1304
opt->set_state(number_as_string);
1286
1306
| default_collation
1320
1340
| FIXED_SYM { $$= COLUMN_FORMAT_TYPE_FIXED; }
1321
1341
| DYNAMIC_SYM { $$= COLUMN_FORMAT_TYPE_DYNAMIC; };
1324
DEFAULT { $$= ROW_TYPE_DEFAULT; }
1325
| FIXED_SYM { $$= ROW_TYPE_FIXED; }
1326
| DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
1327
| COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
1328
| REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
1329
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
1330
| PAGE_SYM { $$= ROW_TYPE_PAGE; }
1333
1344
opt_select_from:
1334
1345
opt_limit_clause {}