Skip to content

Parser throws uninitialized offsets warning when "REPLACE" MySQL function used in SELECT clause #156

Description

@GoogleCodeExporter
Hello,

Using the replace function in MySQL (the str_replace of MySQL) in a SELECT 
clause will cause the parser to throw PHP notices & warnings.

Example: Query is :
SELECT test_ID, 
test_name, 
    REPLACE(   test_name  , 'aa', 'bb') AS 'test_name_modified'
FROM  test  
ORDER BY test_name ASC; 


Notice: Undefined index: alias in  
PHP-SQL-Parser\src\processors\OrderByProcessor.php on line 69 
Notice: Undefined index: INTO in 
PHP-SQL-Parser\src\processors\InsertProcessor.php on line 50 
Warning: Invalid argument supplied for foreach() in 
PHP-SQL-Parser\src\processors\InsertProcessor.php on line 51 
Notice: Uninitialized string offset: 0 in  
PHP-SQL-Parser\src\processors\AbstractProcessor.php on line 66  
Notice: Uninitialized string offset: 0 in  
PHP-SQL-Parser\src\processors\AbstractProcessor.php on line 71 
Notice: Uninitialized string offset: 0 in  
PHP-SQL-Parser\src\processors\AbstractProcessor.php on line 76


I am using php-sql-parser version SVN: $Id: PHPSQLParser.php 757 2013-12-16 
09:54:05Z phosco@gmx.de $
with  PHP  5.4.6


Is there a way around this? It "works" but I like to have a clean output, 
without warnings & notices. 

Thank you!

Original issue reported on code.google.com by charline...@gmail.com on 22 Dec 2014 at 3:20

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions