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

Failed to load routine: 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

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: