Hi, Nikita! On Apr 03, Nikita Malyavin wrote:
Hi!
IIRC, rw_trans is false when the table was empty
the code inside the if() is for (Ha_trx_info *ha_info= trans->ha_list; ha_info; ha_info= ha_info->next()) { if (ha_info->ht()->prepare_commit_versioned) { trx_end_id= ha_info->ht()->prepare_commit_versioned(thd, &trx_start_id); if (trx_end_id) break; // FIXME: use a common ID for cross-engine transactions } } Are you saying that when the table was empty, rw_trans is false, but ha_list is not empty and innodb->prepare_commit_versioned() returns a non-zero trx_end_id (that is, inside InnoDB, trx->mod_tables is not empty either)?
#if 1 // FIXME: This should be done in ha_prepare(). if (rw_trans || (thd->lex->sql_command == SQLCOM_ALTER_TABLE && - thd->lex->alter_info.flags & ALTER_ADD_SYSTEM_VERSIONING)) + thd->lex->alter_info.flags & ALTER_ADD_SYSTEM_VERSIONING && + is_real_trans))
Why there's a special check for SQLCOM_ALTER_TABLE + ALTER_ADD_SYSTEM_VERSIONING in the first place?
Does it mean that ALTER TABLE ... ADD SYSTEM VERSIONING does not marks a transaction as read/write? That's be weird.
Regards, Sergei Chief Architect MariaDB and security@mariadb.org