Comment 1 for bug 1403607

Revision history for this message
Anoop Sharma (anoop-sharma) wrote :

This is not an issue with initialize and is expected behavior.

When a table in a query is correlated, then the correlation name is returned
by binder/compiler in case of an error accessing it.
For an internal query against metadata, if that metadata doesn't exist, then
the correlated name used in the internal metadata query is returned.

This behavior has always been like this (from pre-trafodion days) and should
not be treated as a a bug.

Has this case been filed to change the binder behavior and return the
name of the underlying table in case of an error? What if the underlying
table is a derived table or another query?

Here is a example of a query that accesses table ZZ which
does not exist. The error msg shows correlated name T.

>>prepare s from select * from zz t;

*** ERROR[4082] Object T does not exist or is inaccessible.

*** ERROR[8822] The statement was not prepared.

>>

If table ZZ exists, then other errors(like a missing columns) also refer to the correlated name:

>>prepare s from select * from zz t where t.a = 1;

*** ERROR[4003] Column T.A is not a column in table T, or, after a NATURAL JOIN or JOIN USING, is no longer allowed to be specified with a table correlation name.

*** ERROR[8822] The statement was not prepared.

>>

We should document this behavior and close this case.