Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory error in API Live.getLastVisitsDetails when filter_offset is large #7596

Merged
merged 1 commit into from Apr 1, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Mar 31, 2015

fixes #7458

Before, when LIMIT 10 OFFSET 15 was requested we did fetch 25 records from the database to make sure the Sort and Limit filter in GenericFilter works.

Now we do directly in the API apply filter_limit and filter_offset to fetch only 10 records. This means we do no longer support Sort for the Live.getLastVisitsDetails API method. As the method name says we will always sort by visit_last_action_time. filter_sort_order will still work.

$sql .= "
LIMIT
$limit";
$sql = $this->appendLimitClauseToQuery($sql, $limit);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a "bug". The PHPdoc already said it would support a Limit by clause but it only supported a limit number (int). It does now actually support 10, 5 for LIMIT 5 OFFSET 10

return $data;
} catch (Exception $e) {
echo $e->getMessage();
exit;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exit was added in 977d059#diff-11527d0f07d21b83277153a2ebb852acR306 but didn't really make sense to me. Maybe it was just the way we handled it back then

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. labels Mar 31, 2015
@tsteur tsteur added this to the Piwik 2.13.0 milestone Mar 31, 2015
@tsteur tsteur added the Needs Review PRs that need a code review label Mar 31, 2015
@mattab
Copy link
Member

mattab commented Apr 1, 2015

Code and tests look good to me,

mattab pushed a commit that referenced this pull request Apr 1, 2015
Memory error in API Live.getLastVisitsDetails when filter_offset is large
@mattab mattab merged commit d81f63e into master Apr 1, 2015
@mnapoli mnapoli deleted the 7458 branch April 9, 2015 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants