sundb 85c8240a96 Improve dbid range check for SELECT, MOVE, COPY (#8085)
SELECT used to read the index into a `long` variable, and then pass it to a function
that takes an `int`, possibly causing an overflow before the range check.

Now all these commands use better and cleaner range check, and that also results in
a slight change of the error response in case of an invalid database index.

SELECT:
in the past it would have returned either `-ERR invalid DB index` (if not a number),
or `-ERR DB index is out of range` (if not between 1..16 or alike).
now it'll return either `-ERR value is out of range` (if not a number), or
`-ERR value is out of range, value must between -2147483648 and 2147483647`
(if not in the range for an int), or `-ERR DB index is out of range`
(if not between 0..16 or alike)


MOVE:
in the past it would only fail with `-ERR index out of range` no matter the reason.
now return the same errors as the new ones for SELECT mentioned above.
(i.e. unlike for SELECT even for a value like 17 we changed the error message)

COPY:
doesn't really matter how it behaved in the past (new command), new behavior is
like the above two.
2020-12-01 21:41:26 +02:00
..
2020-11-09 21:48:56 -08:00
2020-11-25 13:36:21 -08:00
2019-11-20 20:39:04 -05:00
2020-05-05 10:20:48 +02:00
2020-04-24 17:00:03 -07:00
2020-04-24 17:11:21 -07:00
2020-11-25 12:15:32 -08:00
2019-02-24 21:38:15 +01:00
2020-11-08 08:32:38 +02:00
2020-10-27 15:04:18 +02:00
2020-10-27 15:04:18 +02:00
2020-10-20 09:12:24 +03:00
2020-05-05 23:35:08 -04:00
2020-09-29 15:52:13 +03:00
2019-11-19 17:23:47 +08:00
2019-10-02 11:30:20 +02:00
2020-07-24 14:40:19 +08:00
2020-11-17 12:03:05 +02:00
2020-11-29 12:08:47 +02:00
2020-07-21 08:13:05 +03:00