Issue Details (XML | Word | Printable)

Key: CORE-5470
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

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

Trace INCLUDE_FILTER with [[:WHITESPACE:]]+ does not work when statement contains newline is issued

Created: 26/Jan/17 09:25 AM   Updated: 09/Feb/17 09:22 AM
Component/s: SVCMGR, TRACEMGR
Affects Version/s: 4.0 Initial, 3.0.0, 2.5.6, 3.0.1
Fix Version/s: 2.5.7, 3.0.2, 4.0 Alpha 1

QA Status: Done successfully


 Description  « Hide
1. Create following config for trace and launch it:
===
database
{
# Do we trace database events or not
enabled = true

include_filter = "%(recreate|create|alter|drop|comment on)[[:WHITESPACE:]]+(domain|generator|sequence|exception|procedure|table|index|view|trigger|role|filter|external function)%"

time_threshold = 0
log_statement_finish = true
}
===

2. Create empty database, connect via ISQL and run there:

C:\FB\40SS>C:\FB\40SS\isql /:e40
Database: /:e40, User: SYSDBA
SQL> select 1 from rdb$database where 'create or alter procedure sp_test10 as begin end;' similar to '%(create|alter)[[:WHITESPACE:]]{1,}(procedure)%';

    CONSTANT
============
           1

SQL> create or alter procedure sp_test10 as begin end;

(NOTE: there are 10 spaces between words "alter" & "procedure")


3. Look in the trace log. It will contain:

2017-01-26T12:08:52.9950 (2660:0000000004BE5540) EXECUTE_STATEMENT_FINISH
        e40 (ATT_9, SYSDBA:NONE, NONE, TCPv6:fe80::c02:27a4:3d45:915c%4/50151)
        C:\FB\40SS\isql.EXE:5448
                (TRA_10, CONCURRENCY | WAIT | READ_WRITE)

Statement 28:
-------------------------------------------------------------------------------
select 1 from rdb$database where 'create or alter procedure sp_test10 as begin end;' similar to '%(create|alter)[[:WHITESPACE:]]{1,}(procedure)%'
1 records fetched
      0 ms, 1 read(s), 11 fetch(es)

2017-01-26T12:09:12.1210 (2660:0000000004BE5540) EXECUTE_STATEMENT_FINISH
        e40 (ATT_9, SYSDBA:NONE, NONE, TCPv6:fe80::c02:27a4:3d45:915c%4/50151)
        C:\FB\40SS\isql.EXE:5448
                (TRA_11, READ_COMMITTED | NO_REC_VERSION | WAIT | READ_WRITE)

-------------------------------------------------------------------------------
create or alter procedure sp_test10 as begin end
0 records fetched
      0 ms

// so far so good.

========================================================================

4. Switch back in ISQL and try there:

SQL> create or alter
CON> procedure sp_test11 as begin end;

SQL> create or alter
CON> procedure sp_test10 as begin end;

SQL> select 1 from rdb$database where 'create or alter
CON> procedure sp_test10 as begin end;' similar to '%(create|alter)[[:WHITESPACE:]]{1,}(procedure)%';

    CONSTANT
============
           1

SQL> select 1 from rdb$database where 'create or alter
CON> procedure sp_test10 as begin end;' similar to '%(create|alter)[[:WHITESPACE:]]{1,}(procedure)%';

    CONSTANT
============
           1

You will NOT see in the trace log any messages for these statements.
So, we got TRUE when verify pattern in ISQL and EMPTY result in trace.

Is it my mistake somewhere or this is a bug ? (if the latter - please, fix it ...)

Check on:

WI-T4.0.0.494
WI-V3.0.2.32664
WI-V2.5.7.27038


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 03/Feb/17 04:32 PM
> You will NOT see in the trace log any messages for these statements.
I.e. all kind of statements is affected, not DDL only.

Vlad Khorsun added a comment - 03/Feb/17 04:33 PM
Fix is committed into B3_0_Release, please verify

Pavel Zotov added a comment - 07/Feb/17 12:44 PM
Checked on WI-V3.0.2.32683, WI-T4.0.0.530 - all fine.

Vlad Khorsun added a comment - 08/Feb/17 11:58 AM
Fix is backported into B3_0_Release and B2_5_Release branches