Bug #66070 [NEW]: UTF8 Keys Truncated at 15 When mbstring Installed
| From: | ewilde at bsmdevelopment dot com | Date: | Sat, 09 Nov 2013 03:45:52 +0000 |
| Subject: | Bug #66070 [NEW]: UTF8 Keys Truncated at 15 When mbstring Installed | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182674@lists.php.net to get a copy of this message | ||
From: ewilde at bsmdevelopment dot com
Operating system: CentOS 6.4
PHP version: 5.5.5
Package: ODBC related
Bug Type: Bug
Bug description:UTF8 Keys Truncated at 15 When mbstring Installed
Description:
------------
It is a well-known fact that ODBC support truncates returned database
keys to 31 characters. No surprise there, since the key name length is
hard coded at 32 bytes in php_odbc_includes.h. And, no complaints
either, since we've all learned how to live with it.
However, when "mbstring" support is compiled into PHP using
"--enable-mbstring" at build time, the keys are now truncated at 15.
This happens even when the server and database are set to a single-byte
character set such as UTF8.
In my case, I am using mysql-5.6.14, unixODBC-2.3.2 and
mysql-connector-odbc-5.2.6-src. I have set "character-set-server = utf8"
in my.cnf and have set the default database character set with "alter
database character set = 'utf8';" but still no joy.
The obvious fix is to recompile PHP with "char name[64];" in the
odbc_result_value structure in php_odbc_includes.h. However, if it is
possible, ODBC support should query the database and determine which
character set is in use (e.g. the query in question under MySQL is "show
variables like 'character_set_database';"). If it is an 8-byte character
set, the mbstring support should be turned off and the full 31-byte keys
returned. If it is not possible, I throw my vote behind changing the key
length to 64 by default (regardless of the reluctance to do so as
expressed in Bug #30043).
--
Edit bug report at https://bugs.php.net/bug.php?id=66070&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66070&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66070&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66070&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66070&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66070&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66070&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66070&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66070&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66070&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66070&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66070&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66070&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66070&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66070&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66070&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66070&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66070&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66070&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66070&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66070&r=mysqlcfg