sql_optimizer_tests = [ ( "select * from person where (age < 18) or (age > 60 and age < 35);", { "select_cols": [ { "target": { "type": "select_all_column", "value": "select_all_column", }, "type": "select_all_column", } ], "table_names": ["person"], "type": "select_stmt", "where": { "left": {"type": "identifier", "value": "age"}, "op_type": "bin_cmp_op", "right": {"type": "int", "value": 18}, "type": "小于", }, }, ), ( "select * from person where (age < 18) and age < 5 and age < 35;", { "select_cols": [ { "target": { "type": "select_all_column", "value": "select_all_column", }, "type": "select_all_column", } ], "table_names": ["person"], "type": "select_stmt", "where": { "left": {"type": "identifier", "value": "age"}, "op_type": "bin_cmp_op", "right": {"type": "int", "value": 5}, "type": "小于", }, }, ), ( "select * from person where age < 18 and (age > 5 and age > 35);", { "select_cols": [ { "target": { "type": "select_all_column", "value": "select_all_column", }, "type": "select_all_column", } ], "table_names": ["person"], "type": "select_stmt", "where": {"type": "bool", "value": False}, }, ), ]