Skip to content

Commit

Permalink
SQL: NOT NULL for implicit fields (fixes #46)
Browse files Browse the repository at this point in the history
  • Loading branch information
midenok committed Oct 15, 2016
1 parent e349e76 commit 5de65ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6341,20 +6341,21 @@ static bool create_sys_trx_field(THD *thd, const char *field_name,
if (!f)
return true;

memset(f, 0, sizeof(*f));
f->field_name= field_name;
f->charset= system_charset_info;
if (integer_fields)
{
f->sql_type= MYSQL_TYPE_LONGLONG;
f->flags= UNSIGNED_FLAG;
f->flags= UNSIGNED_FLAG | NOT_NULL_FLAG;
f->length= MY_INT64_NUM_DECIMAL_DIGITS;
}
else
{
f->sql_type= MYSQL_TYPE_TIMESTAMP2;
f->flags= NOT_NULL_FLAG;
f->length= 6;
}
f->decimals= 0;

if (f->check(thd))
return true;
Expand Down

0 comments on commit 5de65ef

Please sign in to comment.