Trace INCLUDE_FILTER with [[:WHITESPACE:]]+ does not work when DDL statement contains newline is issued --------------------------------------------------------------------------------------------------------
Key: CORE-5470 URL: http://tracker.firebirdsql.org/browse/CORE-5470 Project: Firebird Core Issue Type: Bug Components: SVCMGR, TRACEMGR Affects Versions: 3.0.1, 2.5.6, 3.0.0, 4.0 Initial Reporter: Pavel Zotov 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 -- 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 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel