PHP-SQL-Parser icon indicating copy to clipboard operation
PHP-SQL-Parser copied to clipboard

PHPSQLCreator doesn't seem to support /*comment*/ "unknown [expr_type] = comment in "WHERE" [x]"

Open ParleyHammon opened this issue 3 years ago • 1 comments

I have version v4.5.0

When I create a WHERE statement like WHERE s.status_id != 8 /*Pending*/ parse it then try to create it from the parse I get "unknown [expr_type] = comment in "WHERE" [x]"

The Parser seems to understand it: [{"expr_type":"comment","value":"\/*Pending*\/"}]

PHPSQLCreator just needs to add it back in

ParleyHammon avatar Oct 13 '22 17:10 ParleyHammon

What's even more interesting is PHPSQLParser mistook a comment like "# Set" as a colref {"expr_type":"colref","base_expr":"# Set","no_quotes":{"delim":false,"parts":["# Set"]},"sub_tree":false} So PHPSQLCreator added it back in and because PHPSQLCreator generates the query in one line it commented out the rest of the query.

ParleyHammon avatar Oct 20 '22 21:10 ParleyHammon