Skip to content

Commit 226c904

Browse files
committed
ecpg: Restore detection of unsupported COPY FROM STDIN.
The ecpg command includes code to warn about unsupported COPY FROM STDIN statements in input files. However, since commit 3d009e4, this functionality has been broken due to a bug introduced in that commit, causing ecpg to fail to detect the statement. This commit resolves the issue, restoring ecpg's ability to detect COPY FROM STDIN and issue a warning as intended. Back-patch to all supported versions. Author: Ryo Kanbayashi Reviewed-by: Hayato Kuroda, Tom Lane Discussion: https://postgr.es/m/CANOn0Ez_t5uDCUEV8c1YORMisJiU5wu681eEVZzgKwOeiKhkqQ@mail.gmail.com
1 parent 332023e commit 226c904

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces/ecpg/preproc/ecpg.addons

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
234234
$$ = cat_str(2,mm_strdup("where current of"), cursor_marker);
235235
}
236236
ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listcopy_fromopt_programcopy_file_namecopy_delimiteropt_withcopy_optionswhere_clause addon
237-
if (strcmp($6, "from") == 0 &&
237+
if (strcmp($5, "from") == 0 &&
238238
(strcmp($7, "stdin") == 0 || strcmp($7, "stdout") == 0))
239239
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
240240
ECPG: var_valueNumericOnly addon

0 commit comments

Comments
 (0)