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

Merge branch '10.7' into 10.8

This commit is contained in:
Oleksandr Byelkin
2022-02-04 14:50:25 +01:00
907 changed files with 20182 additions and 6211 deletions

View File

@ -1762,14 +1762,13 @@ int ha_commit_trans(THD *thd, bool all)
#endif
TR_table trt(thd, true);
if (trt.update(trx_start_id, trx_end_id))
#ifdef WITH_WSREP
{
#ifdef WITH_WSREP
thd->variables.wsrep_on= saved_wsrep_on;
#endif
(void) trans_rollback_stmt(thd);
goto err;
#ifdef WITH_WSREP
}
#endif
// Here, the call will not commit inside InnoDB. It is only working
// around closing thd->transaction.stmt open by TR_table::open().
if (all)
@ -2203,7 +2202,8 @@ int ha_rollback_trans(THD *thd, bool all)
Thanks to possibility of MDL deadlock rollback request can come even if
transaction hasn't been started in any transactional storage engine.
*/
if (thd->transaction_rollback_request)
if (thd->transaction_rollback_request &&
thd->transaction->xid_state.is_explicit_XA())
thd->transaction->xid_state.set_error(thd->get_stmt_da()->sql_errno());
thd->has_waiter= false;
@ -4535,6 +4535,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_COMMIT_ERROR:
textno= ER_ERROR_DURING_COMMIT;
break;
case HA_ERR_PARTITION_LIST:
my_error(ER_VERS_NOT_ALLOWED, errflag, table->s->db.str, table->s->table_name.str);
DBUG_VOID_RETURN;
default:
{
/* The error was "unknown" to this function.
@ -8304,6 +8307,8 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
List_iterator<Create_field> it(alter_info->create_list);
while (Create_field *f= it++)
{
if (f->vers_sys_field())
continue;
if ((f->versioning == Column_definition::VERSIONING_NOT_SET && !add_versioning) ||
f->versioning == Column_definition::WITHOUT_VERSIONING)
{
@ -8325,9 +8330,10 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields(
if (!(options & HA_VERSIONED_TABLE))
return false;
uint versioned_fields= 0;
if (!(alter_info->flags & ALTER_DROP_SYSTEM_VERSIONING))
{
uint versioned_fields= 0;
uint fieldnr= 0;
List_iterator<Create_field> field_it(alter_info->create_list);
while (Create_field *f= field_it++)
@ -8358,7 +8364,7 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields(
}
}
if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING))
if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING) && !versioned_fields)
return false;
return vers_info.check_sys_fields(table_name, db, alter_info);