iliaa                                    Mon, 08 Mar 2010 12:39:44 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=295958

Log:
Fixed bug #51213 (pdo_mssql is trimming value of the money column).

Bug: http://bugs.php.net/51213 (Open) pdo_mssql is trimming value of the money 
column
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/ext/pdo_dblib/dblib_stmt.c
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/pdo_dblib/dblib_stmt.c
    U   php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2010-03-08 10:58:37 UTC (rev 295957)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-03-08 12:39:44 UTC (rev 295958)
@@ -3,6 +3,8 @@
 ?? ??? 2010, PHP 5.2.14
 - Updated timezone database to version 2010.3. (Derick)

+- Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia,
+  alexr at oplot dot com)
 - Fixed bug #51192 (FILTER_VALIDATE_URL will invalidate a hostname that
   includes '-'). (Adam, solar at azrael dot ws).
 - Fixed bug #51190 (ftp_put() returns false when transfer was successful).

Modified: php/php-src/branches/PHP_5_2/ext/pdo_dblib/dblib_stmt.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/pdo_dblib/dblib_stmt.c     2010-03-08 
10:58:37 UTC (rev 295957)
+++ php/php-src/branches/PHP_5_2/ext/pdo_dblib/dblib_stmt.c     2010-03-08 
12:39:44 UTC (rev 295958)
@@ -166,7 +166,14 @@
                                                memcpy(val->data, 
dbdata(H->link, i+1), val->len);
                                                val->data[val->len] = '\0';
                                                break;
-
+                                       case SQLMONEY:
+                                       case SQLMONEY4:
+                                       case SQLMONEYN: {
+                                               DBFLT8 money_value;
+                                               dbconvert(NULL, 
S->cols[i].coltype, dbdata(H->link, i+1), dbdatlen(H->link, i+1), SQLFLT8, 
(LPBYTE)&money_value, val->len);
+                                               val->len = spprintf(val->data, 
0, "%.4f", money_value);
+                                               }
+                                               break;
                                        default:
                                                if 
(dbwillconvert(S->cols[i].coltype, SQLCHAR)) {
                                                        val->len = 32 + (2 * 
dbdatlen(H->link, i+1));

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-03-08 10:58:37 UTC (rev 295957)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-03-08 12:39:44 UTC (rev 295958)
@@ -6,6 +6,8 @@
 - Added stream filter support to mcrypt extension (ported from
   mcrypt_filter). (Stas)

+- Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia,
+  alexr at oplot dot com)
 - Fixed bug #51190 (ftp_put() returns false when transfer was successful).
   (Ilia)
 - Fixed bug #51176 (Static calling in non-static method behaves like $this->).

Modified: php/php-src/branches/PHP_5_3/ext/pdo_dblib/dblib_stmt.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/pdo_dblib/dblib_stmt.c     2010-03-08 
10:58:37 UTC (rev 295957)
+++ php/php-src/branches/PHP_5_3/ext/pdo_dblib/dblib_stmt.c     2010-03-08 
12:39:44 UTC (rev 295958)
@@ -166,7 +166,14 @@
                                                memcpy(val->data, 
dbdata(H->link, i+1), val->len);
                                                val->data[val->len] = '\0';
                                                break;
-
+                                       case SQLMONEY:
+                                       case SQLMONEY4:
+                                       case SQLMONEYN: {
+                                               DBFLT8 money_value;
+                                               dbconvert(NULL, 
S->cols[i].coltype, dbdata(H->link, i+1), dbdatlen(H->link, i+1), SQLFLT8, 
(LPBYTE)&money_value, val->len);
+                                               val->len = spprintf(val->data, 
0, "%.4f", money_value);
+                                               }
+                                               break;
                                        default:
                                                if 
(dbwillconvert(S->cols[i].coltype, SQLCHAR)) {
                                                        val->len = 32 + (2 * 
dbdatlen(H->link, i+1));

Modified: php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c
===================================================================
--- php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c        2010-03-08 10:58:37 UTC 
(rev 295957)
+++ php/php-src/trunk/ext/pdo_dblib/dblib_stmt.c        2010-03-08 12:39:44 UTC 
(rev 295958)
@@ -166,7 +166,14 @@
                                                memcpy(val->data, 
dbdata(H->link, i+1), val->len);
                                                val->data[val->len] = '\0';
                                                break;
-
+                                       case SQLMONEY:
+                                       case SQLMONEY4:
+                                       case SQLMONEYN: {
+                                               DBFLT8 money_value;
+                                               dbconvert(NULL, 
S->cols[i].coltype, dbdata(H->link, i+1), dbdatlen(H->link, i+1), SQLFLT8, 
(LPBYTE)&money_value, val->len);
+                                               val->len = spprintf(val->data, 
0, "%.4f", money_value);
+                                               }
+                                               break;
                                        default:
                                                if 
(dbwillconvert(S->cols[i].coltype, SQLCHAR)) {
                                                        val->len = 32 + (2 * 
dbdatlen(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