I succeeded to reproduce this bug with the latest 5.1 build using the test case from the bug #798576:
Server version: 5.1.58-MariaDB-debug Source distribution
This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test]> CREATE TABLE t1 ( f1 int NOT NULL , f2 int NOT NULL ) ; Query OK, 0 rows affected (0.02 sec)
MariaDB [test]> INSERT INTO t1 VALUES (214,0),(6,6); Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]> MariaDB [test]> CREATE TABLE t2 ( f2 int) ; Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> INSERT INTO t2 VALUES (88),(88); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]> MariaDB [test]> CREATE ALGORITHM=MERGE VIEW v2 AS SELECT t1.f1, t2.f2 FROM (t2 LEFT JOIN t1 ON (t2.f2 <> t1.f1)) WHERE (t1.f2 <= 'up') ; Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> SELECT f1 , MIN(f2) FROM v2 GROUP BY f1; ERROR 1062 (23000): Duplicate entry '214' for key 'group_key'
The bug is not reproducible with the latest mysql-5.1. It should be fixed in maria-5.1.
I succeeded to reproduce this bug with the latest 5.1 build using the test case from
the bug #798576:
Server version: 5.1.58- MariaDB- debug Source distribution
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test]> CREATE TABLE t1 ( f1 int NOT NULL , f2 int NOT NULL ) ;
Query OK, 0 rows affected (0.02 sec)
MariaDB [test]> INSERT INTO t1 VALUES (214,0),(6,6);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]>
MariaDB [test]> CREATE TABLE t2 ( f2 int) ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> INSERT INTO t2 VALUES (88),(88);
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test]>
MariaDB [test]> CREATE ALGORITHM=MERGE VIEW v2 AS SELECT t1.f1, t2.f2 FROM (t2 LEFT JOIN t1 ON (t2.f2 <> t1.f1)) WHERE (t1.f2 <= 'up') ;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> SELECT f1 , MIN(f2) FROM v2 GROUP BY f1;
ERROR 1062 (23000): Duplicate entry '214' for key 'group_key'
The bug is not reproducible with the latest mysql-5.1.
It should be fixed in maria-5.1.