Navigation Menu

Skip to content

Commit

Permalink
[storage] support TEXT type in REPLACE. fixes #1153
Browse files Browse the repository at this point in the history
Reported by Kazuhiki Shiozaki. Thanks!!!
  • Loading branch information
kou committed Nov 2, 2011
1 parent 0a4b30a commit 3d39e3c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ha_mroonga.cc
Expand Up @@ -77,6 +77,9 @@ static const char *index_column_name = "index";
extern "C" {
#endif

/* groonga's internal functions */
const char *grn_obj_get_value_(grn_ctx *ctx, grn_obj *obj, grn_id id, uint32 *size);

/* global variables */
pthread_mutex_t mrn_db_mutex;
pthread_mutex_t mrn_log_mutex;
Expand Down Expand Up @@ -906,6 +909,15 @@ static void mrn_store_field(grn_ctx *ctx, Field *field, grn_obj *col, grn_id id)
field->charset());
break;
}
case MYSQL_TYPE_BLOB:
{
GRN_VOID_INIT(&buf);
uint32 len;
const char *val = grn_obj_get_value_(ctx, col, id, &len);
Field_blob *blob = (Field_blob *)field;
blob->set_ptr((uchar *)&len, (uchar *)val);
break;
}
default: //strings etc..
{
GRN_TEXT_INIT(&buf,0);
Expand Down

0 comments on commit 3d39e3c

Please sign in to comment.