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

Remote decimal division triggers assertion / returns wrong answer #6595

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

Comments

@monetdb-team
Copy link

Date: 2018-05-01 13:47:45 +0200
From: @joerivanruth
To: SQL devs <>
Version: 11.29.3 (Mar2018)
CC: @njnes

Last updated: 2018-06-20 11:02:13 +0200

Comment 26416

Date: 2018-05-01 13:47:45 +0200
From: @joerivanruth

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0
Build Identifier:

Given a table t with a single DECIMAL value in it:

 CREATE TABLE t (
     n DECIMAL(8,2)
 );
 INSERT INTO t VALUES (2.00);

I expect the query

 SELECT n/1 FROM t

to return 2.00.

However, if on another server I create a REMOTE TABLE

 CREATE REMOTE TABLE t (
     n DECIMAL(8,2)
 )
 ON '$SLAVE';

running the query against the remote table yields an assertion
failure:

 Assertion failed: (bid == 0 || is_bat_nil(bid) || t == TYPE_any || ATOMtype(_b->ttype) == ATOMtype(t)), function runMALsequence, file /Users/joeri/monets/Mar2018_release/src/monetdb5/mal/mal_interpreter.c, line 661.

This is on the Mar2018_release tag. Interestingly, on the current tip
of the Mar2018 branch (06b77742de12c1cb2ca998f4b04a87cefcf5c1a1) there
is no assertion but an incorrect result:

 sql>SELECT n/1 FROM t;
 +---------------+
 | L2            |
 +===============+
 |       100.000 |
 +---------------+

Reproducible: Always

Steps to Reproduce:

!/bin/sh

FARM="$PWD/FARM"
MASTER=mapi:monetdb://localhost:5501/master
SLAVE=mapi:monetdb://localhost:5502/slave
set -e -x

killall -9 monetdbd mserver5 || true
rm -rf "$FARM"
mkdir "$FARM"

start() {
name="${1*/}"
tmp="${1*:}"
port="${tmp%%/*}"
mserver5 --daemon=yes --dbpath="$FARM/$name" --set mapi_port="$port"
2>&1 >"$FARM/$name.log" &
sleep 1
}

start "$MASTER"
start "$SLAVE"

mclient -d "$SLAVE" <<END
CREATE TABLE t (
n DECIMAL(8,2)
);
INSERT INTO t VALUES (2.00);
END

mclient -d "$MASTER" <<END
CREATE REMOTE TABLE t (
n DECIMAL(8,2)
)
ON '$SLAVE';
END

query() {
mclient -d "$1" <<END
SELECT n/1 FROM t;
END
}

query "$SLAVE"
query "$MASTER"

Actual Results:

Assertion failure on Mar2018_release (see above).
100.000 on 06b77742de12c1cb2ca998f4b04a87cefcf5c1a1

Expected Results:

2.00

Comment 26430

Date: 2018-05-10 12:01:20 +0200
From: MonetDB Mercurial Repository <>

Changeset 439cd2cddb4c made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

fixes for bugs 6594 and 6595

6595, disabled optimizers based on arguments (A...) as
these are passed after the optimizer is run

Also approved output after recent changes on system functions
@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