Error "invalid BLOB ID" can occur when retrieving MON$STATEMENTS.MON$SQL_TEXT
using ES/EDS and db_connect argument is not specified
-----------------------------------------------------------------------------------------------------------------------------------
Key: CORE-4747
URL: http://tracker.firebirdsql.org/browse/CORE-4747
Project: Firebird Core
Issue Type: Bug
Components: Engine
Reporter: Pavel Zotov
Test-1 (works correct):
=====
set list on;
set blob all;
recreate table test(sid int, txt blob);
commit;
set term ^;
execute block returns( msg varchar(10), running_stt_id int, running_stt_text
blob) as
declare v_dbname varchar(255);
declare v_stt1 varchar(1024) = 'select t.sid, t.txt from test t';
declare v_stt2 varchar(1024) = 'select s.mon$statement_id, s.mon$sql_text
from mon$statements s rows 1';
declare v_usr rdb$user = 'sysdba';
declare v_pwd varchar(20) = 'masterke';
declare v_trn int;
begin
-- NOTE: v_dbname is NOT initialized with database connection string.
in autonomous transaction do
insert into test(sid, txt) select s.mon$statement_id, s.mon$sql_text from
mon$statements s rows 1;
msg = 'point-1';
execute statement (v_stt1)
on external (v_dbname)
as user :v_usr password :v_pwd
into running_stt_id, running_stt_text;
suspend;
msg = 'point-2';
execute statement (v_stt2)
on external (v_dbname)
as user :v_usr password :v_pwd
into running_stt_id, running_stt_text ;
suspend;
end
^
set term ;^
rollback;
Output:
======
MSG point-1
RUNNING_STT_ID 108
RUNNING_STT_TEXT b0:0
<execute block>
MSG point-2
RUNNING_STT_ID 227
RUNNING_STT_TEXT 0:1
<execute block>
Test-2:
======
set list on;
set blob all;
recreate table test(sid int, txt blob);
commit;
insert into test(sid, txt) select s.mon$statement_id, s.mon$sql_text from
mon$statements s rows 1;
commit;
set term ^;
execute block returns( msg varchar(10), running_stt_id int, running_stt_text
blob) as
declare v_dbname varchar(255);
declare v_stt1 varchar(1024) = 'select t.sid, t.txt from test t';
declare v_stt2 varchar(1024) = 'select s.mon$statement_id, s.mon$sql_text
from mon$statements s rows 1';
declare v_usr rdb$user = 'sysdba';
declare v_pwd varchar(20) = 'masterke';
declare v_trn int;
begin
-- NOTE: v_dbname is NOT initialized with database connection string.
msg = 'point-1';
execute statement (v_stt1)
on external (v_dbname)
as user :v_usr password :v_pwd
into running_stt_id, running_stt_text;
suspend;
msg = 'point-2';
execute statement (v_stt2)
on external (v_dbname)
as user :v_usr password :v_pwd
into running_stt_id, running_stt_text ;
suspend;
end
^
set term ;^
rollback;
Output:
======
MSG point-1
RUNNING_STT_ID 105
RUNNING_STT_TEXT b1:0
insert into test(sid, txt) select s.mon$statement_id, s.mon$sql_text from
mon$statements s rows 1
MSG point-2
RUNNING_STT_ID 227
RUNNING_STT_TEXT 0:1
Statement failed, SQLSTATE = 42000
invalid BLOB ID
No such error in the test-2 if change there MON$DATABASE.MON$SQL_TEXT to
RDB$DATABASE.RDB$DESCRIPTION (and create some non-empty comment for database,
of course).
---------
PS.
WI-V2.5.4.26856
WI-T3.0.0.31780
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel