wp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user