Skip to content

Commit

Permalink
Fix table query continuation token (Azure#5423)
Browse files Browse the repository at this point in the history
  • Loading branch information
djyou authored and jhendrixMSFT committed Aug 5, 2019
1 parent ca07ab7 commit 02b4ce1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions storage/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,12 @@ func (t *Table) queryEntities(uri string, headers map[string]string, ml Metadata
return nil, err
}
v := originalURI.Query()
v.Set(nextPartitionKeyQueryParameter, contToken.NextPartitionKey)
v.Set(nextRowKeyQueryParameter, contToken.NextRowKey)
if contToken.NextPartitionKey != "" {
v.Set(nextPartitionKeyQueryParameter, contToken.NextPartitionKey)
}
if contToken.NextRowKey != "" {
v.Set(nextRowKeyQueryParameter, contToken.NextRowKey)
}
newURI := t.tsc.client.getEndpoint(tableServiceName, t.buildPath(), v)
entities.NextLink = &newURI
entities.ml = ml
Expand All @@ -371,7 +375,7 @@ func extractContinuationTokenFromHeaders(h http.Header) *continuationToken {
NextRowKey: h.Get(headerNextRowKey),
}

if ct.NextPartitionKey != "" && ct.NextRowKey != "" {
if ct.NextPartitionKey != "" || ct.NextRowKey != "" {
return &ct
}
return nil
Expand Down

0 comments on commit 02b4ce1

Please sign in to comment.