Navigation Menu

Skip to content

Commit

Permalink
[truncate] define MRN_HANDLER_HAVE_TRUNCATE flag. refs #1151
Browse files Browse the repository at this point in the history
The flag is for truncate available MySQL implementations.
  • Loading branch information
kou committed Nov 21, 2011
1 parent be4c4f1 commit fd8f057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ha_mroonga.cc
Expand Up @@ -6650,7 +6650,7 @@ int ha_mroonga::delete_all_rows()
DBUG_RETURN(error);
}

#if MYSQL_VERSION_ID >= 50500
#ifdef MRN_HANDLER_HAVE_TRUNCATE
int ha_mroonga::wrapper_truncate()
{
int error = 0;
Expand Down Expand Up @@ -6757,7 +6757,7 @@ int ha_mroonga::storage_truncate_index()
DBUG_RETURN(error);
}

#if MYSQL_VERSION_ID >= 50500
#ifdef MRN_HANDLER_HAVE_TRUNCATE
int ha_mroonga::truncate()
{
MRN_DBUG_ENTER_METHOD();
Expand Down
12 changes: 8 additions & 4 deletions ha_mroonga.h
Expand Up @@ -78,6 +78,10 @@ extern "C" {
# define MRN_HANDLER_HAVE_MULTI_RANGE_READ_INFO_KEY_PARTS
#endif

#if MYSQL_VERSION_ID >= 50500
# define MRN_HANDLER_HAVE_TRUNCATE
#endif

#if MYSQL_VERSION_ID < 50600
typedef Item COND;
#endif
Expand Down Expand Up @@ -294,9 +298,9 @@ class ha_mroonga: public handler
void start_bulk_insert(ha_rows rows);
int end_bulk_insert();
int delete_all_rows();
#if MYSQL_VERSION_ID >= 50500
#ifdef MRN_HANDLER_HAVE_TRUNCATE
int truncate();
#endif
#endif // MRN_HANDLER_HAVE_TRUNCATE
double scan_time();
double read_time(uint index, uint ranges, ha_rows rows);
const key_map *keys_to_use_for_scanning();
Expand Down Expand Up @@ -594,9 +598,9 @@ class ha_mroonga: public handler
#endif // MRN_HANDLER_HAVE_MULTI_RANGE_READ
int wrapper_delete_all_rows();
int storage_delete_all_rows();
#if MYSQL_VERSION_ID >= 50500
#ifdef MRN_HANDLER_HAVE_TRUNCATE
int wrapper_truncate();
#endif
#endif // MRN_HANDLER_HAVE_TRUNCATE
int wrapper_truncate_index();
int storage_truncate();
int storage_truncate_index();
Expand Down

0 comments on commit fd8f057

Please sign in to comment.