php - Techniques for troubleshooting an unexpected mysql query -


i debugging issue in legacy php application column in table updated without constraint setting rows in table value. behavior unexpected i've spent fair amount of time trying track down cause of error.

the background:

  • it's intermittent problem.
  • we can't reproduce in our development environment (which identical production environment)
  • the application using orm

what we've tried:

  • reviewing source code
  • reviewing mysql bin logs. allowed see single update query without clause causing incorrect data appear.
  • adding additional application-level logging. has given better understanding of application haven't been able spot error occurs.

my question:

when faced seemingly rogue query in unfamiliar application, techniques use find source of query?

with intermittent problems, suggest extremely detailed logging in php code. allow see happening when change happens , query(ies) being run. if can't manually reproduced, there no real way track down without sort of debug output/logging.

if, after adding logging, can't spot problem, use test environment , work application without queries involve table in question.

last, not least, check triggers in mysql. i'm not sure mysql logs triggers, makes sense update without giving specifics in bin logs.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -