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

Spurious SQL conditions creating excessive mySQL warnings #1739

Closed
anonymous-matomo-user opened this issue Sep 29, 2010 · 1 comment
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

At least one of the queries that updates a visit has an unnecessary LIMIT that causes mySQL warnings when using replication. For a busy installation this grows the log file excessively. It also appears to have extra WHERE conditions that aren't required.

Example:

100929 11:32:53 [Warning] Statement may not be safe to log in statement format. Statement: /* SHARDING_ID_SITE = 87 */
                                                UPDATE piwik_log_visit
                                                SET visit_total_actions = visit_total_actions + 1,  visit_exit_idaction_url = '52003', visit_last_action_time = '2010-09-29 15:32:53', visit_total_time = '10'
                                                WHERE idsite = '87'
                                                        AND idvisit = '8235537'
                                                        AND visitor_idcookie = 'efa9f489fa1263fcd2ae1f6a36054dc6'
                                                LIMIT 1

Since idvisit is unique there is no reason to have a limit, idsite or visitor_cookie in the query. At the very least, removing the LIMIT will prevent the mySQL warning.

@robocoder
Copy link
Contributor

(In [3195]) fixes #1739 - remove LIMIT clause; leaving the WHERE clause intact until we address #409

@anonymous-matomo-user anonymous-matomo-user added this to the Piwik 1.1 milestone Jul 8, 2014
This issue was closed.
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.
Projects
None yet
Development

No branches or pull requests

2 participants