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

Function crash server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 10.4.8
    • Fix Version/s: 10.4
    • Component/s: Server, Stored routines
    • Labels:
    • Environment:
      Windows 10 64bits (xammp)

      Description

      If I execute this function 2 or 3 times (manually), the server CRASH.

      the idea of the function is to search if a columns exists in 2 different tables

      CREATE FUNCTION if_column_exists_normal_and_backup(tableNameToSearch TINYTEXT,
                                                         columnNameToSearch TINYTEXT)
          RETURNS BOOLEAN
          LANGUAGE SQL
      BEGIN
          SET @original = tableNameToSearch;
          SET @backup = CONCAT(tableNameToSearch, '_backup');
       
          RETURN (
                  exists(SELECT COLUMN_NAME
                         FROM INFORMATION_SCHEMA.COLUMNS
                         WHERE TABLE_NAME = @original
                           AND COLUMN_NAME = `columnnametosearch`
                      )
                  AND
                  exists(SELECT COLUMN_NAME
                         FROM INFORMATION_SCHEMA.COLUMNS
                         WHERE TABLE_NAME = @backup
                           AND COLUMN_NAME = `columnnametosearch`
                      )
              );
      END
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              francogp Franco Gastón Pellegrini
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: