Skip to content

Commit

Permalink
Merge #62490
Browse files Browse the repository at this point in the history
62490: delegate: order AZs in SHOW REGIONS commands r=ajstorm a=otan

Release note (sql change): Availability zones were not ordered when
using the SHOW REGIONS set of commands. This has now been changed to be
ordered.

Co-authored-by: Oliver Tan <[email protected]>
  • Loading branch information
craig[bot] and otan committed Mar 24, 2021
2 parents 9fa4b12 + 64f909f commit 37f5694
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 --no-example-database --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 37f5694

Please sign in to comment.