-
Enhancement
-
Resolution: Done
-
Major
-
0.4
-
None
Came across this issue while evaluating debezium for my company. Also noted this conversation - https://gitter.im/debezium/dev/archives/2016/11/12, and felt like now would be a good time to create the issue
Couple notes - using the dbz mysql image, below is my results when using savepoints and reading the binlog (using python-mysql-replication, because I haven't coded in java in a decade now).
DML:
BEGIN => insert a => SAVEPOINT => insert b => Rollback to savepoint => commit => only a shows up in replication stream, insert b never shows up
BEGIN => insert a => SAVEPOINT => insert b => rollback to savepoint => insert c => commit => insert a and insert c both show up, insert b never shows in replication stream.
BEGIN => insert a => SAVEPOINT => rollback - a does not show up in replication stream
DDL:
if in the middle of a transaction (with or without a savepoint), and a DDL statement is issued, an implicit commit occurs. The DML up to this point is treated as per above. Since there is an implicit commit before and after any ddl statements, SAVEPOINT cannot be used (well, in any useful manner anyway) with DDL.
Attached is output from the debezium mysql container where I issued commands to reach the conclusions above and the output from a replication listener.
Also - i believe that DDL can be transactionally aware in postgres, so points above only apply to mysql i believe