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

pqueue.enqueue_max type mismatch error #3281

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

pqueue.enqueue_max type mismatch error #3281

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

Comments

@monetdb-team
Copy link

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

Date: 2013-05-13 17:29:58 +0200
From: Nik Schuiling <<n.h.schuiling>>
To: MonetDB5 devs <>
Version: 11.15.7 (Feb2013-SP2)
CC: @mlkersten

Last updated: 2013-07-03 08:47:58 +0200

Comment 18718

Date: 2013-05-13 17:29:58 +0200
From: Nik Schuiling <<n.h.schuiling>>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Build Identifier:

pqueue.enqueue_max throws a type mismatch in my example MAL-program. This is incorrect behaviour in my opinion (correct me if i'm wrong).

Reproducible: Always

Steps to Reproduce:

Execute the following MAL code:

 init pqueue
X_buffer_type:bat[:oid,:int] := bat.new(:oid,:int,1);
X_buffer := pqueue.init(X_buffer_type,5:wrd);	

 enqueue something	
pqueue.enqueue_max(X_buffer,5:oid,5:int);  throws a type mismatch error

Actual Results:

type mismatch error

Expected Results:

no error message

In pqueue.c the following check of method PQenqueue_anymax seems to be wrong:

if (p->argc != 4 || getArgType(mb, p, 1) != TYPE_bat || getArgType(mb, p, 2) != TYPE_oid)

In my example MAL-program the condition getArgType(mb, p, 1) != TYPE_bat is true, which doesn't make sense. The value of getArgType(mb, p, 1) in this context is 670777.

Comment 18719

Date: 2013-05-13 21:09:52 +0200
From: @mlkersten

The value 670777 indicates a BAT.
The type TYPE_bat refers to a BAT identifier, which is largely obsolete since we abandoned recursive BATs

The code has been fixed in default and a test has been added
src/modules/mal/Tests/pqueue.mal

Comment 18729

Date: 2013-05-14 15:58:22 +0200
From: @sjoerdmullender

Bug was backported.

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

Successfully merging a pull request may close this issue.

None yet
1 participant