mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Enable warnings for 'no default' fields being set to default when they
are not specified in an insert. Most of these changes are actually to clean up the test suite to either specify defaults to avoid warnings, or add the warnings to the results. Related to bug #5986.
This commit is contained in:
@ -881,19 +881,20 @@ err:
|
||||
|
||||
int check_that_all_fields_are_given_values(THD *thd, TABLE *entry)
|
||||
{
|
||||
if (!thd->abort_on_warning) // No check if not strict mode
|
||||
return 0;
|
||||
|
||||
int err= 0;
|
||||
for (Field **field=entry->field ; *field ; field++)
|
||||
{
|
||||
if ((*field)->query_id != thd->query_id &&
|
||||
((*field)->flags & NO_DEFAULT_VALUE_FLAG))
|
||||
{
|
||||
my_error(ER_NO_DEFAULT_FOR_FIELD, MYF(0), (*field)->field_name);
|
||||
return 1;
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_NO_DEFAULT_FOR_FIELD,
|
||||
ER(ER_NO_DEFAULT_FOR_FIELD),
|
||||
(*field)->field_name);
|
||||
err= 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return thd->abort_on_warning ? err : 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
Reference in New Issue
Block a user