Opened 5 years ago

Closed 5 years ago

Last modified 5 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 Changed 5 years ago by Sergey Fedoseev

Triage Stage: UnreviewedAccepted

comment:2 Changed 5 years ago by Sergey Fedoseev

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:3 Changed 5 years ago by Sergey Fedoseev

Has patch: set

comment:4 Changed 5 years ago by Tim Graham

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 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 967450a3:

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

comment:6 Changed 5 years ago by Tim Graham <timograham@…>

In 5638b77:

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

Backport of 967450a3bf940c43db891fe1e2ef3bcf73456ff8 from master

comment:7 Changed 5 years ago by David

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 Changed 5 years ago by Tim Graham

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

comment:9 in reply to:  8 Changed 5 years ago by David

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 Changed 5 years ago by Tim Graham

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