Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28794 closed Cleanup/optimization (fixed)

tx_isolation deprecation warning with MySQL 5.7.20+

Reported by: JC Owned by: Sergey Fedoseev
Component: Database layer (models, ORM) Version: 2.0
Severity: Normal Keywords: mysql
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Testing on ubuntu 17.10 and received this warning.

/site-packages/django/db/backends/mysql/base.py:71: Warning: (1287, "'@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead")

return self.cursor.execute(query, args)

Error does not halt execution but thought I would report it.

Ubuntu = 17.10
Python 3.6.3
MySQL Server/libmysqlclient = 5.7.20
Django version = 2.0b1

Change History (10)

comment:1 by Sergey Fedoseev, 7 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Sergey Fedoseev, 7 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:3 by Sergey Fedoseev, 7 years ago

Has patch: set

comment:4 by Tim Graham, 7 years ago

Summary: @@tx_isolation is deprecated warning in django/db/backends/mysql/base.py:71tx_isolation deprecation warning with MySQL 5.7.20+
Triage Stage: AcceptedReady for checkin
Type: UncategorizedCleanup/optimization

comment:5 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: assignedclosed

In 967450a3:

Fixed #28794 -- Fixed tx_isolation deprecation warning on MySQL 5.7.20+.

comment:6 by Tim Graham <timograham@…>, 7 years ago

In 5638b77:

[2.0.x] Fixed #28794 -- Fixed tx_isolation deprecation warning on MySQL 5.7.20+.

Backport of 967450a3bf940c43db891fe1e2ef3bcf73456ff8 from master

comment:7 by David, 7 years ago

The same error occurs in 1.11. Is there a chance of this patch being further backported (doesn't seem to require any changes) to 1.11 and included in the next patch release?

comment:8 by Tim Graham, 7 years ago

It doesn't qualify for a backport per our supported versions policy. 1.11 only receives security and data loss fixes.

in reply to:  8 comment:9 by David, 7 years ago

Replying to Tim Graham:

It doesn't qualify for a backport per our supported versions policy. 1.11 only receives security and data loss fixes.

Fair enough! Was just hoping that a patch would be a better way of supressing the constant depreciation warnings, wish the MySQL backend had the same silent depreciation warnings as everything else now has.

comment:10 by Tim Graham, 7 years ago

I think the warning comes from MySQL itself and it's passed on through MySQLdb/mysqlclient. This may do the trick to suppress it:

from warnings import filterwarnings
import MySQLdb as Database
filterwarnings('ignore', category=Database.Warning)
Note: See TracTickets for help on using tickets.
Back to Top