<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="example-storage-engine">
      </a>
      18.9 The EXAMPLE Storage Engine
     </h2>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045146970208">
  </a>
  <a class="indexterm" name="idm46045146969168">
  </a>
  <p>
   The
   <code class="literal">
    EXAMPLE
   </code>
   storage engine is a stub engine that
    does nothing. Its purpose is to serve as an example in the MySQL
    source code that illustrates how to begin writing new storage
    engines. As such, it is primarily of interest to developers.
  </p>
  <p>
   To enable the
   <code class="literal">
    EXAMPLE
   </code>
   storage engine if you build
    MySQL from source, invoke
   <span class="command">
    <strong>
     CMake
    </strong>
   </span>
   with the
   <a class="link" href="source-configuration-options.html#option_cmake_storage_engine_options" title="Storage Engine Options">
    <code class="option">
     -DWITH_EXAMPLE_STORAGE_ENGINE
    </code>
   </a>
   option.
  </p>
  <p>
   To examine the source for the
   <code class="literal">
    EXAMPLE
   </code>
   engine,
    look in the
   <code class="filename">
    storage/example
   </code>
   directory of a
    MySQL source distribution.
  </p>
  <p>
   When you create an
   <code class="literal">
    EXAMPLE
   </code>
   table, no files are
    created. No data can be stored into the table. Retrievals return an
    empty result.
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa84458103"><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 prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> test <span class="token punctuation">(</span>i <span class="token datatype">INT</span><span class="token punctuation">)</span> <span class="token keyword">ENGINE</span> <span class="token operator">=</span> EXAMPLE<span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.78 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> test <span class="token keyword">VALUES</span> <span class="token keyword">ROW</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">ROW</span><span class="token punctuation">(</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token keyword">ROW</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">ERROR 1031 (HY000)<span class="token punctuation">:</span> Table storage engine for 'test' doesn't »
                    have this option
</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> test<span class="token punctuation">;</span>
<span class="token output">Empty set (0.31 sec)</span></code></pre>
  </div>
  <p>
   The
   <code class="literal">
    EXAMPLE
   </code>
   storage engine does not support
    indexing.
  </p>
  <p>
   The
   <code class="literal">
    EXAMPLE
   </code>
   storage engine does not support
    partitioning.
  </p>
 </div>
 <br/>
</div>
