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
        [EMAIL PROTECTED]
        [EMAIL PROTECTED]

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

*/


Reply via email to