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

Bug #457 Notice with function raiseError() in Parser.php
Submitted: 2003-12-19 15:22 UTC
From: coil at strangebuzz dot com Assigned: busterb
Status: Closed Package: SQL_Parser
PHP Version: 4.3.4 OS: 2K + Easy PHP 1.7
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 36 + 37 = ?

 
 [2003-12-19 15:22 UTC] coil at strangebuzz dot com
Description: ------------ We have PHP notices in raiseError($message) function. Reproduce code: --------------- $parseRes = $this->SQLParser->parse("fromy CheinSELECT nUserID FROM users"); // It was to test error parsing Expected result: ---------------- No Notice should happen. Actual result: -------------- Notice: Uninitialized string offset: 36 in pear\SQL\Parser.php on line 95 Notice: Uninitialized string offset: 36 in pear\SQL\Parser.php on line 96 Here is a quick patch, can you verify it : replace : >>> function raiseError($message) { $end = 0; if ($this->lexer->string != '') { while (($this->lexer->string{$this->lexer->lineBegin+$end} != "\n") && ($this->lexer->string{$this->lexer->lineBegin+$end})) { ++$end; } } >>> by >>> function raiseError($message) { $TempArr = explode("\n",$this->lexer->string); $end = strlen($TempArr[0]); >>>>>> COil. :)

Comments

 [2003-12-19 16:41 UTC] coil at strangebuzz dot com
Changes the title of the bug...
 [2003-12-21 01:45 UTC] busterb at php dot net
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. Hello. This is fixed in the CVS version. I'll make a release shortly to put the fix out into the open. Thanks for the report.