This commit is contained in:
2026-06-13 07:13:03 +00:00
parent aca0252cfd
commit 5778782737
10 changed files with 99 additions and 58 deletions

View File

@@ -228,6 +228,8 @@ type appendIndexRecordIn struct {
}
func appendIndexRecord(in appendIndexRecordIn) []byte {
//fmt.Printf("appendIndexRecord: % x\n", in.Records)
//fmt.Printf("timestamp: %d, pageNo: %d\n", in.Timestamp, in.PageNo)
if in.RecordsCount < maxRecordsOnIndexPage {
var (
pos int
@@ -235,11 +237,13 @@ func appendIndexRecord(in appendIndexRecordIn) []byte {
)
if in.RecordsCount > 0 {
pos = in.RecordsCount * indexRecordSize
//fmt.Printf("pos: %d\n", pos)
} else {
buf = make([]byte, IndexPageSize) // IndexPageIncSize
}
bin.PutUint32(buf[pos:], in.Timestamp)
bin.PutUint32(buf[pos+4:], in.PageNo)
//fmt.Printf("appendIndexRecord after: % x\n", buf)
return buf
}
qb.Abort(qb.NoSpaceOnIndexPage, nil)