db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "TomohitoNakayama" <tomon...@basil.ocn.ne.jp>
Subject Re: About improvement of DERBY-134
Date Sun, 13 Mar 2005 18:41:31 GMT
Thanks Satheesh.

It seems that I could address this phenomena evaluating 
resultCol.isNameGenerated() in OrderByColumn.bindOrderByColumn.

Best regards.

/*

         Tomohito Nakayama
         tomoihto@rose.zero.ad.jp
         tomonaka@basil.ocn.ne.jp

         Naka
         http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/
  ----- Original Message ----- 
  From: Satheesh Bandaram
  To: Derby Development
  Sent: Monday, March 14, 2005 2:53 AM
  Subject: Re: About improvement of DERBY-134


  I think new behavior is a bug... and should be addressed in the patch. 
Since there is no column name called 'SQLCol1' in the user querry, accepting 
an order by with that name is incorrect. Column names like these are 
generated names when there is no exposed name or alias provided for the 
result columns. Derby generates these names and should be hidden to the end 
user.

  It should be easy to address this. You probably need to mark any new 
expressions you are adding as generated columns using setNameGenerated(true) 
call.

  Satheesh

  TomohitoNakayama wrote:

    Hello.

    I tried to change handling single column name in order by clause , and 
just finished coding.
    Now single column name is treated as additiveExpression in afterPatch.

    And I have found next difference in orderby.out between beforePatch and 
afterPatch as follows.
    I 'm confusing whether I should judge this is bug or not.

    beforePatch
    ij> -- . order by doesn't see generated names
    values (1,0,1),(1,0,0),(0,0,1),(0,1,0);
    1          |2          |3
    ----------------------------------- 
    1          |0          |1
    1          |0          |0
    0          |0          |1
    0          |1          |0
    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by "SQLCol1";
    ERROR 42X78: Column 'SQLCol1' is not in the result of the query 
expression.
    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by "SQLCol2";
    ERROR 42X78: Column 'SQLCol2' is not in the result of the query 
expression.
    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by 1,1,2,3;
    1          |2          |3
    ----------------------------------- 
    0          |0          |1
    0          |1          |0
    1          |0          |0
    1          |0          |1

    afterPatch
    ij> -- . order by doesn't see generated names ....?
    values (1,0,1),(1,0,0),(0,0,1),(0,1,0);
    1          |2          |3
    ----------------------------------- 
    1          |0          |1
    1          |0          |0
    0          |0          |1
    0          |1          |0

      -- now next was accepted.

    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by "SQLCol1";
    1          |2          |3
    ----------------------------------- 
    0          |1          |0
    0          |0          |1
    1          |0          |0
    1          |0          |1

      -- now next was accepted too.

    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by "SQLCol2";
    1          |2          |3
    ----------------------------------- 
    0          |0          |1
    1          |0          |0
    1          |0          |1
    0          |1          |0
    ij> values (1,0,1),(1,0,0),(0,0,1),(0,1,0) order by 1,1,2,3;
    1          |2          |3
    ----------------------------------- 
    0          |0          |1
    0          |1          |0
    1          |0          |0
    1          |0          |1

    I have some question now.

    Q1:
    What is  "generated names" ?
    <"> "SQLCol NUMBER" <"> seems to be called "generated names".

    Q2:
    Why was it error to use "generated name" in order by caluse as seen in 
beforePatch?

    Q3:
    Is it bug to accept "generated names" in order clause like as in 
afterPatcch ?

    Please give me some adivise...

    Best regards.

    /*

            Tomohito Nakayama
            tomoihto@rose.zero.ad.jp
            tomonaka@basil.ocn.ne.jp

            Naka
            http://www5.ocn.ne.jp/~tomohito/TopPage.html

    */





------------------------------------------------------------------------------


  No virus found in this incoming message.
  Checked by AVG Anti-Virus.
  Version: 7.0.308 / Virus Database: 266.7.2 - Release Date: 2005/03/11

Mime
View raw message