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

Cursor row variable field not found (4082) if alias used

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • PL/SQL
    • None

    Description

      Alias for field is not being used, so an error (4082) appears in the following double alias configuration.

      CREATE TABLE tmp_1 (id1 INT );
       
      INSERT INTO tmp_1 VALUES (15);           
      INSERT INTO tmp_1 VALUES (16);  
       
      CREATE or replace VIEW tmp_v AS SELECT id1 id FROM tmp_1;
       
      -- SELECT * FROM tmp_v
       
      delimiter //
      begin
      for k in (select 
                 b.ID id2
                 FROM tmp_v b
                 ) loop
      SELECT k.id2; -- <error
      RETURN;
      END loop;
      END//
      delimiter ;
      

      /* SQL Error (4082): Row variable 'k' does not have a field 'id2' */

      Attachments

        Activity

          People

            Unassigned Unassigned
            balta Tadas Balaišis
            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.