Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17408

VIEW is incorrectly defined for a combination of = and BETWEEN

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3, 10.4
    • Fix Version/s: 10.3, 10.4
    • Component/s: Parser, Views
    • Labels:
      None

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: