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

Use of RAND() in procedure crashes server

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Duplicate
    • 10.5.9, 10.2, 10.3, 10.4, 10.5
    • N/A
    • Stored routines
    • Ubuntu

    Description

      The following procedure, using the RAND() function, crashes the server when called more than once.

      DELIMITER $$
       
      DROP PROCEDURE IF EXISTS sp_test;
      $$
      CREATE PROCEDURE sp_test(
      )
      BEGIN
       
      	SELECT x, y
      	FROM (
      		SELECT x, RAND() y
      		FROM (
      			SELECT 1 x
      			UNION
      			SELECT 2
      		) SQ0
      	) SQ1;
       
      END;
      $$
       
      CALL sp_test();
      CALL sp_test(); -- this call crashes the server
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tgj1970 Thomas G. Jensen
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.