null+****@clear*****
null+****@clear*****
2011年 9月 23日 (金) 23:28:37 JST
Kouhei Sutou 2011-09-23 14:28:37 +0000 (Fri, 23 Sep 2011)
New Revision: b698bf7f42a18c5f8ed62ae0923cac62041be5d0
Log:
[storage] keep backward compatibility for index column name change.
Modified files:
ha_mroonga.cc
Modified: ha_mroonga.cc (+8 -1)
===================================================================
--- ha_mroonga.cc 2011-09-23 14:26:15 +0000 (3b0b74e)
+++ ha_mroonga.cc 2011-09-23 14:28:37 +0000 (0af9e4b)
@@ -2224,11 +2224,18 @@ int ha_mroonga::storage_open_indexes(const char *name)
goto error;
}
- Field *field = key_info.key_part[0].field;
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));