Bugs item #555070, was opened at 2002-05-12 05:49 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=555070&group_id=22866
Category: JBossCMP >Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Dylan van Iersel (dviersel) Assigned to: Dain Sundstrom (dsundstrom) Summary: Incorrect CREATE statement for MySQL ds Initial Comment: The CREATE statement to create a new table in a MySQL datasource does not quote the tablename nor the column names. This causes problems when tables are created with names corresponding to MySQL reserved words. For example: when deploying an entity bean called "Group", JBoss trace shows: org.jboss.deployment.DeploymentException: Could not deploy njar:file:/C:/Java/jboss- 3.0.0RC2/server/ default/tmp/deploy/server/default/deploy/rcontrol.ear/80.rcontrol.ear^/nntp- bingrab.jar; - nested th rowable: (org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: Syntax error or access violation: You have an error in your SQL syntax near 'Group (id VARCHAR(255) BINARY NOT NULL, CONSTRAINT pk_Group PRIMARY KEY (id))' at line 1)) When I directly enter this CREATE statement on the MySQL command-line, I get the same error, whilst when I surround them by quotes (`) the table is created correctly. OS: Win2000 JDK: 1.3.1 JBoss 3.0 RC2 ---------------------------------------------------------------------- Comment By: Dain Sundstrom (dsundstrom) Date: 2002-05-14 13:09 Message: Logged In: YES user_id=251431 This is unlikely to change any time soon. I suggest you avoid sql reserved words. In the future, I want to add some code that will autogenerate around SQL reserved words. ---------------------------------------------------------------------- Comment By: Stephen Coy (scoy) Date: 2002-05-13 02:29 Message: Logged In: YES user_id=463096 Further to this, I've added a feature request (555315) regarding this because I think the current behaviour is more of a limitation of the current design/implementation rather than a bug per se. ---------------------------------------------------------------------- Comment By: Stephen Coy (scoy) Date: 2002-05-13 01:30 Message: Logged In: YES user_id=463096 Further to this, I've added a feature request (555315) regarding this because I think the current behaviour is more of a limitation of the current design/implementation rather than a bug per se. ---------------------------------------------------------------------- Comment By: Stephen Coy (scoy) Date: 2002-05-13 01:06 Message: Logged In: YES user_id=463096 This issue is not limited to MySQL. It's my understanding that all JDBC 2.0 compliant drivers are supposed to support the quoting syntax. For now, you need to set up name mappings manually in jbosscmp-jdbc.xml. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=555070&group_id=22866 _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development