Run one execution_state; either to completion or to first result row */ Returns true if we ran to completion */
| 1005 | /* Run one execution_state; either to completion or to first result row */ |
| 1006 | /* Returns true if we ran to completion */ |
| 1007 | static bool |
| 1008 | postquel_getnext(execution_state *es, SQLFunctionCachePtr fcache) |
| 1009 | { |
| 1010 | bool result; |
| 1011 | |
| 1012 | if (es->qd->operation == CMD_UTILITY) |
| 1013 | { |
| 1014 | ProcessUtility(es->qd->plannedstmt, |
| 1015 | fcache->src, |
| 1016 | false, |
| 1017 | PROCESS_UTILITY_QUERY, |
| 1018 | es->qd->params, |
| 1019 | es->qd->queryEnv, |
| 1020 | es->qd->dest, |
| 1021 | NULL); |
| 1022 | result = true; /* never stops early */ |
| 1023 | } |
| 1024 | else |
| 1025 | { |
| 1026 | /* Run regular commands to completion unless lazyEval */ |
| 1027 | uint64 count = (es->lazyEval) ? 1 : 0; |
| 1028 | |
| 1029 | ExecutorRun(es->qd, ForwardScanDirection, count, !fcache->returnsSet || !es->lazyEval); |
| 1030 | |
| 1031 | /* |
| 1032 | * If we requested run to completion OR there was no tuple returned, |
| 1033 | * command must be complete. |
| 1034 | */ |
| 1035 | result = (count == 0 || es->qd->estate->es_processed == 0); |
| 1036 | } |
| 1037 | |
| 1038 | return result; |
| 1039 | } |
| 1040 | |
| 1041 | /* Shut down execution of one execution_state node */ |
| 1042 | static void |
no test coverage detected