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

Mysql-Warning: Statement is not safe to log in statement format #681

Closed
samimussbach opened this issue Apr 27, 2009 · 5 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@samimussbach
Copy link

We have tons of Statements like this in our mysql errorlog. perhaps you could take care of this.

cheers

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
Copy link
Member

mattab commented Apr 28, 2009

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

@robocoder
Copy link
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.

References:

@robocoder
Copy link
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
Copy link
Contributor

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

@mattab
Copy link
Member

mattab commented May 16, 2009

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

@samimussbach samimussbach added this to the RobotRock milestone Jul 8, 2014
@mattab mattab added the wontfix label Aug 3, 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. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

3 participants