質問

I`m new in MySQL and MariaDB. I replaced mysql with mariadb and have issue with transactions.

MariaDB [(none)]> show engines;
+--------------------+---------+--------------+------+------------+
| Engine             | Support | Transactions | XA   | Savepoints |
+--------------------+---------+--------------+------+------------+
| MyISAM             | YES     | NO           | NO   | NO         |
| PERFORMANCE_SCHEMA | YES     | NO           | NO   | NO         |
| Aria               | YES     | NO           | NO   | NO         |
| InnoDB             | DEFAULT | YES          | YES  | YES        |
+--------------------+---------+--------------+------+------------+

MariaDB [(none)]> create table test (id INT) ENGINE=ARIA TRANSACTIONAL=1


BEGIN;
INSERT INTO test VALUES (1);
ROLLBACK;

WARNING:some non-transactional changed tables couldn't be rolled back
役に立ちましたか?

解決

The Aria storage engine is not currently transactional. From the MariaDB site:

TRANSACTIONAL is only applicable for Aria tables. In future Aria tables created with this option will be fully transactional, but currently this provides a form of crash protection.

Aria is planned to be transactional in the future, but it is not a priority. Also from the MariaDB site:

For the moment, Aria 2.0 is on hold as the developers are focusing their main efforts on improving MariaDB.

If you need a table to be transactional, use the InnoDB storage engine (which is actually XtraDB). If you are replacing an existing installation that required transactions, the old tables must have been InnoDB since MyISAM is non-transactional.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top