Rick Hillegas wrote:
Dag H. Wanvik wrote:
Isn't this a bug? Or?... I could not find a JIRA for it.

(unqualified schema in a view definition fails in view used by another user)

http://www.jroller.com/gmazza/entry/apache_derby_sql_state_42y07

Dag
In the trunk, the table reference is correctly resolved if, while logged in as user app, I switch to another schema which has a different table by the same name:

This issue is a result of user Bob (or foo) connecting and (indirectly)
attempting to access a table in a schema that does not exist yet. The schema
does not exist because Bob (or foo) has not created any database objects (yet),
nor has the schema been explicitly created.

In Rick's example, all schemas have already been created when the view is
accessed, so the error is avoided.

If you connect as a new user (foo), and don't explicitly create the schema
(foo), and don't create any database objects (such as tables), you will see the
error. As Derby is probably first looking for the correct table t1 in the
default schema of user foo, which is FOO, the error is thrown.

I think the situation where a user's default schema does not yet exist is
unfortunate and leads to a lot of confusion among our users. Not only in this
particular situation, but also when using external tools or frameworks to
connect to the database.

Does it make sense to do something about this, for example creating the schema
implicitly upon the first connection if it does not already exist?


--
John







Reply via email to