{"action":"created","issue":{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/47","labels_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/47/comments","events_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/47/events","html_url":"https://github.com/greenlion/PHP-SQL-Parser/issues/47","id":88964285,"number":47,"title":"Tab character causes a wrong parsing.","user":{"login":"witchi","id":5766508,"avatar_url":"https://avatars.githubusercontent.com/u/5766508?v=3","gravatar_id":"","url":"https://api.github.com/users/witchi","html_url":"https://github.com/witchi","followers_url":"https://api.github.com/users/witchi/followers","following_url":"https://api.github.com/users/witchi/following{/other_user}","gists_url":"https://api.github.com/users/witchi/gists{/gist_id}","starred_url":"https://api.github.com/users/witchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witchi/subscriptions","organizations_url":"https://api.github.com/users/witchi/orgs","repos_url":"https://api.github.com/users/witchi/repos","events_url":"https://api.github.com/users/witchi/events{/privacy}","received_events_url":"https://api.github.com/users/witchi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/imported","name":"imported","color":"FFFFFF"},{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/labels/Priority-Medium","name":"Priority-Medium","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-17T09:15:23Z","updated_at":"2015-06-17T09:15:24Z","closed_at":null,"body":"_From [johnny.c...@gmail.com](https://code.google.com/u/112149023784980472854/) on January 23, 2012 12:07:44_\n\nHere an example query :\r\nSELECT \tSUM( 10 ) FROM account\r\n\r\nThere is a tab character before the SUM function. I've a class which use php-sql-parser to perform internal extra validation.\r\n\r\nThe example query causes my parser to fail.\r\n\r\nBut with this query where I've replaced tab character by a space :\r\nSELECT  SUM( 10 ) FROM account\r\nMy parser doesn't fail.\r\n\r\nParser result with tab character :\r\n    [SELECT] => Array\r\n        (\r\n            [0] => Array\r\n                (\r\n                    [expr_type] => expression\r\n                    [alias] => `SUM( 10   as test`\r\n                    [base_expr] => SUM( 10   as test\r\n                    [sub_tree] => Array\r\n                        (\r\n                            [0] => Array\r\n                                (\r\n                                    [expr_type] => aggregate_function\r\n                                    [base_expr] => SUM\r\n                                    [sub_tree] => \r\n                                )\r\n\r\n                            [1] => Array\r\n                                (\r\n                                    [expr_type] => colref\r\n                                    [base_expr] => ( 10   as test\r\n                                    [sub_tree] => \r\n                                )\r\n\r\n                        )\r\n\r\n                )\r\n\r\n        )\r\n\r\nParser result with space character :\r\n    [SELECT] => Array\r\n        (\r\n            [0] => Array\r\n                (\r\n                    [expr_type] => expression\r\n                    [alias] => `test`\r\n                    [base_expr] => SUM( 10 ) \r\n                    [sub_tree] => Array\r\n                        (\r\n                            [0] => Array\r\n                                (\r\n                                    [expr_type] => aggregate_function\r\n                                    [base_expr] => SUM\r\n                                    [sub_tree] => \r\n                                )\r\n\r\n                            [1] => Array\r\n                                (\r\n                                    [expr_type] => const\r\n                                    [base_expr] => ( 10 )\r\n                                    [sub_tree] => \r\n                                )\r\n\r\n                        )\r\n\r\n                )\r\n\r\n        )\r\n\r\nShould this bug be fixed onto php-sql-parser or my own class ?\r\n\r\nThe fix would be to do a : str_replace(\"\\t\", ' ', $query);\n\n_Original issue: http://code.google.com/p/php-sql-parser/issues/detail?id=21_"},"comment":{"url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/comments/112731741","html_url":"https://github.com/greenlion/PHP-SQL-Parser/issues/47#issuecomment-112731741","issue_url":"https://api.github.com/repos/greenlion/PHP-SQL-Parser/issues/47","id":112731741,"user":{"login":"witchi","id":5766508,"avatar_url":"https://avatars.githubusercontent.com/u/5766508?v=3","gravatar_id":"","url":"https://api.github.com/users/witchi","html_url":"https://github.com/witchi","followers_url":"https://api.github.com/users/witchi/followers","following_url":"https://api.github.com/users/witchi/following{/other_user}","gists_url":"https://api.github.com/users/witchi/gists{/gist_id}","starred_url":"https://api.github.com/users/witchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/witchi/subscriptions","organizations_url":"https://api.github.com/users/witchi/orgs","repos_url":"https://api.github.com/users/witchi/repos","events_url":"https://api.github.com/users/witchi/events{/privacy}","received_events_url":"https://api.github.com/users/witchi/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T09:15:24Z","updated_at":"2015-06-17T09:15:24Z","body":"_From [pho...@gmx.de](https://code.google.com/u/109317404671582518013/) on January 31, 2012 02:21:29_\n\nSolved in current version on http://www.phosco.info/php-sql-parser_current.zip"}}