Comment 3 for bug 662714

Revision history for this message
Kristian Nielsen (knielsen) wrote :

This may be a limitation of PBXT with transactions where some statements fail.

From the PBXT documentation, http://www.primebase.org/documentation/#diffs :

8.2 No Statement Level Sub-transactions

PBXT does not support statement level sub-transactions. This means that if an error occurs, PBXT will rollback the entire transaction, not just the current statement.

The only exception to this is the duplicate key error. PBXT undoes the INSERT or UPDATE statement when an duplicate key error occurs. The user is then free to decide whether to continue, or rollback the transaction.

Note that this can cause problems for replication, and means that INSERT with multiple rows should not be used when replicating PBXT tables. For example:

use test;
drop table if exists t;
create table t ( i int not null, unique index i (i) ) engine = PBXT;
set autocommit = 0;
insert into t values (1),(2),(2);
# error 1062 (duplicate key) occurs
commit;

select * from t;
i
1
2

In the above example, the INSERT statement is not completely rolled back. MySQL replication, however, will not replicate any part of the statement because it assumes that a transactional storage engine supports statement level sub-transactions.

In the original test case, the first UPDATE statement fails, and is therefore not replicated, however it is not completely rolled back despite what the pbxt documentation says.