Skip to content

Commit

Permalink
delegate: order AZs in SHOW REGIONS commands
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
otan committed Mar 23, 2021
1 parent 0796cbc commit 64f909f
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 64f909f

Please sign in to comment.