Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Not a Bug
-
10.1.17
-
None
-
CentOS 7 64bit
Description
with mariadb 10.1, the record with id 8 appear twice
MariaDB [test]> DROP TABLE random_order; |
Query OK, 0 rows affected, 1 warning (0.01 sec) |
|
|
MariaDB [test]> CREATE TABLE `random_order` ( `Id` INT NOT NULL AUTO_INCREMENT , `Name` VARCHAR(8) NOT NULL , PRIMARY KEY (`Id`)) ENGINE = InnoDB; |
Query OK, 0 rows affected (0.04 sec) |
|
|
MariaDB [test]> INSERT INTO `random_order` (`Id`, `Name`) VALUES (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (N |
ULL, 'a'); |
Query OK, 8 rows affected (0.00 sec) |
Records: 8 Duplicates: 0 Warnings: 0
|
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 0,2; |
+----+------+ |
| Id | Name | |
+----+------+ |
| 8 | a |
|
| 2 | a |
|
+----+------+ |
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 2,2; |
+----+------+ |
| Id | Name | |
+----+------+ |
| 3 | a |
|
| 4 | a |
|
+----+------+ |
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 4,2; |
+----+------+ |
| Id | Name | |
+----+------+ |
| 5 | a |
|
| 6 | a |
|
+----+------+ |
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 6,2; |
+----+------+ |
| Id | Name | |
+----+------+ |
| 7 | a |
|
| 8 | a |
|
+----+------+ |
2 rows in set (0.00 sec) |
and mariadb 5.5 works as expected:
MariaDB [test]> DROP TABLE random_order;
|
Query OK, 0 rows affected (0.02 sec) |
|
|
MariaDB [test]> CREATE TABLE `random_order` ( `Id` INT NOT NULL AUTO_INCREMENT , `Name` VARCHAR(8) NOT NULL , PRIMARY KEY (`Id`)) ENGINE = InnoDB; |
Query OK, 0 rows affected (0.06 sec) |
|
|
MariaDB [test]> INSERT INTO `random_order` (`Id`, `Name`) VALUES (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (NULL, 'a'), (N |
ULL, 'a'); |
Query OK, 8 rows affected (0.00 sec) |
Records: 8 Duplicates: 0 Warnings: 0 |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 0,2; |
+----+------+
|
| Id | Name |
|
+----+------+
|
| 1 | a | |
| 2 | a | |
+----+------+
|
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 2,2; |
+----+------+
|
| Id | Name |
|
+----+------+
|
| 3 | a | |
| 4 | a | |
+----+------+
|
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 4,2; |
+----+------+
|
| Id | Name |
|
+----+------+
|
| 5 | a | |
| 6 | a | |
+----+------+
|
2 rows in set (0.00 sec) |
|
|
MariaDB [test]> SELECT * FROM `random_order` ORDER BY Name LIMIT 6,2; |
+----+------+
|
| Id | Name |
|
+----+------+
|
| 7 | a | |
| 8 | a | |
+----+------+
|
2 rows in set (0.00 sec) |