We have tons of Statements like this in our mysql errorlog. perhaps you could take care of this.
090427 9:22:37 [Warning] Statement is not safe to log in statement format. Statement: /* SHARDING_ID_SITE = 1 */ UPDATE piwik_log_visit SET visit_last_action_time = '2009-04-27 09:22:37', visit_exit_idaction = '7', visit_total_actions = visit_total_actions + 1, visit_total_time = UNIX_TIMESTAMP(visit_last_action_time) - UNIX_TIMESTAMP(visit_first_action_time) WHERE idvisit = '35037' AND visitor_idcookie = 'XXXXXXXXXXXXXXXXXXXXX' LIMIT 1
what's the problem with these queries? how can we fix them?
According to the MySQL docs, this query is non-deterministic for replication.
The fix is to add ORDER BY to make it deterministic. However, there is an outstanding bug where this warning is logged even when the statement is deterministic.
In other words, even with the ORDER BY fix in Piwik, MySQL will continue to log a warning until a fix is commited to some future version of MySQL...
Another thought is to remove the LIMIT clause assuming there is only one matching row.
it sounds more like a mysql server issue. The requests are fine.
The only thing I can think is of: if this error comes from the comments in the queries we could delete the comments... please experiment and reopen if this is the case. thanks