php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch pdo_exec_return_zero_after_pdo_pgsql_select.patch for PDO related Bug #61267

Patch version 2012-03-03 13:54 UTC

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

Developer: ben.pineau@gmail.com

--- ext/pdo_pgsql/pgsql_driver.c-orig	2012-03-01 20:19:03.000000000 +0100
+++ ext/pdo_pgsql/pgsql_driver.c	2012-03-02 11:56:21.000000000 +0100
@@ -299,7 +299,7 @@
 		return -1;
 	}
 	H->pgoid = PQoidValue(res);
-	ret = atol(PQcmdTuples(res));
+	ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L;
 	PQclear(res);
 
 	return ret;
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 00:01:21 2014 UTC