Issue Details (XML | Word | Printable)

Key: CORE-3335
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dmitry Yemanov
Reporter: Dmitry Yemanov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Wrong results (internal wrapping occured) for the multi-byte blob SUBSTRING function and its boundary arguments

Created: 04/Feb/11 08:23 AM   Updated: 16/May/12 03:13 PM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0 Initial, 2.5.0
Fix Version/s: 2.5.1, 2.1.5, 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide

select substring(cast('abcdef' as blob sub_type text character set utf8)
from 1 for 2147483647) from rdb$database;
-- 'abcdef'

select substring(cast('abcdef' as blob sub_type text character set utf8)
from 2 for 2147483647) from rdb$database;
-- ''

select substring(cast('abcdef' as blob sub_type text character set utf8)
from 3 for 2147483647) from rdb$database;
-- 'cd'

select substring(cast('abcdef' as blob sub_type text character set utf8)
from 3 for 2147483646) from rdb$database;
-- ''

i.e. the problem occurs when (offset + length) overflows the 32-bit signed value.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.