MySQL/MariaDB: InnoDB – Get more information about current transaction

I wanted to find out how many rows were modified by the current transaction. Seems like MariaDB doesn’t have a straight forward way to retrieve the transaction ID. To narrow down transactions I used the current connection as the thread ID. You can run the below command to check the information about the transaction.

nn

SELECT * nFROM information_schema.innodb_trx nWHERE trx_mysql_thread_id = CONNECTION_ID() \Gn

nn

Here is an example:

nn

n

Missing Images

n

nn

Tags

nn

    n

  • mysql
  • n

  • mariadb
  • n

n

Proudly powered by WordPress

Discover more from Dedunu

Subscribe now to keep reading and get access to the full archive.

Continue reading