<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2013-11-17 22:15:48 +0900 (Sun, 17 Nov 2013)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2">c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">Move version check to hpp from cpp

We should check MySQL version and define logical flags in hpp and use
them in cpp. It improves maintenability.

Some flags are used in two or more locations. If they are used in two
or more locations, we need to write the same version check conditions
there. It reduces maintenability:

Not good:

    #if MYSQL_VERSION_ID &gt;= 50607
      // code1
    #endif
      // ...
    #if MYSQL_VERSION_ID &gt;= 50607
      // code2
    #endif

Better:

    #if MYSQL_VERSION_ID &gt;= 50607
    #  define LOGICAL_FLAG
    #endif

    #ifdef LOGICAL_FLAG
      // code1
    #endif
      // ...
    #ifdef LOGICAL_FLAG
      // code2
    #endif</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#diff-0">ha_mroonga.cpp</a></li>
          <li><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#diff-1">ha_mroonga.hpp</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: ha_mroonga.cpp (+1 -1)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3808">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3809">3809</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3810">3810</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3811">3811</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3812">3812</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3813">3813</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3814">3814</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0L3815">3815</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3808">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3809">3809</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3810">3810</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3811">3811</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3812">3812</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3813">3813</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3814">3814</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L0R3815">3815</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -3809,7 +3809,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">       DBUG_RETURN(HA_ERR_OUT_OF_MEM);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     wrap_handler-&gt;init();</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-#if MYSQL_VERSION_ID &gt;= 50600</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+#ifdef MRN_HANDLER_HAVE_SET_HA_SHARE_REF</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     wrap_handler-&gt;set_ha_share_ref(&amp;table-&gt;s-&gt;ha_share);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #endif</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     error = wrap_handler-&gt;ha_open(table, name, mode, test_if_locked);</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: ha_mroonga.hpp (+4 -0)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L90">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L91">91</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L92">92</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L93">93</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L94">94</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L95">95</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1L96">96</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R90">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R91">91</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R92">92</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R93">93</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R94">94</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R95">95</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R96">96</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R97">97</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R98">98</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R99">99</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/c4b16ed9d95af9bbf8ac2244ebb8e80b7cc8d0b2#L1R100">100</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -91,6 +91,10 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">extern &quot;C&quot; {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #  define MRN_HANDLER_HAVE_GET_TABLESPACE_NAME</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #endif</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+#if MYSQL_VERSION_ID &gt;= 50607</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+#  define MRN_HANDLER_HAVE_SET_HA_SHARE_REF</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+#endif</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #if MYSQL_VERSION_ID &gt;= 50500</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #  define MRN_TABLE_LIST_INIT_REQUIRE_ALIAS</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #endif</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>