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

Assoc array `TABLE OF cursor%ROWTYPE` does not work

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.1(EOL), 12.2(EOL), 12.3, 13.0, 13.1
    • None
    • Data types, Stored routines
    • None

    Description

      SET sql_mode=ORACLE;
      CREATE OR REPLACE TABLE t1 (a INT, b VARCHAR(10));
      DELIMITER $$
      CREATE OR REPLACE PROCEDURE p1() AS
        CURSOR c1 IS SELECT * FROM t1;
        TYPE assoc0_t IS TABLE OF c1%ROWTYPE INDEX BY INT;
        a0 assoc0_t;
      BEGIN
        a0(0).a:= 10;
        a0(0).b:= 'b10';
        SELECT a0(10).a, a0(10).b;
      END;
      $$
      DELIMITER ;
      CALL p1;
      

      ERROR 1146 (42S02): Table 'test.c1' doesn't exist
      

      The above output is not expected. It should not get the element structure from from cursor c1 rather than the table c1.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.