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

COUNT(DISTINCT <DECFLOAT_FIELD>) leads FB to crash when there are duplicate values of this field [CORE6218] #6462

Closed
firebird-automations opened this issue Jan 9, 2020 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Attachments:
firebird.20200109_102731.704191.WI-T4_0_0_1714.stack_trace.7z

Consider following script:

recreate table test0(n decfloat);
commit;

insert into test0 values( 0 );
insert into test0 values( 0 );
commit;

set sqlda_display on;
select n as test0_n from test0;
set sqlda_display off;
commit;

set list on;
set explain on;

select n as n_grouped_from_test0 from test0 group by 1; --- [ 1 ]

select distinct n as n_uniq_from_test0 from test0; -- [ 2 ]

select count(distinct n) as count_uniq_from_test0 from test0; -- [ 3 ]

Statement [ 3 ] will raise crash on recent FB 4.x.

firebird.log will contain after this:

IMAGE-PC1 Thu Jan 9 10:27:31 2020
Access violation.
The code attempted to access a virtual
address without privilege to do so.
This exception will cause the Firebird server
to terminate abnormally.

IMAGE-PC1 Thu Jan 9 10:27:31 2020
INET/inet_error: read errno = 10054, server host = Image-PC1, address = fe80::fcf1:e33c:e924:969d%16/3439

IMAGE-PC1 Thu Jan 9 10:27:31 2020
REMOTE INTERFACE/gds__detach: Unsuccesful detach from database.
Uncommitted work may have been lost.
Error writing data to the connection.
send_packet/send

Stack trace can be seen in attached .7z

PS.

If replace records with unique values:

insert into test0 values( 0 );
insert into test0 values( 1 );

-- then count(distinct N) works OK.

Checked on WI-T4.0.0.1714

Commits: 272a49e 473afd3

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: firebird.20200109_102731.704191.WI-T4_0_0_1714.stack_trace.7z [ 13412 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Recheck on next build please. I suppose it's fixed but confirmation needed cause I did not reproduce a crash

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

WI-T4.0.0.1731 - works fine, no crash.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 2 [ 10888 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

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