123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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},
- },
- ),
- ]
|