luislavena / mysql-gem

MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support
http://rubyforge.org/projects/mysql-win
Other
53 stars 20 forks source link

Add `charsetnr` to Mysql::Result #24

Open peterkovacs opened 10 years ago

peterkovacs commented 10 years ago

charsetnr is (appears to be?) the only way to tell the difference between two fields like this:

field_a VARCHAR(255) COLLATE utf8_bin,
field_b VARBINARY(255)

Having charsetnr makes determining the difference between these two field types to be quite trivial.

luislavena commented 10 years ago

Hello @peterkovacs, can you add a test that verifies this?

Thank you.

peterkovacs commented 10 years ago

Hi @luislavena --

I'm not sure how fixed the constants are going to be across various installations of mysql. This test passes in my environment with mysql 5.5.33.

The mysql API doesn't seem to export these constants, but they are documented here: http://dev.mysql.com/doc/internals/en/charsets.html

Should they be enumerated in the gem?