Skip to content
  • Daogang Qu's avatar
    c9d222bb
    Bug #20748502 ASSERTION `THD->VARIABLES.GTID_NEXT.TYPE== ANONYMOUS_GROUP' FAILED. · c9d222bb
    Daogang Qu authored
    Problem 1: In row binlog format, when autocommit is disabled and
    @@GLOBAL.GTID_MODE=OFF_PERMISSIVE, setting GTID_NEXT='UUID:NUMBER'
    was causing the assertion failure, right afte committing the
    single statement 'CREATE TEMPORARY TABLE' transaction. The root
    cause is that the statement 'CREATE TEMPORARY TABLE' sets
    has_gtid_consistency_violation to true, so that we call
    end_gtid_violating_transaction(...) to check a possible violation
    of gtid consistency and set it back to false on committing the
    transaction later, but the single statement transaction missed
    to call end_gtid_violating_transaction(...), since the binlog
    transaction cache is empty on committing the transaction. Which
    causes the next transaction to cause the assertion failure.
    Problem 2: When autocommit is disabled, the statement
    'CREATE TEMPORARY TABLE' does not start a transaction, so setting
    GTID_NEXT='UUID:NUMBER' can not cause an error right after it.
    
    To fix the first problem, A transaction with an empty owned gtid
    should call end_gtid_violating_transaction(...) to check a
    possible violation of gtid consistency and set
    has_gtid_consistency_violation back to false on commit, if it has
    set has_gtid_consistency_violation to true.
    To fix the second problem, when autocommit is disabled,
    'CREATE/DROP TEMPORARY TABLE' sets SERVER_STATUS_IN_TRANS to start
    transaction in any case (regardless of binlog=on/off, binlog format
    and transactional/non-transactional engine) to make behavior
    consistent. Which is changing user-visible behavior when binary log
    is disabled.
    c9d222bb
    Bug #20748502 ASSERTION `THD->VARIABLES.GTID_NEXT.TYPE== ANONYMOUS_GROUP' FAILED.
    Daogang Qu authored
    Problem 1: In row binlog format, when autocommit is disabled and
    @@GLOBAL.GTID_MODE=OFF_PERMISSIVE, setting GTID_NEXT='UUID:NUMBER'
    was causing the assertion failure, right afte committing the
    single statement 'CREATE TEMPORARY TABLE' transaction. The root
    cause is that the statement 'CREATE TEMPORARY TABLE' sets
    has_gtid_consistency_violation to true, so that we call
    end_gtid_violating_transaction(...) to check a possible violation
    of gtid consistency and set it back to false on committing the
    transaction later, but the single statement transaction missed
    to call end_gtid_violating_transaction(...), since the binlog
    transaction cache is empty on committing the transaction. Which
    causes the next transaction to cause the assertion failure.
    Problem 2: When autocommit is disabled, the statement
    'CREATE TEMPORARY TABLE' does not start a transaction, so setting
    GTID_NEXT='UUID:NUMBER' can not cause an error right after it.
    
    To fix the first problem, A transaction with an empty owned gtid
    should call end_gtid_violating_transaction(...) to check a
    possible violation of gtid consistency and set
    has_gtid_consistency_violation back to false on commit, if it has
    set has_gtid_consistency_violation to true.
    To fix the second problem, when autocommit is disabled,
    'CREATE/DROP TEMPORARY TABLE' sets SERVER_STATUS_IN_TRANS to start
    transaction in any case (regardless of binlog=on/off, binlog format
    and transactional/non-transactional engine) to make behavior
    consistent. Which is changing user-visible behavior when binary log
    is disabled.
Loading