rickywu-posh / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

unknown expr_type in WHERE expression subtree[0] expression #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
<?php

require("php-sql-parser.php");
require("php-sql-creator.php");

error_reporting( E_ALL );
ini_set( 'display_errors', 1 );

$sql = "SELECT * FROM `table` `t` WHERE ( ( UNIX_TIMESTAMP() + 3600 ) > 
`t`.`expires` ) ";

$parser = new PHPSQLParser($sql);

echo "<pre>";
print_r( new PHPSQLCreator($parser->parsed) );

What is the expected output? What do you see instead?
Expected output
---------------
"SELECT * FROM `table` `t` WHERE ( ( UNIX_TIMESTAMP() + 3600 ) > `t`.`expires` 
) ";

Observed output
---------------
unknown expr_type in WHERE expression subtree[0] expression

What version of the product are you using? On what operating system?
https://www.phosco.info/publicsvn/php-sql-parser/trunk/ REV 141

Please provide any additional information below.
I believe this is in php-sql-creator.php as opposed to php-sql-parser.php

Original issue reported on code.google.com by ben.swin...@gmail.com on 13 Mar 2012 at 10:03

GoogleCodeExporter commented 8 years ago
The creator only handles some case, which I have used for my own project. If 
the creator returns an unknown expr_type, there will be a case, which I have 
not implemented yet. You can find the places, if you search for "stop". This is 
the method, which generates the error output. I think, it can be the function 
within the WHERE clause, which I don't await at this point.

Original comment by pho...@gmx.de on 13 Mar 2012 at 12:21

GoogleCodeExporter commented 8 years ago
Please try current version on REV 187.

Original comment by pho...@gmx.de on 13 Mar 2012 at 12:39

GoogleCodeExporter commented 8 years ago
Confirmed fixed. I tried REV 190 though.

Original comment by ben.swin...@gmail.com on 13 Mar 2012 at 2:17

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 13 Mar 2012 at 2:38