From a5ed725ae3617ff93072d3e3228a6824afed2ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 18 May 2024 13:12:08 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D1=8F=D0=B2=D0=BD=D0=BE=D0=B5=20=D0=BE?= =?UTF-8?q?=D0=B1=D0=BD=D0=BE=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20`txn`=20?= =?UTF-8?q?=D0=B8=20`dbi=5Fstate`=20=D1=83=20=D0=B2=D0=BB=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BA=D1=83=D1=80=D1=81=D0=BE?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BB=D0=BE?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20=D1=82=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B7=D0=B0=D0=BA=D1=86=D0=B8=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core.c b/src/core.c index 4a230101..8c9fc5e9 100644 --- a/src/core.c +++ b/src/core.c @@ -8327,7 +8327,8 @@ static int cursor_shadow(MDBX_txn *parent, MDBX_txn *nested) { MDBX_xcursor *mx = mc->mc_xcursor; if (mx != NULL) { *(MDBX_xcursor *)(bk + 1) = *mx; - mx->mx_cursor.mc_txn = nested; + mx->mx_cursor.mc_txn = mc->mc_txn; + mx->mx_cursor.mc_dbistate = mc->mc_dbistate; } mc->mc_next = nested->mt_cursors[i]; nested->mt_cursors[i] = mc; @@ -8374,11 +8375,8 @@ static void cursors_eot(MDBX_txn *txn, const bool merge) { mc->mc_db = bk->mc_db; mc->mc_dbistate = bk->mc_dbistate; if (mx) { - if (mx != bk->mc_xcursor) { - *bk->mc_xcursor = *mx; - mx = bk->mc_xcursor; - } - mx->mx_cursor.mc_txn = bk->mc_txn; + mx->mx_cursor.mc_txn = mc->mc_txn; + mx->mx_cursor.mc_dbistate = mc->mc_dbistate; } } else { /* Restore from backup, i.e. rollback/abort nested txn */