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

Bug #12846 Escaping missing in getSequenceName
Submitted: 2008-01-07 16:11 UTC
From: sberthelot Assigned: quipo
Status: Closed Package: MDB2_Driver_pgsql (version 1.4.1)
PHP Version: 5.1.4 OS: Linux 2.6.18
Roadmaps: (Not assigned)    
Subscription  


 [2008-01-07 16:11 UTC] sberthelot (Stephane Berthelot)
Description: ------------ When using a recent (8.2.4) version of Postgresql using standard_conforming_strings in postgresql.conf config file, the select done in getSequenceName returns in error. This is handled by the script which then uses the sprintf method but it produces Errors in logs and can be corrected easily. I added a E on line 952 : AND a.atthasdef ) FROM E'nextval[^\']*\'([^\']*)') FROM pg_attribute a which should escape the string correctly. Next versions of Postgresql are said to have this setting to On in default configuration Actual result: -------------- STATEMENT: SELECT substring((SELECT substring(pg_get_expr(d.adbin, d.adrelid) for 128) FROM pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef ) FROM 'nextval[^\']*\'([^\']*)') FROM pg_attribute a LEFT JOIN pg_class c ON c.oid = a.attrelid LEFT JOIN pg_attrdef d ON d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef WHERE (c.relname = 'xxxx_1_id' OR (c.relname = 'xxxx' AND a.attname = '1') ) AND NOT a.attisdropped AND a.attnum > 0 AND pg_get_expr(d.adbin, d.adrelid) LIKE 'nextval%' ORDER BY a.attnum ERROR: syntax error at or near "AND" at character 565

Comments

 [2008-01-09 19:12 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.