Details
Description
might be related to MDEV-13673:
Parentheses in view were optimized out, which ends up in wrong result:
|
mysql> create table t1 (a int, b decimal(10,2));
|
Query OK, 0 rows affected (0,02 sec)
|
|
mysql> insert into t1 values (1, 10.2);
|
Query OK, 1 row affected (0,01 sec)
|
|
mysql> create view v1 as select avg(b) / (2 + a) from t1;
|
Query OK, 0 rows affected (0,00 sec)
|
|
mysql> select * from v1;
|
+------------------+
|
| avg(b) / (2 + a) |
|
+------------------+
|
| 6.1000000000 |
|
+------------------+
|
1 row in set (0,00 sec)
|
|
mysql> select avg(b) / (2 + a) from t1;
|
+------------------+
|
| avg(b) / (2 + a) |
|
+------------------+
|
| 3.4000000000 |
|
+------------------+
|
1 row in set (0,00 sec)
|
Attachments
Issue Links
- duplicates
-
MDEV-23859 view: arithmetic of column is wrong whereas underlying select works correctly
- Closed
- relates to
-
MDEV-17406 Problems with LIKE using a parenthesized expression in the pattern
- Open
-
MDEV-17408 VIEW is incorrectly defined for a combination of = and BETWEEN
- Closed
- links to