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

PREPARE still doesn't work as expected & throws errors but MySQL is working fine

    XMLWordPrintable

Details

    Description

      Bug issue no. 13436 (https://jira.mariadb.org/browse/MDEV-13436) reported two issues with PREPARE statements. Both should be fixed with the new MariaDB Version 10.2.9 but only the 1st one is fixed and the 2nd one not. Could you please double check this case?

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 9
      Server version: 10.2.9-MariaDB mariadb.org binary distribution
       
      Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [anaedv]> USE test;
      Database changed
      MariaDB [test]>
      MariaDB [test]> SET @sql_query = "
          ">
          ">   CREATE OR REPLACE VIEW cte_test AS
          ">
          ">    WITH  cte1  AS ( SELECT 1 )
          ">
          ">     ,    cte2  AS ( SELECT * FROM cte1 )
          ">
          ">     SELECT * FROM cte2;
          ">
          "> ";
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]>
      MariaDB [test]> PREPARE stmt FROM @sql_query;
      ERROR 1146 (42S02): Table 'test.cte1' doesn't exist
      MariaDB [test]>
      

      This is the exact same error message as before 10.2.9. MySQL 8.0.2 Alpha returns the correct result. Update: The new MySQL 8.0.3 RC is working fine too.

      Thanks
      Gert

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gertstraubert Gert Straubert
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.