Translation of Summary of Part 1 of "Methods for searching errors in SQL application" just published
By Sveta Smirnova on Jun 30, 2010
There is not much new content this week. Just summary of what was written before.
In the summary of this part I'd want to recommend following:
Try to find a query which causes inconsistent behavior
Use log files:
- General query log
- Log files in your application
- MySQL Proxy or any other suitable proxy
Analyze what is wrong, then solve the problem using your findings
Below I place a list of methods which we studied in the first part.
Method #1: use output operator to output query in exactly same way in which RDBMS gets it.
Method #2: use general query log if you need to find which exact query causes wrong behavior of your application.
Method #3: after you found a query which causes the problem run it using command line client and analyze result.
Method #4: try to modify SQL in such a way what you get correct result. Use search engines to find a workaround.
Method #5: use EXPLAIN EXTENDED for finding how optimized (and executing) SQL query.
Method #6: convert DML queries to corresponding SELECT to examine which rows will be modified.
Method #7: repeat your scenario backward step-by-step until you found the problem query.
Method #8: always check result of the query! Use means of your connector or interface of interactive client.
Method #9: tune your application in such a way so it will write queries to log files itself.
Method #10: use MySQL Proxy or any other proxy.
Full text (which now is same as posted above) is here