Update of /cvsroot/simplemail/simplemail
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22125
Modified Files:
index_external.c
Log Message:
Catch another special insert case that is not supported yet.
Index: index_external.c
===================================================================
RCS file: /cvsroot/simplemail/simplemail/index_external.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- index_external.c 19 Jan 2014 18:28:25 -0000 1.5
+++ index_external.c 19 Jan 2014 18:28:47 -0000 1.6
@@ -314,7 +314,24 @@
bnode_write_block(idx, tmp, 0);
} else
{
- fprintf(stderr, "Splitting the non-root node is not supported for now!\n");
+ int lchild;
+
+ /* Read root node, we want to add the new element */
+ bnode_read_block(idx, tmp, 0);
+
+ lchild = tmp->lchild;
+ i = 0;
+
+ /* Find the separation key whose left child points to the block */
+ for (i=0; i<tmp->num_elements && lchild != block; i++);
+
+ if (i==tmp->num_elements)
+ {
+ fprintf(stderr, "Splitting a non-direct-child of the root node %d is not supported for now!\n", block);
+ exit(1);
+ }
+
+ fprintf(stderr, "Splitting the non-root node %d is not supported for now!\n", block);
exit(1);
}
} else
|