> Hello Vlad,
>
>>> while we have a strategy in the parser in FB TraceManager to detect a
>>> new statement in the raw output, I wonder if there is an ultimate
>>> solution for that? ;-)
>>>
>>> With several event types producing more or less an undefined number of
>>> rows at the end of the raw output, I currently don't see some kind of
>>> end of statement terminator character thingy in the raw output.
>>>
>>> Currently, we use the first line of a new statement to detect that it is
>>> a new statement, but obviously, this won't get me some kind of end of
>>> statement thingy for the last received statement in the raw output, thus
>>> the parsed output somehow one statement "behind" the raw output.
>>>
>>> Any ideas/comments?
>>
>> Could you put example of such raw output and point me where you
>> have a troubles with parsing ?
>
> Imagine the following output:
>
> 2011-06-14T10:05:50.3790 (2032:0000000000F3DC88) CLOSE_CURSOR
> softnet_art.fdb (ATT_70, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
> C:\Program Files (x86)\Upscene Productions\Database Workbench 4
> Pro\DBW4.exe:6064
>
> Statement 111:
> -------------------------------------------------------------------------------
> select rf.rdb$field_name, f.rdb$field_type, f.rdb$field_sub_type,
> rf.rdb$description,
> rf.rdb$null_flag, rf.rdb$default_source as field_default,
> f.rdb$default_source as domain_default,
> f.rdb$field_scale, f.rdb$computed_source, rf.rdb$field_position,
> f.rdb$field_length, f....
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> PLAN SORT (JOIN (JOIN (F NATURAL, FD INDEX (RDB$INDEX_36)), RF INDEX
> (RDB$INDEX_3, RDB$INDEX_4)))
>
> 2011-06-14T10:05:50.3790 (2032:0000000000F3DC88) FREE_STATEMENT
> softnet_art.fdb (ATT_70, SYSDBA:NONE, NONE, TCPv4:127.0.0.1)
> C:\Program Files (x86)\Upscene Productions\Database Workbench 4
> Pro\DBW4.exe:6064
>
> Statement 111:
> -------------------------------------------------------------------------------
> select rf.rdb$field_name, f.rdb$field_type, f.rdb$field_sub_type,
> rf.rdb$description,
> rf.rdb$null_flag, rf.rdb$default_source as field_default,
> f.rdb$default_source as domain_default,
> f.rdb$field_scale, f.rdb$computed_source, rf.rdb$field_position,
> f.rdb$field_length, f....
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> PLAN SORT (JOIN (JOIN (F NATURAL, FD INDEX (RDB$INDEX_36)), RF INDEX
> (RDB$INDEX_3, RDB$INDEX_4)))
>
>
>
> There are two event types here: CLOSE_CURSOR, FREE_STATEMENT
>
> Currently we detect the end of statement thingy of CLOSE_CURSOR, by
> parsing the first line of FREE_STATEMENT, because due to possibly
> multi-line plan output etc., IMHO there is no reliable way to detect the
> end of CLOSE_CURSOR (just an example here).
>
> So, currently, our parser knows, that CLOSE_CURSOR is finished, by
> receiving the first line of the next event (FREE_STATEMENT). The end of
> FREE_STATEMENT is detected when the next event is received. If
> FREE_STATEMENT is the last event, the parser somehow thinks, that
> FREE_STATEMENT isn't finished yet.
>
> I possibly could add some kind of timer, which e.g. notifies the parser
> of the finished last event type, in case no other trace raw output is
> received.
>
> A simplified example:
>
> A
> B
> C
> D
> E
> ...
>
> where A, B ... are output for a particular event type. I need to receive
> the first line of B to detect that the raw output of A is finished etc
> ... Thus, my grid of parsed output is always one trace event behind the
> raw output.
Hmm... not sure if text below could satisfy you, but anyway :
trace always puts whole event record into log, i.e. it is imposible to read
half of
record's text from a trace log. So, if next call of isc_service_query is
blocked
(or returns nothing, depending of how you call it) you can consider previous
text as complete event record.
Another possibility for you is to create own trace plugin and put into
trace log
(or whatever you choose) records in you own format. If speak about FB3 - you are
free to propose new format for trace log and we'll consider it.
Regards,
Vlad
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel