Commit 13901daf authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup

parent fe44d46a
......@@ -8930,8 +8930,7 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
table->auto_increment_field_not_null= TRUE;
const bool skip_sys_field= rfield->vers_sys_field() &&
(update || table->versioned(VERS_TRX_ID) ||
!(thd->variables.option_bits & OPTION_INSERT_HISTORY));
(update || !thd->vers_insert_history_fast(table));
if ((rfield->vcol_info || skip_sys_field) &&
!value->vcol_assignment_allowed_value() &&
......@@ -9217,8 +9216,7 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List<Item> &values,
DBUG_ASSERT(value);
const bool skip_sys_field= field->vers_sys_field() &&
(table->versioned(VERS_TRX_ID) ||
!(thd->variables.option_bits & OPTION_INSERT_HISTORY));
!thd->vers_insert_history_fast(table);
if (field->field_index == autoinc_index)
table->auto_increment_field_not_null= TRUE;
......
......@@ -5575,14 +5575,18 @@ class THD: public THD_count, /* this must be first */
lex= backup_lex;
}
bool vers_insert_history_fast(const TABLE *table)
{
DBUG_ASSERT(table->versioned());
return table->versioned(VERS_TIMESTAMP) &&
(variables.option_bits & OPTION_INSERT_HISTORY);
}
bool vers_insert_history(const Field *field)
{
if (!field->vers_sys_field())
return false;
DBUG_ASSERT(field->table->versioned());
if (field->table->versioned(VERS_TRX_ID))
return false;
if (!(variables.option_bits & OPTION_INSERT_HISTORY))
if (!vers_insert_history_fast(field->table))
return false;
if (lex->sql_command != SQLCOM_INSERT &&
lex->sql_command != SQLCOM_INSERT_SELECT &&
......
......@@ -898,10 +898,8 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
For single line insert, generate an error if try to set a NOT NULL field
to NULL.
*/
thd->count_cuted_fields= ((values_list.elements == 1 &&
!ignore) ?
CHECK_FIELD_ERROR_FOR_NULL :
CHECK_FIELD_WARN);
thd->count_cuted_fields= (values_list.elements == 1 && !ignore)
? CHECK_FIELD_ERROR_FOR_NULL : CHECK_FIELD_WARN;
thd->cuted_fields = 0L;
table->next_number_field=table->found_next_number_field;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment