Uh oh!
There was an error while loading. Please reload this page.
Fix bug #54379 PDO_OCI: UTF-8 output gets truncated - #2276
Conversation
KalleZ
commented
Jan 5, 2017
Tagging Christopher as he is the Oracle guy; @cjbj |
nikic
commented
Jan 12, 2017
Ping @cjbj |
KalleZ
commented
Jan 12, 2017
cjbj
commented
Jan 13, 2017
I'm back; I've asked a developer to look at this. It's in a big queue of tasks TBD. |
| S->cols[colno].datalen *= 3; | ||
| } | ||
| S->cols[colno].datalen *= S->H->max_char_width; |
There was a problem hiding this comment.
Lines 602-606 need to be:
} else if (dtype == SQLT_BIN){
S->cols[colno].datalen = (ub4) col->maxlen * 2; // raw characters to hex digits
} else {
S->cols[colno].datalen = (ub4) (col->maxlen * S->H->max_char_width);
}
There was a problem hiding this comment.
Rationale from the developer who looked at it is:
"Given raw data(SQLT_BIN) is defined as SQLT_CHR (See line #609), raw is returned as strings. So 1 byte raw is represented as two bytes of hex digits.
For example, a 1-byte raw data 'FF' is converted to two 'F' characters. So we need to multiply by 2 (not 3) to accommodate the translation of raw to hex digits. max_char_width should be used for character strings.
Apart from that, other changes all look good including the testcase. The test would normally be skipped in the test suite as a UTF-8 DSN is required.
But we can see the skip reason in the test result and run it manually if required."
cjbj
commented
Mar 2, 2017
No update from filer on this. But no fear! We've got a corrected patch ready for testing and merge. I'll close this PR |
php-pulls
commented
Mar 2, 2017
Comment on behalf of sixd at php.net: We will commit a corrected patch |
This was a modification of an incomplete PR #2276.
Replacement for issue #542