PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB » Bug #6194

function _isAlreadyQuoted and _quoteIdentificator behavior

Details

Request #6194function _isAlreadyQuoted and _quoteIdentificator behavior
Submitted2005-12-08 16:47 UTC
Fromi at buro dot com dot ru
StatusWont fix
PackageDB
PHP Version4.3.11
OSFC3
Roadmaps(Not assigned)

Comments

[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 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.