Skip to content
Permalink
Browse files
feat(spanner/spansql): fix unstable SelectFromTable SQL (#4473)
#4457 made unstable SQL string, and fail test sometimes like this.
Because map range result is unstable.
This PR makes the SQL output stable by sorting the Hints keys.
  • Loading branch information
nktks committed Jul 21, 2021
1 parent b850315 commit 39bc4eca655d0180b18378c175d4a9a77fe1602f
Showing 1 changed file with 2 additions and 0 deletions.
@@ -25,6 +25,7 @@ package spansql

import (
"fmt"
"sort"
"strconv"
"strings"
"time"
@@ -373,6 +374,7 @@ func (sft SelectFromTable) SQL() string {
kvs[i] = fmt.Sprintf("%s=%s", k, v)
i++
}
sort.Strings(kvs)
str += strings.Join(kvs, ",")
str += "}"
}

0 comments on commit 39bc4ec

Please sign in to comment.