mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 03:29:01 +08:00 
			
		
		
		
	lmdb: ITS#8109 fix mdb_cursor_del0 on empty DB.
Change-Id: Idba0acfd64b597f2bc5cb847ca99fe4560eed875
This commit is contained in:
		
							
								
								
									
										7
									
								
								mdb.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								mdb.c
									
									
									
									
									
								
							| @@ -8569,6 +8569,13 @@ mdb_cursor_del0(MDB_cursor *mc) | ||||
| 		MDB_cursor *m2, *m3; | ||||
| 		MDB_dbi dbi = mc->mc_dbi; | ||||
|  | ||||
| 		/* DB is totally empty now, just bail out. | ||||
| 		 * Other cursors adjustments were already done | ||||
| 		 * by mdb_rebalance and aren't needed here. | ||||
| 		 */ | ||||
| 		if (!mc->mc_snum) | ||||
| 			return rc; | ||||
|  | ||||
| 		mp = mc->mc_pg[mc->mc_top]; | ||||
| 		nkeys = NUMKEYS(mp); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user