php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #50755
Patch pdo_dblib_unbuffer-5.3.patch revision 2010-04-05 17:35 UTC by ssufficool at gmail dot com
revision 2010-03-19 23:33 UTC by ssufficool at gmail dot com
revision 2010-03-09 22:23 UTC by ssufficool at gmail dot com
Patch pdo_dblib_unbuffer-6.patch revision 2010-03-09 22:24 UTC by ssufficool at gmail dot com
Patch pdo_dblib_unbuffer-5.2.patch revision 2010-03-09 22:23 UTC by ssufficool at gmail dot com

Patch pdo_dblib_unbuffer-5.3.patch for PDO related Bug #50755

Patch version 2010-04-05 17:35 UTC

Return to Bug #50755 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2010-04-05 17:35 UTC | 2010-03-19 23:33 UTC | 2010-03-09 22:23 UTC

Developer: ssufficool@gmail.com



  Index: ext/pdo_dblib/dblib_stmt.c
  ===================================================================
 --- ext/pdo_dblib/dblib_stmt.c	(revision 296442)
 --- ext/pdo_dblib/dblib_stmt.c	(revision 297505)
  +++ ext/pdo_dblib/dblib_stmt.c	(working copy)
  @@ -32,36 +32,46 @@
   #include "php_pdo_dblib_int.h"
   #include "zend_exceptions.h"


  +	col->namelen = strlen(col->name);
   	col->param_type = PDO_PARAM_STR;
   		
   	return 1;
 @@ -252,11 +141,65 @@
 @@ -252,11 +141,58 @@
   static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
   	 unsigned long *len, int *caller_frees TSRMLS_DC)
   {
  +	


  +	char *tmp_ptr = NULL;
  +	
  +	coltype = dbcoltype(H->link, colno+1);
  +	
 +	*len = dbdatlen(H->link, colno+1);
 +	*len = (DBINT) dbdatlen(H->link, colno+1);
  +	*ptr = dbdata(H->link, colno+1);
 +	*caller_frees = 1;
  +	
  +	if (*len == 0 && *ptr == NULL) {
  +		return 1;
  +	}
Line 308 (now 309), was 9 lines, now 8 lines

  +			tmp_ptr = emalloc(*len + 1);
  +			memcpy(tmp_ptr, *ptr, *len);
  +			tmp_ptr[*len] = '\0';
  +			*ptr = tmp_ptr;
 +			++(*len);
  +			break;
  +		case SQLMONEY:
  +		case SQLMONEY4:
  +		case SQLMONEYN: {
Line 323 (now 323), was 30 lines, now 23 lines

  +		default:
  +			if (dbwillconvert(coltype, SQLCHAR)) {
  +				tmp_len = 32 + (2 * (*len));
  +				tmp_ptr = emalloc(tmp_len);
 +				*len = (DBINT) dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, -1);
 +				*ptr = tmp_ptr;
 +			} else {
 +				*len = 0;
 +				*ptr = NULL;
 +			}
 +	}
   
  -	*ptr = val->data;
  -	*len = val->len;
 +				*len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, tmp_len);
 +
 +				if (*len >= 0) {
 +					tmp_ptr[*len] = '\0';
 +				}
 +				*ptr = tmp_ptr;
 +				*len = tmp_len;
 +		} else {
 +			*len = 0;
 +			*ptr = NULL;
 +		}
 +	}
 +
 +	*caller_frees = 1;
  +
   	return 1;
   }
   
 @@ -266,18 +209,7 @@
 @@ -266,18 +202,7 @@
   	return 1;
   }
   
  -static int dblib_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)


  -
   struct pdo_stmt_methods dblib_stmt_methods = {
   	pdo_dblib_stmt_dtor,
   	pdo_dblib_stmt_execute,
 @@ -288,7 +220,7 @@
 @@ -288,7 +213,7 @@
   	NULL, /* set attr */
   	NULL, /* get attr */
   	NULL, /* meta */
  -	NULL, /* nextrow */


   };
   
  Index: ext/pdo_dblib/php_pdo_dblib_int.h
  ===================================================================
 --- ext/pdo_dblib/php_pdo_dblib_int.h	(revision 296442)
 --- ext/pdo_dblib/php_pdo_dblib_int.h	(revision 297505)
  +++ ext/pdo_dblib/php_pdo_dblib_int.h	(working copy)
  @@ -114,28 +114,7 @@
   } pdo_dblib_db_handle;
   
Line 404 (now 397), was 5 lines, now 4 lines

  -	int current;
  -	
   	pdo_dblib_err err;
   } pdo_dblib_stmt;
  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC