php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #62024
Patch Bind_Remember_Null revision 2012-10-25 08:33 UTC by james at kenjim dot com

Patch Bind_Remember_Null for PDO related Bug #62024

Patch version 2012-10-25 08:33 UTC

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

Developer: james@kenjim.com

diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index ae05870..1bf03b7 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -535,12 +535,12 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
 				int force_null;
 				
 				case IS_LONG:
-					var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG;
+					var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) + (var->sqltype & 1);
 					var->sqldata = (void*)&Z_LVAL_P(param->parameter);
 					var->sqllen = sizeof(long);
 					break;
 				case IS_DOUBLE:
-					var->sqltype = SQL_DOUBLE;
+					var->sqltype = SQL_DOUBLE + (var->sqltype & 1);
 					var->sqldata = (void*)&Z_DVAL_P(param->parameter);
 					var->sqllen = sizeof(double);
 					break;
@@ -560,7 +560,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
 							force_null = (Z_STRLEN_P(param->parameter) == 0);
 					}
 					if (!force_null) {
-						var->sqltype = SQL_TEXT;
+						var->sqltype = SQL_TEXT + (var->sqltype & 1);
 						var->sqldata = Z_STRVAL_P(param->parameter);
 						var->sqllen	 = Z_STRLEN_P(param->parameter);
 						break;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 18:01:29 2024 UTC