<!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 <kou****@clear*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2012-07-26 14:20:40 +0900 (Thu, 26 Jul 2012)</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/ebd352913f4a99905484aef967f7640e3a0bb05f">ebd352913f4a99905484aef967f7640e3a0bb05f</a></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Merge</dt>
<dd style="margin-left: 8.5em">
<ul>
<li>Merged 7874035: Merge branch 'master' of github.com:mroonga/mroonga</li>
</ul>
</dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Log</dt>
<dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em">storage: reduce storage size for ENUM
This is incompatible change!
ENUM requires 1 byte storage size for the number of elements < 256, 2
bytes storage size for the number of elements >= 256. Before this
change, ENUM always uses 2 byte storage size. By this change, ENUM
that has the number of elements < 256 uses 1 byte storage size.
Users who use ENUM that has the number of elements < 256 need to
recreate database. Users who doesn't use ENUM or use ENUM that has the
number of elements >= 256 don't need to recreate database.</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/ebd352913f4a99905484aef967f7640e3a0bb05f#diff-0">ha_mroonga.cpp</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, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre"> Modified: ha_mroonga.cpp (+12 -5)</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, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1089">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1090">1090</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1091">1091</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1092">1092</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1093">1093</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1094">1094</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1095">1095</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L1096">1096</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9067">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9068">9068</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9069">9069</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9070">9070</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9071">9071</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9072">9072</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9073">9073</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9074">9074</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9075">9075</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9076">9076</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9077">9077</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9078">9078</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9079">9079</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9080">9080</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0L9081">9081</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1089">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1090">1090</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1091">1091</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1092">1092</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1093">1093</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1094">1094</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1095">1095</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1096">1096</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1097">1097</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1098">1098</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1099">1099</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R1100">1100</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9071">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9072">9072</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9073">9073</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9074">9074</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9075">9075</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9076">9076</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9077">9077</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9078">9078</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9079">9079</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9080">9080</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9081">9081</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9082">9082</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9083">9083</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/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9084">9084</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9085">9085</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9086">9086</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9087">9087</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/mroonga/mroonga/commit/ebd352913f4a99905484aef967f7640e3a0bb05f#L0R9088">9088</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -1090,7 +1090,11 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">static grn_builtin_type mrn_grn_type_from_field(grn_ctx *ctx, Field *field,</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> type = GRN_DB_SHORT_TEXT; // 4Kbytes</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> case MYSQL_TYPE_ENUM: // ENUM; <= 2bytes</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- type = GRN_DB_UINT16; // 2bytes</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ if (field->pack_length() == 1) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ type = GRN_DB_UINT8; // 1bytes</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ } else {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ type = GRN_DB_UINT16; // 2bytes</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"> break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> case MYSQL_TYPE_SET: // SET; <= 8bytes</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> switch (field->pack_length()) {</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -9068,14 +9072,17 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">int ha_mroonga::storage_encode_key_enum(Field *field, const uchar *key,</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> MRN_DBUG_ENTER_METHOD();</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> int error = 0;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- uint16 value;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (field->pack_length() == 1) {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- value = static_cast<uint16>(key[0]);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ uchar value;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ value = key[0];</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ *size = 1;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ memcpy(buf, &value, *size);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> } else {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ uint16 value;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> shortget(value, key);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ *size = 2;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ memcpy(buf, &value, *size);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- memcpy(buf, &value, 2);</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- *size = 2;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> DBUG_RETURN(error);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>