[MDEV-28661] MIN(X) returns incorrect result in view Created: 2022-05-25  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.11

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: view-protocol

Issue Links:
PartOf
is part of MDEV-27691 make working view-protocol Open
Relates
relates to MDEV-28651 quote(NULL) returns incorrect result ... Closed

 Description   

Test:

create view v1 as SELECT min(999999999999999999999999999999999999999999999999999999999999999999999999999999999) AS foo;
select * from v1;
drop view v1;

Number is less than it should be
Actual result:

foo
99999999999999999999999999999999999999999999999999999999999999999

Expected result:

foo
999999999999999999999999999999999999999999999999999999999999999999999999999999999

It looks like the problem is in the allowed number of digits, because in the next test the same problem:

Test:

create view v1 as SELECT -(999999999999999999999999999999999999999999999999999999999999999999999999999999999) AS foo;
select * from v1;
drop view v1;

Number is less than it should be
Actual result:

foo
-99999999999999999999999999999999999999999999999999999999999999999

Expected result:

foo
-999999999999999999999999999999999999999999999999999999999999999999999999999999999


Generated at Thu Feb 08 10:02:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.