Hi Fabrizio,

Did you specify the correct character set and collation on your JDBC
connection? The following properties seem relevant

- characterEncoding
- characterSetResults
- connectionCollation

See also:
-
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connp-props-connection.html
-
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connp-props-session.html

Thanks,
Lukas

On Fri, Jan 22, 2021 at 9:15 PM 'Fabrizio Gennari' via jOOQ User Group <
[email protected]> wrote:

>
> Hello,
> I'm using MySQL.
> A jOOQ query that used to work until recently suddenly started giving an
> error message
>
> Illegal mix of collations (latin1_swedish_ci,IMPLICIT),
> (utf8mb4_0900_ai_ci,COERCIBLE) for operation '='
>
> The query is pretty trivial:
> Mytable.MY_FIELD.eq("some string value")
>
> Mytable has CHARSET=latin1. Column my_field is a varchar(2).
>
> I already tried to force the collation on the field,
> Mytable.MY_FIELD.collate("utf8mb4_0900_ai_ci").eq("some string value")
>
> but it gives an error:
> COLLATION 'utf8mb4_0900_ai_ci' is not valid for CHARACTER SET 'latin1'
>
> To my knowledge the only change was an upgrade of the server to MySQL 8.0.
>
> What is the way out? Is it possible, for example, to force the collation
> on the constant string itself? In SQL,
> `column`="value" collate latin1_general_ci
> is valid.
>
> Regards,
> Fabrizio
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/ba974368-b98b-4251-8ea5-ddfb31caf2a1n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/ba974368-b98b-4251-8ea5-ddfb31caf2a1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO6Oc-yGDmNPQgoh6CZ8kSanpXsBBFQbzhmXO2YS%3DHXb%3Dw%40mail.gmail.com.

Reply via email to