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

sys.statistics column "nils" always contains 0. Expected a positive value for columns that have one or more nils/NULLs #6331

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2017-06-01 19:02:33 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.25.23 (Dec2016-SP5)

Last updated: 2018-03-29 16:44:25 +0200

Comment 25370

Date: 2017-06-01 19:02:33 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Build Identifier:

It appears that column "nils" of sys.statistics always contains 0 after running ANALYSE on all columns of all tables of schemas: sys, tmp and profiler.
I expected that columns "nils" would contain the number of nils/NULLs found in the specific column.

Reproducible: Always

Steps to Reproduce:

  1. Run SQL commands:
    ANALYSE sys;
    ANALYSE tmp;
    ANALYSE profiler;
    SELECT * FROM sys.statistics WHERE nils <> 0.
    SELECT * FROM sys.statistics WHERE minval = 'nil' OR maxval = 'nil';
    SELECT * FROM sys.statistics WHERE (minval = 'nil' OR maxval = 'nil') AND nils <> 0;

Actual Results:

nils always contain 0 for all columns analyzed, although there are many columns which have 'nil' as minimum or maximum value.

Expected Results:

For columns that have NULLs/nils value, the number of occurences in that column.

Comment 25383

Date: 2017-06-20 11:28:37 +0200
From: MonetDB Mercurial Repository <>

Changeset b4f5f29a002f made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=b4f5f29a002f

Changeset description:

Fix BATselect comment so that it tells the truth; fix call to select for NIL.
This fixes bug #6331.

Comment 25390

Date: 2017-06-22 14:14:15 +0200
From: MonetDB Mercurial Repository <>

Changeset 567718e3de97 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=567718e3de97

Changeset description:

Add test and output files for bug #6331

Comment 26330

Date: 2018-03-29 16:44:25 +0200
From: MonetDB Mercurial Repository <>

Changeset 8920ec11dedc made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8920ec11dedc

Changeset description:

Fix memory leak reported on
http://monetdb.cwi.nl/testweb/web/showtestoutput.php?serial=66173:f34a57f73307&target=GNU-Fedora-x86_64-sanitize&module=sql&test=sql%2Ftest%2FBugTracker-2017%2Fstatistics_nils_not_eq_zero.Bug-6331&which=err
The leak is introduced recently via [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=78237ac1720c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=78237ac1720c) 
I also found and removed two unneccesary GDKfree() calls to pointers which are already NULL.
@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants