apache / cloudberry

One advanced and mature open-source MPP (Massively Parallel Processing) database. Open source alternative to Greenplum Database.
https://cloudberry.apache.org
Apache License 2.0
648 stars 112 forks source link

[Bug] manage pg_task in code block got ERROR: unrecognized node type: 742 (copyfuncs.c:7358) #740

Open avamingli opened 2 days ago

avamingli commented 2 days ago

Apache Cloudberry version

main

What happened

manage pg_task in code block got ERROR.

What you think should happen instead

Besides the error in copyfuncs.c, there may be other bugs when serialization or desrialization.

How to reproduce

gpadmin=# create task task1 schedule '5 * * * * ' as 'select * from t1';
CREATE TASK
gpadmin=# select * from pg_task;
 jobid |  schedule  |     command      | nodename  | nodeport | database | username | active | jobname
-------+------------+------------------+-----------+----------+----------+----------+--------+---------
 17022 | 5 * * * *  | select * from t1 | 127.0.0.1 |     9000 | gpadmin  | gpadmin  | t      | task1
(1 row)

gpadmin=# DO $$
DECLARE
    jn text;
BEGIN
    SELECT jobname from pg_task limit 1 into jn;
    EXECUTE FORMAT('DROP TASK %I', jn);
END $$;
ERROR:  unrecognized node type: 742 (copyfuncs.c:7358)
CONTEXT:  SQL statement "DROP TASK task1"
PL/pgSQL function inline_code_block line 6 at EXECUTE

Operating System

Ubuntu

Anything else

No response

Are you willing to submit PR?

Code of Conduct

avamingli commented 2 days ago

@roseduan

roseduan commented 2 days ago

@roseduan

Thanks, I will fix this.