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

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2023-09-11 11:29:31 +03:00
83 changed files with 1045 additions and 22797 deletions

View File

@ -931,7 +931,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
same table in the same connection.
*/
if (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
values_list.elements > 1)
!table->s->long_unique_table && values_list.elements > 1)
{
using_bulk_insert= 1;
table->file->ha_start_bulk_insert(values_list.elements);
@ -3516,7 +3516,7 @@ bool Delayed_insert::handle_inserts(void)
we get a crash, then binary log will contain rows that are not yet
written to disk, which will cause problems in replication.
*/
if (!using_bin_log)
if (!using_bin_log && !table->s->long_unique_table)
table->file->extra(HA_EXTRA_WRITE_CACHE);
mysql_mutex_lock(&mutex);
@ -3676,7 +3676,7 @@ bool Delayed_insert::handle_inserts(void)
table->s->table_name.str);
goto err;
}
if (!using_bin_log)
if (!using_bin_log && !table->s->long_unique_table)
table->file->extra(HA_EXTRA_WRITE_CACHE);
mysql_mutex_lock(&mutex);
THD_STAGE_INFO(&thd, stage_insert);
@ -4053,7 +4053,8 @@ int select_insert::prepare2(JOIN *)
if (thd->lex->describe)
DBUG_RETURN(0);
if (thd->lex->current_select->options & OPTION_BUFFER_RESULT &&
thd->locked_tables_mode <= LTM_LOCK_TABLES)
thd->locked_tables_mode <= LTM_LOCK_TABLES &&
!table->s->long_unique_table)
table->file->ha_start_bulk_insert((ha_rows) 0);
/* Same as the other variants of INSERT */
@ -4802,13 +4803,16 @@ select_create::prepare(List<Item> &_values, SELECT_LEX_UNIT *u)
table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE);
if (info.handle_duplicates == DUP_UPDATE)
table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE);
if (thd->locked_tables_mode <= LTM_LOCK_TABLES)
if (thd->locked_tables_mode <= LTM_LOCK_TABLES &&
!table->s->long_unique_table)
{
table->file->ha_start_bulk_insert((ha_rows) 0);
table->file->extra(HA_EXTRA_WRITE_CACHE);
}
thd->abort_on_warning= !info.ignore && thd->is_strict_mode();
if (check_that_all_fields_are_given_values(thd, table, table_list))
DBUG_RETURN(1);
table->mark_columns_needed_for_insert();
table->file->extra(HA_EXTRA_WRITE_CACHE);
// Mark table as used
table->query_id= thd->query_id;
DBUG_RETURN(0);