Skip to content

Commit

Permalink
Merge pull request #62619 from otan-cockroach/backport21.1-62490
Browse files Browse the repository at this point in the history
release-21.1: delegate: order AZs in SHOW REGIONS commands
  • Loading branch information
otan authored Mar 25, 2021
2 parents 2b37aea + 59ab49c commit 7225cba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cli/interactive_tests/test_demo_global.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ spawn $argv demo --empty --nodes 9 --global
# Ensure db is defaultdb.
eexpect "defaultdb>"

# Ensure regions display correctly.
send "SELECT region, zones FROM \[SHOW REGIONS FROM CLUSTER\] ORDER BY region;\r"
eexpect " europe-west1 | {b,c,d}"
eexpect " us-east1 | {b,c,d}"
eexpect " us-west1 | {a,b,c}"
eexpect "defaultdb>"

interrupt
eexpect eof
end_test
1 change: 1 addition & 0 deletions pkg/sql/delegate/show_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (d *delegator) delegateShowRegions(n *tree.ShowRegions) (tree.Statement, er
'zone=([^,]*)'
)
)
ORDER BY locality
),
NULL
)
Expand Down

0 comments on commit 7225cba

Please sign in to comment.