Commit f4d8ec54 authored by 张振华's avatar 张振华 Committed by 33cn

jointable-bugfix

parent 76334d1c
...@@ -91,7 +91,7 @@ func NewJoinTable(left *Table, right *Table, indexes []string) (*JoinTable, erro ...@@ -91,7 +91,7 @@ func NewJoinTable(left *Table, right *Table, indexes []string) (*JoinTable, erro
join.leftIndex = append(join.leftIndex, joinindex[0]) join.leftIndex = append(join.leftIndex, joinindex[0])
} }
if joinindex[1] == "" || !right.canGet(joinindex[1]) { if joinindex[1] == "" || !right.canGet(joinindex[1]) {
return nil, errors.New("jointable: left table can not get: " + joinindex[1]) return nil, errors.New("jointable: right table can not get: " + joinindex[1])
} }
if joinindex[1] != "" { if joinindex[1] != "" {
join.rightIndex = append(join.rightIndex, joinindex[1]) join.rightIndex = append(join.rightIndex, joinindex[1])
...@@ -160,6 +160,7 @@ func (join *JoinTable) GetData(primaryKey []byte) (*Row, error) { ...@@ -160,6 +160,7 @@ func (join *JoinTable) GetData(primaryKey []byte) (*Row, error) {
} }
rowjoin := join.meta.CreateRow() rowjoin := join.meta.CreateRow()
rowjoin.Ty = None rowjoin.Ty = None
rowjoin.Primary = leftrow.Primary
rowjoin.Data.(*JoinData).Left = leftrow.Data rowjoin.Data.(*JoinData).Left = leftrow.Data
rowjoin.Data.(*JoinData).Right = rightrow.Data rowjoin.Data.(*JoinData).Right = rightrow.Data
return rowjoin, nil return rowjoin, nil
......
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