summaryrefslogtreecommitdiffstats
path: root/sqlglot/optimizer/simplify.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-22 18:53:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-22 18:53:31 +0000
commit20d090151fbc2e75394fc456f49f0078e59752d8 (patch)
tree084494962f092ff80f5ef8fdba1b917206abbc83 /sqlglot/optimizer/simplify.py
parentAdding upstream version 16.2.1. (diff)
downloadsqlglot-upstream/16.4.0.tar.xz
sqlglot-upstream/16.4.0.zip
Adding upstream version 16.4.0.upstream/16.4.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/optimizer/simplify.py')
-rw-r--r--sqlglot/optimizer/simplify.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/sqlglot/optimizer/simplify.py b/sqlglot/optimizer/simplify.py
index e2772a0..5365aef 100644
--- a/sqlglot/optimizer/simplify.py
+++ b/sqlglot/optimizer/simplify.py
@@ -408,9 +408,14 @@ def remove_where_true(expression):
if always_true(where.this):
where.parent.set("where", None)
for join in expression.find_all(exp.Join):
- if always_true(join.args.get("on")):
- join.set("kind", "CROSS")
+ if (
+ always_true(join.args.get("on"))
+ and not join.args.get("using")
+ and not join.args.get("method")
+ ):
join.set("on", None)
+ join.set("side", None)
+ join.set("kind", "CROSS")
def always_true(expression):