db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [PATCH] Jira-189 ResultSetMetaData.getSchemaName and ResultSetMetaData.isWritable donot return correct values
Date Tue, 10 May 2005 21:22:48 GMT
Mamta Satoor wrote:

> Hi Dan,
> Here is another patch with more comments on the getTable/SchemaName
> and getSourceTable/SchemaName methods.
> As for your following question
> "Then with this patch ColumnReference has a getSchemaName() and a
> getSourceSchemaName(). I'm unclear on what the intended behaviour of
> each is, and why we need two methods. If getTableName() means return the
> "user" name or correlation name, then logically getSchemaName() would
> follow the same pattern, but user names or correlation names don't have
> schemas."
> You are right that there is no way to provide a correlation name for
> schema. But a user sql can look like following
> select app1.t1.c1, app2.t1.c1 from app1.t1, app2.t1
> For this sql, getSchemaName(and getSourceSchemaName) will return app1
> for first column and app2 for second column.
> For select t1.c1 from t1, getSchemaName for first column will return
> null but getSourceSchemaName will return app (assuming we are in the
> schema app).
> Aggregate functions rely on ColumnReference.getSchemaName at generate time.

The above comments and examples are really helpful, and would be even
more helpful if they were added to the javadoc comments for these
methods. :-)

A third example would be 'select a.c1 from t1 a'

I'll work on committing this patch.


View raw message