Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24600

performance_schema.events_transactions_history_long.trx_id reports garbage

    XMLWordPrintable

Details

    Description

      The table performance_schema.events_transactions_history_long that was imported from MySQL 5.7.28 to MariaDB Server 10.5.2 may report bogus trx_id values for InnoDB transactions:

      --source include/not_embedded.inc
      --source include/have_perfschema.inc
      --source include/have_innodb.inc
       
      TRUNCATE performance_schema.events_transactions_history_long;
       
      START TRANSACTION WITH CONSISTENT SNAPSHOT;
      COMMIT;
      BEGIN;
      SELECT COUNT(*)>=0 FROM mysql.innodb_index_stats LOCK IN SHARE MODE;
      COMMIT;
       
      SELECT state,trx_id,gtid
      FROM performance_schema.events_transactions_history_long;
      

      For the first reported row, the trx_id may not be deterministic between test runs, because it is based on the value of trx_t*, computed by the function trx_get_id_for_print() and passed to trans_register_ha() by innobase_register_trx().

      Yes, it is possible that no transaction identifier has been assigned to a transaction at the time when innobase_register_trx() has been called. In this case, passing the dummy value trx->id=0 would result in a preferred outcome: the TRX_ID would be reported as NULL.

      We can also observe that GTID} will be reported as a dummy value '0-0-0' instead of more appropriate NULL. I will not report or address that for now.

      Attachments

        Activity

          People

            marko Marko Mäkelä
            marko Marko Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.