You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the third argument is not present, SUBSTRING should return from <startpos> to the end of the string.
But with long text blobs, it returns a maximum of 32767 characters, as the following query demonstrates:
with q (s) as (
select cast(cast('abc' as char(32767)) as blob sub_type text)
|| cast('def' as char(32767))
|| cast('ghi' as char(32767))
|| 'jkl'
from rdb$database
),
r (sub_for, sub_nofor) as (
select substring(s from 8000 for 120000),
substring(s from 8000)
from q
)
select char_length(s), right(s, 3),
char_length(sub_for), right(sub_for, 3),
char_length(sub_nofor), right(sub_nofor, 3)
from q cross join r
The result is (98304, 'jkl', 90305, 'jkl', 32767, ' ').
Columns 5 and 6 should be the same as 3 and 4: 90305, 'jkl'.
Submitted by: @paulvink
Is related to QA285
If the third argument is not present, SUBSTRING should return from <startpos> to the end of the string.
But with long text blobs, it returns a maximum of 32767 characters, as the following query demonstrates:
with q (s) as (
select cast(cast('abc' as char(32767)) as blob sub_type text)
|| cast('def' as char(32767))
|| cast('ghi' as char(32767))
|| 'jkl'
from rdb$database
),
r (sub_for, sub_nofor) as (
select substring(s from 8000 for 120000),
substring(s from 8000)
from q
)
select char_length(s), right(s, 3),
char_length(sub_for), right(sub_for, 3),
char_length(sub_nofor), right(sub_nofor, 3)
from q cross join r
The result is (98304, 'jkl', 90305, 'jkl', 32767, ' ').
Columns 5 and 6 should be the same as 3 and 4: 90305, 'jkl'.
Commits: e43425e c3f23b1 cb34e0c
The text was updated successfully, but these errors were encountered: