JRuby

jdbc_mysql.rb should not enforce the utf8_bin collation on table creation

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    activerecord-jdbc-adapter-0.8.1
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

ActiveRecord-JDBC forces the utf8_bin collation while creating a MySQL database, which is at least strange.

utf8_bin provides case-sensitive collation that corresponds exactly to the order of unicode code points. It is way different from the default case-insensitive utf8_general_ci collation for utf8 data.

Activity

Hide
Charles Oliver Nutter added a comment -

Very interesting. I would guess one of two things are true:

  1. There was a reason to do it this way, and it was never documented
  2. Some old code did it this way, and nobody has bothered to change it

Either way, the patch seems pretty harmless, and it sounds like the default collation is what we actually want. Nick?

Show
Charles Oliver Nutter added a comment - Very interesting. I would guess one of two things are true:
  1. There was a reason to do it this way, and it was never documented
  2. Some old code did it this way, and nobody has bothered to change it
Either way, the patch seems pretty harmless, and it sounds like the default collation is what we actually want. Nick?
Hide
Clemens Wyss added a comment -

Dear Nick/Charles,
why is this patch not applied 8at least not in 0.9)?
Thx Clemens

Show
Clemens Wyss added a comment - Dear Nick/Charles, why is this patch not applied 8at least not in 0.9)? Thx Clemens
Hide
Thomas E Enebo added a comment -

Fixed in commit 5fd5a94. 0.9.1 will have this. I did not apply the patch as well but followed and refactored create_database character set handling into a private helper method. So it will collate if you actually specify collate as an option. Otherwise, it will not specify collation. Also tables will honor the charset option specified as well.

Show
Thomas E Enebo added a comment - Fixed in commit 5fd5a94. 0.9.1 will have this. I did not apply the patch as well but followed and refactored create_database character set handling into a private helper method. So it will collate if you actually specify collate as an option. Otherwise, it will not specify collation. Also tables will honor the charset option specified as well.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: