Home » Database » MDB_QueryTool » Bug #7570
Postgres SQL bug (case sensitive inserts)
Details
| Submitted | 2006-05-07 02:20 UTC |
|---|---|
| From | sendto at ronald-douglas dot com |
| Assigned | hugoki |
| Status | Closed |
| Package | MDB_QueryTool |
| PHP Version | 5.1.2 |
| OS | Redhat Linux Enterprise |
| Roadmaps | (Not assigned) |
Comments
[2006-05-07 02:20 UTC] sendto at ronald-douglas dot com
Description:
------------
Apply to line 646
Test script:
---------------
Patch idea: Apply to line 646
if($this->db->phptype == 'pgsql')
{
foreach($newData as $k => $v)
$newDataEncapsulated['`'.$k.'`'] = $v;
$newData = $newDataEncapsulated;
}
Description:
Postgres REQUIRES double quotations around case sensitive
fieldsnames.
INSERT INTO Users (Email, FirstName, LastName, ip, BusinessName, Website, OptIn, userId) VALUES ('foo@bar.com', 'Ronald', 'Partridge', '127.0.0.0', 'Ronald Douglas Consulting', 'http://www.ronald-douglas.com', 'YES', 105)
<DOES NOT WORK UNDER POSTGRES>
INSERT INTO Users ("Email", "FirstName", "LastName", "ip", "BusinessName", "Website", "OptIn", "userId") VALUES ('foo@bar.com', 'Ronald', 'Partridge', '127.0.0.0', 'Ronald Douglas Consulting', 'http://www.ronald-douglas.com', 'YES', 105)
<WORKS UNDER POSTGRES>
Expected result:
----------------
I expect that if the postgres database has been selected within the object, that the add() method will wrap double quotes " around fieldnames.
INSERT INTO Users ("Email", "FirstName", "LastName", "ip", "BusinessName", "Website", "OptIn", "userId") VALUES ('foo@bar.com', 'Ronald', 'Partridge', '127.0.0.0', 'Ronald Douglas Consulting', 'http://www.ronald-douglas.com', 'YES', 105)
Actual result:
--------------
Please give me your thoughts and feedback. <sendto@ronald-douglas.com
I will be patching MDB_QueryTool on my system and my clients production system.