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

This commit is contained in:
Ilia Alshanetsky 2010-03-08 12:39:44 +00:00
parent 3025ca8e17
commit 48adfafab8
2 changed files with 10 additions and 1 deletions

2
NEWS
View File

@ -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->).

View File

@ -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));