Navigation Menu

Skip to content

Commit

Permalink
supports sql_calc_found_rows. refs #1161
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentoku committed Nov 10, 2011
1 parent 57d685e commit 8a83e9d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ha_mroonga.cc
Expand Up @@ -5929,7 +5929,19 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys,
grn_obj *score_column)
{
MRN_DBUG_ENTER_METHOD();
st_select_lex *select_lex = table->pos_in_table_list->select_lex;
TABLE_LIST *table_list = table->pos_in_table_list;
st_select_lex *select_lex = table_list->select_lex;
SELECT_LEX_UNIT *unit = table_list->derived;
st_select_lex *first_select_lex;
if (unit)
{
first_select_lex = unit->first_select();
} else {
first_select_lex = select_lex;
}
DBUG_PRINT("info",
("mroonga: first_select_lex->options=%u",
first_select_lex ? first_select_lex->options : 0));

if (
thd_sql_command(ha_thd()) == SQLCOM_SELECT &&
Expand All @@ -5953,6 +5965,12 @@ void ha_mroonga::check_fast_order_limit(grn_table_sort_key **sort_keys,
fast_order_limit = FALSE;
DBUG_VOID_RETURN;
}
if (first_select_lex && (first_select_lex->options & OPTION_FOUND_ROWS)) {
DBUG_PRINT("info",
("mroonga: fast_order_limit = FALSE by calc_found_rows"));
fast_order_limit = FALSE;
DBUG_VOID_RETURN;
}
Item *info = (Item *)select_lex->item_list.first_node()->info;
Item *where;
where = select_lex->where;
Expand Down

0 comments on commit 8a83e9d

Please sign in to comment.