1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #30897 -- Added support for TREE format to Queryset.explain() on MySQL 8.0.16+.

This commit is contained in:
Nick Pope
2019-10-21 17:32:56 +01:00
committed by Mariusz Felisiak
parent 37f02c47f8
commit 742961332e
5 changed files with 25 additions and 6 deletions

View File

@@ -71,9 +71,10 @@ class ExplainTests(TestCase):
@unittest.skipUnless(connection.vendor == 'mysql', 'MySQL specific')
def test_mysql_text_to_traditional(self):
# Initialize the cached property, if needed, to prevent a query for
# the MySQL version during the QuerySet evaluation.
# Ensure these cached properties are initialized to prevent queries for
# the MariaDB or MySQL version during the QuerySet evaluation.
connection.features.needs_explain_extended
connection.features.supported_explain_formats
with CaptureQueriesContext(connection) as captured_queries:
Tag.objects.filter(name='test').explain(format='text')
self.assertEqual(len(captured_queries), 1)