-
Notifications
You must be signed in to change notification settings - Fork 7.9k
add test for bug #70700 (LOB read loop ends early for multibyte strings) #1569
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since bug #70700 is not a code bug perhaps the title should just say 'Tests for LOBS with multibyte strings'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curb service :-)
ext/oci8/tests/bug70700.phpt
Outdated
$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the following between line 11 and 12:
--ENV--
NLS_LANG=.AL32UTF8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that dot supposed to be there? =.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repeat time should be 1000000 to match the expected result.
@cjbj can we get another review here please ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
ashnazg@php.net | ||
--SKIPIF-- | ||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.