Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7209

Collation not set properly when data stored via Hot Rod when JdbcStringBasedStore is used with MariaDB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 9.0.0.Alpha4
    • Loaders and Stores
    • None
    • Workaround Exists
    • Hide

      There are two options:
      Use the MySQL JDBC driver instead of the official MariaDB one.
      Explicitly set the collation and character set of either the database, table involved, or the table column used to store the string key before infinispan starts interacting with the DB. I believe different collation and character combos can be combined, however forcing utf8 seems to cause the least amount of problems:
      character-set-server=utf8mb4
      collation-server=utf8mb4_unicode_ci

      Show
      There are two options: Use the MySQL JDBC driver instead of the official MariaDB one. Explicitly set the collation and character set of either the database, table involved, or the table column used to store the string key before infinispan starts interacting with the DB. I believe different collation and character combos can be combined, however forcing utf8 seems to cause the least amount of problems: character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci

      Given following scenario:
      1) store entry to ISPN server via Hot Rod (e.g. with RemoteCache)
      2) have the server configured to use JdbcStringBasedStore
      3) used database is MariaDB 10

      Following exception is thrown:

      ERROR [org.infinispan.persistence.jdbc.stringbased.JdbcStringBasedStore] (HotRodServerHandler-3-2) ISPN008024: Error while storing string key to database; key: '9A09AJAAAAAAAAA==': java.sql.BatchUpdateException: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
      

      Note that his doesn't happen when stored via, for example, Memcached client. Also this issue doesn't appear in library mode, doesn't appear in any with any other database (including MySQL, which is very similar to MariaDB).

            remerson@redhat.com Ryan Emerson
            jholusa Jiří Holuša (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: