From: Pallavi Sontakke Date: Tue, 19 Jul 2016 05:17:49 +0000 (+0530) Subject: Add test case for Issue #5 X-Git-Tag: XL9_5_R1_2~21 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=fc9147058f22a468ad7ec397026f5b742a46720e;p=postgres-xl.git Add test case for Issue #5 --- diff --git a/src/test/regress/expected/xl_reported_bugs.out b/src/test/regress/expected/xl_reported_bugs.out index bacaa4b0cc..2d419ff260 100644 --- a/src/test/regress/expected/xl_reported_bugs.out +++ b/src/test/regress/expected/xl_reported_bugs.out @@ -15,3 +15,14 @@ EXPLAIN SELECT last_value(a) OVER (PARTITION by b) FROM (SELECT * FROM test) AS EXPLAIN SELECT last_value(a) OVER (PARTITION by b) FROM (SELECT * FROM test ORDER BY a) AS s ORDER BY a; DROP TABLE test; +-- #5 +-- Type corresponding to a view does not exist on datanode +CREATE TABLE test (a int, b int); +CREATE VIEW v AS SELECT * FROM test; +-- Using view type throws an error +CREATE FUNCTION testf (x v) RETURNS INTEGER AS $$ SELECT 1; $$ LANGUAGE SQL; +-- Same works for table type though +CREATE FUNCTION testf (x test) RETURNS INTEGER AS $$ SELECT 1; $$ LANGUAGE SQL; +DROP FUNCTION testf (x test); +DROP VIEW v; +DROP TABLE test; diff --git a/src/test/regress/sql/xl_reported_bugs.sql b/src/test/regress/sql/xl_reported_bugs.sql index 5b3b6097b5..847977a372 100644 --- a/src/test/regress/sql/xl_reported_bugs.sql +++ b/src/test/regress/sql/xl_reported_bugs.sql @@ -4,3 +4,18 @@ CREATE TABLE test (a int, b int); EXPLAIN SELECT last_value(a) OVER (PARTITION by b) FROM (SELECT * FROM test) AS s ORDER BY a; EXPLAIN SELECT last_value(a) OVER (PARTITION by b) FROM (SELECT * FROM test ORDER BY a) AS s ORDER BY a; DROP TABLE test; + +-- #5 +-- Type corresponding to a view does not exist on datanode +CREATE TABLE test (a int, b int); +CREATE VIEW v AS SELECT * FROM test; + +-- Using view type throws an error +CREATE FUNCTION testf (x v) RETURNS INTEGER AS $$ SELECT 1; $$ LANGUAGE SQL; + +-- Same works for table type though +CREATE FUNCTION testf (x test) RETURNS INTEGER AS $$ SELECT 1; $$ LANGUAGE SQL; + +DROP FUNCTION testf (x test); +DROP VIEW v; +DROP TABLE test;