]> granicus.if.org Git - php/commitdiff
Fix #50444: PDO-ODBC changes for 64-bit
authorAndrew Kehrig <kehrigan@gmail.com>
Mon, 24 Feb 2014 17:01:58 +0000 (12:01 -0500)
committerStanislav Malyshev <stas@php.net>
Sun, 20 Apr 2014 23:49:15 +0000 (16:49 -0700)
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.

NEWS
ext/pdo_odbc/odbc_stmt.c
ext/pdo_odbc/php_pdo_odbc_int.h

diff --git a/NEWS b/NEWS
index a1427512c2937427aae49ec1a784d73940173def..d1de079b6760d6e2a6bba6fec3150fbccb323090 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,9 @@ PHP                                                                        NEWS
   . Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
     (Matteo)
 
+- PDO-ODBC:
+  . Fixed bug #50444 (PDO-ODBC changes for 64-bit). 
+
 - SQLite:
   . Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol)
 
index 8b0ccf34e6c92b17f9ff8e5262ca0ff9851c9509..1d275cd654951e420e4ddb448e5171cfe23f00e5 100644 (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;
        RETCODE rc;
        SWORD sqltype = 0, ctype = 0, scale = 0, nullable = 0;
-       UDWORD precision = 0;
+       SQLULEN precision = 0;
        pdo_odbc_param *P;
        
        /* 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];
        RETCODE rc;
        SWORD   colnamelen;
-       SDWORD  colsize;
+       SQLULEN colsize;
        SQLLEN displaysize;
 
        rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
index 87b2f9100dcf3692eef123ce91f8afabb09d25c5..5e42951f865b8892e0c2f7846c61df32d2bc4783 100644 (file)
@@ -157,7 +157,7 @@ typedef struct {
 } pdo_odbc_stmt;
 
 typedef struct {
-       SQLINTEGER len;
+       SQLLEN len;
        SQLSMALLINT paramtype;
        char *outbuf;
        unsigned is_unicode:1;