[MDEV-17408] VIEW is incorrectly defined for a combination of = and BETWEEN Created: 2018-10-09  Updated: 2020-10-23  Resolved: 2020-10-23

Status: Closed
Project: MariaDB Server
Component/s: Parser, Views
Affects Version/s: 10.5.5, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.2.35, 10.3.26, 10.4.16, 10.5.7

Type: Bug Priority: Blocker
Reporter: Alexander Barkov Assignee: Sergei Golubchik
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-23656 view: removal of parentheses results ... Closed
relates to MDEV-17359 || operator is not understand by "lik... Closed
relates to MDEV-17406 Problems with LIKE using a parenthesi... Open

 Description   

DROP VIEW IF EXISTS v1;
CREATE VIEW v1 AS SELECT (1 = 2) BETWEEN 1 AND 2 AS c;
SHOW CREATE TABLE v1;

+------+-------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| View | Create View                                                                                                                   | character_set_client | collation_connection |
+------+-------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| v1   | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 = (2 between 1 and 2) AS `c` | utf8                 | utf8_general_ci      |
+------+-------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+

Notice:

  • the original definition has parentheses around 1=2 and no parentheses around BETWEEN
  • the created definition has parentheses around BETWEEN

Generated at Thu Feb 08 08:36:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.