Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 3900 invoked from network); 15 May 2007 21:29:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 May 2007 21:29:42 -0000 Received: (qmail 64034 invoked by uid 500); 15 May 2007 21:29:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 63983 invoked by uid 500); 15 May 2007 21:29:45 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 63934 invoked by uid 99); 15 May 2007 21:29:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2007 14:29:44 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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; Tue, 15 May 2007 14:29:37 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5286E71406F for ; Tue, 15 May 2007 14:29:17 -0700 (PDT) Message-ID: <5020079.1179264557335.JavaMail.jira@brutus> Date: Tue, 15 May 2007 14:29:17 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-2335) Compare character datatypes with different collation ordering. In-Reply-To: <11316854.1171484585505.JavaMail.jira@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 [ https://issues.apache.org/jira/browse/DERBY-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor updated DERBY-2335: ----------------------------------- Attachment: DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v2_stat.txt DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v2_diff.txt Committed attached patch (DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v2_diff.txt) with revision 538325 and following comments DERBY-2335 Made changes such that rather than having a new method in BaseTypeCompiler to push the DVD on the stack at code generation time, we use the existing method that accomplishes the same task in ExpressionClassBuilder. The junit tests have run fine with these changes and the stack trace experienced by Army in DERBY-2335 has been fixed by this fix. The reason for stack trace was that the lifetime of a BaseTypeCompiler is longer than a single class generation and I was trying to hold a reference to a declared method from MethodBuilder.describeMethod across the generated classes. This discussion can be found at http://www.nabble.com/DERBY-1478-subtask-DERBY-2583---need-help-in-debugging-stack-trace-thrown-during-code-generation-p10611184.html > Compare character datatypes with different collation ordering. > -------------------------------------------------------------- > > Key: DERBY-2335 > URL: https://issues.apache.org/jira/browse/DERBY-2335 > Project: Derby > Issue Type: Sub-task > Components: SQL > Affects Versions: 10.3.0.0 > Reporter: Mamta A. Satoor > Assigned To: Mamta A. Satoor > Attachments: DERBY2335_correct_collation_for_constants_persistent_column_v1_diff.txt, DERBY2335_correct_collation_for_constants_persistent_column_v1_stat.txt, DERBY2335_fix_stringCompare_Method_CollatorSQLxxx_classes_v1_diff.txt, DERBY2335_fix_stringCompare_Method_CollatorSQLxxx_classes_v1_stat.txt, DERBY2335_More_tests_And_Fix_getNull_v1_diff.txt, DERBY2335_More_tests_And_Fix_getNull_v1_stat.txt, DERBY2335_Use_LCC_in_ValueNode_v1_diff.txt, DERBY2335_Use_LCC_in_ValueNode_v1_stat.txt, DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v1_diff.txt, DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v1_stat.txt, DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v2_diff.txt, DERBY2335_Use_PushDataValueFactory_in_ExpressionClassBuilder_v2_stat.txt > > > The parent task DERBY-1478 will enable users to have a different collation order for user-defined character datatypes compared to UNICODE based collation, UCS_BASIC, used by system tables. This sub-task is added to handle the case where a comparison is made between character datatypes with different collation order. > For instance > Let's say, a database is created to use a territory based collation for character types. And say there is a userSchema schema in that database which has a table tableInfo with column tablename defined as VARCHAR. This tableInfo.tablename will have territory based collation assoicated with it. And say this column is then compared with a VARCHAR column in SYS schema, then how will the comparison happen, since the 2 columns being compared have different collation associated with them? > select * from sys.systables and userSchema.tableInfo where systables.tablename = tableInfo,tablename > Thanks to Rick for taking the time out on this issue. He had following suggestion > > "As I read part 2 of the SQL Standard, it looks like you need a CAST in order to compare 2 strings which have different collations bound to them. Both string operands must have the same collation--that is my reading of Syntax rule 3b in section 9.13. Sections 6.12 and 6.1 explain how to cast the operands so that you can compare them. I think you need to write an expression like this: > WHERE userStringCol = CAST ( systemStringCol AS VARCHAR COLLATE userStringColumnsCollation ) > Here's an example I googled up: http://docs.openlinksw.com/virtuoso/sqlrefDATATYPES.html. Hope this helps. > > When this task is taken up, it would be good to explore Rick's suggestion. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.