From d14dda202c0b0f696ed48e41a50c3695ce7a63a7 Mon Sep 17 00:00:00 2001 From: Pallavi Sontakke Date: Tue, 26 Jul 2016 15:31:24 +0530 Subject: [PATCH] Add test case for Issue #13 INSERT query with SELECT part using joins on OID fails to insert all rows correctly --- src/test/regress/expected/xl_reported_bugs.out | 18 ++++++++++++++++++ src/test/regress/sql/xl_reported_bugs.sql | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/src/test/regress/expected/xl_reported_bugs.out b/src/test/regress/expected/xl_reported_bugs.out index 77a1b3f08a..33b8daecbc 100644 --- a/src/test/regress/expected/xl_reported_bugs.out +++ b/src/test/regress/expected/xl_reported_bugs.out @@ -1,3 +1,21 @@ +-- #13 +-- INSERT query with SELECT part using joins on OID fails to insert all rows correctly +create table tmp_films(a int, b text default 'a_tmp_film') with oids; +create table films(a int, b text default 'a_film') with oids; +insert into tmp_films select generate_series(1, 10000);-- 10K entries +select count(*) from tmp_films; + count +------- + 10000 +(1 row) + +insert into films select * from tmp_films where oid >= (select oid from tmp_films order by oid limit 1); +select count(*) from films; + count +------- + 10000 +(1 row) + -- #9 -- Fails to see DDL's effect inside a function create function xl_getint() returns integer as $$ diff --git a/src/test/regress/sql/xl_reported_bugs.sql b/src/test/regress/sql/xl_reported_bugs.sql index 1e7181019d..ccc751e7d4 100644 --- a/src/test/regress/sql/xl_reported_bugs.sql +++ b/src/test/regress/sql/xl_reported_bugs.sql @@ -1,3 +1,11 @@ +-- #13 +-- INSERT query with SELECT part using joins on OID fails to insert all rows correctly +create table tmp_films(a int, b text default 'a_tmp_film') with oids; +create table films(a int, b text default 'a_film') with oids; +insert into tmp_films select generate_series(1, 10000);-- 10K entries +select count(*) from tmp_films; +insert into films select * from tmp_films where oid >= (select oid from tmp_films order by oid limit 1); +select count(*) from films; -- #9 -- Fails to see DDL's effect inside a function create function xl_getint() returns integer as $$ -- 2.39.5