summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib/dblib_stmt.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2010-03-08 12:39:44 (GMT)
committerIlia Alshanetsky <iliaa@php.net>2010-03-08 12:39:44 (GMT)
commit48adfafab8a347c2b1b62292e013f30af52feb9f (patch)
treefb9a2d1393c7b0e2df012e4ade45b4d1ae0c4f11 /ext/pdo_dblib/dblib_stmt.c
parent3025ca8e17da2fc22878f57176d688c61073a134 (diff)
downloadphp-48adfafab8a347c2b1b62292e013f30af52feb9f.tar.gz
Fixed bug #51213 (pdo_mssql is trimming value of the money column).
Diffstat (limited to 'ext/pdo_dblib/dblib_stmt.c')
-rw-r--r--ext/pdo_dblib/dblib_stmt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index 6ce7ec7..a9f8cf2 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -166,7 +166,14 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
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));