-
Notifications
You must be signed in to change notification settings - Fork 8k
Fix bug #54379 PDO_OCI: UTF-8 output gets truncated #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It will probably need fixes/tweaks, especially with the given DSN at line 12
|
Added test. |
|
I scanned the change quickly. The code looks delicate. It defines the new size in terms of a utext (a short) which is intended for utf-16. If this sizing code is the root cause of the crash, I would have expected the patch to use oratext or text with some character set multiplication factor. The test uses the wrong number of args to putenv() so it will fail. It hardcodes the connection string and char set. It should also have a skipif if the DB char set is not UTF8. |
|
Which patch? |
|
Can you squash the commit? |
|
It is not quite right solution.
There is also another one caveat: NCHAR, NVARCHAR2, NCLOB types. Before transferring data to client Oracle converts data from such columns to NLS_NCHAR character set (if it is defined). Look here for details: http://docs.oracle.com/cd/A84870_01/doc/server.816/a76966/ch2.htm#94684 I see here two ways.
But i don't know what to do with NLS_NCHAR. |
|
use oci function cast() like this : |
|
Can anyone clarify the status of this bug? |
|
Comment on behalf of krakjoe at php.net: Since this PR has merge conflicts, seems to have been abandoned by author, and seems like a questionable solution, I'm closing this PR. If the author is watching and feels I am wrong, please open a clean PR, and start a discussion on internals. |
|
Well the original PR was more a quick hack than a real fix. |
Comprehensive performance optimization of TrueAsync API to eliminate expensive EG(exception) checks in hot execution paths by refactoring function signatures from void to
bool and replacing exception-based error handling with direct return value checks.
Key changes:
- Updated function typedefs: zend_async_event_del_callback_t, zend_async_event_stop_t, zend_async_event_dispose_t (void→bool)
- Refactored zend_async_callbacks_remove to return bool
- Updated all del_callback, stop, and dispose function implementations with proper return values
- Fixed forward declarations compatibility issues
- Optimized all function call sites to use if (!function()) return false; pattern instead of EG(exception) checks
- Applied optimization to ~80 functions across coroutine, scope, curl, and libuv reactor modules
Performance impact:
Replaces expensive exception checks with fast boolean operations in critical async execution paths.
Changed return types from void to bool for three functions to match header declarations:
zend_async_internal_context_set:
- Returns false when coroutine == NULL
- Returns true on successful context setting
zend_coroutine_call_switch_handlers:
- Returns true when no handlers exist or execution succeeds
- Preserves existing handler cleanup logic
zend_async_add_main_coroutine_start_handler:
- Returns false when duplicate handler detected
- Returns true on successful handler addition
I can test a Windows build ogf PHP with that fix if needed.