function test_unresolve_where_clause_columns() { $parser = new SQL_Parser(null, 'MySQL'); $compiler = new SQL_Compiler(); $sql = "SELECT a,b,c from Foo f inner join Bar b where (Foo.a='5' and Bar.b='6') or (Foo.c='7' and Bar.d='8')"; $parsed = $parser->parse($sql); $wrapper = new SQL_Parser_wrapper($parsed, 'MySQL'); $wrapper->unresolveWhereClauseColumns($parsed['where_clause']); $this->assertEquals("select a, b, c from Foo as f inner join Bar as b where (f.a = '5' and b.b = '6') or (f.c = '7' and b.d = '8')", $compiler->compile($parsed)); //print_r($parsed); }