Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2.31, 10.4.12, 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
Minimal example:
DROP TABLE IF EXISTS t; |
CREATE TABLE t |
(
|
id int unsigned not null, |
value int unsigned null |
);
|
INSERT INTO t |
values (1, null); |
|
CREATE OR REPLACE VIEW v |
as
|
select 1 as id, |
ifnull(null, 999) as value |
from t |
;
|
|
select *, |
MIN(t.value) over (PARTITION BY t.id) as min_t, |
MIN(v.value) over (PARTITION BY t.id) as min_v |
from t |
left join v |
on t.id > v.id |
;
|
With the affected MariaDB versions, the select returns:
id value id value min_t min_v
|
1 null null null null 999
|
but I would expect it to return
id value id value min_t min_v
|
1 null null null null null
|
Corresponding queries with other RDBMS:
Return null and 999:
MySQL 5.6 - it shouldn't have window functions, but it returns the same result as MariaDB http://sqlfiddle.com/#!9/7da5e/12
Return null and null:
Oracle 11g R2 - http://sqlfiddle.com/#!4/18d8e/1
PostgreSQL 9.3 - http://sqlfiddle.com/#!15/a1756/4
MySQL 8.0 - https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=3a6b0308f7f889cbd0ab77ef65cd87db