public inbox for [email protected]  
help / color / mirror / Atom feed
From: Shruthi Gowda <[email protected]>
To: Nishant Sharma <[email protected]>
Cc: Mahendra Singh Thalor <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: PostgreSQL Development <[email protected]>
Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL
Date: Thu, 9 Apr 2026 16:14:13 +0530
Message-ID: <CAASxf_OdsJRi17EZ_ZMyQgOwUzn357YyMqJ2Z2qiExPaLRW_Lg@mail.gmail.com> (raw)
In-Reply-To: <CADrsxdbb2fn1LACQShrQT0bNqSCQ3hSzEojb2tODhD0PmewDiA@mail.gmail.com>
References: <CAASxf_P1F75Ck+0qyb10auT+BORupOM4yigXBnm7aWRNx1LYcA@mail.gmail.com>
	<[email protected]>
	<CAASxf_P5f=Frf8S7rN9BzphtCLoeN9vFuh-V7ukotOQZU54g+w@mail.gmail.com>
	<CAHGQGwHAPXexiGaHMkDDRF7cPBr_3fgCNdT4n2+1UjaEU++BAQ@mail.gmail.com>
	<CAASxf_OGWD7PA5TMEh2MdF2YxN8V3ByLhnFJ=uw0hKr33sgqAw@mail.gmail.com>
	<CAKYtNAqjJbzV+ZJDqA-s0fHSLen6msc=A0SfrTS1ub1KKH9haQ@mail.gmail.com>
	<CADrsxdbb2fn1LACQShrQT0bNqSCQ3hSzEojb2tODhD0PmewDiA@mail.gmail.com>

On Tue, Mar 24, 2026 at 11:29 AM Nishant Sharma <
[email protected]> wrote:

> Here are some review comments on v3 patch:-
>
>    1.
>
>    Change in descriptor.c file - In my opinion, we can use `if(conn)`
>    with ecpg_raise, like other occurrence of ecpg_get_connection() call check
>    in this file, and not using ecpg_init(). Three reasons: a) Consistency in
>    checking conn after ecpg_get_connection() call in this file with if check.
>    b) We don't need to remove 'ecpg_init_sqlca(sqlca);' line due to call to
>    ecpg_init(). c) #2 comment below.
>    2.
>
>    If you agree with #1, then I see many other reasons for which
>    ECPGget_desc() returns and we can avoid ecpg_get_connection() call at top
>    of that function for those reasons and keep the check at the required
>    location only instead of moving at top of the function.
>    3.
>
>    I see there is one more location of ecpg_get_connection() call where
>    there is no check of NULL conn. In function ecpg_freeStmtCacheEntry() of
>    file prepare.c? I understand it's not required for a call in
>    ecpg_auto_prepare(), as the caller already validated that connection
>    string. But I think, conn in ecpg_freeStmtCacheEntry() is different from
>    the one that was validated.
>    4.
>
>    +1 to Mahindra, new test cases specific to the crash required for this
>    change?
>
>
>
> Regards,
> Nishant Sharma,
> EDB, Pune.
> https://www.enterprisedb.com/
>

Thanks, Nishant, for the review. I agree with points 1 and 2 and have
revised the patch accordingly. Regarding point 3, you are correct; the conn
in ecpg_freeStmtCacheEntry() differs from the one validated in the caller.
I have now added the necessary validation in the latest version.

I have also included a test case patch covering all execution paths except
for the ecpg_freeStmtCacheEntry() flow. I was unable to trigger that
specific flow, and it appears none of the existing test cases cover that
line either.

Thanks & Regards,

Shruthi K C

EnterpriseDB: http://www.enterprisedb.com


Attachments:

  [application/octet-stream] v4-0001-Add-missing-connection-validation-in-ECPG.patch (3.1K, 3-v4-0001-Add-missing-connection-validation-in-ECPG.patch)
  download | inline diff:
From 75ee6b6cb5f86139deb7b0f3caa8ab5f69455bca Mon Sep 17 00:00:00 2001
From: shruthi gowda <[email protected]>
Date: Wed, 8 Apr 2026 11:32:16 +0000
Subject: [PATCH v4] Add missing connection validation in ECPG

ECPGdeallocate_all(), ECPGprepared_statement(), ECPGget_desc(), and
ecpg_freeStmtCacheEntry() could crash or misbehave when operating on
NULL or invalid connections. Add proper connection validation to
prevent dereferencing NULL pointers.
---
 src/interfaces/ecpg/ecpglib/descriptor.c |  8 ++++++++
 src/interfaces/ecpg/ecpglib/prepare.c    | 25 ++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/src/interfaces/ecpg/ecpglib/descriptor.c b/src/interfaces/ecpg/ecpglib/descriptor.c
index 39cd5130ec9..88f1e9858b0 100644
--- a/src/interfaces/ecpg/ecpglib/descriptor.c
+++ b/src/interfaces/ecpg/ecpglib/descriptor.c
@@ -507,6 +507,14 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
 
 		/* desperate try to guess something sensible */
 		stmt.connection = ecpg_get_connection(NULL);
+		if (stmt.connection == NULL)
+		{
+			ecpg_raise(lineno, ECPG_NO_CONN, ECPG_SQLSTATE_CONNECTION_DOES_NOT_EXIST,
+					   ecpg_gettext("NULL"));
+			va_end(args);
+			return false;
+		}
+
 		ecpg_store_result(ECPGresult, index, &stmt, &data_var);
 
 #ifdef HAVE_USELOCALE
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index 5c7c5397535..f9489044724 100644
--- a/src/interfaces/ecpg/ecpglib/prepare.c
+++ b/src/interfaces/ecpg/ecpglib/prepare.c
@@ -381,8 +381,12 @@ ecpg_deallocate_all_conn(int lineno, enum COMPAT_MODE c, struct connection *con)
 bool
 ECPGdeallocate_all(int lineno, int compat, const char *connection_name)
 {
-	return ecpg_deallocate_all_conn(lineno, compat,
-									ecpg_get_connection(connection_name));
+	struct connection *con = ecpg_get_connection(connection_name);
+
+	if (!ecpg_init(con, connection_name, lineno))
+		return false;
+
+	return ecpg_deallocate_all_conn(lineno, compat, con);
 }
 
 char *
@@ -395,13 +399,15 @@ ecpg_prepared(const char *name, struct connection *con)
 }
 
 /* return the prepared statement */
-/* lineno is not used here, but kept in to not break API */
 char *
 ECPGprepared_statement(const char *connection_name, const char *name, int lineno)
 {
-	(void) lineno;				/* keep the compiler quiet */
+	struct connection *con = ecpg_get_connection(connection_name);
+
+	if (!ecpg_init(con, connection_name, lineno))
+		return NULL;
 
-	return ecpg_prepared(name, ecpg_get_connection(connection_name));
+	return ecpg_prepared(name, con);
 }
 
 /*
@@ -499,9 +505,12 @@ ecpg_freeStmtCacheEntry(int lineno, int compat,
 	con = ecpg_get_connection(entry->connection);
 
 	/* free the 'prepared_statement' list entry */
-	this = ecpg_find_prepared_statement(entry->stmtID, con, &prev);
-	if (this && !deallocate_one(lineno, compat, con, prev, this))
-		return -1;
+	if (con)
+	{
+		this = ecpg_find_prepared_statement(entry->stmtID, con, &prev);
+		if (this && !deallocate_one(lineno, compat, con, prev, this))
+			return -1;
+	}
 
 	entry->stmtID[0] = '\0';
 
-- 
2.43.0



  [application/octet-stream] v1_test-0001-Tests-for-NULL-connection-validation.patch (13.0K, 4-v1_test-0001-Tests-for-NULL-connection-validation.patch)
  download | inline diff:
From 20d35849e84233c28858271655b91e09edd66863 Mon Sep 17 00:00:00 2001
From: shruthi gowda <[email protected]>
Date: Thu, 9 Apr 2026 08:37:36 +0000
Subject: [PATCH v1_test] Tests for NULL connection validation

---
 src/interfaces/ecpg/test/connect/Makefile     |   3 +-
 src/interfaces/ecpg/test/connect/meson.build  |   1 +
 .../ecpg/test/connect/test_null_connection.c  | 150 ++++++++++++++++++
 .../test/connect/test_null_connection.pgc     |  69 ++++++++
 src/interfaces/ecpg/test/ecpg_schedule        |   1 +
 .../connect-test_null_connection.stderr       |  50 ++++++
 .../connect-test_null_connection.stdout       |   8 +
 7 files changed, 281 insertions(+), 1 deletion(-)
 create mode 100644 src/interfaces/ecpg/test/connect/test_null_connection.c
 create mode 100644 src/interfaces/ecpg/test/connect/test_null_connection.pgc
 create mode 100644 src/interfaces/ecpg/test/expected/connect-test_null_connection.stderr
 create mode 100644 src/interfaces/ecpg/test/expected/connect-test_null_connection.stdout

diff --git a/src/interfaces/ecpg/test/connect/Makefile b/src/interfaces/ecpg/test/connect/Makefile
index 2602d5d286f..02151733c4c 100644
--- a/src/interfaces/ecpg/test/connect/Makefile
+++ b/src/interfaces/ecpg/test/connect/Makefile
@@ -7,6 +7,7 @@ TESTS = test1 test1.c \
         test2 test2.c \
         test3 test3.c \
         test4 test4.c \
-        test5 test5.c
+        test5 test5.c \
+        test_null_connection test_null_connection.c
 
 all: $(TESTS)
diff --git a/src/interfaces/ecpg/test/connect/meson.build b/src/interfaces/ecpg/test/connect/meson.build
index 591e04bc422..1147b4e8f51 100644
--- a/src/interfaces/ecpg/test/connect/meson.build
+++ b/src/interfaces/ecpg/test/connect/meson.build
@@ -6,6 +6,7 @@ pgc_files = [
   'test3',
   'test4',
   'test5',
+  'test_null_connection',
 ]
 
 foreach pgc_file : pgc_files
diff --git a/src/interfaces/ecpg/test/connect/test_null_connection.c b/src/interfaces/ecpg/test/connect/test_null_connection.c
new file mode 100644
index 00000000000..ef0af1fe157
--- /dev/null
+++ b/src/interfaces/ecpg/test/connect/test_null_connection.c
@@ -0,0 +1,150 @@
+/* Processed by ecpg (regression mode) */
+/* These include files are added by the preprocessor */
+#include <ecpglib.h>
+#include <ecpgerrno.h>
+#include <sqlca.h>
+/* End of automatic include section */
+#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
+
+#line 1 "test_null_connection.pgc"
+/*
+ * This test verifies that ecpg functions properly handle NULL connections
+ * (i.e., when a connection name doesn't exist or has been disconnected).
+ * Before the fix, these operations would cause a segmentation fault.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+
+#line 1 "./../regression.h"
+
+
+
+
+
+
+#line 11 "test_null_connection.pgc"
+
+
+int
+main(void)
+{
+/* exec sql begin declare section */
+
+
+
+
+
+
+#line 17 "test_null_connection.pgc"
+ char * query = "SELECT 1" ;
+
+#line 18 "test_null_connection.pgc"
+ int val1output = 2 ;
+
+#line 19 "test_null_connection.pgc"
+ int val1 = 1 ;
+
+#line 20 "test_null_connection.pgc"
+ char val2 [ 5 ] = "data1" ;
+
+#line 21 "test_null_connection.pgc"
+ char * stmt1 = "SELECT * from test1 where a = $1 and b = $2" ;
+/* exec sql end declare section */
+#line 22 "test_null_connection.pgc"
+
+
+	ECPGdebug(1, stderr);
+
+	/* Connect to the database */
+	{ ECPGconnect(__LINE__, 0, "ecpg1_regression" , NULL, NULL , "myconn", 0); }
+#line 27 "test_null_connection.pgc"
+
+
+	/* Test 1: Try to get descriptor on a disconnected connection */
+	printf("Test 1: Try to get descriptor on a disconnected connection \n");
+	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "create table test1 ( a int , b text )", ECPGt_EOIT, ECPGt_EORT);}
+#line 31 "test_null_connection.pgc"
+
+	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "insert into test1 ( a , b ) values ( 1 , 'data1' )", ECPGt_EOIT, ECPGt_EORT);}
+#line 32 "test_null_connection.pgc"
+
+
+	ECPGallocate_desc(__LINE__, "indesc");
+#line 34 "test_null_connection.pgc"
+
+	ECPGallocate_desc(__LINE__, "outdesc");
+#line 35 "test_null_connection.pgc"
+
+
+	{ ECPGprepare(__LINE__, NULL, 0, "foo2", stmt1);}
+#line 37 "test_null_connection.pgc"
+
+
+	{ ECPGset_desc(__LINE__, "indesc", 1,ECPGd_data,
+	ECPGt_int,&(val1),(long)1,(long)1,sizeof(int), ECPGd_EODT);
+}
+#line 39 "test_null_connection.pgc"
+
+	{ ECPGset_desc(__LINE__, "indesc", 2,ECPGd_data,
+	ECPGt_char,(val2),(long)5,(long)1,(5)*sizeof(char), ECPGd_EODT);
+}
+#line 40 "test_null_connection.pgc"
+
+
+	{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_execute, "foo2",
+	ECPGt_descriptor, "indesc", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, 
+	ECPGt_descriptor, "outdesc", 1L, 1L, 1L, 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
+#line 42 "test_null_connection.pgc"
+
+
+	{ ECPGdisconnect(__LINE__, "CURRENT");}
+#line 44 "test_null_connection.pgc"
+
+	{ ECPGget_desc(__LINE__, "outdesc", 1,ECPGd_data,
+	ECPGt_int,&(val1output),(long)1,(long)1,sizeof(int), ECPGd_EODT);
+}
+#line 45 "test_null_connection.pgc"
+
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 2: Try to deallocate all on a non-existent connection */
+	printf("Test 2: deallocate all with non-existent connection\n");
+	{ ECPGdeallocate_all(__LINE__, 0, "nonexistent");}
+#line 50 "test_null_connection.pgc"
+
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 3: deallocate on disconnected connection */
+	printf("Test 3: deallocate all on disconnected connection\n");
+	{ ECPGdeallocate_all(__LINE__, 0, NULL);}
+#line 55 "test_null_connection.pgc"
+
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 4: Use prepared statement from non-existent connection */
+	printf("Test 4: Use prepared statement from non-existent connection\n");
+  	{ ECPGprepare(__LINE__, "nonexistent", 0, "stmt1", "SELECT 1");}
+#line 60 "test_null_connection.pgc"
+
+  	/* declare cur1 cursor for $1 */
+#line 61 "test_null_connection.pgc"
+
+ 	{ ECPGdo(__LINE__, 0, 1, "nonexistent", 0, ECPGst_normal, "declare cur1 cursor for $1", 
+	ECPGt_char_variable,(ECPGprepared_statement("nonexistent", "stmt1", __LINE__)),(long)1,(long)1,(1)*sizeof(char), 
+	ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
+#line 62 "test_null_connection.pgc"
+
+
+	printf("All tests completed !\n");
+
+	{ ECPGdisconnect(__LINE__, "CURRENT");}
+#line 66 "test_null_connection.pgc"
+
+
+	return 0;
+}
diff --git a/src/interfaces/ecpg/test/connect/test_null_connection.pgc b/src/interfaces/ecpg/test/connect/test_null_connection.pgc
new file mode 100644
index 00000000000..886e4eab218
--- /dev/null
+++ b/src/interfaces/ecpg/test/connect/test_null_connection.pgc
@@ -0,0 +1,69 @@
+/*
+ * This test verifies that ecpg functions properly handle NULL connections
+ * (i.e., when a connection name doesn't exist or has been disconnected).
+ * Before the fix, these operations would cause a segmentation fault.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+exec sql include ../regression;
+
+int
+main(void)
+{
+exec sql begin declare section;
+	char *query = "SELECT 1";
+	int val1output = 2;
+	int val1 = 1;
+	char val2[5] = "data1";
+	char *stmt1 = "SELECT * from test1 where a = $1 and b = $2";
+exec sql end declare section;
+
+	ECPGdebug(1, stderr);
+
+	/* Connect to the database */
+	exec sql connect to REGRESSDB1 as myconn;
+
+	/* Test 1: Try to get descriptor on a disconnected connection */
+	printf("Test 1: Try to get descriptor on a disconnected connection \n");
+	exec sql create table test1 (a int, b text);
+	exec sql insert into test1 (a,b) values (1, 'data1');
+
+	exec sql allocate descriptor indesc;
+	exec sql allocate descriptor outdesc;
+
+	exec sql prepare foo2 from :stmt1;
+
+	exec sql set descriptor indesc value 1 DATA = :val1;
+	exec sql set descriptor indesc value 2 DATA = :val2;
+
+	exec sql execute foo2 using sql descriptor indesc into sql descriptor outdesc;
+
+	exec sql disconnect;
+	exec sql get descriptor outdesc value 1 :val1output = DATA;
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 2: Try to deallocate all on a non-existent connection */
+	printf("Test 2: deallocate all with non-existent connection\n");
+	exec sql at nonexistent deallocate all;
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 3: deallocate on disconnected connection */
+	printf("Test 3: deallocate all on disconnected connection\n");
+	exec sql deallocate all;
+	printf("sqlca.sqlcode = %ld\n", sqlca.sqlcode);
+
+	/* Test 4: Use prepared statement from non-existent connection */
+	printf("Test 4: Use prepared statement from non-existent connection\n");
+  	exec sql at nonexistent prepare stmt1 FROM "SELECT 1";
+  	exec sql at nonexistent declare cur1 cursor for stmt1;
+ 	exec sql at nonexistent open cur1;
+
+	printf("All tests completed !\n");
+
+	exec sql disconnect;
+
+	return 0;
+}
diff --git a/src/interfaces/ecpg/test/ecpg_schedule b/src/interfaces/ecpg/test/ecpg_schedule
index b75e16fde1e..a798f2497ab 100644
--- a/src/interfaces/ecpg/test/ecpg_schedule
+++ b/src/interfaces/ecpg/test/ecpg_schedule
@@ -13,6 +13,7 @@ test: connect/test2
 test: connect/test3
 test: connect/test4
 test: connect/test5
+test: connect/test_null_connection
 test: pgtypeslib/dt_test
 test: pgtypeslib/dt_test2
 test: pgtypeslib/num_test
diff --git a/src/interfaces/ecpg/test/expected/connect-test_null_connection.stderr b/src/interfaces/ecpg/test/expected/connect-test_null_connection.stderr
new file mode 100644
index 00000000000..f4bc2a07924
--- /dev/null
+++ b/src/interfaces/ecpg/test/expected/connect-test_null_connection.stderr
@@ -0,0 +1,50 @@
+[NO_PID]: ECPGdebug: set to 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGconnect: opening database ecpg1_regression on <DEFAULT> port <DEFAULT>  
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 31: query: create table test1 ( a int , b text ); with 0 parameter(s) on connection myconn
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 31: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 31: OK: CREATE TABLE
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 32: query: insert into test1 ( a , b ) values ( 1 , 'data1' ); with 0 parameter(s) on connection myconn
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 32: using PQexec
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 32: OK: INSERT 0 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: prepare_common on line 37: name foo2; query: "SELECT * from test1 where a = $1 and b = $2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 42: query: SELECT * from test1 where a = $1 and b = $2; with 2 parameter(s) on connection myconn
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_execute on line 42: using PQexecPrepared for "SELECT * from test1 where a = $1 and b = $2"
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_free_params on line 42: parameter 1 = 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_free_params on line 42: parameter 2 = data1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 42: correctly got 1 tuples with 2 fields
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_process_output on line 42: putting result (1 tuples) into descriptor outdesc
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: deallocate_one on line 0: name foo2
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ecpg_finish: connection myconn closed
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: ECPGget_desc: reading items for tuple 1
+[NO_PID]: sqlca: code: 0, state: 00000
+[NO_PID]: raising sqlcode -220 on line 45: connection "NULL" does not exist on line 45
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 50: connection "nonexistent" does not exist on line 50
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 55: connection "NULL" does not exist on line 55
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 60: connection "nonexistent" does not exist on line 60
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 63: connection "nonexistent" does not exist on line 63
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 62: connection "nonexistent" does not exist on line 62
+[NO_PID]: sqlca: code: -220, state: 08003
+[NO_PID]: raising sqlcode -220 on line 66: connection "CURRENT" does not exist on line 66
+[NO_PID]: sqlca: code: -220, state: 08003
diff --git a/src/interfaces/ecpg/test/expected/connect-test_null_connection.stdout b/src/interfaces/ecpg/test/expected/connect-test_null_connection.stdout
new file mode 100644
index 00000000000..a845c736a0a
--- /dev/null
+++ b/src/interfaces/ecpg/test/expected/connect-test_null_connection.stdout
@@ -0,0 +1,8 @@
+Test 1: Try to get descriptor on a disconnected connection 
+sqlca.sqlcode = -220
+Test 2: deallocate all with non-existent connection
+sqlca.sqlcode = -220
+Test 3: deallocate all on disconnected connection
+sqlca.sqlcode = -220
+Test 4: Use prepared statement from non-existent connection
+All tests completed !
-- 
2.43.0



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [BUG] CRASH: ECPGprepared_statement() and ECPGdeallocate_all() when connection is NULL
  In-Reply-To: <CAASxf_OdsJRi17EZ_ZMyQgOwUzn357YyMqJ2Z2qiExPaLRW_Lg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox