Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.2

Bug #14850 order by direction inside of backticks
Submitted: 2008-10-22 13:53 UTC
From: wlp1979 Assigned: quipo
Status: Closed Package: DB_QueryTool (version 1.1.2)
PHP Version: 5.2.6 OS: Linux 2.4
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 29 - 29 = ?

 
 [2008-10-22 13:53 UTC] wlp1979 (Lee Parker)
Description: ------------ When the order for a column is set to DESC, and the backticks are added around the column name, the DESC is getting included inside the backticks. Test script: --------------- <?php require_once 'DB/QueryTool.php'; $dsn = 'mysql://user:pass@server/db'; $Query = new DB_QueryTool_Query($dsn); $Query->setTable('users'); $Query->setSelect('user_id'); $Query->addSelect('username'); $Query->setOrder('user_id', true); $Query->setLimit(0,1); $sql = $Query->getQueryString(); echo $sql, "\n"; Expected result: ---------------- SELECT `user_id`,`username` FROM `users` ORDER BY `users`.`user_id` DESC LIMIT 0, 1 Actual result: -------------- SELECT `user_id`,`username` FROM `users` ORDER BY `users`.`user_id DESC` LIMIT 0, 1

Comments

 [2008-10-25 05:54 UTC] doconnor (Daniel O'Connor)
See also: Bug #14862
 [2008-11-09 18:53 UTC] quipo (Lorenzo Alberton)
Please try the CVS version.
 [2008-11-10 15:13 UTC] wlp1979 (Lee Parker)
Thanks for the fix.