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

Add support for anchored data types for user variables

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Stored routines
    • None

    Description

      We have anchored data types declarations support since 10.3.3 and MDEV-14139. But while this kind of use for them works:

      MariaDB [test]> delimiter //
      MariaDB [test]> create procedure prt(OUT a row type of mysql.user) begin select *
      into a from mysql.user limit 1; end;//
      Query OK, 0 rows affected (0.156 sec)
       
      MariaDB [test]> create procedure use_prt() begin declare b row type of mysql.user; call prt(b); select b.user, b.host; end;//
      Query OK, 0 rows affected (0.192 sec)
       
      MariaDB [test]> call use_prt()//
      +-------------+-----------+
      | b.user      | b.host    |
      +-------------+-----------+
      | mariadb.sys | localhost |
      +-------------+-----------+
      1 row in set (0.012 sec)
       
      Query OK, 1 row affected (0.012 sec)
      

      we have no way to return to a user variable:

      MariaDB [test]> call prt(@a)//
      ERROR 1241 (21000): Operand should contain 1 column(s)
      

      and this makes a feature incomplete and even misleading. It would make sense to let user variables be of record types and rely on anchored types declarations, both for compatibility and consistency.

      Attachments

        Activity

          People

            Unassigned Unassigned
            valerii Valerii Kravchuk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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