Spurious SQL conditions creating excessive mySQL warnings
|Reported by:||DriverDan||Owned by:|
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.
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.