From:             davbrown4 at yahoo dot com
Operating system: Solaris
PHP version:      5.3.1
PHP Bug Type:     PDO related
Bug description:  PDO-ODBC changes for 64-bit

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 bug report at http://bugs.php.net/?id=50444&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50444&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50444&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50444&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50444&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50444&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50444&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50444&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50444&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50444&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50444&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50444&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50444&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50444&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50444&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50444&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50444&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50444&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50444&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50444&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50444&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50444&r=mysqlcfg

Reply via email to