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

Server Crash using UDF in WHERE clause of VIEW

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.3.27
    • Fix Version/s: 10.2, 10.3, 10.4, 10.5
    • Component/s: Views
    • Labels:
      None
    • Environment:
      Debian 10

      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
        2. testudf.c
          0.6 kB
        3. testudf.sql
          0.4 kB

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            vlakkies Willem Schreuder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration