<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-user-defined-functions-table">
      </a>
      29.12.22.10 The user_defined_functions Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045066962528">
  </a>
  <a class="indexterm" name="idm46045066961024">
  </a>
  <p>
   The
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   table
          contains a row for each loadable function registered
          automatically by a component or plugin, or manually by a
   <a class="link" href="create-function-loadable.html" title="15.7.4.1 CREATE FUNCTION Statement for Loadable Functions">
    <code class="literal">
     CREATE
          FUNCTION
    </code>
   </a>
   statement. For information about operations
          that add or remove table rows, see
   <a class="xref" href="function-loading.html" title="7.7.1 Installing and Uninstalling Loadable Functions">
    Section 7.7.1, “Installing and Uninstalling Loadable Functions”
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    The name of the
    <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
     <code class="literal">
      user_defined_functions
     </code>
    </a>
    table
            stems from the terminology used at its inception for the
            type of function now known as a loadable function (that is,
            user-defined function, or UDF).
   </p>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   table
          has these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       UDF_NAME
      </code>
     </p>
     <p>
      The function name as referred to in SQL statements. The
              value is
      <code class="literal">
       NULL
      </code>
      if the function was
              registered by a
      <a class="link" href="create-function.html" title="15.1.14 CREATE FUNCTION Statement">
       <code class="literal">
        CREATE
              FUNCTION
       </code>
      </a>
      statement and is in the process of
              unloading.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UDF_RETURN_TYPE
      </code>
     </p>
     <p>
      The function return value type. The value is one of
      <code class="literal">
       int
      </code>
      ,
      <code class="literal">
       decimal
      </code>
      ,
      <code class="literal">
       real
      </code>
      ,
      <code class="literal">
       char
      </code>
      , or
      <code class="literal">
       row
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UDF_TYPE
      </code>
     </p>
     <p>
      The function type. The value is one of
      <code class="literal">
       function
      </code>
      (scalar) or
      <code class="literal">
       aggregate
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UDF_LIBRARY
      </code>
     </p>
     <p>
      The name of the library file containing the executable
              function code. The file is located in the directory named
              by the
      <a class="link" href="server-system-variables.html#sysvar_plugin_dir">
       <code class="literal">
        plugin_dir
       </code>
      </a>
      system
              variable. The value is
      <code class="literal">
       NULL
      </code>
      if the
              function was registered by a component or plugin rather
              than by a
      <a class="link" href="create-function.html" title="15.1.14 CREATE FUNCTION Statement">
       <code class="literal">
        CREATE FUNCTION
       </code>
      </a>
      statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       UDF_USAGE_COUNT
      </code>
     </p>
     <p>
      The current function usage count. This is used to tell
              whether statements currently are accessing the function.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   table
          has these indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Primary key on (
      <code class="literal">
       UDF_NAME
      </code>
      )
     </p>
    </li>
   </ul>
  </div>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is not permitted
          for the
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   table.
  </p>
  <p>
   The
   <code class="literal">
    mysql.func
   </code>
   system table also lists
          installed loadable functions, but only those installed using
   <a class="link" href="create-function-loadable.html" title="15.7.4.1 CREATE FUNCTION Statement for Loadable Functions">
    <code class="literal">
     CREATE
          FUNCTION
    </code>
   </a>
   . The
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   table
          lists loadable functions installed using
   <a class="link" href="create-function-loadable.html" title="15.7.4.1 CREATE FUNCTION Statement for Loadable Functions">
    <code class="literal">
     CREATE
          FUNCTION
    </code>
   </a>
   as well as loadable functions installed
          automatically by components or plugins. This difference makes
   <a class="link" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    <code class="literal">
     user_defined_functions
    </code>
   </a>
   preferable
          to
   <code class="literal">
    mysql.func
   </code>
   for checking which loadable
          functions are installed.
  </p>
 </div>
 <br/>
</div>
