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

Server Crash using UDF in WHERE clause of VIEW

    XMLWordPrintable

Details

    Description

      When using a UDF in the WHERE clause of a view, mariadb segfaults:

      mysqld[17525]: segfault at 7f533c00b180 ip 00007f533f794dff sp 00007f5328e6b720 error 4 in libgcc_s.so.1[7f533f788000+11000]

      The UDF simply returns the length of the string provided in args->lengths.
      The UDF works perfectly when access is to a table.

      To recreate the problem:
      Modify plugin location in makefile if required.
      Compile testudf.c and install with "sudo make install".
      Create test database.
      Run testudf.sql

      Note that testudf.sql demonstrates correct operation on tables and failure on view.
      Crash can be induced in other circumstances on derived tables, but this is the simplest demonstration.

      Attachments

        1. Makefile
          0.3 kB
          Willem Schreuder
        2. testudf.c
          0.6 kB
          Willem Schreuder
        3. testudf.sql
          0.4 kB
          Willem Schreuder

        Activity

          People

            danblack Daniel Black
            vlakkies Willem Schreuder
            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.