Bug #50444 [Opn]: PDO-ODBC changes for 64-bit
Edit report at https://bugs.php.net/bug.php?id=50444&edit=1
ID: 50444
User updated by: davbrown4 at yahoo dot com
Reported by: davbrown4 at yahoo dot com
Summary: PDO-ODBC changes for 64-bit
Status: Open
Type: Bug
Package: PDO related
Operating System: Solaris
PHP Version: 5.3.1
Block user comment: N
Private report: N
New Comment:
Hello - are there any plans to accept this fix? We have customers using php who need this fix.
Previous Comments:
------------------------------------------------------------------------
[2009-12-11 00:25:46] davbrown4 at yahoo dot com
Description:
------------
While testing the 64-bit version of our ODBC driver (StarQuest StarSQL http://www.starquest.com) on Solaris SPARC, with unixODBC 2.2.14
(the current stable version), we encountered typedef problems with the PDO-ODBC support - it needed
64-bit changes similar to what had already been done to the ODBC support. The lines that needed to
be changed were pointed out by the Solaris (Sun Workshop) compiler.
(Note that in unixODBC 2.2.14, the default build for 64 bit platforms is to make sizeof( SQLLEN ) =
8. The changes below should continue to work with the older interpretation
(BUILD_LEGACY_64_BIT_MODE)).
Reproduce code:
---------------
The following are our diffs to 5.3.1 (we originally were working with 5.2.11).
diff -ur pdo_odbc-orig pdo_odbc
diff -ur pdo_odbc-orig/odbc_stmt.c pdo_odbc/odbc_stmt.c
--- pdo_odbc-orig/odbc_stmt.c 2009-07-14 19:32:43.000000000 -0700
+++ pdo_odbc/odbc_stmt.c 2009-12-03 16:36:42.000000000 -0800
@@ -279,7 +279,7 @@
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 */
@@ -546,7 +546,7 @@
zend_bool dyn = FALSE;
RETCODE rc;
SWORD colnamelen;
- SDWORD colsize, displaysize;
+ SQLULEN colsize, displaysize;
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,
sizeof(S->cols[colno].colname)-1, &colnamelen,
diff -ur pdo_odbc-orig/php_pdo_odbc_int.h pdo_odbc/php_pdo_odbc_int.h
--- pdo_odbc-orig/php_pdo_odbc_int.h 2008-12-31 03:15:49.000000000 -0800
+++ pdo_odbc/php_pdo_odbc_int.h 2009-12-03 16:37:45.000000000 -0800
@@ -157,7 +157,7 @@
} pdo_odbc_stmt;
typedef struct {
- SQLINTEGER len;
+ SQLLEN len;
SQLSMALLINT paramtype;
char *outbuf;
unsigned is_unicode:1;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=50444&edit=1
Thread (6 messages)