1196
field_definition opt_attribute {}
1200
int_type ignored_field_number_length opt_field_number_signed opt_zerofill
1202
$$= parser::buildIntegerColumn(Lex, $1, ($3 or $4));
1204
| real_type opt_precision
1206
assert ($1 == DRIZZLE_TYPE_DOUBLE);
1207
$$= parser::buildDoubleColumn(Lex);
1211
$$= parser::buildVarcharColumn(Lex, $3.str);
1215
$$= parser::buildVarcharColumn(Lex, "1");
1217
| varchar '(' NUM ')'
1219
$$= parser::buildVarcharColumn(Lex, $3.str);
1221
| VARBINARY '(' NUM ')'
1223
$$= parser::buildVarbinaryColumn(Lex, $3.str);
1227
$$=DRIZZLE_TYPE_DATE;
1230
Lex->field()->set_type(message::Table::Field::DATE);
1234
$$=DRIZZLE_TYPE_TIME;
1237
Lex->field()->set_type(message::Table::Field::TIME);
1205
TIMESTAMP_SYM opt_attribute_timestamp
1241
1207
$$=parser::buildTimestampColumn(Lex, NULL);
1243
| TIMESTAMP_SYM '(' NUM ')'
1209
| TIMESTAMP_SYM '(' NUM ')' opt_attribute_timestamp
1245
1211
$$=parser::buildTimestampColumn(Lex, $3.str);
1213
| DATETIME_SYM opt_attribute_timestamp
1249
1215
$$=DRIZZLE_TYPE_DATETIME;
1251
1217
if (Lex->field())
1252
1218
Lex->field()->set_type(message::Table::Field::DATETIME);
1256
$$= parser::buildBlobColumn(Lex);
1220
| int_type opt_attribute_number
1224
| CHAR_SYM opt_attribute_string
1226
$$= parser::buildVarcharColumn(Lex, "1");
1228
| varchar '(' NUM ')' opt_attribute_string
1230
$$= parser::buildVarcharColumn(Lex, $3.str);
1232
| TEXT_SYM opt_attribute_string
1260
1234
$$=DRIZZLE_TYPE_BLOB;
1261
1235
Lex->length=(char*) 0; /* use default length */
1264
Lex->field()->set_type(message::Table::Field::BLOB);
1266
| DECIMAL_SYM float_options
1268
$$= parser::buildDecimalColumn(Lex);
1270
| NUMERIC_SYM float_options
1272
$$= parser::buildDecimalColumn(Lex);
1274
| FIXED_SYM float_options
1276
$$= parser::buildDecimalColumn(Lex);
1238
Lex->field()->set_type(message::Table::Field::BLOB);
1280
1242
Lex->interval_list.clear();
1244
'(' string_list ')' opt_attribute_string
1284
1246
$$=DRIZZLE_TYPE_ENUM;
1286
1248
if (Lex->field())
1287
1249
Lex->field()->set_type(message::Table::Field::ENUM);
1251
| VARBINARY '(' NUM ')' opt_attribute
1253
$$= parser::buildVarbinaryColumn(Lex, $3.str);
1255
| real_type opt_attribute_number
1257
assert ($1 == DRIZZLE_TYPE_DOUBLE);
1258
$$= parser::buildDoubleColumn(Lex);
1260
| DATE_SYM opt_attribute
1262
$$=DRIZZLE_TYPE_DATE;
1265
Lex->field()->set_type(message::Table::Field::DATE);
1267
| TIME_SYM opt_attribute
1269
$$=DRIZZLE_TYPE_TIME;
1272
Lex->field()->set_type(message::Table::Field::TIME);
1274
| BLOB_SYM opt_attribute
1276
$$= parser::buildBlobColumn(Lex);
1278
| DECIMAL_SYM float_options opt_attribute_number
1280
$$= parser::buildDecimalColumn(Lex);
1282
| NUMERIC_SYM float_options opt_attribute_number
1284
$$= parser::buildDecimalColumn(Lex);
1286
| FIXED_SYM float_options opt_attribute_number
1288
$$= parser::buildDecimalColumn(Lex);
1290
| UUID_SYM opt_attribute
1291
1292
$$= parser::buildUuidColumn(Lex);
1294
| BOOLEAN_SYM opt_attribute_boolean
1295
1296
$$= parser::buildBooleanColumn(Lex);
1315
$$= DRIZZLE_TYPE_LONG;
1319
$$= DRIZZLE_TYPE_LONG;
1323
$$= DRIZZLE_TYPE_LONGLONG;
1314
INT_SYM ignored_field_number_length opt_field_number_signed opt_zerofill
1316
$$= parser::buildIntegerColumn(Lex, DRIZZLE_TYPE_LONG, ($3 or $4));
1318
| BIGINT_SYM ignored_field_number_length opt_field_number_signed opt_zerofill
1320
$$= parser::buildIntegerColumn(Lex, DRIZZLE_TYPE_LONGLONG, ($3 or $4));
1330
$$= DRIZZLE_TYPE_DOUBLE;
1334
$$= DRIZZLE_TYPE_DOUBLE;
1336
| DOUBLE_SYM PRECISION
1327
$$= DRIZZLE_TYPE_DOUBLE;
1329
| DOUBLE_SYM opt_precision
1331
$$= DRIZZLE_TYPE_DOUBLE;
1333
| DOUBLE_SYM PRECISION opt_precision
1338
1335
$$= DRIZZLE_TYPE_DOUBLE;
1410
1397
Lex->field()->mutable_constraints()->set_is_notnull(true);
1413
| DEFAULT now_or_signed_literal
1415
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1417
statement->default_value=$2;
1418
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1420
| ON UPDATE_SYM NOW_SYM optional_braces
1422
((statement::AlterTable *)Lex->statement)->on_update_value= new Item_func_now_local();
1426
parser::buildAutoOnColumn(Lex);
1428
| SERIAL_SYM DEFAULT VALUE_SYM
1430
(void)parser::buildSerialColumn(Lex);
1432
| opt_primary KEY_SYM
1402
opt_attribute_index:
1434
1405
parser::buildPrimaryOnColumn(Lex);
1442
1413
parser::buildKeyOnColumn(Lex);
1444
| COMMENT_SYM TEXT_STRING_sys
1446
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1447
statement->comment= $2;
1450
Lex->field()->set_comment($2.str);
1419
| opt_attribute opt_attribute_not_null
1421
| opt_attribute DEFAULT signed_literal
1423
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1425
statement->default_value= $3;
1426
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1428
| opt_attribute opt_attribute_index
1432
opt_attribute_boolean:
1434
| opt_attribute_boolean opt_attribute_not_null
1436
| opt_attribute_boolean DEFAULT boolean_literal
1438
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1440
statement->default_value= $3;
1441
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1443
| opt_attribute_boolean opt_attribute_index
1447
opt_attribute_string:
1449
| opt_attribute_list_string {}
1452
opt_attribute_list_string:
1453
opt_attribute_list_string attribute_string {}
1458
opt_attribute_not_null
1460
| DEFAULT signed_literal
1462
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1464
statement->default_value=$2;
1465
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1452
1467
| COLLATE_SYM collation_name
1462
1477
Lex->charset=$2;
1467
now_or_signed_literal:
1468
NOW_SYM optional_braces
1469
{ $$= new Item_func_now_local(); }
1480
| opt_attribute_index
1484
opt_attribute_number:
1486
| opt_attribute_list_integer {}
1489
opt_attribute_list_integer:
1490
opt_attribute_list_integer attribute_integer {}
1495
opt_attribute_not_null
1499
parser::buildAutoOnColumn(Lex);
1501
| SERIAL_SYM DEFAULT VALUE_SYM
1503
(void)parser::buildSerialColumn(Lex);
1505
| DEFAULT integer_literal
1507
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1509
statement->default_value=$2;
1510
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1512
| opt_attribute_index
1516
opt_attribute_timestamp:
1518
| opt_attribute_list_timestamp {}
1521
opt_attribute_list_timestamp:
1522
opt_attribute_list_timestamp attribute_timestamp {}
1523
| attribute_timestamp
1526
attribute_timestamp:
1527
opt_attribute_not_null
1529
| DEFAULT NOW_SYM optional_braces
1531
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1533
statement->default_value= new Item_func_now_local();
1534
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1536
| DEFAULT date_literal
1538
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1540
statement->default_value=$2;
1541
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1543
| ON UPDATE_SYM NOW_SYM optional_braces
1545
((statement::AlterTable *)Lex->statement)->on_update_value= new Item_func_now_local();
1547
| opt_attribute_index
1551
opt_attribute_comment:
1553
| COMMENT_SYM TEXT_STRING_sys
1555
statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1556
statement->comment= $2;
1559
Lex->field()->set_comment($2.str);
1474
1563
collation_name:
2331
2420
| NOT_SYM expr %prec NOT_SYM
2332
2421
{ $$= negate_expression(YYSession, $2); }
2333
2422
| bool_pri IS TRUE_SYM %prec IS
2334
{ $$= new (YYSession->mem_root) Item_func_istrue($1); }
2335
| bool_pri IS not TRUE_SYM %prec IS
2336
{ $$= new (YYSession->mem_root) Item_func_isnottrue($1); }
2424
$$= new (YYSession->mem_root) Item_func_istrue($1);
2426
| bool_pri IS NOT_SYM TRUE_SYM %prec IS
2428
$$= new (YYSession->mem_root) Item_func_isnottrue($1);
2337
2430
| bool_pri IS FALSE_SYM %prec IS
2338
{ $$= new (YYSession->mem_root) Item_func_isfalse($1); }
2339
| bool_pri IS not FALSE_SYM %prec IS
2340
{ $$= new (YYSession->mem_root) Item_func_isnotfalse($1); }
2432
$$= new (YYSession->mem_root) Item_func_isfalse($1);
2434
| bool_pri IS NOT_SYM FALSE_SYM %prec IS
2436
$$= new (YYSession->mem_root) Item_func_isnotfalse($1);
2341
2438
| bool_pri IS UNKNOWN_SYM %prec IS
2342
{ $$= new Item_func_isnull($1); }
2343
| bool_pri IS not UNKNOWN_SYM %prec IS
2344
{ $$= new Item_func_isnotnull($1); }
2440
$$= new Item_func_isnull($1);
2442
| bool_pri IS NOT_SYM UNKNOWN_SYM %prec IS
2444
$$= new Item_func_isnotnull($1);
2349
2450
bool_pri IS NULL_SYM %prec IS
2350
{ $$= new Item_func_isnull($1); }
2351
| bool_pri IS not NULL_SYM %prec IS
2352
{ $$= new Item_func_isnotnull($1); }
2452
$$= new Item_func_isnull($1);
2454
| bool_pri IS NOT_SYM NULL_SYM %prec IS
2456
$$= new Item_func_isnotnull($1);
2353
2458
| bool_pri EQUAL_SYM predicate %prec EQUAL_SYM
2354
{ $$= new Item_func_equal($1,$3); }
2460
$$= new Item_func_equal($1,$3);
2355
2462
| bool_pri comp_op predicate %prec '='
2356
{ $$= (*$2)(0)->create($1,$3); }
2464
$$= (*$2)(0)->create($1,$3);
2357
2466
| bool_pri comp_op all_or_any '(' subselect ')' %prec '='
2358
{ $$= all_any_subquery_creator($1, $2, $3, $5); }
2468
$$= all_any_subquery_creator($1, $2, $3, $5);
2451
2562
$$= new function::bit::ShiftLeft($1, $3);
2453
2564
| bit_expr '+' bit_expr %prec '+'
2454
{ $$= new Item_func_plus($1,$3); }
2566
$$= new Item_func_plus($1,$3);
2455
2568
| bit_expr '-' bit_expr %prec '-'
2456
{ $$= new Item_func_minus($1,$3); }
2570
$$= new Item_func_minus($1,$3);
2457
2572
| bit_expr '+' INTERVAL_SYM expr interval %prec '+'
2458
{ $$= new Item_date_add_interval($1,$4,$5,0); }
2574
$$= new Item_date_add_interval($1,$4,$5,0);
2459
2576
| bit_expr '-' INTERVAL_SYM expr interval %prec '-'
2460
{ $$= new Item_date_add_interval($1,$4,$5,1); }
2578
$$= new Item_date_add_interval($1,$4,$5,1);
2461
2580
| bit_expr '*' bit_expr %prec '*'
2462
{ $$= new Item_func_mul($1,$3); }
2582
$$= new Item_func_mul($1,$3);
2463
2584
| bit_expr '/' bit_expr %prec '/'
2464
{ $$= new Item_func_div(YYSession,$1,$3); }
2586
$$= new Item_func_div(YYSession,$1,$3);
2465
2588
| bit_expr '%' bit_expr %prec '%'
2466
{ $$= new Item_func_mod($1,$3); }
2590
$$= new Item_func_mod($1,$3);
2467
2592
| bit_expr DIV_SYM bit_expr %prec DIV_SYM
2468
{ $$= new Item_func_int_div($1,$3); }
2594
$$= new Item_func_int_div($1,$3);
2469
2596
| bit_expr MOD_SYM bit_expr %prec MOD_SYM
2470
{ $$= new Item_func_mod($1,$3); }
2598
$$= new Item_func_mod($1,$3);
2471
2600
| bit_expr '^' bit_expr
2473
2602
$$= new (YYSession->mem_root) function::bit::Xor($1, $3);
4818
4939
| TIMESTAMP_SYM text_literal { $$ = $2; }
4943
text_literal { $$ = $1; }
4944
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
4945
| BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
4946
| NUM_literal { $$ = $1; }
4949
$$ = new Item_null();
4950
YYSession->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
4952
| '+' NUM_literal { $$ = $2; }
4963
$$ = new Item_null();
4964
YYSession->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
4968
$$= new drizzled::item::False();
4972
$$= new drizzled::item::True();
4977
text_literal { $$ = $1; }
4980
$$ = new Item_null();
4981
YYSession->m_lip->next_state=MY_LEX_OPERATOR_OR_IDENT;
4983
| NUM_literal { $$ = $1; }
4984
| DATE_SYM text_literal { $$ = $2; }
4985
| TIMESTAMP_SYM text_literal { $$ = $2; }