Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.1.12
-
None
Description
When you count from high to low the Values starts not from "from" Value every time. see sample
MariaDB [mysql]> select Version(); |
+-----------------------+ |
| Version() |
|
+-----------------------+ |
| 10.1.12-MariaDB-debug |
|
+-----------------------+ |
1 row in set (0.00 sec) |
MariaDB [mysql]> SELECT * FROM seq_15_to_1_step_2; |
+-----+ |
| seq |
|
+-----+ |
| 15 |
|
| 13 |
|
| 11 |
|
| 9 |
|
| 7 |
|
| 5 |
|
| 3 |
|
| 1 |
|
+-----+ |
8 rows in set (0.00 sec) |
MariaDB [mysql]> SELECT * FROM seq_15_to_1_step_3; |
+-----+ |
| seq |
|
+-----+ |
| 13 |
|
| 10 |
|
| 7 |
|
| 4 |
|
| 1 |
|
+-----+ |
5 rows in set (0.01 sec) |
It has actually been documented, although wording could be clearer:
https://mariadb.com/kb/en/mariadb/sequence/
In fact, of course, it should be not "will always be 1", but "will always be the TO value"; but anyway, it works so by design.
greenman, do you think it makes sense to put it better and maybe add a more generic example?