Misleading parameter name in generate_series function #6606
Last updated: 2018-08-31 13:23:09 +0200
Date: 2018-05-22 10:26:37 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
The general form of the generate_series function (in all the integer-size variants) is:
create function sys.generate_series(first int, last int, stepsize int)
Parameters "first" and "last" obviously suggest that the series is from "first" to "last" included.
But it actually is from "first" to ("last" - 1)
sql>select * from sys.generate_series(1,5,1);
It looks to me like actually generating all numbers from "first" to "last" was the initially intended behaviour - I can't think why one would want to complicate function parameters this way intentionally. A "=" probably slipped off the condition in the loop during implementation. However changing that now would break backward compatibility.
Date: 2018-06-01 19:30:53 +0200
I agree it should behave similar to Postgresql Series Generating Functions:
Date: 2018-08-08 15:17:38 +0200
For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e63096367379
Date: 2018-08-28 09:42:37 +0200
The confusion was (hopefully) taken away by changing the name of the parameter.
The text was updated successfully, but these errors were encountered: