Navigation Menu

Skip to content

Commit

Permalink
[mysql-5.6] follow ORDER direction change. refs #1046
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 12, 2011
1 parent 75ddab3 commit 81db4ab
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ha_mroonga.cc
Expand Up @@ -83,6 +83,12 @@ extern pthread_mutex_t LOCK_open;
# define mysql_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
#endif

#if MYSQL_VERSION_ID >= 50603
# define MRN_ORDER_IS_ASC(order) ((order)->direction == ORDER::ORDER_ASC)
#else
# define MRN_ORDER_IS_ASC(order) ((order)->asc)
#endif

static const char *wrapper_index_column_name = "index";

#ifdef __cplusplus
Expand Down Expand Up @@ -4816,10 +4822,12 @@ void ha_mroonga::check_fast_order_limit()
col_field_index = field->field_index;
}
sort_keys[i].offset = 0;
if (order->asc)
if (MRN_ORDER_IS_ASC(order))
{
sort_keys[i].flags = GRN_TABLE_SORT_ASC;
else
} else {
sort_keys[i].flags = GRN_TABLE_SORT_DESC;
}
}
grn_obj *index;
if (i == 1 && col_field_index >= 0 &&
Expand Down

0 comments on commit 81db4ab

Please sign in to comment.