From 994a00eb70969e4fd8f7a30a95122e2f0411ff48 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Sun, 21 Apr 2019 12:17:05 +0200 Subject: [PATCH] Refs #30380 -- Used cursor._executed in DatabaseOperations.last_executed_query() on MySQL. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression in a41b09266dcdd01036d59d76fe926fe0386aaade. Thanks Tobias Krönke for the report. --- django/db/backends/mysql/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py index a0d1095edd..231665847a 100644 --- a/django/db/backends/mysql/operations.py +++ b/django/db/backends/mysql/operations.py @@ -143,7 +143,7 @@ class DatabaseOperations(BaseDatabaseOperations): # attribute where the exact query sent to the database is saved. # See MySQLdb/cursors.py in the source distribution. # MySQLdb returns string, PyMySQL bytes. - return force_str(getattr(cursor, '_last_executed', None), errors='replace') + return force_str(getattr(cursor, '_executed', None), errors='replace') def no_limit_value(self): # 2**64 - 1, as recommended by the MySQL documentation