Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trace shows info only after 2nd (repeated) .sql run (FB must be restarted before this) [CORE5476] #5746

Closed
firebird-automations opened this issue Feb 3, 2017 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Votes: 1

1. Create following trace config:

database = %[\\/]security4.fdb
{
enabled = false
}

database = #⁠((%[\\/](e40).fdb)|(e40))
{
enabled = true
time_threshold = 0
include_filter = "%(select x from test where x = ?)%"
exclude_filter = "%(execute block)%"
log_statement_finish = true
}

2. ::: NB ::: RESTART Firebird instance.

3. Create .sql:

recreate table test(x int);
insert into test(x) values( 123 );
commit;

set term ^;
execute block as
declare n int = 3;
declare c int;
begin
while( n > 0 ) do
begin
execute statement ( 'select x from test where x = ? rows 1' ) ( 123 ) into c;
n = n - 1;
end
end^
set term ;^
quit;

4. Run trace session

C:\MIX\firebird\fb40\fbtracemgr -sta -c 1runtrace.conf -se localhost/3400:service_mgr

-- and wait until 1st message will appear there:

Trace session ID 1 started

5. Run .sql:

C:\MIX\firebird\fb40\isql localhost/3400:e40 -i test.sql

You will see in the trace window only this two lines (and nothing more):

2017-02-03T09:18:20.7650 (176:00CF25C8) TRACE_INIT
SESSION_1

6. Run .sql again . You will see in the trace window all info that was expected on previous step:

===
2017-02-03T09:19:10.8430 (176:00CF3820) TRACE_INIT
SESSION_1

2017-02-03T09:19:10.9210 (176:00CF3820) EXECUTE_STATEMENT_FINISH
e40 (ATT_99, SYSDBA:NONE, NONE, TCPv4:127.0.0.1/1166)
C:\MIX\firebird\fb40\isql.exe:1424
(TRA_237, CONCURRENCY | WAIT | READ_WRITE)

Statement 109:
-----------------------------------------------------------------
select x from test where x = ? rows 1

param0 = integer, "123"

1 records fetched
0 ms, 2 fetch(es)

PS.
Checked on WI-T4.0.0.519 (01-feb-2017), 32 bit, SuperServer.
It seems that only 4.0 is affected: no such problem on WI-V3.0.2.32677 (31-jan-2017).

Commits: 415fdc4

====== Test Details ======

Checked manually - all OK.
But test can not be imlpemented until one may to restart FB service just before this test run (currently this is not so).

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PPS.
On WI-T4.0.0.511 (24-jan-2017) 1st run of .sql lead trace to show the same message FOUR times:

2017-02-03T09:33:43.8080 (3632:0000000004BD0040) TRACE_INIT

SESSION\_3  

2017-02-03T09:33:43.8080 (3632:0000000004BD0040) TRACE_FINI

SESSION\_3  

2017-02-03T09:34:12.8310 (3632:0000000004BD0040) TRACE_INIT

SESSION\_3  

2017-02-03T09:34:12.9770 (3632:0000000004BD16C0) TRACE_INIT

SESSION\_3  

2017-02-03T09:34:22.8340 (3632:0000000004BD0040) TRACE_FINI

SESSION\_3  

===

-- but also no useful info after this point. Need to run .sql again

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The problem is that now user authentication used the same attachment that is established and attachment's trace manager initialized when current user is unknown.
Trace manager with unknown owner user can't use trace session started by any user.
When second attachment (by the same user) is established the users mapping cache is already populated and trace manager initialized later, when current user is known and confirmed.

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Checked on WI-T4.0.0.530 - works fine. Test will be soon.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Deferred

Test Details: Checked manually - all OK.
But test can not be imlpemented until one may to restart FB service just before this test run (currently this is not so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants