Bug #44003 [Opn->Dup]: odbc_fetch_array returns truncated field names
| From: | cmb@php.net | Date: | Mon, 05 Oct 2020 13:25:29 +0000 |
| Subject: | Bug #44003 [Opn->Dup]: odbc_fetch_array returns truncated field names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229404@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=44003&edit=1
ID: 44003
Updated by: cmb@php.net
Reported by: tceverling at yahoo dot co dot uk
Summary: odbc_fetch_array returns truncated field names
-Status: Open
+Status: Duplicate
Type: Bug
Package: ODBC related
Operating System: Windows XP SP2
PHP Version: 5.2.5
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This issue has been fixed as bug #65950.
Previous Comments:
------------------------------------------------------------------------
[2009-08-11 16:29:38] tyler dot reese at taqua dot com
In /ext/odbc/php_odbc_includes.h, you can change the 'name' field, of the
'odbc_result_value' struct, from 32 to 256 (or whatever length you need), and then
recompile PHP.
With that said, is this (changing 'name' length from 32 to 256) ever going to be a
permanent fix in any upcoming official version of PHP?
This same issue is reported in:
Bug #30043 ODBC Column Name Truncation (missing multi-byte support)
------------------------------------------------------------------------
[2009-04-17 13:09:35] netvbonline at yahoo dot co dot uk
This is over a year old? Has anyone been able to fix as I am using latest version of PHP as of 17
Apr 2009 with dynamic queries and just encountered this issue
Many Thanks :-))
------------------------------------------------------------------------
[2008-01-31 18:17:50] tceverling at yahoo dot co dot uk
Description:
------------
After executing a "SELECT" SQL query and then doing an odbc_fetch_array(), field names
longer than 31 characters gets truncated.
Reproduce code:
---------------
<?php
$link = odbc_connect('MYSQL', '', ''); // Connect to MySQL
$res = odbc_exec($link, 'select * from test');
var_dump(odbc_fetch_array($res));
$link = odbc_connect('Access', '', ''); // Connect to Microsoft
Access
$res = odbc_exec($link, 'select * from test');
var_dump(odbc_fetch_array($res));
?>
Expected result:
----------------
Assuming that a field name within the table
test is
'1234567890123456789012345678901234567890', expected result maybe like:
array(1) {
["1234567890123456789012345678901234567890"]=>
string(1) "1"
}
array(1) {
["1234567890123456789012345678901234567890"]=>
string(1) "1"
}
Actual result:
--------------
array(1) {
["1234567890123456789012345678901"]=>
string(1) "1"
}
array(1) {
["1234567890123456789012345678901"]=>
string(1) "1"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=44003&edit=1