MantisBT - TestLink
View Issue Details
0002663TestLinkDatabase Generalpublic2009-06-25 17:032010-05-01 20:34
Eloff 
fman 
normalfeature requestN/A
closedfixed 
 
1.9 Beta 2 
0002663: Show stack trace on SQL error to easier find the bad code
When SQL errors occurs displaying result of debug_print_backtrace(), can be useful.
No tags attached.
patch 015_enable_stacktrace_on_sql_error.patch (609) 2009-06-25 17:03
http://mantis.testlink.org/file_download.php?file_id=1145&type=bug
Issue History
2009-06-25 17:03EloffNew Issue
2009-06-25 17:03EloffFile Added: 015_enable_stacktrace_on_sql_error.patch
2010-01-11 06:53mhavlatNote Added: 0008623
2010-01-11 06:53mhavlatStatusnew => feedback
2010-01-11 21:27EloffNote Added: 0008634
2010-01-11 23:49fmanNote Added: 0008637
2010-01-12 00:09EloffNote Added: 0008639
2010-01-12 05:46fmanNote Added: 0008644
2010-01-12 06:26fmanDescription Updated
2010-01-12 18:35fmanNote Added: 0008647
2010-01-12 18:36fmanStatusfeedback => resolved
2010-01-12 18:36fmanFixed in Version => 1.9 (DEV)
2010-01-12 18:36fmanResolutionopen => fixed
2010-01-12 18:36fmanAssigned To => fman
2010-05-01 20:34fmanStatusresolved => closed

Notes
(0008623)
mhavlat   
2010-01-11 06:53   
Erik, is it for CVS head?
(0008634)
Eloff   
2010-01-11 21:27   
Yes, it is. Or rather was... 6 months ago
(0008637)
fman   
2010-01-11 23:49   
lot of info is missign:

how this can be enabled / disabled ?
this info must be displayed allways ?

this is useful only for developement => can be solved adding debug code instead of new feature

More if added info on each query regarding class and method, when sql fails you can get idea of where to look for . (this has been implemented in several method using a var named $debugMsg)
(0008639)
Eloff   
2010-01-12 00:09   
> how this can be enabled / disabled ?
> this info must be displayed allways ?
Always enabled, only executed when a query fails.

> this is useful only for developement => can be solved adding debug code instead of new feature
Can also be useful for users submitting bugs.

> More if added info on each query regarding class and method, when sql fails you can get idea of where to look for . (this has been implemented in several method using a var named $debugMsg)

This (very old) patch gives a stack trace when a database query fails.

The problem this solves is when a (to the developer unknown) query fails. It can be very hard finding the source of it. The stack trace makes it easy to find without putting debug messages all over the code.
(0008644)
fman   
2010-01-12 05:46   
OK we can add this patch.
Anyway $debugMsg MUST BE added on each sql sentence (will be part of new development standard).
(0008647)
fman   
2010-01-12 18:35   
using debugMsg has no drawbacks, comment is inserted on SQL CODE, then can be useful whe you print sql statement for some debugging purpose => has to be used.