[MDEV-2938] LP:806477 - WHERE condition not observed with views in maria-5.3 after MWL#106 Created: 2011-07-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: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Repeatable in maria-5.3. Not repeatable on mysql-5.5 or maria-5.3 before WL#106. Not repeatable if a base table is vused instead of a view. influenced by optimizer_switch. Repeatable if the view is inlined as a derived table. The following query: SELECT t3.f2, v1.f3, v1.f2 FROM t3 LEFT JOIN (t2,v1) ON t3.f1 WHERE v1.f3 = v1.f3 OR t3.f2 != 0; returns 1 row which does not match the WHERE predicate: -----
-----
----- for the second row, nether side of the OR expression is TRUE, therefore the entire WHERE predicate must be FALSE. explain: ---
---
--- explain in before WL#106: mysql> explain SELECT t3.f2, v1.f3, v1.f2 FROM t3 LEFT JOIN (t2,v1) ON t3.f1 WHERE v1.f3 = v1.f3 OR t3.f2 != 0;
---
--- test case: CREATE TABLE t1 (f1 int(11) NOT NULL ,f2 int(11) NOT NULL ,f3 int(11) NOT NULL ,f4 int); CREATE TABLE t2 ( f1 int NOT NULL, f2 int, f3 int, f4 int ); CREATE TABLE t3 ( f1 int, f2 int, f3 int, f4 int ); CREATE ALGORITHM=MERGE VIEW v1 AS select * FROM t1; SELECT t3.f2, v1.f3, v1.f2 FROM t3 LEFT JOIN (t2,v1) ON t3.f1 WHERE v1.f3 = v1.f3; SELECT t3.f2, v1.f3, v1.f2 FROM t3 LEFT JOIN (t2,v1) ON t3.f1 WHERE v1.f3 = v1.f3 OR t3.f2 != 0; bzr version-info: revision-id: <email address hidden> |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 806477 |