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

Procedure containing CTE incorrectly stored in mysql.proc

    XMLWordPrintable

Details

    Description

      Only reproducible on 10.2.

      CREATE PROCEDURE p () WITH cte AS ( SELECT 1 ) SELECT * FROM cte;
      CALL p();
      

      10.2 12e3ac04

      mysqltest: At line 2: query 'CALL p()' failed: 1457: Failed to load routine test.p. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
      

      Note wrong body:

      select * from mysql.proc where name = 'p';
      db	test
      name	p
      type	PROCEDURE
      specific_name	p
      language	SQL
      sql_data_access	CONTAINS_SQL
      is_deterministic	NO
      security_type	DEFINER
      param_list	
      returns	
      body	cte AS ( SELECT 1 ) SELECT * FROM cte
      definer	root@localhost
      created	2019-08-23 02:50:38
      modified	2019-08-23 02:50:38
      sql_mode	STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
      comment	
      character_set_client	latin1
      collation_connection	latin1_swedish_ci
      db_collation	latin1_swedish_ci
      body_utf8	cte AS ( SELECT 1 ) SELECT * FROM cte
      

      Attachments

        Activity

          People

            igor Igor Babaev
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.