![]() ![]() This leads us back to December 11, 2019, where I first added parsing support for character sets and collations.Īt the time, we only truly supported the utf8mb4 character set, along with the utf8mb4_0900_bin collation, as they match up perfectly with Go's internal string encoding and sort order. In the worst-case scenario, data may be corrupted and queries may return the wrong results (which may or may not be caught!).ĭata corruption is unacceptable, and incorrect results can lead to catastrophic circumstances, so it is imperative that we get character sets and collations right. In the best-case scenario, people don't really notice or care that they exist. The stakes are also completely different compared to indexes. The case-sensitive collation sorts uppercase letters before lowercase letters, which is why the col < 'b' filter still returns an uppercase 'B'. SELECT * FROM case_insensitive WHERE col < 'b' SELECT * FROM case_sensitive WHERE col < 'b' SELECT * FROM case_insensitive WHERE col = 'A' SELECT * FROM case_sensitive WHERE col = 'A' Worst-case scenario is that they're not used, and statements are slower.Ĭharacter sets and collations are a bit different.Īs a very brief summary, character sets define how to interpret a sequence of bytes as a sequence of characters, and collations define how characters sort in relation to each other.įor example, saying that the sequence of bytes is equivalent to the string "ab" is the job of a character set, and a collation states that "a" comes before "b" when sorting. When they're used correctly, statements execute quicker. Often times this isn't an issue, as it is fairly clear on what the observed behavior should be. The MySQL documentation is a great resource for learning how to use MySQL, but it does not contain any information on how to implement MySQL. We're completely re-implementing MySQL's feature set over a custom storage engine, which presents a lot of interesting problems to solve. I mentioned that Dolt is MySQL-compatible, and that's because we're not a wrapper around MySQL. Used to MySQL's implementation of character sets and collations for strings?ĭolt even supports this, however getting this in has been a journey. Make a new branch off of production and test without fear.Ĭurious to know who made those changes to that one table? Want to run tests against production without risk? However, you now have access to the full power that versioning provides, and as Git is the most popular versioning software ever, you can apply that same knowledge to Dolt there is practically zero learning curve.īut with Dolt, you're versioning your data rather than your source code. ![]()
0 Comments
Leave a Reply. |