File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4587,14 +4587,15 @@ execq(PG_FUNCTION_ARGS)
4587
4587
uint64 proc;
4588
4588
4589
4589
/* Convert given text object to a C string */
4590
- command = text_to_cstring(PG_GETARG_TEXT_PP(1 ));
4591
- cnt = PG_GETARG_INT32(2 );
4590
+ command = text_to_cstring(PG_GETARG_TEXT_PP(0 ));
4591
+ cnt = PG_GETARG_INT32(1 );
4592
4592
4593
4593
SPI_connect();
4594
4594
4595
4595
ret = SPI_exec(command, cnt);
4596
4596
4597
4597
proc = SPI_processed;
4598
+
4598
4599
/*
4599
4600
* If some rows were fetched, print them via elog(INFO).
4600
4601
*/
@@ -4611,7 +4612,7 @@ execq(PG_FUNCTION_ARGS)
4611
4612
int i;
4612
4613
4613
4614
for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++)
4614
- snprintf(buf + strlen (buf), sizeof(buf) - strlen(buf), " %s%s",
4615
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %s%s",
4615
4616
SPI_getvalue(tuple, tupdesc, i),
4616
4617
(i == tupdesc->natts) ? " " : " |");
4617
4618
elog(INFO, "EXECQ: %s", buf);
You can’t perform that action at this time.
0 commit comments