[MDEV-27119] mariadb client should track whether a transaction is open when handling reconnections Created: 2021-11-24 Updated: 2021-11-24 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Rick Pizzi | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The command line client is not tracking whether a transaction is open on the client side. Let's consider this transaction:
If connection with server dies during the sleep, transaction is rolled back on server side, however when the 2nd insert is executed a new connection to the server is established and the insert is committed because the notion that the insert was part of a transaction is lost by the client. Client should track transactions so that if connection to server is lost in the middle of a transaction, it will error out at next statement, instead of executing the transaction partially (by executing the remainder in autocommit mode). This behaviour only happens in interactive mode, because in batch mode, even with the force flag, the client never ever reconnects to server if connection is lost. |