mirror of
				https://github.com/isar/libmdbx.git
				synced 2025-10-31 15:38:57 +08:00 
			
		
		
		
	mdbx: backport - ITS#8622 fix xcursor after cursor_del.
Re-fix 6b1df0e4c7fadd21d1233d7157229b2d89ccaa04 from ITS#8406 Change-Id: Ied16e11c06fc3ce626ee4885d153aff98e5f8802
This commit is contained in:
		
							
								
								
									
										15
									
								
								mdb.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								mdb.c
									
									
									
									
									
								
							| @@ -8767,14 +8767,17 @@ mdb_cursor_del0(MDB_cursor *mc) | |||||||
| 					} | 					} | ||||||
| 					if (mc->mc_db->md_flags & MDB_DUPSORT) { | 					if (mc->mc_db->md_flags & MDB_DUPSORT) { | ||||||
| 						MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); | 						MDB_node *node = NODEPTR(m3->mc_pg[m3->mc_top], m3->mc_ki[m3->mc_top]); | ||||||
| 						/* If this node is a fake page, it needs to be reinited | 						/* If this node has dupdata, it may need to be reinited | ||||||
| 						 * because its data has moved. But just reset mc_pg[0] | 						 * because its data has moved. | ||||||
| 						 * if the xcursor is already live. | 						 * If the xcursor was not initd it must be reinited. | ||||||
|  | 						 * Else if node points to a subDB, nothing is needed. | ||||||
|  | 						 * Else (xcursor was initd, not a subDB) needs mc_pg[0] reset. | ||||||
| 						 */ | 						 */ | ||||||
| 						if ((node->mn_flags & (F_DUPDATA|F_SUBDATA)) == F_DUPDATA) { | 						if (node->mn_flags & F_DUPDATA) { | ||||||
| 							if (m3->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED) | 							if (m3->mc_xcursor->mx_cursor.mc_flags & C_INITIALIZED) { | ||||||
|  | 								if (!(node->mn_flags & F_SUBDATA)) | ||||||
| 									m3->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(node); | 									m3->mc_xcursor->mx_cursor.mc_pg[0] = NODEDATA(node); | ||||||
| 							else | 							} else | ||||||
| 								mdb_xcursor_init1(m3, node); | 								mdb_xcursor_init1(m3, node); | ||||||
| 						} | 						} | ||||||
| 					} | 					} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user