-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[4.0] Backend: Duplicated query #27232
Comments
As you can see the query uses bind variables (the things starting with colon). These may have different values, and for sure they have at least different values for :id, because the statement is used to update status of an update site for a particular if, and so it is not a duplicate query. |
P.S. Please close your issue due to reasons stated in my previous comment. I could close it for you, but I prefer not to use this power. |
when i set it to old id, then i got just 1 query
|
Again, just because the text of the query is the same does not mean it is a duplicated query. Please confirm whether the query is being executed for a single row multiple times or for multiple rows. Without a confirmation that the query is being executed multiple times for one row, this is not an issue report that can be processed in any way other than closing it. |
That's the disadvantage of parametrized queries or prepared statements or however you call it: They are parsed on server side (including bind variable replacement), and so in debug we don't see the final query. Not sure if this can be changed to be parsed on client side. I've once seen such option in an ODBC driver, I think I remember, but I'm not 100% sure. |
@richard67 See #26135 |
@Quy I saw that one. But I'm not sure if there is a solution, except of replacing the bind vars on client side just for debugging, but there would not be a guarantee that we see the same query as the server does. It just needs some mistake when doing thatz replacement, and you see something in the debugger which is not equal to what the db server executes. |
@richard67 there are already plenty of libraries that have logic for replacing parameters with their parameterized values (the Laravel extension of the PHP Debug Bar used in 4.0 has support for this, and somewhere within the code used by the DoctrineBundle for Symfony is code to show an executable query). So it's really not as brittle as you might think it is. |
@mbabker That‘s good to know. That will save a lot of work. Thanks for the info. |
Steps to reproduce the issue
Enable debug.
Login backend.
Expected result
1x the query
Actual result
2x the query
System information (as much as possible)
Nightly build
Additional comments
The text was updated successfully, but these errors were encountered: