db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: feature or bug?
Date Wed, 28 Nov 2007 20:18:56 GMT
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:

ij version 10.4
ij> connect 'jdbc:derby:derby10.4;create=true';
WARNING 01J01: Database 'derby10.4' not created, connection made to 
existing database instead.
ij> ---------------------------------------
--
-- Drop all objects.
--
---------------------------------------
drop table foo.t1;
0 rows inserted/updated/deleted
ij> drop schema foo restrict;
0 rows inserted/updated/deleted
ij> drop view v1;
0 rows inserted/updated/deleted
ij> drop table t1;
0 rows inserted/updated/deleted
ij> ---------------------------------------
--
-- Create table and view in app schema
--
---------------------------------------
set schema app;
0 rows inserted/updated/deleted
ij> create table t1( intcol int );
0 rows inserted/updated/deleted
ij> create view v1 as select * from t1;
0 rows inserted/updated/deleted
ij> ---------------------------------------
--
-- Create table by the same name in foo schema
--
---------------------------------------
create schema foo;
0 rows inserted/updated/deleted
ij> set schema foo;
0 rows inserted/updated/deleted
ij> create table t1( charcol char( 1 ) );
0 rows inserted/updated/deleted
ij> ---------------------------------------
--
-- Now select from the view while in app schema.
-- Note that the table is resolved correctly.
--
---------------------------------------
set schema app;
0 rows inserted/updated/deleted
ij> select * from v1;
INTCOL    
-----------

0 rows selected
ij> select * from t1;
INTCOL    
-----------

0 rows selected
ij> ---------------------------------------
--
-- Now select from the view while in foo schema.
-- Note that the table is still resolved correctly.
--
---------------------------------------
set schema foo;
0 rows inserted/updated/deleted
ij> select * from app.v1;
INTCOL    
-----------

0 rows selected
ij> select * from t1;
CHA&
----

0 rows selected


Mime
View raw message