[MDEV-10207] DEFAULT udf(x) does not return an error when UDF is dropped Created: 2016-06-09 Updated: 2017-03-22 Resolved: 2017-03-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.2 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
I'm testing the I add this script to mysql-test/t/udf.test and run "./mtr udf"
After the function METAPHON is dropped, INSERT still uses it. |
| Comments |
| Comment by Elena Stepanova [ 2016-07-09 ] |
|
After running FLUSH TABLES server starts returning the error. |
| Comment by Sergei Golubchik [ 2017-03-22 ] |
|
This is basically what plugins do in this case. If you UNINSTALL a plugin that is used (locked) at the moment, it will not be completely uninstalled, but only marked as "being uninstalled". You cannot start using it anymore (e.g. cannot open a table in this storage engine), but already opened tables will be able to continue using it. This status is visible in the INFORMATION_SCHEMA.PLUGINS table. When the last user of the plugin will release it, the plugin will be automatically uninstalled. Same happens with UDFs — an open table with a DEFAULT (or a virtual column) using UDF keeps it loaded. When the table is closed, it releases the UDF and it is unloaded automatically. But because UDF API is much simpler (and older) that Plugin API, there is no explicit server control over this process and the user has no visibility into it. This can only be fixed when we move UDFs to use the Plugin API. |