Bug #50444 [Com]: PDO-ODBC changes for 64-bit
| From: | fdemoures at sotraig dot fr | Date: | Fri, 28 Mar 2014 16:03:23 +0000 |
| Subject: | Bug #50444 [Com]: PDO-ODBC changes for 64-bit | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184943@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50444&edit=1
ID: 50444
Comment by: fdemoures at sotraig dot fr
Reported by: davbrown4 at yahoo dot com
Summary: PDO-ODBC changes for 64-bit
Status: Open
Type: Bug
Package: PDO ODBC
Operating System: Solaris
PHP Version: 5.3.1
Block user comment: N
Private report: N
New Comment:
I use pdo_odbc on Ubuntu 13.10 x86_64 with php 5.5.3 and the new driver odbc IBM i Access.
Segmentation fault occurs on execute() after a prepare().
If I use query() directly, it works.
On architecture i386 it works.
Previous Comments:
------------------------------------------------------------------------
[2014-03-19 23:21:12] kadler at us dot ibm dot com
We have customers running in to this problem on x86_64 and PPC64 Linux using our new IBM i Access
ODBC driver, since we now build against the newer version of unixODBC that has a 64-bit SQLLEN.
I've added a pull request against the latest code in GitHub. Hopefully, this should make it
easy enough to close this nearly 4.5 year old bug.
------------------------------------------------------------------------
[2014-01-31 19:13:09] samifruit514 at hotmail dot com
We also need this for our sql server native 11 connection
------------------------------------------------------------------------
[2013-01-30 00:43:04] paul dot posts at gmail dot com
Related To: Bug #61777
------------------------------------------------------------------------
[2011-10-12 16:59:20] davbrown4 at yahoo dot com
Hello - are there any plans to accept this fix? We have customers using php who need this fix.
------------------------------------------------------------------------
[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