add test for bug #70700 (LOB read loop ends early for multibyte strings)#1569
add test for bug #70700 (LOB read loop ends early for multibyte strings)#1569ashnazg wants to merge 11 commits intophp:masterfrom
Conversation
|
I think it's somewhat plausible that this bug behavior here could be the root cause behind the bug#60994 (#1566). |
|
@cjbj please can we get some feedback ? |
|
@ashnazg See the updates in https://bugs.php.net/bug.php?id=70700 about why the testcase is not correct. |
ext/oci8/tests/bug70700.phpt
Outdated
| @@ -0,0 +1,179 @@ | |||
| --TEST-- | |||
| Bug #70700 (LOB read loop ends early for multibyte strings) | |||
There was a problem hiding this comment.
Since bug #70700 is not a code bug perhaps the title should just say 'Tests for LOBS with multibyte strings'?
| $target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs | ||
| require(dirname(__FILE__).'/skipif.inc'); | ||
| ?> | ||
| --FILE-- |
There was a problem hiding this comment.
Please add the following between line 11 and 12:
--ENV--
NLS_LANG=.AL32UTF8
There was a problem hiding this comment.
Is that dot supposed to be there? =.
There was a problem hiding this comment.
Yes the dot should be there. It is the separator from the language & territory component. In this case the language & territory are empty meaning the defaults are used. Other examples exist in PHP tests: http://lxr.php.net/xref/PHP-MASTER/ext/oci8/tests/bug47281.phpt#17
ext/oci8/tests/bug70700.phpt
Outdated
|
|
||
|
|
||
| echo PHP_EOL, 'Test 1: j', PHP_EOL; | ||
| $string1 = 'abc' . str_repeat('j', 10000) . 'xyz'; |
There was a problem hiding this comment.
The repeat time should be 1000000 to match the expected result.
|
@cjbj can we get another review here please ? |
tianfyang
left a comment
There was a problem hiding this comment.
Thanks for your contributions. I've tested the testcase on different branches. After adding the check of mbstring, we're good to go.
| Chuck Burgess | ||
| [email protected] | ||
| --SKIPIF-- | ||
| <?php |
There was a problem hiding this comment.
Please add the following check here:
if (!extension_loaded('mbstring')) die('skip mbstring is not enabled');
After adding this, we're good to go.
|
Comment on behalf of sixd at php.net: Merged - thanks! |
Tests to show bug behavior of "LOB read loop ends early for multibyte strings", as described in https://bugs.php.net/bug.php?id=70700.
Additional notes are on my question here (http://stackoverflow.com/questions/33026617/pdo-oci-truncates-large-multibyte-clobs) that might help diagnose the bug.
@cjbj: I had to construct this PHPT by hand from my standalone PHP test file, so it may need some polishing to run just right with your test scaffolding (those require targets etc). I'll update PR if you'll highlight any edits that are needed to get it running.