Return-Path: Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: (qmail 84809 invoked from network); 3 Feb 2009 08:44:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Feb 2009 08:44:06 -0000 Received: (qmail 69416 invoked by uid 500); 3 Feb 2009 08:44:06 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 69396 invoked by uid 500); 3 Feb 2009 08:44:06 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 69387 invoked by uid 99); 3 Feb 2009 08:44:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 00:44:06 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2009 08:44:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 83A89234C4B4 for ; Tue, 3 Feb 2009 00:43:45 -0800 (PST) Message-ID: <426334594.1233650625536.JavaMail.jira@brutus> Date: Tue, 3 Feb 2009 00:43:45 -0800 (PST) From: "Andrus Adamchik (JIRA)" To: commits@cayenne.apache.org Subject: [jira] Closed: (CAY-878) Field names for INSERT are unquoted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/cayenne/browse/CAY-878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrus Adamchik closed CAY-878. ------------------------------- Resolution: Duplicate Let's use CAY-289 for tracking the quoting feature. It will work the same for all types of queries. > Field names for INSERT are unquoted > ----------------------------------- > > Key: CAY-878 > URL: https://issues.apache.org/cayenne/browse/CAY-878 > Project: Cayenne > Issue Type: Bug > Affects Versions: 3.0 > Environment: MySQL/Tomcat/Cayenne > Reporter: Scott Anderson > Assignee: Andrus Adamchik > > My INSERT query fails against MySQL because I have a field named `group` that is not unquoted. > Oct 10, 2007 4:12:31 PM org.apache.cayenne.access.QueryLogger logQuery > INFO: INSERT INTO requests2 (autoengineer, close_time, completion_comments, completion_passfail, completion_time, group, idx, lab_action, lab_budget, lab_date_needed, lab_device_id, lab_location, lab_program, lab_rack_no, lab_requesting_group, lab_serial_no, model_affecting, model_changes, platform, priority, req_type, request, rpt_affecting, rpt_changes, state, submission_comments, submit_time, submitter, testcnt, ui_affecting, ui_changes, version) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) > Oct 10, 2007 4:12:31 PM org.apache.cayenne.access.QueryLogger logQueryParameters > INFO: [bind: NULL, '2005-11-02 10:51:13.0', '
IMPLEMENT COMMENTS: All do...', NULL, '2005-11-02 10:34:39.0', NULL, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'false', NULL, 'ClearQuest Tools', 03, NULL, 'Test Plan Import Problems', 'false', NULL, 'CLOSED', 'Please update the CQ export to...', '2005-10-12 13:18:42.0', 'ddarrah', 0, 'false', NULL, NULL] > Oct 10, 2007 4:12:32 PM org.apache.cayenne.access.QueryLogger logQueryError > INFO: *** error. > com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, idx, lab_action, lab_budget, lab_date_needed, lab_device_id, lab_location' at line 1 > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715) > at com.mysql.jdbc.Connection.execSQL(Connection.java:3249) > at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1541) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1455) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1440) > at org.apache.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:191) > at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:84) > at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:57) > at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:236) > at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:225) > at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:143) > at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:803) > at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:770) > at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:829) > at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:767) > at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1159) > at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1072) > at com.airvana.nmms.autodb.test.main(test.java:91) > Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.3.0-SNAPSHOT Sep 01 2007 17:06:09] Commit Exception > at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1191) > at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1072) > at com.airvana.nmms.autodb.test.main(test.java:91) > Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, idx, lab_action, lab_budget, lab_date_needed, lab_device_id, lab_location' at line 1 > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941) > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623) > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715) > at com.mysql.jdbc.Connection.execSQL(Connection.java:3249) > at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1541) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1455) > at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1440) > at org.apache.cayenne.access.jdbc.BatchAction.runAsIndividualQueries(BatchAction.java:191) > at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:84) > at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:57) > at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:236) > at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:225) > at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:143) > at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:803) > at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:770) > at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:829) > at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:767) > at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1159) > ... 2 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.