(ctx: &DispatchCtx<'_>, seq: u64)
| 16 | use super::{DispatchCtx, error_to_native}; |
| 17 | |
| 18 | pub(crate) fn handle_begin(ctx: &DispatchCtx<'_>, seq: u64) -> NativeResponse { |
| 19 | let snapshot_lsn = { |
| 20 | let next = ctx.state.wal.next_lsn(); |
| 21 | crate::types::Lsn::new(next.as_u64().saturating_sub(1)) |
| 22 | }; |
| 23 | match ctx.sessions.begin(ctx.peer_addr, snapshot_lsn) { |
| 24 | Ok(()) => NativeResponse::status_row(seq, "BEGIN"), |
| 25 | Err(msg) => NativeResponse::error(seq, "25P02", msg), |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | pub(crate) async fn handle_commit(ctx: &DispatchCtx<'_>, seq: u64) -> NativeResponse { |
| 30 | // Snapshot isolation conflict check. |
no test coverage detected