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

mclient crashes if real column is multiplied by it itself #6228

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

mclient crashes if real column is multiplied by it itself #6228

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

Comments

@monetdb-team
Copy link

Date: 2017-02-24 13:06:49 +0100
From: Frank Krüger <<frank.krueger2>>
To: SQL devs <>
Version: 11.25.5 (Dec2016-SP1)

Last updated: 2017-03-31 13:28:22 +0200

Comment 25057

Date: 2017-02-24 13:06:49 +0100
From: Frank Krüger <<frank.krueger2>>

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

A table has been created that contains several real typed columns by:
create table raw.ACCELEROMETER("ID" BIGSERIAL, "RECORDING$ID" INT REFERENCES raw.recording("ID"), "DateTime" TIMESTAMP, "TICK" INT, "X" REAL, "Y" REAL, "Z" REAL);

When querying the product of one of the real typed columns with itself, a TypeException is thrown:
sql>select "X"*"X" from raw.accelerometer limit 10;
TypeException:user.main[19]:'mmath.pow' undefined in: mmath.pow(X_1210:flt,2:dbl);

When querying the the same by use of the power function directly everything seems to be fine:
sql>select power("X",2) from raw.accelerometer limit 10;
+-----------------+
| L2 |
+=================+
| 0.9511128 |
| 0.9692405 |
| 0.9692405 |
| 0.9672725 |
| 0.9638332 |
| 0.9520881 |
| 0.95257616 |
| 0.95257616 |
| 0.95257616 |
| 0.9520881 |
+-----------------+
10 tuples (6.4s)

Also querying the result of a real typed column with another works fine. It seems that is a problem with the implicit use of the power function, where the exponent is typed as double instead of real.

This is also confirmed by the output of plan:

mclient data -s "plan select "X"*"X" from raw.accelerometer limit 10;"
+----------------------------------------------------------------+
| rel |
+================================================================+
| top N ( |
| | project ( |
| | | table(raw.accelerometer) [ accelerometer.X ] COUNT |
| | ) [ sys.power(accelerometer.X, double "2.000000") as L2.L2 ] |
| ) [ bigint "10" ] |
+----------------------------------------------------------------+
5 tuples

mclient data -s "plan select power("X",2) from raw.accelerometer limit 10;"
+--------------------------------------------------------------+
| rel |
+==============================================================+
| top N ( |
| | project ( |
| | | table(raw.accelerometer) [ accelerometer.X ] COUNT |
| | ) [ sys.power(accelerometer.X, real "2.000000") as L2.L2 ] |
| ) [ bigint "10" ] |
+--------------------------------------------------------------+
5 tuples

Reproducible: Always

Steps to Reproduce:

1.create table bla("X" REAL);
2.insert into bla values(2.1);
3.select "X"*"X" from bla;

Actual Results:

The mclient tool produces the following output:
TypeException:user.main[19]:'mmath.pow' undefined in: mmath.pow(X_14540:flt,2:dbl);

Expected Results:

Produce the same result as call to power("X",2) directly

In an earlier version (Database: MonetDB v11.23.7 (Jun2016-SP1)) this worked without problems.

Comment 25058

Date: 2017-02-24 14:22:55 +0100
From: MonetDB Mercurial Repository <>

Changeset b7ceaad28f73 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=b7ceaad28f73

Changeset description:

Use correct type when creating an atom of type flt.
This fixes bug #6228.

Comment 25059

Date: 2017-02-24 16:52:57 +0100
From: MonetDB Mercurial Repository <>

Changeset 6c45dfa31141 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=6c45dfa31141

Changeset description:

Test for bug #6228.
@monetdb-team monetdb-team added bug Something isn't working major 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 major SQL
Projects
None yet
Development

No branches or pull requests

2 participants