fixed a VERY nasty bug with BPlusTree (header was erroneously overwritten)

This commit is contained in:
real_nowhereman 2009-12-10 20:47:55 +00:00
parent 44821eeece
commit b8be9cb27a

View File

@ -1590,10 +1590,10 @@ class BPlusTree {
trigger_error("cannot initialize without nodesize, keylen specified\n") ; trigger_error("cannot initialize without nodesize, keylen specified\n") ;
} }
$this->length = 0; $this->length = 0;
$this->root_seek = 22; //pack('a5LCL3',...)
$this->reset_header(); $this->reset_header();
$file = $this->file; $file = $this->file;
fseek($file, 0, SEEK_END); fseek($file, 0, SEEK_END);
$this->root_seek = ftell($file);
$this->root = new BplusTree_Node( $this->root = new BplusTree_Node(
BPT_FLAG_LEAFANDROOT, BPT_FLAG_LEAFANDROOT,
$this->nodesize, $this->keylen, $this->root_seek, $file $this->nodesize, $this->keylen, $this->root_seek, $file