1

MySQL doesn't accept a value like 'foo' if the column is of type varchar with a unique index and has a value 'Foo'.

So I want to change varchar into varbinary,

But jOOQ maps varbinary to byte[] in Java,

How can I configure jOOQ to resolve this?

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
genechu
  • 97
  • 2
  • 7
  • 1
    I don't understand why you'd like to change a `varchar` column to `varbinary` in the first place. Could you explain? Is this a case-sensitivity problem (`foo` vs. `Foo`)? In that case, you might want to consider this question here: http://stackoverflow.com/questions/6448825/sql-unique-varchar-case-sensitivity-question – Lukas Eder Aug 21 '12 at 09:54
  • Thanks you,but it's not my idea. – genechu Aug 21 '12 at 10:11
  • My team is using jooq, It's greate! – genechu Aug 21 '12 at 10:12

1 Answers1

0

MySQL UNIQUE constraints can be case-insensitive if their underlying column's collation is case-insensitive. So, instead of changing the column data type, you should really fix the collation of the VARCHAR column. This is explained here:

SQL unique varchar case sensitivity question

Community
  • 1
  • 1
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509