dynamobi/dynamobi — Issue #673: [FRG-199] having clause column always needs to be qualified with tablename
Author: dynamobi-build
Created: 2011-12-30 03:42:31+00:00
State: open
Labels: FRG, Sql2Rel

[reporter="schoi", created="Mon, 11 Sep 2006 17:58:23 -0500 (GMT-05:00)"]
repro:

----------

create schema s;

set schema 's';

create table qrysrcnum (

n1 numeric (2, 0) primary key,

n2 numeric (5, 2));

insert into qrysrcnum values ( 5, 20.00 );

insert into qrysrcnum values ( 7, 10.00 );

-- doesn't work

SELECT n1, n2

FROM qrysrcnum

GROUP BY n1, n2

HAVING n1 > 5;

Error: java.lang.AssertionError: Internal error: Identifier 'N1' is not a group expr (state=,code=0)

net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: java.lang.AssertionError: Internal error: Identifier 'N1' is not a group expr

at org.eigenbase.util.Util.newInternal(Util.java:785)

at org.eigenbase.sql2rel.SqlToRelConverter.convertIdentifier(SqlToRelConverter.java:1907)

at org.eigenbase.sql2rel.SqlToRelConverter.access$900(SqlToRelConverter.java:58)

at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:2714)

at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:2294)

at org.eigenbase.sql.SqlIdentifier.accept(SqlIdentifier.java:349)

at org.eigenbase.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:2638)

at org.eigenbase.sql2rel.StandardConvertletTable.convertExpressionList(StandardConvertletTable.java:737)

at org.eigenbase.sql2rel.StandardConvertletTable.convertCall(StandardConvertletTable.java:726)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

-- works

SELECT n1, n2

FROM qrysrcnum

GROUP BY n1, n2

HAVING qrysrcnum.n1 > 5;

+-----+--------+

| N1 | N2 |

+-----+--------+

| 7 | 10.00 |

+-----+--------+