diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-11-27 19:50:02 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-12-02 16:19:13 +0100 |
commit | 401ae95a6089b0cec5e5b9900bdb44a1f78c4248 (patch) | |
tree | 89bf2ec9f99ae4fcc2e7cb7d3179d7faf6522a59 /mysql-test/main/precedence_bugs.result | |
parent | 37bfe32c6d4a65ea7b8297817e01954d6212c863 (diff) | |
download | mariadb-git-401ae95a6089b0cec5e5b9900bdb44a1f78c4248.tar.gz |
MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result
Item_func_not_all::print() either uses Item_func::print() or
directly invokes args[0]->print(). Thus the precedence should be
either the one of Item_func or of args[0].
Item_allany_subselect::print() prints args[0], then a comparison op,
then a subquery. That is, the precedence should be the one of
a comparison.
Diffstat (limited to 'mysql-test/main/precedence_bugs.result')
-rw-r--r-- | mysql-test/main/precedence_bugs.result | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/main/precedence_bugs.result b/mysql-test/main/precedence_bugs.result index 4b13e820d7f..723ab823b48 100644 --- a/mysql-test/main/precedence_bugs.result +++ b/mysql-test/main/precedence_bugs.result @@ -58,3 +58,21 @@ Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY D character_set_client latin1 collation_connection latin1_swedish_ci drop view v1; +# +# MDEV-30082 View definition losing brackets changes semantics of the query and causes wrong result +# +create table t1 (a varchar(1), b bool) engine=myisam; +insert into t1 values ('u',1),('s',1); +select * from t1 where t1.b in (t1.a <= all (select 'a')); +a b +create view v as select * from t1 where t1.b in (t1.a <= all (select 'a')); +select * from v; +a b +show create view v; +View Create View character_set_client collation_connection +v CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where `t1`.`b` = (`t1`.`a` <= all (select 'a')) latin1 latin1_swedish_ci +drop view v; +drop table t1; +# +# End of 10.3 results +# |