Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-23656 view: removal of parentheses results in wrong result
Item_ref should have the precedence of the item it's referencing
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # | ||
| # MDEV-23656 view: removal of parentheses results in wrong result | ||
| # | ||
| create table t1 (a int, b decimal(10,2)); | ||
| insert into t1 values (1, 10.2); | ||
| create view v1 as select avg(b) / (2 + a) from t1; | ||
| show create view v1; | ||
| View v1 | ||
| Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select avg(`t1`.`b`) / (2 + `t1`.`a`) AS `avg(b) / (2 + a)` from `t1` | ||
| character_set_client latin1 | ||
| collation_connection latin1_swedish_ci | ||
| drop view v1; | ||
| drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| --echo # | ||
| --echo # MDEV-23656 view: removal of parentheses results in wrong result | ||
| --echo # | ||
| create table t1 (a int, b decimal(10,2)); | ||
| insert into t1 values (1, 10.2); | ||
| create view v1 as select avg(b) / (2 + a) from t1; | ||
| query_vertical show create view v1; | ||
| drop view v1; | ||
| drop table t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters