#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 , 7 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 7 years ago
Summary: | @@tx_isolation is deprecated warning in django/db/backends/mysql/base.py:71 → tx_isolation deprecation warning with MySQL 5.7.20+ |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Type: | Uncategorized → Cleanup/optimization |
comment:7 by , 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?
follow-up: 9 comment:8 by , 7 years ago
It doesn't qualify for a backport per our supported versions policy. 1.11 only receives security and data loss fixes.
comment:9 by , 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 , 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)
There is some notes in MySQL docs: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_tx_isolation.