[ http://issues.apache.org/jira/browse/DERBY-1304?page=comments#action_12436003 ] Bryan Pendleton commented on DERBY-1304: ----------------------------------------
Hi Yip, thanks for the patch! I had a look at your comments and at the patch code, and it seems reasonable to me. However, I am having a strange result with the testing. I tried running your test case without the code change, and the test passes, where I had expected the test to fail. Strangely, though, based on the description in the comments, I tried typing in a very similar test case and it failed just as I expected it to: create schema s; create table s.t1 (a int); create view s.v1 as select a as c_1 from s.t1; drop view s.v1; drop table s.t1; drop schema s restrict; create schema s; create table s.t1 (a int); create view s.v1 as select a as c_1 from s.t1; drop view s.v1; At this last statement, I get "ERROR X0X05: Table/View 'S.V1' does not exist.". But for some reason, I don't get this error with your test case. I am mystified by this and can't explain why the two scripts would have different behavior, but I double-checked my steps several times and am pretty confident that I am seeing that behavior. Can you help me understand why I might be seeing this different behavior? > DROP view does not always completely remove view > ------------------------------------------------ > > Key: DERBY-1304 > URL: http://issues.apache.org/jira/browse/DERBY-1304 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.1.2.1 > Environment: Windows XP > Reporter: Piet Blok > Assigned To: Yip Ng > Fix For: 10.2.1.0 > > Attachments: derby1304-trunk-diff01.txt, derby1304-trunk-stat01.txt > > > Execute the following scenario: > Create a schema > Create a table > Create a view > Drop the view > Drop the table > Drop the schema > The first time this sequence executes OK, However, executing the same > sequence again fails on the drop view: > ERROR X0X05: Table 'view' does not exist. > When I leave out the create and drop of a view, all goes well, so it seems > to have something to do with the view. > I encountered the problem first using > org.apache.derby.jdbc.ClientConnectionPoolDataSource, but later I found that > the problem is reproducable with a simple ij script as follows: > -- ******************************************************* > -- Setup connection > -- ******************************************************* > connect 'jdbc:derby://localhost/TestData;create=true;'; > -- ******************************************************* > -- The first time > -- ******************************************************* > CREATE SCHEMA TEST_SCHEMA; > CREATE TABLE TEST_SCHEMA.T1 (TABLE_COLUMN LONG VARCHAR); > CREATE VIEW TEST_SCHEMA.V1 AS SELECT TABLE_COLUMN AS VIEW_COLUMN FROM > TEST_SCHEMA.T1; > DROP VIEW TEST_SCHEMA.V1; > DROP TABLE TEST_SCHEMA.T1; > DROP SCHEMA TEST_SCHEMA RESTRICT; > -- ******************************************************* > -- The second time > -- ******************************************************* > CREATE SCHEMA TEST_SCHEMA; > CREATE TABLE TEST_SCHEMA.T1 (TABLE_COLUMN LONG VARCHAR); > CREATE VIEW TEST_SCHEMA.V1 AS SELECT TABLE_COLUMN AS VIEW_COLUMN FROM > TEST_SCHEMA.T1; > DROP VIEW TEST_SCHEMA.V1; -- This statement fails > DROP TABLE TEST_SCHEMA.T1; > DROP SCHEMA TEST_SCHEMA RESTRICT; > -- ******************************************************* > -- Cleanup > -- ******************************************************* > disconnect; > connect 'jdbc:derby://localhost/TestData;shutdown=true;'; > As an explanation why I would like to be able to create and then drop views: > I am trying to interactively create my table setup. When I make mistakes I > must drop wrongly defined tables or views. > I encountered some other very strange behaviour that might be related to this > issue (table not found when I just created it and wanted to create a second > table with a foreign key referencing the first table), but which I am not yet > able to reproduce in a consistent and simple way. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
