mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
SQL: NOT NULL for implicit fields (fixes #46)
This commit is contained in:
@@ -6567,20 +6567,21 @@ static bool create_sys_trx_field(THD *thd, const char *field_name,
|
|||||||
if (!f)
|
if (!f)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
memset(f, 0, sizeof(*f));
|
||||||
f->field_name= field_name;
|
f->field_name= field_name;
|
||||||
f->charset= system_charset_info;
|
f->charset= system_charset_info;
|
||||||
if (integer_fields)
|
if (integer_fields)
|
||||||
{
|
{
|
||||||
f->sql_type= MYSQL_TYPE_LONGLONG;
|
f->sql_type= MYSQL_TYPE_LONGLONG;
|
||||||
f->flags= UNSIGNED_FLAG;
|
f->flags= UNSIGNED_FLAG | NOT_NULL_FLAG;
|
||||||
f->length= MY_INT64_NUM_DECIMAL_DIGITS;
|
f->length= MY_INT64_NUM_DECIMAL_DIGITS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f->sql_type= MYSQL_TYPE_TIMESTAMP2;
|
f->sql_type= MYSQL_TYPE_TIMESTAMP2;
|
||||||
|
f->flags= NOT_NULL_FLAG;
|
||||||
f->length= 6;
|
f->length= 6;
|
||||||
}
|
}
|
||||||
f->decimals= 0;
|
|
||||||
|
|
||||||
if (f->check(thd))
|
if (f->check(thd))
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user