sadpandajoe commented on code in PR #45771:
URL: https://github.com/apache/superset/pull/45771#discussion_r4396871246
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -2884,8 +2884,18 @@ def test_firebolt_old_escape_string() -> None:
("SELECT * FROM t WHERE ROWNUM <= 9 AND x = 1 AND ROWNUM < 4",
"oracle", 3),
("SELECT * FROM t WHERE ROWNUM < 0", "oracle", 0),
("SELECT * FROM (SELECT * FROM t) WHERE ROWNUM <= 11", "oracle", 11),
+ # A nested `AND` grouped in parentheses still bounds the result, no
+ # matter which side of the chain it is on.
+ ("SELECT * FROM t WHERE x = 1 AND (y = 2 AND ROWNUM <= 5)", "oracle",
5),
Review Comment:
These cases only check that the nested cap is detected, but the user-visible
effect described in the PR (no redundant wrapper) isn't asserted anywhere.
`test_cap_limit_value_oracle_rownum` has no nested form, so a regression that
finds the cap but still stacks a `SELECT * FROM (...) WHERE ROWNUM <= n` layer
would still pass. Would a case like `SELECT n FROM t WHERE x = 1 AND (y = 2 AND
ROWNUM <= 5)` with limit 10 be worth adding there, so the `statement.format()
== SQLStatement(sql, "oracle").format()` check covers it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]