mirror of https://github.com/citusdata/citus.git
Fix segfault when executing DDL via UDF
parent
5957d731ec
commit
b1b13e394e
|
@ -479,6 +479,12 @@ ExecuteQueryIntoDestReceiver(Query *query, ParamListInfo params, DestReceiver *d
|
|||
{
|
||||
int cursorOptions = CURSOR_OPT_PARALLEL_OK;
|
||||
|
||||
if (query->commandType == CMD_UTILITY)
|
||||
{
|
||||
/* can only execute DML/SELECT via this path */
|
||||
ereport(ERROR, (errmsg("cannot execute utility commands")));
|
||||
}
|
||||
|
||||
/* plan the subquery, this may be another distributed query */
|
||||
PlannedStmt *queryPlan = pg_plan_query(query, cursorOptions, params);
|
||||
|
||||
|
|
|
@ -252,6 +252,13 @@ SELECT * FROM squares ORDER BY x;
|
|||
-- empty shard interval array should raise error
|
||||
SELECT worker_hash_partition_table(42,1,'SELECT a FROM generate_series(1,100) AS a', 'a', 23, ARRAY[0]);
|
||||
ERROR: invalid distribution column value
|
||||
-- cannot use DDL commands
|
||||
select broadcast_intermediate_result('a', 'create table foo(int serial)');
|
||||
ERROR: cannot execute utility commands
|
||||
select broadcast_intermediate_result('a', 'prepare foo as select 1');
|
||||
ERROR: cannot execute utility commands
|
||||
select create_intermediate_result('a', 'create table foo(int serial)');
|
||||
ERROR: cannot execute utility commands
|
||||
DROP SCHEMA intermediate_results CASCADE;
|
||||
NOTICE: drop cascades to 5 other objects
|
||||
DETAIL: drop cascades to table interesting_squares
|
||||
|
|
|
@ -67,7 +67,7 @@ ERROR: column name array size: 2 and type array size: 3 do not match
|
|||
SELECT worker_merge_files_into_table(:JobId, :TaskId,
|
||||
ARRAY['textcolumn', 'binarycolumn'],
|
||||
ARRAY['text', 'integer']);
|
||||
ERROR: invalid input syntax for type integer: "\x0b50"
|
||||
ERROR: invalid input syntax for integer: "\x0b50"
|
||||
CONTEXT: COPY task_101108, line 1, column binarycolumn: "\x0b50"
|
||||
-- Check that we fail to merge when ids are wrong
|
||||
SELECT worker_merge_files_into_table(-1, :TaskId,
|
||||
|
@ -97,3 +97,6 @@ SELECT worker_merge_files_into_table(:JobId, :TaskId,
|
|||
|
||||
(1 row)
|
||||
|
||||
-- worker_execute_sql_task should only accept queries
|
||||
select worker_execute_sql_task(0,0,'create table foo(a serial)',false);
|
||||
ERROR: cannot execute utility commands
|
||||
|
|
|
@ -143,4 +143,9 @@ SELECT * FROM squares ORDER BY x;
|
|||
-- empty shard interval array should raise error
|
||||
SELECT worker_hash_partition_table(42,1,'SELECT a FROM generate_series(1,100) AS a', 'a', 23, ARRAY[0]);
|
||||
|
||||
-- cannot use DDL commands
|
||||
select broadcast_intermediate_result('a', 'create table foo(int serial)');
|
||||
select broadcast_intermediate_result('a', 'prepare foo as select 1');
|
||||
select create_intermediate_result('a', 'create table foo(int serial)');
|
||||
|
||||
DROP SCHEMA intermediate_results CASCADE;
|
||||
|
|
|
@ -100,3 +100,6 @@ SELECT worker_merge_files_and_run_query(:JobId, -1,
|
|||
SELECT worker_merge_files_into_table(:JobId, :TaskId,
|
||||
ARRAY['textcolumn', 'binarycolumn'],
|
||||
ARRAY['text', 'bytea']);
|
||||
|
||||
-- worker_execute_sql_task should only accept queries
|
||||
select worker_execute_sql_task(0,0,'create table foo(a serial)',false);
|
||||
|
|
Loading…
Reference in New Issue