Details
-
Technical task
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
there's a way to make ps2 protocol to work for INSERT/UPDATE/DELETE.
It could work approximately like this
- when mariadb-test gets an INSERT/UPDATE/DELETE to execute:
- prepare the statement
- if SERVER_STATUS_IN_TRANS
- execute (simple ps1 protocol)
- otherwise
- run START TRANSATION
- execute (ps2 step 1)
- if SERVER_STATUS_IN_TRANS is not set
- run COMMIT or ROLLBACK — it was non-transactional table
- otherwise
- run ROLLBACK
- execute ps2 step 2
this isn't perfect, won't wok for multi-update/delete that accesses both transactional and non-transactional tables. They are rare and will have to be protected with disable_ps2_protocol.
also it's possible to make it work when not autocommit — with savepoints.