Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
c1ac9c5e
Kaydet (Commit)
c1ac9c5e
authored
Tem 05, 2018
tarafından
Michal Čihař
Kaydeden (comit)
Tim Graham
Tem 05, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[2.1.x] Fixed #29544 -- Fixed regex lookup on MariaDB.
Regression in
42490768
. Backport of
39e287d8
from master
üst
b505cef6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
base.py
django/db/backends/mysql/base.py
+12
-4
operations.py
django/db/backends/mysql/operations.py
+2
-2
2.0.8.txt
docs/releases/2.0.8.txt
+2
-1
No files found.
django/db/backends/mysql/base.py
Dosyayı görüntüle @
c1ac9c5e
...
...
@@ -326,11 +326,19 @@ class DatabaseWrapper(BaseDatabaseWrapper):
return
True
@cached_property
def
mysql_
version
(
self
):
def
mysql_
server_info
(
self
):
with
self
.
temporary_connection
()
as
cursor
:
cursor
.
execute
(
'SELECT VERSION()'
)
server_info
=
cursor
.
fetchone
()[
0
]
match
=
server_version_re
.
match
(
server_info
)
return
cursor
.
fetchone
()[
0
]
@cached_property
def
mysql_version
(
self
):
match
=
server_version_re
.
match
(
self
.
mysql_server_info
)
if
not
match
:
raise
Exception
(
'Unable to determine MySQL version from version string
%
r'
%
server_info
)
raise
Exception
(
'Unable to determine MySQL version from version string
%
r'
%
se
lf
.
mysql_se
rver_info
)
return
tuple
(
int
(
x
)
for
x
in
match
.
groups
())
@cached_property
def
mysql_is_mariadb
(
self
):
# MariaDB isn't officially supported.
return
'mariadb'
in
self
.
mysql_server_info
.
lower
()
django/db/backends/mysql/operations.py
Dosyayı görüntüle @
c1ac9c5e
...
...
@@ -285,8 +285,8 @@ class DatabaseOperations(BaseDatabaseOperations):
def
regex_lookup
(
self
,
lookup_type
):
# REGEXP BINARY doesn't work correctly in MySQL 8+ and REGEXP_LIKE
# doesn't exist in MySQL 5.6.
if
self
.
connection
.
mysql_version
<
(
8
,
0
,
0
):
# doesn't exist in MySQL 5.6
or in MariaDB
.
if
self
.
connection
.
mysql_version
<
(
8
,
0
,
0
)
or
self
.
connection
.
mysql_is_mariadb
:
if
lookup_type
==
'regex'
:
return
'
%
s REGEXP BINARY
%
s'
return
'
%
s REGEXP
%
s'
...
...
docs/releases/2.0.8.txt
Dosyayı görüntüle @
c1ac9c5e
...
...
@@ -9,4 +9,5 @@ Django 2.0.8 fixes several bugs in 2.0.7.
Bugfixes
========
* ...
* Fixed a regression in Django 2.0.7 that broke the ``regex`` lookup on MariaDB
(even though MariaDB isn't officially supported) (:ticket:`29544`).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment