You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Matthew J." <ma...@hotmail.com> on 2010/07/31 00:04:40 UTC

ActiveMQ fails to create tables in MySQL 5.5.5

I have been running an embedded ActiveMQ database, using MySQL as the JDBC
data source.  This worked fine under MySQL 5.4.  I have recently tried
upgrading to MySQL 5.5.5.  ActiveMQ works fine as long as the three required
tables in the activemq database are already created.  However, if they
aren't, it fails to create the tables.

The problem appears to be in the create table script that's used.  In
previous versions of MySQL, it was legal (though deprecated as of 4.1) to
specify the engine using the "TYPE=INNODB" syntax.  However, the preferred
non-deprecated way to do it was to use "ENGINE=INNODB" instead.  However,
under 5.5.5, it appears that the MySQL developers have made the "TYPE"
syntax completely illegal, requiring use of the "ENGINE" syntax.

A relevant MySQL bug discussing the issue:
http://bugs.mysql.com/bug.php?id=17501

The following is an example of the actual SQL that is generated by ActiveMQ:

CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250),
MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG LONGBLOB,
PRIMARY KEY ( ID ) ) TYPE=INNODB

I haven't had the opportunity to test it, but it seems likely that the
culprit is MySqlJDBCAdapter.java.  It includes the line:

String typeClause = " TYPE="+type;

which should probably change to

String typeClause = " ENGINE="+type;

-- 
View this message in context: http://old.nabble.com/ActiveMQ-fails-to-create-tables-in-MySQL-5.5.5-tp29310273p29310273.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Matthew J." <ma...@hotmail.com>.
Patch has been created and submitted to the Jira issue.


Matthew J. wrote:
> 
> Jira created as AMQ-2857.
> 
> https://issues.apache.org/activemq/browse/AMQ-2857
> 
> I have not yet created or posted a patch for the issue.
> 
> 
> Timothy Bish wrote:
>> 
>> ...
>> 
>> Can you open a new Jira issue for this, and even better, attach a
>> patch  :)
>> 
>> Regards
>> 
>> -- 
>> Tim Bish
>> 
>> Open Source Integration: http://fusesource.com
>> ActiveMQ in Action: http://www.manning.com/snyder/
>> 
>> Follow me on Twitter: http://twitter.com/tabish121
>> My Blog: http://timbish.blogspot.com/
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-fails-to-create-tables-in-MySQL-5.5.5-tp29310273p29423868.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Matthew J." <ma...@hotmail.com>.
Jira created as AMQ-2857.

https://issues.apache.org/activemq/browse/AMQ-2857

I have not yet created or posted a patch for the issue.


Timothy Bish wrote:
> 
> On Fri, 2010-07-30 at 15:04 -0700, Matthew J. wrote:
>> I have been running an embedded ActiveMQ database, using MySQL as the
>> JDBC
>> data source.  This worked fine under MySQL 5.4.  I have recently tried
>> upgrading to MySQL 5.5.5.  ActiveMQ works fine as long as the three
>> required
>> tables in the activemq database are already created.  However, if they
>> aren't, it fails to create the tables.
>>
>> ... 
> 
> Can you open a new Jira issue for this, and even better, attach a
> patch  :)
> 
> Regards
> 
> -- 
> Tim Bish
> 
> Open Source Integration: http://fusesource.com
> ActiveMQ in Action: http://www.manning.com/snyder/
> 
> Follow me on Twitter: http://twitter.com/tabish121
> My Blog: http://timbish.blogspot.com/
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/ActiveMQ-fails-to-create-tables-in-MySQL-5.5.5-tp29310273p29325782.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ fails to create tables in MySQL 5.5.5

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2010-07-30 at 15:04 -0700, Matthew J. wrote:
> I have been running an embedded ActiveMQ database, using MySQL as the JDBC
> data source.  This worked fine under MySQL 5.4.  I have recently tried
> upgrading to MySQL 5.5.5.  ActiveMQ works fine as long as the three required
> tables in the activemq database are already created.  However, if they
> aren't, it fails to create the tables.
> 
> The problem appears to be in the create table script that's used.  In
> previous versions of MySQL, it was legal (though deprecated as of 4.1) to
> specify the engine using the "TYPE=INNODB" syntax.  However, the preferred
> non-deprecated way to do it was to use "ENGINE=INNODB" instead.  However,
> under 5.5.5, it appears that the MySQL developers have made the "TYPE"
> syntax completely illegal, requiring use of the "ENGINE" syntax.
> 
> A relevant MySQL bug discussing the issue:
> http://bugs.mysql.com/bug.php?id=17501
> 
> The following is an example of the actual SQL that is generated by ActiveMQ:
> 
> CREATE TABLE ACTIVEMQ_MSGS(ID BIGINT NOT NULL, CONTAINER VARCHAR(250),
> MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG LONGBLOB,
> PRIMARY KEY ( ID ) ) TYPE=INNODB
> 
> I haven't had the opportunity to test it, but it seems likely that the
> culprit is MySqlJDBCAdapter.java.  It includes the line:
> 
> String typeClause = " TYPE="+type;
> 
> which should probably change to
> 
> String typeClause = " ENGINE="+type;
> 

Can you open a new Jira issue for this, and even better, attach a
patch  :)

Regards

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/