Navigation Menu

Skip to content

Commit

Permalink
add require PK error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentoku committed Jun 18, 2011
1 parent f09a00c commit cd841bb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ha_mroonga.cc
Expand Up @@ -992,7 +992,8 @@ ulonglong ha_mroonga::wrapper_table_flags() const
MRN_DBUG_ENTER_METHOD();
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
table_flags = wrap_handler->ha_table_flags() | HA_CAN_FULLTEXT;
table_flags = wrap_handler->ha_table_flags() |
HA_CAN_FULLTEXT | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE;
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
DBUG_RETURN(table_flags);
Expand Down Expand Up @@ -1054,6 +1055,12 @@ int ha_mroonga::wrapper_create(const char *name, TABLE *table,
handler *hnd;
MRN_DBUG_ENTER_METHOD();

if (table_share->primary_key == MAX_KEY)
{
my_message(ER_REQUIRES_PRIMARY_KEY, ER(ER_REQUIRES_PRIMARY_KEY), MYF(0));
DBUG_RETURN(ER_REQUIRES_PRIMARY_KEY);
}

error = wrapper_create_index(name, table, info, tmp_share);
if (error)
DBUG_RETURN(error);
Expand Down

0 comments on commit cd841bb

Please sign in to comment.