Commit 97ddfc96 authored by Kirill Smelkov's avatar Kirill Smelkov

X: AnswerPartitionTable - wrong code for slice of slice

parent d2e49b19
...@@ -179,3 +179,26 @@ func (p *AnswerLastIDs) NEODecode(data []byte) (int, error) { ...@@ -179,3 +179,26 @@ func (p *AnswerLastIDs) NEODecode(data []byte) (int, error) {
func (p *PartitionTable) NEODecode(data []byte) (int, error) { func (p *PartitionTable) NEODecode(data []byte) (int, error) {
return 0 /* + TODO variable part */, nil return 0 /* + TODO variable part */, nil
} }
func (p *AnswerPartitionTable) NEODecode(data []byte) (int, error) {
p.PTid = BigEndian.Uint64(data[0:])
{
l := BigEndian.Uint32(data[8:])
data = data[12:]
p.RowList = make([]neo.RowInfo, l)
for i := 0; i < l; i++ {
p.RowList[i].Offset = BigEndian.Uint32(data[0:])
{
l := BigEndian.Uint32(data[4:])
data = data[8:]
p.RowList[i].CellList = make([]neo.CellInfo, l)
for i := 0; i < l; i++ {
p.RowList[i].CellList[i].UUID = int32(BigEndian.Uint32(data[0:]))
p.RowList[i].CellList[i].CellState = int32(BigEndian.Uint32(data[4:]))
data = data[8:]
}
}
data = data[0:]
}
}
return 0 /* + TODO variable part */, nil
}
...@@ -274,13 +274,13 @@ type AnswerLastIDs struct { ...@@ -274,13 +274,13 @@ type AnswerLastIDs struct {
type PartitionTable struct { type PartitionTable struct {
} }
/*
type AnswerPartitionTable struct { type AnswerPartitionTable struct {
PTid PTid
RowList []RowInfo RowList []RowInfo
} }
/*
// Send rows in a partition table to update other nodes. PM -> S, C. // Send rows in a partition table to update other nodes. PM -> S, C.
type NotifyPartitionTable struct { type NotifyPartitionTable struct {
PTid PTid
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment