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.