runc / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Create or replace view statement has no effect on the JDBC connection #516

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
MC_OPR is a view as "select * from MC_OPR_M",

Connection conn = datasource.getConnection();
conn.createStatement().executeQuery("select * from MC_OPR");  // then return 
from MC_OPR_M

conn.createStatement().execute("create or replace view MC_OPR as select * from 
MC_OPR_S");
conn.createStatement().executeQuery("select * from MC_OPR");  // but also 
return from MC_OPR_M

Original issue reported on code.google.com by artern@gmail.com on 16 Oct 2013 at 2:32

GoogleCodeExporter commented 9 years ago
This is fixed in current SVN.
Not sure exactly when it got fixed, but this test case works for me.

CREATE TABLE MC_OPR_M (id int);
insert into mc_opr_m values (1);
CREATE VIEW MC_OPR AS select * from MC_OPR_M;
CREATE TABLE MC_OPR_S (id int);
insert into mc_opr_s values (2);
create or replace view MC_OPR as select * from MC_OPR_S;
select * from mc_opr;

Original comment by noelgrandin on 16 Oct 2013 at 2:05