From 03afa0151cf699cd0fad822512068342ef55e09d Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Wed, 2 Dec 2026 18:40:12 +0000 Subject: [PATCH v1] ecpg: Add test for FETCH/MOVE of an undeclared cursor. Discussion: --- src/interfaces/ecpg/preproc/t/001_ecpg_err_warn_msg.pl | 2 ++ src/interfaces/ecpg/preproc/t/err_warn_msg.pgc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/interfaces/ecpg/preproc/t/001_ecpg_err_warn_msg.pl b/src/interfaces/ecpg/preproc/t/001_ecpg_err_warn_msg.pl index 4ff6b6a..1492b9b 100644 --- a/src/interfaces/ecpg/preproc/t/001_ecpg_err_warn_msg.pl +++ b/src/interfaces/ecpg/preproc/t/001_ecpg_err_warn_msg.pl @@ -30,6 +30,8 @@ command_checks_all( qr/ERROR: cursor "duplicate_cursor" is already defined/, qr/ERROR: SHOW ALL is not implemented/, qr/WARNING: no longer supported LIMIT/, + qr/ERROR: cursor "undeclared_cursor" does not exist/, + qr/ERROR: cursor "undeclared_cursor" does not exist/, qr/WARNING: cursor "duplicate_cursor" has been declared but not opened/, qr/WARNING: cursor "duplicate_cursor" has been declared but not opened/, qr/WARNING: cursor ":cursor_var" has been declared but not opened/, diff --git a/src/interfaces/ecpg/preproc/t/err_warn_msg.pgc b/src/interfaces/ecpg/preproc/t/err_warn_msg.pgc index 5ab0a76..0722bfe 100644 --- a/src/interfaces/ecpg/preproc/t/err_warn_msg.pgc +++ b/src/interfaces/ecpg/preproc/t/err_warn_msg.pgc @@ -38,5 +38,9 @@ main(void) /* Test deprecated LIMIT syntax warning */ EXEC SQL SELECT * FROM test LIMIT 10, 5; + /* Test FETCH and MOVE of an undeclared cursor */ + EXEC SQL FETCH undeclared_cursor; + EXEC SQL MOVE undeclared_cursor; + return 0; } -- 2.47.3