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

View definition corruption

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.3.25, 10.3.26
    • Fix Version/s: 10.2.37, 10.3.28, 10.4.18, 10.5.9
    • Component/s: Parser
    • Labels:
      None
    • Environment:
      Debian Buster 64bit

      Description

      Not sure in which version was this bug introduced (at least 10.3.25) but version 10.3.26 draw the attention on it.

      Do this:

      CREATE TABLE `test_table` (`ID` INTEGER(0)) ENGINE=MyISAM;
       
      CREATE VIEW `test_view` AS SELECT * FROM `test_table` WHERE ISNULL(ID)=0;
       
      SHOW CREATE VIEW test_view;
      

      Result in 10.3.25 (see the changed/corrupted ISNULL() part):

      +-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
      | View      | Create View                                                                                                                                                                           | character_set_client | collation_connection |
      +-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
      | test_view | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test_view` AS select `test_table`.`ID` AS `ID` from `test_table` where `test_table`.`ID` is null = 0 | latin1               | latin1_swedish_ci    |
      +-----------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
      

      Result in 10.3.26:

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0' at line 1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              azurit azurit
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration