diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-22 18:53:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-22 18:53:31 +0000 |
commit | 20d090151fbc2e75394fc456f49f0078e59752d8 (patch) | |
tree | 084494962f092ff80f5ef8fdba1b917206abbc83 /sqlglot/optimizer/simplify.py | |
parent | Adding upstream version 16.2.1. (diff) | |
download | sqlglot-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.py | 9 |
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): |