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
This is false in case when there is text blob of length more than 2 Gb.
I've created such blob by fill GTT tables with result of
RECREATE SEQUENCE G;
RECREATE GLOBAL TEMPORARY TABLE GTT(BLOB_FLD BLOB) ON COMMIT DELETE ROWS;
SELECT LIST( gen_id( g, 1 ) ) FROM RDB$TYPES,RDB$TYPES,RDB$TYPES,(SELECT 1 k FROM RDB$TYPES ROWS 15);
-- and after that blob_fld will have length 2'346'948'497 bytes.
Exception:
Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-numeric value is out of range
-- raises when trying to do:
select substring( bob_field from 2147483649 for 1); // NOTE: exception does NOT appear when 2nd arg = 2147483648, i.e. exact power(2, 31) from gtt;
select substring( bob_field from 2147483647 for 2147483648) from gtt;
It will be nice if we'll have new implementation of substring (and all other functions for string handling) that will be able to operate with blobs which length more than 2Gb.
The text was updated successfully, but these errors were encountered:
SQL> select position(',2,' in left(b, 50)) from gtt;
POSITION
============
2 ---------------- OK
SQL> select position(',2,' in b) from gtt;
POSITION
============
0 --------------------------- ?!
But for relatively small (medium ?) blob it is OK:
SQL> delete from gtt2;
SQL> alter sequence g2 restart with 0;
SQL> insert into gtt2 select list(gen_id(g2,1)) from rdb$types,rdb$types;
SQL> select char_length(b) from gtt2;
Submitted by: @pavel-zotov
Currently documentation ( http://www.firebirdsql.org/refdocs/langrefupd25-intfunc-substring.html ) issues that "this function fully supports binary and text BLOBs of ___any___ length and character set" (note on emphasized "any").
This is false in case when there is text blob of length more than 2 Gb.
I've created such blob by fill GTT tables with result of
RECREATE SEQUENCE G;
RECREATE GLOBAL TEMPORARY TABLE GTT(BLOB_FLD BLOB) ON COMMIT DELETE ROWS;
SELECT LIST( gen_id( g, 1 ) ) FROM RDB$TYPES,RDB$TYPES,RDB$TYPES,(SELECT 1 k FROM RDB$TYPES ROWS 15);
-- and after that blob_fld will have length 2'346'948'497 bytes.
Exception:
Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-numeric value is out of range
-- raises when trying to do:
select substring( bob_field from 2147483649 for 1); // NOTE: exception does NOT appear when 2nd arg = 2147483648, i.e. exact power(2, 31) from gtt;
select substring( bob_field from 2147483647 for 2147483648) from gtt;
It will be nice if we'll have new implementation of substring (and all other functions for string handling) that will be able to operate with blobs which length more than 2Gb.
The text was updated successfully, but these errors were encountered: