You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Matthew J. (JIRA)" <ji...@apache.org> on 2010/08/06 03:36:52 UTC

[jira] Created: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

ActiveMQ fails to create tables in MySQL 5.5.5
----------------------------------------------

                 Key: AMQ-2857
                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.3.2
         Environment: MySQL 5.5.5
            Reporter: Matthew J.
            Priority: Minor


Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.

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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.

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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Matthew J. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthew J. updated AMQ-2857:
----------------------------

    Patch Info: [Patch Available]

> ActiveMQ fails to create tables in MySQL 5.5.5
> ----------------------------------------------
>
>                 Key: AMQ-2857
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.2
>         Environment: MySQL 5.5.5
>            Reporter: Matthew J.
>            Priority: Minor
>         Attachments: mysqlpatch.txt
>
>
> Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.
> 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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.
> 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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Matthew J. (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61207#action_61207 ] 

Matthew J. commented on AMQ-2857:
---------------------------------

Downloaded the latest snapshot, and it does appear to be working correctly for me.

One thing I noticed in the class was that the "ENGINE" string is still being used directly when using NDBCLUSTER:

{code}           
l.add("ALTER TABLE "+statements.getFullMessageTableName()+" ENGINE="+NDBCLUSTER);
l.add("ALTER TABLE "+statements.getFullAckTableName()+" ENGINE="+NDBCLUSTER);
l.add("ALTER TABLE "+statements.getFullLockTableName()+" ENGINE="+NDBCLUSTER);
{code}

It looks like NDBCLUSTER was added in MySQL 5.x, so the ENGINE statement will always be correct in the MySQL versions that support it.    It just looks strange that we're using the "typeStatement" variable in some cases but not in others.  Would it be worth changing these lines as well merely for the sake of consistency?

> ActiveMQ fails to create tables in MySQL 5.5.5
> ----------------------------------------------
>
>                 Key: AMQ-2857
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.2
>         Environment: MySQL 5.5.5
>            Reporter: Matthew J.
>            Assignee: Gary Tully
>            Priority: Minor
>             Fix For: 5.4.1
>
>         Attachments: mysqlpatch.txt
>
>
> Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.
> 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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.
> 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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Matthew J. (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthew J. updated AMQ-2857:
----------------------------

    Attachment: mysqlpatch.txt

Attaching patch file which fixes MySqlJDBCAdapter.java.  Tested this locally, and it did appear to fix the issue.

> ActiveMQ fails to create tables in MySQL 5.5.5
> ----------------------------------------------
>
>                 Key: AMQ-2857
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.2
>         Environment: MySQL 5.5.5
>            Reporter: Matthew J.
>            Priority: Minor
>         Attachments: mysqlpatch.txt
>
>
> Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.
> 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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.
> 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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully reassigned AMQ-2857:
-------------------------------

    Assignee: Gary Tully

> ActiveMQ fails to create tables in MySQL 5.5.5
> ----------------------------------------------
>
>                 Key: AMQ-2857
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.2
>         Environment: MySQL 5.5.5
>            Reporter: Matthew J.
>            Assignee: Gary Tully
>            Priority: Minor
>         Attachments: mysqlpatch.txt
>
>
> Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.
> 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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.
> 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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-2857) ActiveMQ fails to create tables in MySQL 5.5.5

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-2857.
-----------------------------

    Fix Version/s: 5.4.1
       Resolution: Fixed

variant of patch applied in r985151
added typeStatement attribute to make this configurable for backwards compatibility, default to new ENGINE statement so it will work out of the box with MySQL 5.5
Tanks for the patch. Would be great if you could validate a 5.5 snapshot over the next few days.

> ActiveMQ fails to create tables in MySQL 5.5.5
> ----------------------------------------------
>
>                 Key: AMQ-2857
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2857
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.2
>         Environment: MySQL 5.5.5
>            Reporter: Matthew J.
>            Assignee: Gary Tully
>            Priority: Minor
>             Fix For: 5.4.1
>
>         Attachments: mysqlpatch.txt
>
>
> Running an embedded ActiveMQ database, using MySQL as the JDBC data source worked fine under MySQL 5.4.  After upgrading to MySQL 5.5.5, ActiveMQ works fine as long as the three required tables in the activemq database already exist (activemq_acks, activemq_lock, activemq_msgs).  However, if they don't exist, it fails to create the tables, whereas the tables would be automatically created under MySQL 5.4.
> 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.  The preferred non-deprecated way to do it was to use "ENGINE=INNODB" instead.  Under 5.5.5, it appears that the "TYPE" syntax is now completely illegal, requiring use of the "ENGINE" syntax instead.
> 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 have not yet tested 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;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.