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

Request #6194 function _isAlreadyQuoted and _quoteIdentificator behavior
Submitted: 2005-12-08 16:47 UTC
From: i at buro dot com dot ru Assigned:
Status: Wont fix Package: DB
PHP Version: 4.3.11 OS: FC3
Roadmaps: (Not assigned)    

 [2005-12-08 16:47 UTC] i at buro dot com dot ru
Description: ------------ When method _quoteIdentifier is called it's just simply put quote marks on the sides if id. It can be dangerous and misleading when sequantially called on the same data(field id). So Request is to make implementation aware of double quotation on field ids. It should not be public method just simply inner behavior of _quoteIdentifier function.


 [2005-12-09 10:36 UTC] lsmith
Sorry, but you just need to structure your code properly to not call this on already quoted data.
 [2005-12-09 21:25 UTC] i at buro dot com dot ru
Its a bit tricky. Suppose i have this table id | int(10) unsigned | | PRI | NULL|auto_increment left | int(10) unsigned | | | 0 | right | int(10) unsigned | | | 0 | level | int(10) unsigned | | MUL | 0 | name | varchar(255) | | | | . In order to perform createRightNode with nested set i am to quote names like "`left`". Insertion consists of three queries two updates(line 1305,1315) and one insert(line 1345). So updates are made using sprintf (without quoting), and after that insert is made with _values2InsertQuery(line 1339), which quotes field names with _quoteIdentifier. So in order to make updates successfull i need to quote fields. But after these already quoted fields are quoted once more. And that is a bug. I guess createLeftNode, createSubNode have the same behavior.