From: Marko Kreen Date: Wed, 14 May 2008 12:25:00 +0000 (+0000) Subject: make RUN optional, defaulting to RUN ON 0; X-Git-Tag: plproxy_2_0_5_rc1~4 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ef300f3c92784900153a42dd6bf8e27eab31b551;p=plproxy.git make RUN optional, defaulting to RUN ON 0; --- diff --git a/expected/plproxy_test.out b/expected/plproxy_test.out index ed35e9e..9cc596d 100644 --- a/expected/plproxy_test.out +++ b/expected/plproxy_test.out @@ -215,7 +215,7 @@ select * from test_types('types', NULL, NULL, NULL); create domain posint as int4 check (value > 0); create type struct as (id int4, data text); create function test_types2(username text, inout v_posint posint, inout v_struct struct, inout arr int8[]) -as $$ cluster 'testcluster'; run on 0; $$ language plproxy; +as $$ cluster 'testcluster'; $$ language plproxy; \c test_part create domain posint as int4 check (value > 0); create type struct as (id int4, data text); diff --git a/sql/plproxy_test.sql b/sql/plproxy_test.sql index 41dd0ec..43cd7d4 100644 --- a/sql/plproxy_test.sql +++ b/sql/plproxy_test.sql @@ -127,7 +127,7 @@ create domain posint as int4 check (value > 0); create type struct as (id int4, data text); create function test_types2(username text, inout v_posint posint, inout v_struct struct, inout arr int8[]) -as $$ cluster 'testcluster'; run on 0; $$ language plproxy; +as $$ cluster 'testcluster'; $$ language plproxy; \c test_part create domain posint as int4 check (value > 0); diff --git a/src/parser.y b/src/parser.y index 9f19de2..9f21124 100644 --- a/src/parser.y +++ b/src/parser.y @@ -151,6 +151,10 @@ void plproxy_run_parser(ProxyFunction *func, const char *body, int len) got_run = got_cluster = got_connect = 0; cur_sql = select_sql = cluster_sql = hash_sql = NULL; + /* By default expect RUN ON 0; */ + xfunc->run_type = R_EXACT; + xfunc->exact_nr = 0; + /* setup scanner */ plproxy_yy_scan_bytes(body, len); @@ -164,8 +168,6 @@ void plproxy_run_parser(ProxyFunction *func, const char *body, int len) } else { if (!got_cluster) yyerror("CLUSTER statement missing"); - if (!got_run) - yyerror("RUN statement missing"); } /* reinitialize scanner */