Skip to content

Commit

Permalink
use equal fold
Browse files Browse the repository at this point in the history
  • Loading branch information
flaneur2020 committed Jul 23, 2024
1 parent da0f91c commit acb63d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions restful.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func (c *APIClient) getSessionState() *SessionState {
}

func (c *APIClient) inActiveTransaction() bool {
return c.sessionState != nil && c.sessionState.TxnState == TxnStateActive
return c.sessionState != nil && strings.EqualFold(string(c.sessionState.TxnState), string(TxnStateActive))
}

func (c *APIClient) applySessionState(response *QueryResponse) {
Expand Down Expand Up @@ -491,7 +491,7 @@ func (c *APIClient) startQueryRequest(ctx context.Context, request *QueryRequest
// e.g. transaction state need to be updated if commit fail
c.applySessionState(&resp)
// save route hint for the next following http requests
if len(respHeaders) > 0 && c.routeHint == "" {
if len(respHeaders) > 0 {
c.routeHint = respHeaders.Get(DatabendRouteHintHeader)
}
return &resp, nil
Expand Down

0 comments on commit acb63d5

Please sign in to comment.