Version sans cache

Mise en cache désactivé. Réglage défaut pour cette page : actif (code DEF204)
Si l'affichage est trop lent, vous pouvez désactiver le mode utilisateur pour visualiser la version en cache.

Rechercher dans le manuel MySQL

5.7.1 Installing and Uninstalling User-Defined Functions

User-defined functions (UDFs) must be loaded into the server before they can be used. MySQL supports UDF loading at runtime.

To load a UDF, use the CREATE FUNCTION statement. For example:

  1. CREATE FUNCTION metaphon
  2.   RETURNS STRING
  3.   SONAME 'udf_example.so';

The UDF file base name depends on your platform. Common suffixes are .so for Unix and Unix-like systems, .dll for Windows.

While a UDF is loaded, information about it is available from the Performance Schema user_defined_functions table. See Section 5.7.2, “Obtaining User-Defined Function Information”.

The statement also registers the UDF in the mysql.func system table to cause the server to load it on subsequent restarts. For this reason, CREATE FUNCTION requires the INSERT privilege for the mysql database.

To remove a UDF, use the DROP FUNCTION statement. For example:

  1. DROP FUNCTION metaphon;

CREATE FUNCTION unloads the UDF and removes it from the mysql.func system table. For this reason, DROP FUNCTION statement requires the DELETE privilege for the mysql database. With the UDF no longer registered in the table, the server does not load the UDF automatically for subsequent restarts.

You cannnot use CREATE FUNCTION to reinstall a function that has previously been installed. To reinstall a function, first remove it with DROP FUNCTION, then install it again with CREATE FUNCTION. You would need to do this, for example, if you upgrade to a new version of MySQL that provides an updated implementation of the function, or you recompile a new version of a function that you have written. Otherwise, the server continues to use the old version.

If the server is started with the --skip-grant-tables option, it does not consult the mysql.func table and does not load the UDFs listed there.


Rechercher dans le manuel MySQL

Traduction non disponible

Le manuel MySQL n'est pas encore traduit en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Document créé le 26/06/2006, dernière modification le 26/10/2018
Source du document imprimé : https://www.gaudry.be/mysql-rf-udf-loading.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :en Manuel MySQL : https://dev.mysql.com/

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.

Table des matières Haut