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

CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes (SERVER CRASH)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.3.9, 10.3(EOL)
    • 10.3.11
    • Stored routines
    • None
    • CentOS7

    Description

      The following code in a stored procedure produces the correct result when CALLed:

      	FOR rec IN (SELECT Orders.Order_ID, Customers.State FROM Orders join Customers using (Customer_ID) where State is not null) DO
      		set ans = concat(ans, '/', rec.Order_ID, '-', rec.State);
      	END FOR;
      

      However, if the field list is replaced by * it just crashes the server:

      	FOR rec IN (SELECT * FROM Orders join Customers using (Customer_ID) where State is not null) DO
      		set ans = concat(ans, '/', rec.Order_ID, '-', rec.State);
      	END FOR;
      

      with the message:

      ERROR: (conn=10) unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              rdyas Robert Dyas
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.