Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 46002 invoked from network); 26 Nov 2006 18:26:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2006 18:26:27 -0000 Received: (qmail 90985 invoked by uid 500); 26 Nov 2006 18:26:36 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 90976 invoked by uid 500); 26 Nov 2006 18:26:36 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 90965 invoked by uid 99); 26 Nov 2006 18:26:36 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 10:26:36 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 10:26:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 49DB471435A for ; Sun, 26 Nov 2006 10:25:41 -0800 (PST) Message-ID: <1461636.1164565541300.JavaMail.jira@brutus> Date: Sun, 26 Nov 2006 10:25:41 -0800 (PST) From: "Thomas Vandahl (JIRA)" To: torque-dev@db.apache.org Subject: [jira] Closed: (TORQUE-57) escapeText() method in DBOracle returns false but escape characters are required in Oracle in certain cases In-Reply-To: <23271501.1160381480831.JavaMail.root@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/TORQUE-57?page=all ] Thomas Vandahl closed TORQUE-57. -------------------------------- > escapeText() method in DBOracle returns false but escape characters are required in Oracle in certain cases > ----------------------------------------------------------------------------------------------------------- > > Key: TORQUE-57 > URL: http://issues.apache.org/jira/browse/TORQUE-57 > Project: Torque > Issue Type: Bug > Components: Runtime > Affects Versions: 3.2 > Environment: All OS, All hardware, Oracle Data base > Reporter: parthasarathy > Assigned To: Thomas Fischer > Priority: Minor > Fix For: 3.3 > > > Oracle uses escape characters for interpreting certain special characters like "_" literally. However the escapeText() method in > org.apache.torque.adapter.DBOracle class returns false. The value returned by this method is used by the SqlExpression.quoteAndEscape method. As the escapeText method returns false a where clause condition: like 'abc\_%' will get translated to: like 'abc\%' (note the missing "_") in the SQLExpression.buildLike method. Sybase and SQL Server also has the same Escape behavior but the escapeText() method in DBSybase and DBMSSQL returns true. > Below is a copy of the source code in DBOracle. > /** > * This method is for the SqlExpression.quoteAndEscape rules. The rule is, > * any string in a SqlExpression with a BACKSLASH will either be changed to > * "\\" or left as "\". SapDB does not need the escape character. > * > * @return false. > */ > public boolean escapeText() > { > return false; > } > The usecase I am trying out is one where a column in the table queried has values 'abc' and 'a_c'. I need to query the record that has the column value as 'a_c'. If I issue a query without escapecharacters (where like 'a_%' ) both the rows are returned. I need to provide a where clause with the condition as like 'a\_%' to get the correct record (also need to add ESCAPE keyword to the query). However, because escapeText returns false, the criteria value gets built wrongly in the buildLike method of SQLExpression class.. (the method returns 'a\%'). If escapeText returns true this problem will be solved (ESCAPE keyword addition needs to be tackled separately also). > information regarding escape characters in Oracle http://www.dba-oracle.com/tips_oracle_escape_characters.htm -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org