Therefore, the SQL function returns NULL.
While this could be the expected behaviour in MAL (to return void), I don't think it is expected to return NULL in SQL.
What I would expect from the SQL call rand(100) is a call to srand(100) followed by a call to rand(), with its return valued passed to SQL.
Date: 2011-10-12 12:07:15 +0200
From: @swingbit
To: SQL devs <>
Version: 11.5.1 (Aug2011) [obsolete]
CC: @njnes
Last updated: 2011-10-26 13:22:04 +0200
Comment 16394
Date: 2011-10-12 12:07:15 +0200
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.81 Safari/535.2
Build Identifier:
The SQL function rand(i int) (the version with seed!) is mapped to the MAL function srand, which maps in turn to this C function:
str
MATHsrandint(int *seed)
{
srand(*seed);
return MAL_SUCCEED;
}
Therefore, the SQL function returns NULL.
While this could be the expected behaviour in MAL (to return void), I don't think it is expected to return NULL in SQL.
What I would expect from the SQL call rand(100) is a call to srand(100) followed by a call to rand(), with its return valued passed to SQL.
Reproducible: Always
Steps to Reproduce:
Actual Results:
+----------------------------------------------------------------------------------+------------+
| rand_single_value | rand |
+==================================================================================+============+
| null | 1804289383 |
+----------------------------------------------------------------------------------+------------+
Expected Results:
+------------+------------+
| rand | rand |
+============+============+
| 1804289383 | 846930886 |
+------------+------------+
Comment 16416
Date: 2011-10-14 09:02:26 +0200
From: @njnes
fixed by adding the combined srand/rand function
Comment 16417
Date: 2011-10-14 09:08:37 +0200
From: @njnes
Changeset 26cb61b1604b made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=26cb61b1604b
Changeset description:
Comment 16418
Date: 2011-10-14 09:20:28 +0200
From: @drstmane
Changeset 2615851abad6 made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=2615851abad6
Changeset description:
The text was updated successfully, but these errors were encountered: