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

BATsort returns GDK_SUCCEED when **sorted bat is null #6346

monetdb-team opened this issue Nov 30, 2020 · 0 comments

BATsort returns GDK_SUCCEED when **sorted bat is null #6346

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2017-07-07 11:38:23 +0200
From: @lsidir
To: GDK devs <>
Version: -- development

Last updated: 2018-03-29 15:39:18 +0200

Comment 25434

Date: 2017-07-07 11:38:23 +0200
From: @lsidir

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Build Identifier:

In gdk_batop.c line 1281 the following check is done:

if (sorted == NULL && order == NULL && groups == NULL) {
	/* no place to put result, so we're done quickly */
	return GDK_SUCCEED;

I can understand that if the caller has not allocate a bat for the result to be stored, then BATsort can not sort, but is this a success? or should BATsort return GDK_FAIL in this case?

Reproducible: Always

Comment 25611

Date: 2017-09-05 11:14:39 +0200
From: @sjoerdmullender

It does exactly what you ask it to do, so why would that be wrong? ;-)

In any case, sorted==NULL is perfectly legitimate, but indeed if all outputs are NULL, and in particular both sorted and order are NULL, there is no point calling the function. I'll turn that into an error. Just having groups as a non-NULL pointer doesn't really make much sense either, so I'll disallow that as well.

Comment 26317

Date: 2018-03-29 15:39:18 +0200
From: @sjoerdmullender

The Mar2018 version has been released.

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

Successfully merging a pull request may close this issue.

None yet
1 participant