1. 31
  1. 10

    That reminds me of the time when I realized that I made the grave mistake of making all my tables have the encoding utf8_unicode_ci and thinking they were UTF-8, not knowing that utf8_unicode_ci is a legacy broken encoding that only supports up to 3 bytes per character. How naïve of me to assume that utf8 means UTF-8. I realized it when I tried to insert some 4 byte UTF-8 characters and the database spewed back errors at me. You should always use utf8mb4_unicode_ci [1]. That was my big WTF moment with MySQL. Not surprised that there are more skeletons in the closet.

    [1] https://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci

    1. 7

      MySQL is full of WTFs. The most recent one I ran into is that GROUP_CONCAT has a maximum length, when exceeded will just silently truncate the resulting string.

      Another one that sticks out in recent memory is that it thinks "foo " = "foo" is true (so trailing spaces don’t matter). Oh, and the always fun gotcha that DDL statements aren’t transactional. PostgreSQL was such a breath of fresh air after having dealt so often with the pain of having migrations half-applied and then crashing (while writing them). And this kind of nonsense goes on and on and on.

      1. 2

        You’re not the only one. I got caught by this one when someone stuck an emoji in a search query that ended up in a URL.

        1. 2

          Having worked with Oracle databases before, this really explains why Oracle the company was happy to buy MySQL - like sees like.

          1. 1
          2. 9

            Backwards consistency with a broken model.

            I encountered similar in 2003: https://lists.mysql.com/mysql/141961

            I stopped using MySQL shortly thereafter. I suppose everyone who cares about integrity has done the same.

            1. 4

              This seems typical for MySQL, though I admit that this is a pretty extreme example. I was introduced to similar weirdnesses by this presentation: https://www.youtube.com/watch?v=emgJtr9tIME

              Don’t use MySQL, friends. At least not if you don’t want to blow up your data.

              1. 2

                Way too many WTF MySQL moments is why I avoid MySQL like the plague.