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

VIEW is incorrectly defined for a combination of = and BETWEEN

    XMLWordPrintable

    Details

      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:
              serg Sergei Golubchik
              Reporter:
              bar Alexander Barkov
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: