@samimussbach opened this Issue on April 27th 2009

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
@mattab commented on April 28th 2009 Owner

what's the problem with these queries? how can we fix them?

@robocoder commented on April 28th 2009 Contributor

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.


@robocoder commented on April 28th 2009 Contributor

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...

@robocoder commented on April 28th 2009 Contributor

Another thought is to remove the LIMIT clause assuming there is only one matching row.

@mattab commented on May 16th 2009 Owner

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

This Issue was closed on May 16th 2009
Powered by GitHub Issue Mirror