diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-22 18:53:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-22 18:53:34 +0000 |
commit | 8f88a01462641cbf930b3c43b780565d0fb7d37e (patch) | |
tree | e211588c29e6ce6d16fbbfd33d8cda63237c2e6e /sqlglot/optimizer/simplify.py | |
parent | Releasing debian version 16.2.1-1. (diff) | |
download | sqlglot-8f88a01462641cbf930b3c43b780565d0fb7d37e.tar.xz sqlglot-8f88a01462641cbf930b3c43b780565d0fb7d37e.zip |
Merging upstream version 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): |