mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.4 into 10.5
This commit is contained in:
27
sql/field.cc
27
sql/field.cc
@ -1430,6 +1430,9 @@ bool Field::sp_prepare_and_store_item(THD *thd, Item **value)
|
||||
if (!(expr_item= thd->sp_prepare_func_item(value, 1)))
|
||||
goto error;
|
||||
|
||||
if (expr_item->check_is_evaluable_expression_or_error())
|
||||
goto error;
|
||||
|
||||
/*
|
||||
expr_item is now fixed, it's safe to call cmp_type()
|
||||
*/
|
||||
@ -11253,6 +11256,30 @@ bool Field::validate_value_in_record_with_warn(THD *thd, const uchar *record)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Find which reaction should be for IGNORE value.
|
||||
*/
|
||||
|
||||
ignore_value_reaction find_ignore_reaction(THD *thd)
|
||||
{
|
||||
enum_sql_command com= thd->lex->sql_command;
|
||||
|
||||
// All insert-like commands
|
||||
if (com == SQLCOM_INSERT || com == SQLCOM_REPLACE ||
|
||||
com == SQLCOM_INSERT_SELECT || com == SQLCOM_REPLACE_SELECT ||
|
||||
com == SQLCOM_LOAD)
|
||||
{
|
||||
return IGNORE_MEANS_DEFAULT;
|
||||
}
|
||||
// Update commands
|
||||
if (com == SQLCOM_UPDATE || com == SQLCOM_UPDATE_MULTI)
|
||||
{
|
||||
return IGNORE_MEANS_FIELD_VALUE;
|
||||
}
|
||||
return IGNORE_MEANS_ERROR;
|
||||
}
|
||||
|
||||
|
||||
bool Field::save_in_field_default_value(bool view_error_processing)
|
||||
{
|
||||
THD *thd= table->in_use;
|
||||
|
Reference in New Issue
Block a user