231
231
constraints->set_is_nullable(field_arg->def->null_value);
234
if (field_arg->comment.length)
234
if (not field_arg->comment.empty())
237
tmp_len= system_charset_info->cset->charpos(system_charset_info,
238
field_arg->comment.str,
239
field_arg->comment.str +
240
field_arg->comment.length,
236
uint32_t tmp_len= system_charset_info->cset->charpos(system_charset_info,
237
field_arg->comment.begin(),
238
field_arg->comment.end(),
241
239
COLUMN_COMMENT_MAXLEN);
243
if (tmp_len < field_arg->comment.length)
241
if (tmp_len < field_arg->comment.size())
245
my_error(ER_WRONG_STRING_LENGTH, MYF(0),
246
field_arg->comment.str,"COLUMN COMMENT",
247
(uint32_t) COLUMN_COMMENT_MAXLEN);
243
my_error(ER_WRONG_STRING_LENGTH, MYF(0), field_arg->comment.data(), "COLUMN COMMENT", (uint32_t) COLUMN_COMMENT_MAXLEN);
251
if (! use_existing_fields)
252
attribute->set_comment(field_arg->comment.str);
247
if (not use_existing_fields)
248
attribute->set_comment(field_arg->comment.data());
254
assert(strcmp(attribute->comment().c_str(), field_arg->comment.str)==0);
250
assert(strcmp(attribute->comment().c_str(), field_arg->comment.data())==0);
257
253
if (field_arg->unireg_check == Field::NEXT_NUMBER)