<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="drop-function-loadable">
      </a>
      15.7.4.2 DROP FUNCTION Statement for Loadable Functions
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045171838928">
  </a>
  <a class="indexterm" name="idm46045171837888">
  </a>
  <a class="indexterm" name="idm46045171836400">
  </a>
  <a class="indexterm" name="idm46045171834912">
  </a>
  <a class="indexterm" name="idm46045171833424">
  </a>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa63028367"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">DROP</span> <span class="token keyword">FUNCTION</span> <span class="token punctuation">[</span><span class="token keyword">IF</span> <span class="token keyword">EXISTS</span><span class="token punctuation">]</span> <em class="replaceable">function_name</em></code></pre>
  </div>
  <p>
   This statement drops the loadable function named
   <em class="replaceable">
    <code>
     function_name
    </code>
   </em>
   . (
   <code class="literal">
    DROP
        FUNCTION
   </code>
   is also used to drop stored functions; see
   <a class="xref" href="drop-procedure.html" title="15.1.29 DROP PROCEDURE and DROP FUNCTION Statements">
    Section 15.1.29, “DROP PROCEDURE and DROP FUNCTION Statements”
   </a>
   .)
  </p>
  <p>
   <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
    <code class="literal">
     DROP
        FUNCTION
    </code>
   </a>
   is the complement of
   <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>
   . It requires the
   <a class="link" href="privileges-provided.html#priv_delete">
    <code class="literal">
     DELETE
    </code>
   </a>
   privilege for the
   <code class="literal">
    mysql
   </code>
   system schema because it removes the
        row from the
   <code class="literal">
    mysql.func
   </code>
   system table that
        registers the function.
  </p>
  <p>
   <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
    <code class="literal">
     DROP
        FUNCTION
    </code>
   </a>
   also removes the function from the
        Performance Schema
   <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 that
        provides runtime information about installed loadable functions.
        See
   <a class="xref" href="performance-schema-user-defined-functions-table.html" title="29.12.22.10 The user_defined_functions Table">
    Section 29.12.22.10, “The user_defined_functions Table”
   </a>
   .
  </p>
  <p>
   During the normal startup sequence, the server loads functions
        registered in the
   <code class="literal">
    mysql.func
   </code>
   table. Because
   <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
    <code class="literal">
     DROP
        FUNCTION
    </code>
   </a>
   removes the
   <code class="literal">
    mysql.func
   </code>
   row
        for the dropped function, the server does not load the function
        during subsequent restarts.
  </p>
  <p>
   <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
    <code class="literal">
     DROP
        FUNCTION
    </code>
   </a>
   cannot be used to drop a loadable function
        that is installed automatically by components or plugins rather
        than by 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>
   . Such a function is also dropped
        automatically, when the component or plugin that installed it is
        uninstalled.
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    To upgrade the shared library associated with a loadable
          function, issue a
    <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
     <code class="literal">
      DROP
          FUNCTION
     </code>
    </a>
    statement, upgrade the shared library, and
          then issue 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. If you upgrade the shared
          library first and then use
    <a class="link" href="drop-function-loadable.html" title="15.7.4.2 DROP FUNCTION Statement for Loadable Functions">
     <code class="literal">
      DROP
          FUNCTION
     </code>
    </a>
    , the server may unexpectedly shut down.
   </p>
  </div>
 </div>
 <br/>
</div>
