Navigation Menu

Skip to content

Commit

Permalink
storage count_skip: BETWEEN arguments exist in WHERE list on MySQL < 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jul 1, 2016
1 parent 084e00b commit 83ade0f
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions ha_mroonga.cpp
Expand Up @@ -9967,11 +9967,25 @@ void ha_mroonga::check_count_skip(key_part_map start_key_part_map,
case Item_func::LE_FUNC:
case Item_func::GE_FUNC:
case Item_func::GT_FUNC:
target = func_item->arguments()[0];
where = where->next->next;
break;
case Item_func::BETWEEN:
target = func_item->arguments()[0];
{
Item **arguments = func_item->arguments();
target = arguments[0];

uint n_arguments = func_item->argument_count();
bool argument_in_where = false;
for (uint i = 0; i < n_arguments; i++) {
if (arguments[i] == where->next) {
argument_in_where = true;
break;
}
}
if (argument_in_where) {
for (uint i = 0; i < n_arguments; i++) {
where = where->next;
}
}
}
break;
default:
target = NULL;
Expand Down

0 comments on commit 83ade0f

Please sign in to comment.