Skip to content

Commit

Permalink
Fixed bug #51213 (pdo_mssql is trimming value of the money column).
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Alshanetsky committed Mar 8, 2010
1 parent 3025ca8 commit 48adfaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -6,6 +6,8 @@ PHP NEWS
- 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->).
Expand Down
9 changes: 8 additions & 1 deletion ext/pdo_dblib/dblib_stmt.c
Expand Up @@ -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));
Expand Down

0 comments on commit 48adfaf

Please sign in to comment.