Browse Source

恢复 update where

myuan 2 years ago
parent
commit
0fb2df0790
1 changed files with 21 additions and 1 deletions
  1. 21 1
      run_test.py

+ 21 - 1
run_test.py

@@ -203,7 +203,7 @@ async def assert_sqls():
         ],
     )
     await assert_sql(
-        "update tb1 set col1=3, col4=4 where not col1=2 and col2=4;",
+        "update tb1 set col1=3, col4=4 where not not not col1=2 and col2=4;",
         [
             {
                 "type": "update",
@@ -221,6 +221,26 @@ async def assert_sqls():
                     },
                 ],
                 "where": {
+                    "type": "且",
+                    "left": {
+                        "type": "非",
+                        "left": {
+                            "type": "非",
+                            "left": {
+                                "type": "非",
+                                "left": {
+                                    "type": "相等",
+                                    "left": {"type": "identifier", "value": "col1"},
+                                    "right": {"type": "int", "value": 2},
+                                },
+                            },
+                        },
+                    },
+                    "right": {
+                        "type": "相等",
+                        "left": {"type": "identifier", "value": "col2"},
+                        "right": {"type": "int", "value": 4},
+                    },
                 },
             }
         ],