null+****@clear*****
null+****@clear*****
2011年 6月 18日 (土) 17:10:24 JST
Kentoku 2011-06-18 08:10:24 +0000 (Sat, 18 Jun 2011)
New Revision: cd841bb4930845d9431dc024a07d053625e47ff1
Log:
add require PK error
Modified files:
ha_mroonga.cc
Modified: ha_mroonga.cc (+8 -1)
===================================================================
--- ha_mroonga.cc 2011-06-18 07:59:33 +0000 (1bbfc24)
+++ ha_mroonga.cc 2011-06-18 08:10:24 +0000 (4f4358c)
@@ -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);
@@ -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);