1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '11.2' into 11.4

This commit is contained in:
Oleksandr Byelkin
2024-10-30 09:24:04 +01:00
734 changed files with 10187 additions and 4442 deletions

View File

@ -279,7 +279,8 @@ static int check_insert_fields(THD *thd, TABLE_LIST *table_list,
unfix_fields(fields);
res= setup_fields(thd, Ref_ptr_array(),
fields, MARK_COLUMNS_WRITE, 0, NULL, 0);
fields, MARK_COLUMNS_WRITE, 0, NULL, 0,
THD_WHERE::INSERT_LIST);
/* Restore the current context. */
ctx_state.restore_state(context, table_list);
@ -395,7 +396,8 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
/* Check the fields we are going to modify */
if (setup_fields(thd, Ref_ptr_array(),
update_fields, MARK_COLUMNS_WRITE, 0, NULL, 0))
update_fields, MARK_COLUMNS_WRITE, 0, NULL, 0,
THD_WHERE::UPDATE_CLAUSE))
{
thd->lex->sql_command= sql_command_save;
return -1;
@ -1756,8 +1758,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
context->resolve_in_table_list_only(table_list);
res= setup_returning_fields(thd, table_list) ||
setup_fields(thd, Ref_ptr_array(),
*values, MARK_COLUMNS_READ, 0, NULL, 0) ||
setup_fields(thd, Ref_ptr_array(), *values, MARK_COLUMNS_READ, 0,
NULL, 0, THD_WHERE::VALUES_CLAUSE) ||
check_insert_fields(thd, context->table_list, fields, *values,
!insert_into_view, 0, &map);
@ -1877,10 +1879,6 @@ int vers_insert_history_row(TABLE *table)
if (row_start->cmp(row_start->ptr, row_end->ptr) >= 0)
return 0;
if (table->vfield &&
table->update_virtual_fields(table->file, VCOL_UPDATE_FOR_READ))
return HA_ERR_GENERIC;
return table->file->ha_write_row(table->record[0]);
}
@ -3299,7 +3297,6 @@ pthread_handler_t handle_delayed_insert(void *arg)
else
{
DBUG_ENTER("handle_delayed_insert");
thd->thread_stack= (char*) &thd;
if (init_thr_lock())
{
thd->get_stmt_da()->set_error_status(ER_OUT_OF_RESOURCES);
@ -4093,7 +4090,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
}
res= res || setup_fields(thd, Ref_ptr_array(), *info.update_values,
MARK_COLUMNS_READ, 0, NULL, 0) ||
MARK_COLUMNS_READ, 0, NULL, 0,
THD_WHERE::UPDATE_CLAUSE) ||
/*
Check that all col=expr pairs are compatible for assignment in
INSERT INTO t1 SELECT ... FROM t2
@ -4621,20 +4619,14 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
bool save_table_creation_was_logged;
DBUG_ENTER("select_create::create_table_from_items");
tmp_table.reset();
tmp_table.s= &share;
init_tmp_table_share(thd, &share, "", 0, "", "");
tmp_table.s->db_create_options=0;
tmp_table.null_row= 0;
tmp_table.maybe_null= 0;
tmp_table.in_use= thd;
if (!(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
promote_first_timestamp_column(&alter_info->create_list);
if (create_info->fix_create_fields(thd, alter_info, *table_list))
DBUG_RETURN(NULL);
while ((item=it++))
{
Field *tmp_field= item->create_field_for_create_select(thd->mem_root,
@ -4672,6 +4664,9 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
alter_info->create_list.push_back(cr_field, thd->mem_root);
}
if (create_info->fix_create_fields(thd, alter_info, *table_list))
DBUG_RETURN(NULL);
/*
Item*::type_handler() always returns pointers to
type_handler_{time2|datetime2|timestamp2} no matter what