Skip to content

Commit 8eeb47b

Browse files
Peter Wilhelmsson2hdddg
authored andcommitted
Proper reset of summary on Bolt connection level
Resets all success response state upon retrieval of new success response. Fixes issue #178
1 parent 003230e commit 8eeb47b

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

neo4j/internal/bolt/hydrator.go

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,6 @@ func (s *success) isResetResponse() bool {
7777
return s.num == 0
7878
}
7979

80-
// Since it is reused
81-
func (s *success) clear() {
82-
s.fields = nil
83-
s.bookmark = ""
84-
s.hasMore = false
85-
s.notifications = nil
86-
s.plan = nil
87-
s.profile = nil
88-
s.qid = -1
89-
s.server = ""
90-
s.connectionId = ""
91-
s.server = ""
92-
s.tfirst = 0
93-
s.tlast = 0
94-
s.db = ""
95-
s.qtype = db.StatementTypeUnknown
96-
}
97-
9880
type hydrator struct {
9981
unpacker packstream.Unpacker
10082
unp *packstream.Unpacker
@@ -189,8 +171,9 @@ func (h *hydrator) success(n uint32) *success {
189171
return nil
190172
}
191173
// Use cached success but clear it first
174+
h.cachedSuccess = success{}
175+
h.cachedSuccess.qid = -1
192176
succ := &h.cachedSuccess
193-
succ.clear()
194177

195178
h.unp.Next() // Detect map
196179
n = h.unp.Len()

0 commit comments

Comments
 (0)