1021
1021
| ident_or_text '=' ident_or_text
1023
parser::buildSchemaOption(&Lex, $1.str, $3);
1023
parser::buildSchemaOption(&Lex, $1.data(), $3);
1025
1025
| ident_or_text '=' ulonglong_num
1027
parser::buildSchemaOption(&Lex, $1.str, $3);
1027
parser::buildSchemaOption(&Lex, $1.data(), $3);
1059
1059
custom_engine_option:
1060
1060
ENGINE_SYM '=' ident_or_text
1062
Lex.table()->mutable_engine()->set_name($3.str);
1062
Lex.table()->mutable_engine()->set_name($3.data());
1064
1064
| COMMENT_SYM opt_equal TEXT_STRING_sys
1066
Lex.table()->mutable_options()->set_comment($3.str);
1066
Lex.table()->mutable_options()->set_comment($3.data());
1068
1068
| AUTO_INC opt_equal ulonglong_num
1097
1097
| ident_or_text '=' engine_option_value
1099
parser::buildEngineOption(&Lex, $1.str, $3);
1099
parser::buildEngineOption(&Lex, $1.data(), $3);
1101
1101
| ident_or_text '=' ulonglong_num
1103
parser::buildEngineOption(&Lex, $1.str, $3);
1103
parser::buildEngineOption(&Lex, $1.data(), $3);
1105
1105
| default_charset
1106
1106
| default_collation
1186
1185
| opt_constraint constraint_key_type opt_ident key_alg
1187
1186
'(' key_list ')' key_options
1189
parser::buildKey(&Lex, $2, $3.str ? $3 : $1);
1188
parser::buildKey(&Lex, $2, $3.data() ? $3 : $1);
1191
1190
| opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references
1193
parser::buildForeignKey(&Lex, $1.str ? $1 : $4, $8);
1192
parser::buildForeignKey(&Lex, $1.data() ? $1 : $4, $8);
1195
1194
| constraint opt_check_constraint
1605
1604
statement->comment= $2;
1607
1606
if (Lex.field())
1608
Lex.field()->set_comment($2.str);
1607
Lex.field()->set_comment($2.data());
1612
1611
collation_name:
1615
if (!($$=get_charset_by_name($1.str)))
1614
if (!($$=get_charset_by_name($1.data())))
1617
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.str);
1616
my_error(ER_UNKNOWN_COLLATION, MYF(0), $1.data());
1618
1617
DRIZZLE_YYABORT;
1790
1789
ident { $$=new Key_part_spec($1, 0); }
1791
1790
| ident '(' NUM ')'
1793
int key_part_len= atoi($3.str);
1792
int key_part_len= atoi($3.data());
1794
1793
if (!key_part_len)
1796
my_error(ER_KEY_PART_0, MYF(0), $1.str);
1795
my_error(ER_KEY_PART_0, MYF(0), $1.data());
1798
1797
$$=new Key_part_spec($1, (uint) key_part_len);
1939
1943
statement->default_value,
1940
1944
statement->on_update_value,
1941
1945
&statement->comment,
1942
$3.str, &Lex.interval_list, Lex.charset))
1946
$3.data(), &Lex.interval_list, Lex.charset))
1943
1947
DRIZZLE_YYABORT;
1951
1955
message::AlterTable::AlterTableOperation *operation;
1952
1956
operation= Lex.alter_table()->add_operations();
1953
1957
operation->set_operation(message::AlterTable::AlterTableOperation::DROP_COLUMN);
1954
operation->set_drop_name($3.str);
1958
operation->set_drop_name($3.data());
1956
1960
| DROP FOREIGN KEY_SYM opt_ident
1958
parser::buildAddAlterDropIndex(&Lex, $4.str, true);
1962
parser::buildAddAlterDropIndex(&Lex, $4.data(), true);
1960
1964
| DROP PRIMARY_SYM KEY_SYM
1989
1993
statement::AlterTable *statement= (statement::AlterTable *)Lex.statement;
1991
statement->alter_info.alter_list.push_back(AlterColumn($3.str,$6));
1995
statement->alter_info.alter_list.push_back(AlterColumn($3.data(),$6));
1992
1996
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1994
1998
| ALTER_SYM opt_column field_ident DROP DEFAULT
1996
2000
statement::AlterTable *statement= (statement::AlterTable *)Lex.statement;
1998
statement->alter_info.alter_list.push_back(AlterColumn($3.str, (Item*) 0));
2002
statement->alter_info.alter_list.push_back(AlterColumn($3.data(), NULL));
1999
2003
statement->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
2001
2005
| RENAME opt_to table_ident
2003
2007
statement::AlterTable *statement= (statement::AlterTable *)Lex.statement;
2006
Lex.select_lex.db=$3->db.str;
2007
if (Lex.select_lex.db == NULL &&
2008
Lex.session->copy_db_to(Lex.select_lex.db, dummy))
2008
Lex.select_lex.db= $3->db.data();
2009
if (not Lex.select_lex.db)
2011
str_ref db = Lex.session->copy_db_to();
2014
Lex.select_lex.db = db.data();
2013
if (check_table_name($3->table.str,$3->table.length))
2017
if (check_table_name($3->table.data(), $3->table.size()))
2015
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);
2019
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.data());
2016
2020
DRIZZLE_YYABORT;
2022
2026
message::AlterTable::RenameTable *rename_operation;
2023
2027
rename_operation= Lex.alter_table()->mutable_rename();
2024
2028
rename_operation->set_to_schema(Lex.select_lex.db);
2025
rename_operation->set_to_name(Lex.name.str);
2029
rename_operation->set_to_name(Lex.name.data());
2027
2031
| CONVERT_SYM TO_SYM collation_name_or_default
2342
2346
YYSession->add_item_to_list($2);
2346
2350
$2->is_autogenerated_name= false;
2347
$2->set_name($4.str, $4.length, system_charset_info);
2351
$2->set_name($4.data(), $4.size(), system_charset_info);
2349
2353
else if (!$2->name)
2686
2690
| function_call_conflict
2687
2691
| simple_expr COLLATE_SYM ident_or_text %prec UMINUS
2689
Item *i1= new (YYSession->mem_root) Item_string($3.str,
2691
YYSession->charset());
2693
Item *i1= new (YYSession->mem_root) Item_string($3.data(), $3.size(), YYSession->charset());
2692
2694
$$= new (YYSession->mem_root) Item_func_set_collation($1, i1);
3114
3116
/* fix for bug 250065, from Andrew Garner <muzazzi@gmail.com> */
3115
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", $1.str);
3117
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "FUNCTION", $1.data());
3118
3120
if (not ($$= item))
3150
3152
because the syntax will not allow having an explicit name here.
3151
3153
See WL#1017 re. udf attributes.
3155
3157
$2->is_autogenerated_name= false;
3156
$2->set_name($4.str, $4.length, system_charset_info);
3158
$2->set_name($4.data(), $4.size(), system_charset_info);
3159
3161
$2->set_name($1, (uint) ($3 - $1), YYSession->charset());
3827
3829
$$= new List<String>;
3828
$$->push_back(new (YYSession->mem_root) String($1.str, $1.length, system_charset_info));
3830
$$->push_back(new (YYSession->mem_root) String($1.data(), $1.size(), system_charset_info));
3830
3832
| using_list ',' ident
3832
$1->push_back(new (YYSession->mem_root) String($3.str, $3.length, system_charset_info));
3834
$1->push_back(new (YYSession->mem_root) String($3.data(), $3.size(), system_charset_info));
4083
ULONGLONG_NUM { $$= new Item_uint($1.str, $1.length); }
4084
| LONG_NUM { $$= new Item_uint($1.str, $1.length); }
4085
| NUM { $$= new Item_uint($1.str, $1.length); }
4085
ULONGLONG_NUM { $$= new Item_uint($1.data(), $1.size()); }
4086
| LONG_NUM { $$= new Item_uint($1.data(), $1.size()); }
4087
| NUM { $$= new Item_uint($1.data(), $1.size()); }
4088
4090
delete_limit_clause:
4102
NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, NULL, &error); }
4103
| HEX_NUM { $$= (unsigned long) strtol($1.str, NULL, 16); }
4104
| LONG_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, NULL, &error); }
4105
| ULONGLONG_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, NULL, &error); }
4106
| DECIMAL_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, NULL, &error); }
4107
| FLOAT_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.str, NULL, &error); }
4104
NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.data(), NULL, &error); }
4105
| HEX_NUM { $$= (unsigned long) strtol($1.data(), NULL, 16); }
4106
| LONG_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.data(), NULL, &error); }
4107
| ULONGLONG_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.data(), NULL, &error); }
4108
| DECIMAL_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.data(), NULL, &error); }
4109
| FLOAT_NUM { int error; $$= (unsigned long) internal::my_strtoll10($1.data(), NULL, &error); }
4111
NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.str, NULL, &error); }
4112
| ULONGLONG_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.str, NULL, &error); }
4113
| LONG_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.str, NULL, &error); }
4114
| DECIMAL_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.str, NULL, &error); }
4115
| FLOAT_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.str, NULL, &error); }
4113
NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.data(), NULL, &error); }
4114
| ULONGLONG_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.data(), NULL, &error); }
4115
| LONG_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.data(), NULL, &error); }
4116
| DECIMAL_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.data(), NULL, &error); }
4117
| FLOAT_NUM { int error; $$= (uint64_t) internal::my_strtoll10($1.data(), NULL, &error); }
4118
4120
select_var_list_init:
4157
4159
OUTFILE TEXT_STRING_filesystem
4159
4161
Lex.setCacheable(false);
4160
Lex.exchange= new file_exchange($2.str, 0);
4162
Lex.exchange= new file_exchange($2.data(), 0);
4161
4163
Lex.result= new select_export(Lex.exchange);
4163
4165
opt_field_term opt_line_term
4203
4205
message::AlterTable::AlterTableOperation *operation;
4204
4206
operation= Lex.alter_table()->add_operations();
4205
4207
operation->set_operation(message::AlterTable::AlterTableOperation::DROP_KEY);
4206
operation->set_drop_name($4.str);
4208
operation->set_drop_name($4.data());
4209
4211
| DROP DATABASE if_exists schema_name
4911
4913
TEXT_STRING_literal
4913
$$ = new Item_string($1.str, $1.length, YYSession->variables.getCollation());
4915
$$ = new Item_string($1.data(), $1.size(), YYSession->variables.getCollation());
4915
4917
| text_literal TEXT_STRING_literal
4917
((Item_string*) $1)->append($2.str, $2.length);
4919
((Item_string*) $1)->append($2);
4922
4924
TEXT_STRING_literal
4924
$$= new (YYSession->mem_root) String($1.str,
4926
YYSession->variables.getCollation());
4926
$$= new (YYSession->mem_root) String($1.data(), $1.size(), YYSession->variables.getCollation());
4930
Item *tmp= new Item_hex_string($1.str, $1.length);
4930
Item *tmp= new Item_hex_string($1);
4932
4932
it is OK only emulate fix_fields, because we need only
4933
4933
value of constant
4969
4969
| FALSE_SYM { $$= new drizzled::item::False(); }
4970
4970
| TRUE_SYM { $$= new drizzled::item::True(); }
4971
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
4972
| BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
4971
| HEX_NUM { $$ = new Item_hex_string($1);}
4972
| BIN_NUM { $$= new Item_bin_string($1.data(), $1.size()); }
4973
4973
| DATE_SYM text_literal { $$ = $2; }
4974
4974
| TIMESTAMP_SYM text_literal { $$ = $2; }
4977
4977
integer_literal:
4978
4978
text_literal { $$ = $1; }
4979
| HEX_NUM { $$ = new Item_hex_string($1.str, $1.length);}
4980
| BIN_NUM { $$= new Item_bin_string($1.str, $1.length); }
4979
| HEX_NUM { $$ = new Item_hex_string($1);}
4980
| BIN_NUM { $$= new Item_bin_string($1.data(), $1.size()); }
4981
4981
| NUM_literal { $$ = $1; }
5027
$$ = new Item_int($1.str, (int64_t) internal::my_strtoll10($1.str, NULL, &error), $1.length);
5027
$$ = new Item_int($1.data(), internal::my_strtoll10($1.data(), NULL, &error), $1.size());
5032
$$ = new Item_int($1.str, (int64_t) internal::my_strtoll10($1.str, NULL, &error), $1.length);
5032
$$ = new Item_int($1.data(), internal::my_strtoll10($1.data(), NULL, &error), $1.size());
5034
5034
| ULONGLONG_NUM
5035
{ $$ = new Item_uint($1.str, $1.length); }
5035
{ $$ = new Item_uint($1.data(), $1.size()); }
5038
$$= new Item_decimal($1.str, $1.length, YYSession->charset());
5038
$$= new Item_decimal($1.data(), $1.size(), YYSession->charset());
5039
5039
if (YYSession->is_error())
5041
5041
DRIZZLE_YYABORT;
5156
5156
const charset_info_st * const cs= system_charset_info;
5157
5157
int dummy_error;
5158
uint32_t wlen= cs->cset->well_formed_len(cs, $1.str,
5160
$1.length, &dummy_error);
5161
if (wlen < $1.length)
5158
uint32_t wlen= cs->cset->well_formed_len(cs, $1.begin(), $1.end(), $1.size(), &dummy_error);
5159
if (wlen < $1.size())
5163
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
5164
cs->csname, $1.str + wlen);
5161
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), cs->csname, $1.data() + wlen);
5165
5162
DRIZZLE_YYABORT;