sfox            Thu Mar 19 22:16:29 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/pdo_dblib      dblib_driver.c dblib_stmt.c 
  Log:
  MFH
  - Fix bug #38805 ( PDO Truncates Text from SQL Server Text Data Type Field)
  - Bring behaviour into line with ext/mssql 
  - Several memleaks plugged
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_dblib/dblib_driver.c?r1=1.9.2.2.2.2.2.2&r2=1.9.2.2.2.2.2.3&diff_format=u
Index: php-src/ext/pdo_dblib/dblib_driver.c
diff -u php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2.2.2.2.2 
php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2.2.2.2.3
--- php-src/ext/pdo_dblib/dblib_driver.c:1.9.2.2.2.2.2.2        Wed Dec 31 
11:15:41 2008
+++ php-src/ext/pdo_dblib/dblib_driver.c        Thu Mar 19 22:16:29 2009
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: dblib_driver.c,v 1.9.2.2.2.2.2.2 2008/12/31 11:15:41 sebastian Exp $ */
+/* $Id: dblib_driver.c,v 1.9.2.2.2.2.2.3 2009/03/19 22:16:29 sfox Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -229,7 +229,11 @@
        if (H->link == NULL) {
                goto cleanup;
        }
-       
+
+       if (DBSETOPT(H->link, DBTEXTLIMIT, "2147483647") == FAIL) {
+               goto cleanup;
+       }
+
        if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
                goto cleanup;
        }
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_dblib/dblib_stmt.c?r1=1.6.2.2.2.4.2.2&r2=1.6.2.2.2.4.2.3&diff_format=u
Index: php-src/ext/pdo_dblib/dblib_stmt.c
diff -u php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2.2.4.2.2 
php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2.2.4.2.3
--- php-src/ext/pdo_dblib/dblib_stmt.c:1.6.2.2.2.4.2.2  Wed Dec 31 11:15:41 2008
+++ php-src/ext/pdo_dblib/dblib_stmt.c  Thu Mar 19 22:16:29 2009
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: dblib_stmt.c,v 1.6.2.2.2.4.2.2 2008/12/31 11:15:41 sebastian Exp $ */
+/* $Id: dblib_stmt.c,v 1.6.2.2.2.4.2.3 2009/03/19 22:16:29 sfox Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -113,18 +113,27 @@
                stmt->column_count = S->ncols;
        
                for (i = 0, j = 0; i < S->ncols; i++) {
+                       char *tmp = NULL;
+
                        S->cols[i].coltype = dbcoltype(H->link, i+1);
-                       S->cols[i].name = dbcolname(H->link, i+1);
-                       if (S->cols[i].name) {
-                               S->cols[i].name = estrdup(S->cols[i].name);
-                       } else if (j) {
-                               spprintf(&S->cols[i].name, 0, "computed%d", 
j++);
-                       } else {
-                               S->cols[i].name = estrdup("computed");
-                               j++;
+                       S->cols[i].name = (char*)dbcolname(H->link, i+1);
+
+                       if (!strlen(S->cols[i].name)) {
+                               if (j) {
+                                       spprintf(&tmp, 0, "computed%d", j++);
+                                       strlcpy(S->cols[i].name, tmp, 
strlen(tmp)+1);
+                                       efree(tmp);
+                               } else {
+                                       S->cols[i].name = "computed";
+                                       j++;
+                               }
                        }
-                       S->cols[i].source = dbcolsource(H->link, i+1);
-                       S->cols[i].source = estrdup(S->cols[i].source ? 
S->cols[i].source : "");
+
+                       S->cols[i].source = (char*)dbcolsource(H->link, i+1);
+                       tmp = estrdup(S->cols[i].source ? S->cols[i].source : 
"");
+                       S->cols[i].source = tmp;
+                       efree(tmp);
+
                        S->cols[i].maxlen = dbcollen(H->link, i+1);
                }
        }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to