php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28248 Can not compile --with-sybase and freetds
Submitted: 2004-05-02 01:12 UTC Modified: 2004-12-21 07:57 UTC
Votes:10
Avg. Score:4.8 ± 0.4
Reproduced:9 of 9 (100.0%)
Same Version:6 (66.7%)
Same OS:1 (11.1%)
From: gem at rellim dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 5.0.2 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gem at rellim dot com
New email:
PHP Version: OS:

 

 [2004-05-02 01:12 UTC] gem at rellim dot com
Description:
------------
I am trying to compile PHP 5.0RC2 with sybase support by way of the freetds libraries.  

This has been working fine with many versions of PHP 4.  Now it will not compile.  

Reproduce code:
---------------
Using FreTDS 0.61.2 and 0.62.3.

This is in my ./configure: --with-sybase=/usr/local

Actual result:
--------------
/usr/local/src/php-5.0.0RC2/ext/sybase/php_sybase_db.c: In function `zif_sybase_fetch_object':
/usr/local/src/php-5.0.0RC2/ext/sybase/php_sybase_db.c:1110: invalid lvalue in assignment
/usr/local/src/php-5.0.0RC2/ext/sybase/php_sybase_db.c:1111: invalid lvalue in assignment
make: *** [ext/sybase/php_sybase_db.lo] Error 1



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-15 06:49 UTC] gem at rellim dot com
The problem persists with FreeTDS 0.62.4 and PHP 5.0RC3
 [2004-06-24 21:14 UTC] muaddib at muaddib dot net
found a fix:
change the code of sybase_fetch_object to:
PHP_FUNCTION(sybase_fetch_object)
{
 php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU);
 if (Z_TYPE_P(return_value)==IS_ARRAY) {
       object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value));
        }
}
 [2004-07-20 05:30 UTC] gem at rellim dot com
Still fails on 5.0.0 release.

Monkey See, Monkey Do.  I looked at the source and comprehension eluded me.  So I looked at similar code.  Here is the patch I came up with that appears to work:

--- php_sybase_db.c.DIST        2004-07-19 20:13:37.000000000 -0700
+++ php_sybase_db.c     2004-07-19 20:13:59.000000000 -0700
@@ -1108,9 +1108,7 @@
 {
        php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU);
        if (Z_TYPE_P(return_value)==IS_ARRAY) {
-               Z_TYPE_P(return_value)=IS_OBJECT;
-               Z_OBJPROP_P(return_value) = Z_ARRVAL_P(return_value);
-               Z_OBJCE_P(return_value) = ZEND_STANDARD_CLASS_DEF_PTR;
+               object_and_properties_init(return_value, ZEND_STANDARD_CLASS_DEF_PTR, Z_ARRVAL_P(return_value));
        }
 }
 /* }}} */
 [2004-12-21 07:57 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Mar 31 20:01:24 2020 UTC