null+****@clear*****
null+****@clear*****
2011年 9月 23日 (金) 17:08:09 JST
Kouhei Sutou 2011-09-23 08:08:09 +0000 (Fri, 23 Sep 2011)
New Revision: 49362b46f86f47569e367efe73ce0b5e84e6fb9f
Log:
[storage] keep backward compatibility for index column name change.
Modified files:
ha_mroonga.cc
Modified: ha_mroonga.cc (+8 -0)
===================================================================
--- ha_mroonga.cc 2011-09-23 08:03:21 +0000 (c84abfb)
+++ ha_mroonga.cc 2011-09-23 08:08:09 +0000 (c33099f)
@@ -1909,6 +1909,14 @@ int ha_mroonga::wrapper_open_indexes(const char *name)
grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i],
index_column_name,
strlen(index_column_name));
+ if (!grn_index_columns[i]) {
+ /* just for backward compatibility before 1.0. */
+ Field *field = key_info.key_part[0].field;
+ grn_index_columns[i] = grn_obj_column(ctx, grn_index_tables[i],
+ field->field_name,
+ strlen(field->field_name));
+ }
+
if (ctx->rc) {
error = ER_CANT_OPEN_FILE;
my_message(error, ctx->errbuf, MYF(0));