Local Examples: Add --binary-as-hex=false flag to mysql alias #15996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The Vitess local examples (source) are a common first touch experience for users. They are regularly confused or curious as to why many of the columns in the examples show up as HEX in the query results. The reason for this is that we use
VARBINARY
types throughout — in some rare cases likekeyspace_id
it makes sense, but most likecustomer.email
are pure text. This makes understanding what's happening and quickly confirming at-a-glance results as expected more difficult and poses a minor hurdle when it's already quite a lot to get started with Vitess.In this PR, we add the
--binary-as-hex=false
mysql client flag to themysql
alias we setup to both increase awareness of that flag and so that more people are using it by default (source ../common/env.sh).The bigger effort would be to move most of our
VARBINARY
usage under./examples
toVARCHAR
. This offers a more intuitive/expected experience while also more closely matching what users will be using for similar types of data. I can only guess thatVARBINARY
was used initially (many years ago now) because at the time Vitess did not have MySQL collation support. Vitess now has MySQL compatible collations so I think it's worth doing this work. For that I've created an issue and marked it as a goodfirst issue
for anyone that's interested in a relatively simple and straightforward first contribution to Vitess.Related Issue(s)
Checklist