Skip to content

Commit 8376e2a

Browse files
committed
Don't cancel finished queries
When closing query rows, if the current segment is the last one (there's no next URI), don't cancel the query. This does not apply to spooled segments.
1 parent 97b4b68 commit 8376e2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

trino/trino.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,9 @@ func (qr *driverRows) Close() error {
15151515
return nil
15161516
}
15171517
qr.err = io.EOF
1518+
if !qr.stmt.usingSpooledProtocol && qr.nextURI == "" {
1519+
return qr.err
1520+
}
15181521
hs := make(http.Header)
15191522
if qr.stmt.user != "" {
15201523
hs.Add(trinoUserHeader, qr.stmt.user)
@@ -1973,6 +1976,7 @@ func (qr *driverRows) fetch() error {
19731976
}
19741977

19751978
qr.rowindex = 0
1979+
qr.nextURI = qresp.NextURI
19761980
switch data := qresp.Data.(type) {
19771981
case []interface{}:
19781982
// direct protocol

0 commit comments

Comments
 (0)