Perhaps this should be handled by a config variable like $cfg['UseDebugMode'] = { TRUE | FALSE }; I blieve that there are some users out there that install phpMyAdmin on a non-productional machine and want to support our development. Of course, this directive should default to FALSE in final versions.
Of the two error functions, there is PMA_SQP_throwError() and PMA_SQP_BUG() [modelled after the linux kernel BUG()].
throwError is a case where the user has given us bad input that we know what is wrong with the query (Invalid Number String, Invalid Punctation String, Unmatched Quotes). These are the errors that MySQL will fail on as well, and the MySQL error return isn't terribly helpful sometimes, so my error messages can help a lot.
BUG is a much rarer case, presently the only time it occurs is when the parser hits a character that MySQL would totally fail on. So far the only occurances of this ever happening in the bug tracker have been when people have uploaded files with unquoted binary content to PMA. I am not certain if I should convert this into a call to check for such binary content and warn people or not. Maybe as a special case before the BUG() call ?
My PMA_SQP_BUG() presently includes:
Error Message CVS $Id$ of sqlparser MySQL version User OS/Browser/BrowserVersion PMA version PMA version/OS SQL query
Do you have any other suggestions of things that might be handy to have in tracking down bugs?
HTTP server software / version,
What are the best variable names to use to get these?
php version, MySQL version...
Got those.
Perhaps some information about the php / MySQL configuration...
Could you be more specific? I've considered included the page that the BUG() call was made from, but that isn't really needed yet.
Windows XP activation key, root password, the user's shoe size...
lol, those will never happen.