Commit 1d35ec1a authored by Marko Mäkelä's avatar Marko Mäkelä

Mroonga: GCC 12.2.0 -Og -Wmaybe-uninitialized

parent 4a8da624
...@@ -3396,16 +3396,16 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table, ...@@ -3396,16 +3396,16 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table,
index_tables, NULL, tmp_share); index_tables, NULL, tmp_share);
} }
} }
}
if (error) { if (error) {
for (uint j = 0; j < i; j++) { for (uint j = 0; j < i; j++) {
if (index_tables[j]) { if (index_tables[j]) {
grn_obj_remove(ctx, index_tables[j]); grn_obj_remove(ctx, index_tables[j]);
}
} }
grn_obj_remove(ctx, grn_table);
grn_table = NULL;
} }
grn_obj_remove(ctx, grn_table);
grn_table = NULL;
} }
MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables); MRN_FREE_VARIABLE_LENGTH_ARRAYS(index_tables);
DBUG_RETURN(error); DBUG_RETURN(error);
......
...@@ -3591,53 +3591,51 @@ grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj, ...@@ -3591,53 +3591,51 @@ grn_obj_search_column_index_by_key(grn_ctx *ctx, grn_obj *obj,
if (need_cast) { if (need_cast) {
GRN_OBJ_INIT(&casted_query, GRN_BULK, 0, key_type); GRN_OBJ_INIT(&casted_query, GRN_BULK, 0, key_type);
rc = grn_obj_cast(ctx, query, &casted_query, GRN_FALSE); rc = grn_obj_cast(ctx, query, &casted_query, GRN_FALSE);
if (rc == GRN_SUCCESS) { if (rc != GRN_SUCCESS)
key = GRN_BULK_HEAD(&casted_query); goto fail;
key_len = GRN_BULK_VSIZE(&casted_query); query = &casted_query;
}
} else {
rc = GRN_SUCCESS;
key = GRN_BULK_HEAD(query);
key_len = GRN_BULK_VSIZE(query);
} }
if (rc == GRN_SUCCESS) {
if (grn_logger_pass(ctx, GRN_REPORT_INDEX_LOG_LEVEL)) { key = GRN_BULK_HEAD(query);
const char *tag; key_len = GRN_BULK_VSIZE(query);
if (optarg) {
switch (optarg->mode) { if (grn_logger_pass(ctx, GRN_REPORT_INDEX_LOG_LEVEL)) {
case GRN_OP_MATCH : const char *tag;
tag = "[key][match]"; if (optarg) {
break; switch (optarg->mode) {
case GRN_OP_EXACT : case GRN_OP_MATCH :
tag = "[key][exact]"; tag = "[key][match]";
break; break;
case GRN_OP_NEAR : case GRN_OP_EXACT :
tag = "[key][near]";
break;
case GRN_OP_NEAR2 :
tag = "[key][near2]";
break;
case GRN_OP_SIMILAR :
tag = "[key][similar]";
break;
case GRN_OP_REGEXP :
tag = "[key][regexp]";
break;
case GRN_OP_FUZZY :
tag = "[key][fuzzy]";
break;
default :
tag = "[key][unknown]";
break;
}
} else {
tag = "[key][exact]"; tag = "[key][exact]";
break;
case GRN_OP_NEAR :
tag = "[key][near]";
break;
case GRN_OP_NEAR2 :
tag = "[key][near2]";
break;
case GRN_OP_SIMILAR :
tag = "[key][similar]";
break;
case GRN_OP_REGEXP :
tag = "[key][regexp]";
break;
case GRN_OP_FUZZY :
tag = "[key][fuzzy]";
break;
default :
tag = "[key][unknown]";
break;
} }
grn_obj_search_index_report(ctx, tag, obj); } else {
tag = "[key][exact]";
} }
rc = grn_ii_sel(ctx, (grn_ii *)obj, key, key_len, grn_obj_search_index_report(ctx, tag, obj);
(grn_hash *)res, op, optarg);
} }
rc = grn_ii_sel(ctx, (grn_ii *)obj, key, key_len,
(grn_hash *)res, op, optarg);
fail:
if (need_cast) { if (need_cast) {
GRN_OBJ_FIN(ctx, &casted_query); GRN_OBJ_FIN(ctx, &casted_query);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment