php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68279 ODBC varchar read broken since PHP-5.5.16
Submitted: 2014-10-21 14:56 UTC Modified: 2015-04-19 04:22 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: charly dot rohart at rcdevs dot com Assigned: cmb (profile)
Status: No Feedback Package: ODBC related
PHP Version: 5.5.18 OS: Linux 32Bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: charly dot rohart at rcdevs dot com
New email:
PHP Version: OS:

 

 [2014-10-21 14:56 UTC] charly dot rohart at rcdevs dot com
Description:
------------
The recent changes to the odbc extension (introduced since PHP-5.5.16) break odbc queries when reading varchar SQL data. We verified that the problem affects PosgreSQL ODBC Driver.
And the issue does not seem to affect the MySQL ODBC Driver from Oracle. 

When fetching VARCHAR values, the ODBC API returns garbage contents having the right length.
The bug does not affect other data type like SQL TEXT or Binary BLOBs.

We noticed that reverting the block below (code from PHP 5.5.18)
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WLONGVARCHAR)
#else
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)
#endif

back to line below (code from PHP 5.5.15) in php_odbc_includes.h
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)

...resolves the problem.
So the very recent changes to php_odbc_includes.h and php_odbc.c have broken something in the ODBC module for Varchar strings.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-11 17:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-04-11 17:04 UTC] cmb@php.net
The problem is likely to be related to bug #68087. Please try PHP
5.5.19 or newer.
 [2015-04-19 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 06:01:27 2019 UTC