php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch pdo_dblib_unbuffer-5.3.patch for PDO related Bug #50755Patch version 2010-03-19 23:33 UTC Return to Bug #50755 | Download this patchThis patch is obsolete Obsoleted by patches: 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 UTCDeveloper: ssufficool@gmail.comIndex: ext/pdo_dblib/dblib_stmt.c =================================================================== --- ext/pdo_dblib/dblib_stmt.c (revision 297505) --- ext/pdo_dblib/dblib_stmt.c (revision 296442) +++ 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,58 @@ @@ -252,11 +141,65 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsigned long *len, int *caller_frees TSRMLS_DC) { + Line 290 (now 290), was 11 lines, now 10 lines + char *tmp_ptr = NULL; + + coltype = dbcoltype(H->link, colno+1); + + *len = (DBINT) dbdatlen(H->link, colno+1); + *len = dbdatlen(H->link, colno+1); + *ptr = dbdata(H->link, colno+1); + *caller_frees = 1; + + if (*len == 0 && *ptr == NULL) { + return 1; + } + 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: { + 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 +202,7 @@ @@ -266,18 +209,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 +213,7 @@ @@ -288,7 +220,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 297505) --- ext/pdo_dblib/php_pdo_dblib_int.h (revision 296442) +++ ext/pdo_dblib/php_pdo_dblib_int.h (working copy) @@ -114,28 +114,7 @@ } pdo_dblib_db_handle; - int current; - pdo_dblib_err err; } pdo_dblib_stmt; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Sat Jun 15 22:01:30 2024 UTC |