On 2015-06-19 01:04, Petr Jelinek wrote:
On 2015-06-19 00:38, Petr Jelinek wrote:
On 2015-06-18 22:04, Tom Lane wrote:

By the by, the tablesample additions to range_table_mutator are
obviously
broken.


Bah, typos. Attached patch corrects them.


Actually it should probably look more like this, sorry.


Apparently it's not a good idea to do this at 1AM after long day :/

The previous diff included some garbage in tests from my local experimentations.

--
 Petr Jelinek                  http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/backend/nodes/nodeFuncs.c b/src/backend/nodes/nodeFuncs.c
index a2bcca5..1c89abb 100644
--- a/src/backend/nodes/nodeFuncs.c
+++ b/src/backend/nodes/nodeFuncs.c
@@ -2870,9 +2870,10 @@ range_table_mutator(List *rtable,
 			case RTE_RELATION:
 				if (rte->tablesample)
 				{
-					MUTATE(rte->tablesample->args, rte->tablesample->args,
+					FLATCOPY(newrte->tablesample, rte->tablesample, TableSampleClause);
+					MUTATE(newrte->tablesample->args, rte->tablesample->args,
 						   List *);
-					MUTATE(rte->tablesample->repeatable,
+					MUTATE(newrte->tablesample->repeatable,
 						   rte->tablesample->repeatable, Node *);
 				}
 				break;
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to