1.617.682.4508

Pythian Blog

The world discusses #Pythian on Twitter. Have a question? Use our hashtag and ask away.

Emergency

24x7 Support

Not a Pythian client but need help now? No problem. Click here.

Are you aware of an existing DBA opening or consulting requirement in your organization? Enter your email for a chance to win one year's access to Safari Books.

  

Overloading BINARY

By: Sheeri Cabral

“There are 10 types of people in the world — those who understand binary, and those who don’t.”

The term “binary” in MySQL has many different meanings. How many can you come up with? I have 6, but I am willing to believe there are more!

0) “Binary distribution” is the name for the package that contains a binary. Another use is “binary installation” but that’s pretty much the same usage pattern as “binary distribution”, so I won’t count “binary installation” as a separate usage.
1) “Server binary” or “client binary” is the actual program (mysqld, mysql).
2) “Binary format” is a compressed format. For example, DECIMAL is stored in a “binary format” — each group of nine digits is compressed into 4 bytes.
3) “Binary log” is the change log. You can argue that this is an extension of #3, because the binary log is a compressed log, but “binary log” is encountered ubiquitously in the MySQL world, and “binary format” is somewhat obscure knowledge.
4) “Binary CHARSET” - sets the collation to be case-insensitive. For instance, utf8_bin and latin1_bin are the binary collations for the utf8 and latin1 character sets, respectively.
5) “Binary string” - a byte string. This is also known as the BINARY data type. There is some kind of wit/pun in the fact that a number in binary is actually a “bit string”.

Any more I missed? There are over 1600 mentions of the word “binary” in the 5.0 manual!

7 Responses

  1. safari says:

    I think there are over 11001000000 mentions of the word “binary” in the 5.0 manual!!! :-D

  2. Sheeri Cabral says:

    @safari — good point! For that matter, I actually have 1100 different ways the term “binary” is used.

  3. Nick says:

    There is the “binary” charset, and the different binary collations for normal charsets — You can set the charset of a varchar column to “binary” which will basically turn it into a varbinary column, otherwise every other charset as a *_bin collation type which you can use.

    There is also the “binary” operator, equivalent to cast(nextvalue as binary), e.g. select binary ‘a’ = ‘A’

  4. Nick says:

    EDIT: …every other charset **has** a *_bin collation type…

  5. Sheeri Cabral says:

    @Nick — two more…wow!

  6. Shlomi says:

    There’s binary backup (also called “raw backup”), as opposed to logical backup.

  7. Sheeri Cabral says:

    Shlomi — neat, I usually call that “physical” backup…we’re up to 8 uses now!

Leave a Reply

Start NowWith Pythian - database design, management and emergency handling capabilities...

Pythian Blog

Connecting to Oracle with SQL Server 2005 x64
The quirks of connecting to Oracle from SQL 2005 64
more



Live Updates

pythian: Pythian is now official members of the Microsoft Partner Program. Thanks Peter
more



RSSTestimonials

  • Casey Dyke

    Database Team Manager Service Delivery and Applications , Telstra

    Pythian were recently engaged to take a lead role in a high end infrastructure build project at Telstra. Our requirements were a combination of... more