Fix #50444: PDO-ODBC changes for 64-bit

This bug is also referenced in
[#61777](https://bugs.php.net/bug.php?id=61777) and is still present in
the latest stable release of the 5.5 branch. I see two tickets exist for
this problem already, and I'm just submitting these changes via github
as a reminder that this is a serious problem for anyone using PDO_ODBC
on the x64 builds.
This commit is contained in:
Andrew Kehrig 2014-02-24 12:01:58 -05:00 committed by Stanislav Malyshev
parent 076c25bfec
commit 91e7b3b84f
3 changed files with 6 additions and 3 deletions

3
NEWS
View file

@ -9,6 +9,9 @@ PHP NEWS
- OPCache: - OPCache:
. Fixed issue #183 (TMP_VAR is not only used once). (Dmitry, Laruence) . Fixed issue #183 (TMP_VAR is not only used once). (Dmitry, Laruence)
- PDO-ODBC:
. Fixed bug #50444 (PDO-ODBC changes for 64-bit).
?? ??? 2014, PHP 5.5.13 ?? ??? 2014, PHP 5.5.13
- CLI server: - CLI server:

View file

@ -279,7 +279,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p
pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data; pdo_odbc_stmt *S = (pdo_odbc_stmt*)stmt->driver_data;
RETCODE rc; RETCODE rc;
SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0; SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0;
UDWORD precision = 0; SQLULEN precision = 0;
pdo_odbc_param *P; pdo_odbc_param *P;
/* we're only interested in parameters for prepared SQL right now */ /* we're only interested in parameters for prepared SQL right now */
@ -551,7 +551,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
struct pdo_column_data *col = &stmt->columns[colno]; struct pdo_column_data *col = &stmt->columns[colno];
RETCODE rc; RETCODE rc;
SWORD colnamelen; SWORD colnamelen;
SDWORD colsize; SQLULEN colsize;
SQLLEN displaysize; SQLLEN displaysize;
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname, rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,

View file

@ -157,7 +157,7 @@ typedef struct {
} pdo_odbc_stmt; } pdo_odbc_stmt;
typedef struct { typedef struct {
SQLINTEGER len; SQLLEN len;
SQLSMALLINT paramtype; SQLSMALLINT paramtype;
char *outbuf; char *outbuf;
unsigned is_unicode:1; unsigned is_unicode:1;