#29544 closed Bug (fixed)
Django 2.0.7 broke regex lookup on MariaDB
| Reported by: | Michal Čihař | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 2.0 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Adam Johnson | 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 (last modified by )
Since Django 2.0.7 it fails to do regex lookups on MariaDB. The problem is in code introduced for #29451 - it assumes that MariaDB 10.3 has REGEXP_LIKE what is not true.
The exception is:
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/cursors.py", line 247, in execute
res = self._query(query)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/cursors.py", line 412, in _query
rowcount = self._do_query(q)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/cursors.py", line 375, in _do_query
db.query(q)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/MySQLdb/connections.py", line 276, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1305, 'FUNCTION test_weblate.REGEXP_LIKE does not exist')
Change History (11)
comment:1 by , 7 years ago
| Component: | Uncategorized → Database layer (models, ORM) |
|---|---|
| Summary: | MariaDB regression in 2.0.7 in REGEXP_LIKE → Add a MariaDB database backend |
| Triage Stage: | Unreviewed → Accepted |
| Type: | Uncategorized → New feature |
| Version: | 2.0 → master |
comment:2 by , 7 years ago
The problem I see is that it worked just fine all versions up to 2.0.7 and it broke in 2.0.7 due to fix for MySQL 8.0. The other tickets seem to be about adding support for new features introduced by MariaDB, while this one is about fixing what used to work before.
https://github.com/django/django/pull/10133 would work on 2.0 just fine in case you decide to use it as a fix.
comment:3 by , 7 years ago
| Severity: | Normal → Release blocker |
|---|
Even if it is not officially supported, I think we should do everything we can to not break it.
I have sites in production with MariaDB!
comment:4 by , 7 years ago
It would be possible to fix the patch I made by detecting MariaDB (or more specifically, MySQL) and triggering the correct implementation?
comment:5 by , 7 years ago
Absolutely, but patches are waiting for a CI instance with MariaDB. Even if we know there are some failures with MariaDB, at least this would prevent massive breakage like this one (I don't blame you or anyone else, to be clear).
comment:6 by , 7 years ago
| Has patch: | set |
|---|---|
| Summary: | Add a MariaDB database backend → Django 2.0.7 broke regex lookup on MariaDB |
| Triage Stage: | Accepted → Ready for checkin |
| Type: | New feature → Bug |
| Version: | master → 2.0 |
comment:7 by , 7 years ago
| Description: | modified (diff) |
|---|
comment:11 by , 7 years ago
| Cc: | added |
|---|
Django doesn't officially support MariaDB. There's been some discussion about adding support. There are some other tickets like #27676.