php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #65689
Patch php5-bug65689.patch revision 2013-09-18 05:18 UTC by slavb18 at gmail dot com

Patch php5-bug65689.patch for PDO Firebird Bug #65689

Patch version 2013-09-18 05:18 UTC

Return to Bug #65689 | Download this patch
Patch Revisions:

Developer: slavb18@gmail.com

diff -ur ext/pdo_firebird.orig/firebird_driver.c ext/pdo_firebird/firebird_driver.c
--- ext/pdo_firebird.orig/firebird_driver.c	2013-09-09 11:02:50.000000000 +0400
+++ ext/pdo_firebird/firebird_driver.c	2013-09-18 08:56:43.000000000 +0400
@@ -144,7 +144,7 @@
 	do {
 		isc_stmt_handle s = NULL;
 		XSQLDA num_sqlda;
-		static char const info[] = { isc_info_sql_stmt_type };
+		static char const info[] = { isc_info_sql_stmt_type,isc_info_end };
 		char result[8];
 
 		num_sqlda.version = PDO_FB_SQLDA_VERSION;
@@ -224,7 +224,7 @@
 {
 	pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
 	isc_stmt_handle stmt = NULL;
-	static char const info_count[] = { isc_info_sql_records };
+	static char const info_count[] = { isc_info_sql_records,isc_info_end };
 	char result[64];
 	int ret = 0;
 	XSQLDA in_sqlda, out_sqlda;
@@ -242,6 +242,7 @@
 	/* execute the statement */
 	if (isc_dsql_execute2(H->isc_status, &H->tr, &stmt, PDO_FB_SQLDA_VERSION, &in_sqlda, &out_sqlda)) {
 		RECORD_ERROR(dbh);
+		isc_dsql_free_statement(H->isc_status, &stmt, DSQL_drop);
 		return -1;
 	}
 	
@@ -249,6 +250,7 @@
 	if (isc_dsql_sql_info(H->isc_status, &stmt, sizeof(info_count), const_cast(info_count),
 			sizeof(result),	result)) {
 		RECORD_ERROR(dbh);
+		isc_dsql_free_statement(H->isc_status, &stmt, DSQL_drop);
 		return -1;
 	}
 
@@ -268,6 +270,10 @@
 	if (dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) {
 		RECORD_ERROR(dbh);
 	}
+	/* release the statement */
+	if (isc_dsql_free_statement(H->isc_status, &stmt, DSQL_drop)) {
+		RECORD_ERROR(dbh);
+	}
 
 	return ret;
 }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 22:01:28 2024 UTC