Hi. I think I found a bug in DB_QueryTool package in file Query.php. The problem is with the setOrder(maybe addOrder too) and _prependTableName methods. The problem occurs when you set the second parameter to setOrder as true. Then it tries to add 'DESC' to the order condition, but the order part of the query isn't built/parsed correctly in the _prependTableName method.
If I used this line, for example in building a query:
$qt->setOrder('question_name', true)
I would get a query string like the following:
SELECT `table1`.`id` AS `id`,`table1`.`question_name` AS `question_name` FROM `table1` WHERE table1.node_type='article' ORDER BY `table1`.`question_name DESC` LIMIT 20, 10
See how 'question_name' and 'DESC' are both enclosed by backticks? The query fails in this case.
I searched this in the bug database and didn't find anything. It's strange like something like this wouldn't have surfaced yet since this seems like something a lot of people would be doing.
Is this really a bug? If so what should I do? Should I fix it myself and submit the fix?