summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/provision.py
diff options
context:
space:
mode:
authorAlessio Bogon <youtux@gmail.com>2019-09-15 11:12:24 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-01-22 11:31:23 -0500
commit3809a5ecfe785cecbc9d91a8e4e4558e3839c694 (patch)
treedbde348bd6673de8acc685f82884f78f6b9f8f67 /lib/sqlalchemy/dialects/mysql/provision.py
parentd3ad35838ede0713d073bbbf78d1bca511806059 (diff)
downloadsqlalchemy-3809a5ecfe785cecbc9d91a8e4e4558e3839c694.tar.gz
Query linter option
Added "from linting" as a built-in feature to the SQL compiler. This allows the compiler to maintain graph of all the FROM clauses in a particular SELECT statement, linked by criteria in either the WHERE or in JOIN clauses that link these FROM clauses together. If any two FROM clauses have no path between them, a warning is emitted that the query may be producing a cartesian product. As the Core expression language as well as the ORM are built on an "implicit FROMs" model where a particular FROM clause is automatically added if any part of the query refers to it, it is easy for this to happen inadvertently and it is hoped that the new feature helps with this issue. The original recipe is from: https://github.com/sqlalchemy/sqlalchemy/wiki/FromLinter The linter is now enabled for all tests in the test suite as well. This has necessitated that a lot of the queries be adjusted to not include cartesian products. Part of the rationale for the linter to not be enabled for statement compilation only was to reduce the need for adjustment for the many test case statements throughout the test suite that are not real-world statements. This gerrit is adapted from Ib5946e57c9dba6da428c4d1dee6760b3e978dda0. Fixes: #4737 Change-Id: Ic91fd9774379f895d021c3ad564db6062299211c Closes: #4830 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4830 Pull-request-sha: f8a21aa6262d1bcc9ff0d11a2616e41fba97a47a
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/provision.py')
0 files changed, 0 insertions, 0 deletions