Experiment: Refine ASCII column definitions #857
Draft
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.
Columns that store SHA hash hex strings or URIs can be ASCII or use "C" collation. Update each engine to use the appropriate encoding or collation for such columns.
Issues that remain:
MySQL
MySQL has trouble comparing strings of different types. On 5-5-5.6 it complains:
Cockroach also has this problem, complaining:
Oracle
Oracle requires MAX_STRING_SIZE=STANDARD, but it seems to require restarting the server, and I don't know how to do that for the Docker image.
Vertica
Has no obvious method to support column-based collation or encoding.
SQLite
SQLite supports a
COLLATE
keyword, but it defaults tiBINARY
, which is what we'd want for SHA hash hex strings and URIs anyway. We could useNOCASE
for SHA sums, but Sqitch always lowercases them anyway.Future Work
Overall it might be better to provide a way for users to select a collation or encoding to use and then apply it.
But in the end I'm not sure it's worth the effort.