You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2018/03/09 13:52:00 UTC

[jira] [Created] (QPID-8122) [Broker-J] Create JDBC backed virtualhost node fails on MariaDB when database charset is utf8mb4

Keith Wall created QPID-8122:
--------------------------------

             Summary: [Broker-J] Create JDBC backed virtualhost node fails on MariaDB when database charset is utf8mb4
                 Key: QPID-8122
                 URL: https://issues.apache.org/jira/browse/QPID-8122
             Project: Qpid
          Issue Type: Bug
          Components: Broker-J
         Environment: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
            Reporter: Keith Wall


With MariaDB 10.0.34 on Ubuntu 16.04 defaults its database character set type to {{utf8mb4}}.
{noformat}
MariaDB [qpid]> show variables like 'character_set_database';
+------------------------+--------+
| Variable_name          | Value  |
+------------------------+--------+
| character_set_database | utf8mb4 |
+------------------------+--------+
1 row in set (0.00 sec)
{noformat}
If I try and create a JDBC backed VHN, it fails with the following exception:
{noformat}
2018-03-09 13:22:58,067 ERROR [Broker-Config] (o.a.q.s.u.ServerScopedRuntimeException) - Unable to open configuration tables
java.sql.SQLSyntaxErrorException: (conn=173) Specified key was too long; max key length is 767 bytes
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:177)
	at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110)
	at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:228)
	at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:334)
	at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:386)
	at com.jolbox.bonecp.StatementHandle.execute(StatementHandle.java:300)
	at org.apache.qpid.server.store.jdbc.AbstractJDBCConfigurationStore.createConfiguredObjectHierarchyTable(AbstractJDBCConfigurationStore.java:497)
	at org.apache.qpid.server.store.jdbc.AbstractJDBCConfigurationStore.createOrOpenConfigurationStoreDatabase(AbstractJDBCConfigurationStore.java:448)
{noformat}
The primary key length of the QPID_CONFIGURED_OBJECT_HIERARCHY is too long in this character set mode.

It seems other MariaDB packages on other distributions default to {{latin1}} which does not face this problem.   Switching to {{latin1}} like so is a workaround:
{noformat}
ALTER DATABASE qpid CHARACTER SET latin1{noformat}
However, this would mean that a characters appearing in configuration items outwith latin1 would be lost.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org