Consider the following two test cases:
CASE A:
create table t1(f1 int);
create or replace function cache_test(int) returns void as $$
begin
insert into t1 values($1);
end
$$ language plpgsql;
select cache_test(23);
Here the targetlist for the insert inside the function is not null, but we do not need to send describe message. However even if we do send describe message, the system works but this is an additional un-necessary message being sent to the datanodes.
CASE B:
create table t2(a int, b int);
INSERT INTO t2 VALUES(1,2);
create or replace function upd_test(int) returns void as $$
begin
update t2 set b=$1;
end
$$ language plpgsql;
select upd_test(23);
This is very similar to CASE A, but here again the targetlist for the update inside the function is not null but we do not need to send describe message.
Once this bug is fixed one needs to fix this condition in pgxc_start_command_on_connection function
if (step->base_tlist != NULL ||
step->exec_nodes->accesstype == RELATION_ACCESS_READ ||
step->has_row_marks)
send_desc = true;
The correct condition should be just
if (step->base_tlist != NULL)
send_desc = true;