Have to release meta page before reading root one!
authorVadim B. Mikheev <vadim4o@yahoo.com>
Mon, 7 Jun 1999 14:28:22 +0000 (14:28 +0000)
committerVadim B. Mikheev <vadim4o@yahoo.com>
Mon, 7 Jun 1999 14:28:22 +0000 (14:28 +0000)
< 6.5 versions were just not affected by this bug due to locking.

src/backend/access/nbtree/nbtpage.c

index da6146f18ddb08936059f28229fb65de69ccc152..1411a4e776f44f24b95d44b25f370a2f5af358e8 100644 (file)
@@ -265,10 +265,10 @@ _bt_getroot(Relation rel, int access)
        }
        else
        {
-               rootbuf = _bt_getbuf(rel, metad->btm_root, access);
+               rootblkno = metad->btm_root;
+               _bt_relbuf(rel, metabuf, BT_READ);      /* done with the meta page */
 
-               /* done with the meta page */
-               _bt_relbuf(rel, metabuf, BT_READ);
+               rootbuf = _bt_getbuf(rel, rootblkno, access);
        }
 
        /*