835
835
!(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
836
836
(type == DRIZZLE_TYPE_TIMESTAMP or type == DRIZZLE_TYPE_MICROTIME)))
838
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
838
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->data());
841
841
else if (default_value->type() == Item::NULL_ITEM)
843
843
default_value= 0;
844
844
if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG)
846
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
846
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->data());
850
850
else if (type_modifier & AUTO_INCREMENT_FLAG)
852
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
852
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->data());
857
857
if (on_update_value && (type != DRIZZLE_TYPE_TIMESTAMP and type != DRIZZLE_TYPE_MICROTIME))
859
my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name->str);
859
my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name->data());
863
863
CreateField* new_field= new CreateField;
864
if (new_field->init(session, field_name->str, type, length, decimals, type_modifier, *comment, change, interval_list, cs, 0, column_format)
864
if (new_field->init(session, field_name->data(), type, length, decimals, type_modifier, *comment, change, interval_list, cs, 0, column_format)
865
865
|| new_field->setDefaultValue(default_value, on_update_value))
906
906
return NULL; // End of memory
907
const char* alias_str= alias ? alias->str : table->table.data();
907
const char* alias_str= alias ? alias->data() : table->table.data();
908
908
if (! table_options.test(TL_OPTION_ALIAS) &&
909
909
check_table_name(table->table.data(), table->table.length))
957
957
ptr->derived= table->sel;
958
958
ptr->select_lex= lex->current_select;
959
959
ptr->index_hints= index_hints_arg;
960
ptr->option= option ? option->str : 0;
960
ptr->option= option ? option->data() : NULL;
961
961
/* check that used name is unique */
962
962
if (lock_type != TL_IGNORE)
1561
1561
int well_formed_error;
1562
uint32_t res= cs->cset->well_formed_len(cs, str->str, str->str + str->length,
1562
uint32_t res= cs->cset->well_formed_len(cs, str->begin(), str->end(),
1563
1563
max_char_length, &well_formed_error);
1565
1565
if (!well_formed_error && str->length == res)
1569
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_char_length);
1569
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->data(), err_msg, max_char_length);
1583
1583
const charset_info_st * const cs= &my_charset_utf8mb4_general_ci;
1585
1585
int well_formed_error;
1586
uint32_t res= cs->cset->well_formed_len(cs, str->str, str->str + str->length,
1586
uint32_t res= cs->cset->well_formed_len(cs, str->begin(), str->end(),
1587
1587
max_char_length, &well_formed_error);
1589
1589
if (well_formed_error)
1591
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), "identifier", str->str);
1591
my_error(ER_INVALID_CHARACTER_STRING, MYF(0), "identifier", str->data());
1602
1602
case ER_WRONG_STRING_LENGTH:
1603
my_error(err_code, MYF(0), str->str, param_for_err_msg, max_char_length);
1603
my_error(err_code, MYF(0), str->data(), param_for_err_msg, max_char_length);
1605
1605
case ER_TOO_LONG_IDENT:
1606
my_error(err_code, MYF(0), str->str);
1606
my_error(err_code, MYF(0), str->data());