void rb_grn_variable_size_column_bind (RbGrnVariableSizeColumn *rb_column, grn_ctx *context, grn_obj *column) { RbGrnObject *rb_grn_object; int column_type; unsigned char value_type; rb_grn_object = RB_GRN_OBJECT(rb_column); rb_grn_column_bind(RB_GRN_COLUMN(rb_column), context, column); rb_column->element_value = NULL; column_type = (column->header.flags & GRN_OBJ_COLUMN_TYPE_MASK); if (column_type != GRN_OBJ_COLUMN_VECTOR) { return; } switch (rb_grn_object->range->header.type) { case GRN_TABLE_HASH_KEY: case GRN_TABLE_PAT_KEY: case GRN_TABLE_DAT_KEY: case GRN_TABLE_NO_KEY: value_type = GRN_UVECTOR; break; default: value_type = GRN_VECTOR; break; } if (column->header.flags & GRN_OBJ_WITH_WEIGHT) { rb_column->element_value = grn_obj_open(context, value_type, 0, rb_grn_object->range_id); } }
void rb_grn_index_column_bind (RbGrnIndexColumn *rb_grn_index_column, grn_ctx *context, grn_obj *column) { RbGrnObject *rb_grn_object; rb_grn_column_bind(RB_GRN_COLUMN(rb_grn_index_column), context, column); rb_grn_object = RB_GRN_OBJECT(rb_grn_index_column); rb_grn_index_column->old_value = grn_obj_open(context, GRN_BULK, 0, rb_grn_object->range_id); rb_grn_index_column->id_query = grn_obj_open(context, GRN_BULK, 0, rb_grn_object->domain_id); rb_grn_index_column->string_query = grn_obj_open(context, GRN_BULK, GRN_OBJ_DO_SHALLOW_COPY, GRN_DB_SHORT_TEXT); }