[MDEV-3439] LP:793448 - <single-table> Wrong result with views , union in maria-5.3-mwl106 Created: 2011-06-06 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Not repeatable in maria-5.3. If UNION is used inside a VIEW inside a subquery, rows that match the WHERE predicate are not returned: CREATE TABLE t1 ( f1 int, f2 int) ; CREATE OR REPLACE VIEW v1 AS SELECT 9 , 3 UNION SELECT 2 , 5 ; In maria-5.3-mwl106, this query returns no rows, even though there are 2 rows for which the IN predicate is TRUE. Explain:
note that the NULL in the final row of the ID column of the EXPLAIN causes the entire table to become misaligned. bzr version-info: revision-id: <email address hidden> |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2011-06-07 ] | ||||||||
|
Re: Wrong result with views , union in maria-5.3-mwl106 server compiled with ./BUILD/compile-pentium-debug-max-no-ndb server started with MTR_VERSION=1 perl mysql-test-run.pl --start-and-exit 1st bzr version-info revision-id: igor@askmonty.org-20110606191935-bbf5xptvw0wuwcww | ||||||||
| Comment by Philip Stoev (Inactive) [ 2011-06-07 ] | ||||||||
|
Re: Wrong result with views , union in maria-5.3-mwl106 | ||||||||
| Comment by Philip Stoev (Inactive) [ 2011-07-06 ] | ||||||||
|
Re: <single-table> Wrong result with views , union in maria-5.3-mwl106 CREATE TABLE t2 (f2 int, f3 int); CREATE TABLE t1 (f2 int, f3 int); CREATE ALGORITHM=MERGE VIEW v1 AS SET SESSION optimizer_switch='derived_with_keys=on'; Still repeatable with: bzr version-info | ||||||||
| Comment by Philip Stoev (Inactive) [ 2011-07-06 ] | ||||||||
|
Re: <single-table> Wrong result with views , union in maria-5.3-mwl106 | ||||||||
| Comment by Igor Babaev [ 2011-07-18 ] | ||||||||
|
Re: <single-table> Wrong result with views , union in maria-5.3-mwl106 MariaDB [test]> CREATE TABLE t1 (a int, b int); MariaDB [test]> INSERT INTO t1 VALUES (9,3), (2,5); MariaDB [test]> CREATE TABLE t2 (a int, b int); MariaDB [test]> INSERT INTO t2 VALUES (9,3), (3,7), (9,1), (2,5), (2,4), (3,8); MariaDB [test]> CREATE VIEW v1(a,b) AS SELECT a, MAX(b) FROM t2 GROUP BY a; MariaDB [test]> SELECT * FROM v1;
-----
----- MariaDB [test]> SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1); | ||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||
|
Launchpad bug id: 793448 |