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

Bug #16973 Wrong _skipDelimitedStrings behavior
Submitted: 2010-01-06 18:38 UTC
From: slnpacifist Assigned: quipo
Status: Closed Package: MDB2 (version 2.5.0b2)
PHP Version: 5.2.5 OS: Any
Roadmaps: (Not assigned)    

 [2010-01-06 18:38 UTC] slnpacifist (Vyacheslav Bazhinov)
Description: ------------ Method is _skipDelimitedStrings. Method gets delimiters the next way: $ignores = $this->string_quoting; $ignores[] = $this->identifier_quoting; , which causes a mess in $ignores. It should be $ignores = array(); $ignores[] = $this->string_quoting; $ignores[] = $this->identifier_quoting; Because of this Query 1 from the test scripts (i used mysqli driver) is considered ok. And this is the cause execute needs parameter in Query 2. But even after we change $ignores for good, this method still doesn't work properly. It watches only two symbols preceeding end delimeter, while there could be any amount of escape symbols. Query 3 and Query 4 should have different results, but while we do so (watching two symbols) they will behave the same. Test script: --------------- double slashes for PHP I use ? in queries in order to use method (it isn't called if no Query 1: " select '?\\' " Query 2: " select 'a\\'?\\'' " Query 3: " select concat('\\\\\\\\', ?) " (4 pairs of slashes) Query 4: " select concat('\\\\\\\\\\', ?) " (5 pairs of slashes) Expected result: ---------------- Result 1: Exception query with an unterminated text string specified Result 2: a'?' as a result of execution without parameters Result 3: \\_param_ as a result of execution with _param_ Result 4: Exception query with an unterminated text string specified


 [2010-01-06 19:03 UTC] slnpacifist (Vyacheslav Bazhinov)
related 13811 bug described only a part of a problem
 [2010-01-28 00:51 UTC] sircus (Jon Bright)
I've inadvertently reported a dupe of this bug, 17039. My report contains a test case.
 [2010-01-31 22:26 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.