Re: [Django] #34217: Migration removing a CheckConstraint results in ProgrammingError using MySQL < 8.0.16.

165 views
Skip to first unread message

Django

unread,
Dec 19, 2022, 4:09:48 PM12/19/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max F. | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------

Comment (by Max F.):

Hi Mariusz,

Thanks for the quick response! As far as the patch goes, I'd love to
contribute (first time reporting a bug) but I think it'd be better to let
someone else pick it up.

I tried to by following along with
[https://docs.djangoproject.com/en/dev/intro/contributing/#writing-your-
first-patch-for-django]; however, I'm having some difficulty figuring out
how to just get the tests to run using MySQL 5.7 in the first place 😕.

{{{

File "/Users/maxwellfisco/django-
fork/django/django/db/backends/base/base.py", line 214, in
check_database_version_supported
raise NotSupportedError(
django.db.utils.NotSupportedError: MySQL 8 or later is required (found
5.7.40).
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 19, 2022, 11:12:16 PM12/19/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: nobody

Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------

Comment (by Mariusz Felisiak):

Replying to [comment:2 Max Fisco]:


> Hi Mariusz,
>
> Thanks for the quick response! As far as the patch goes, I'd love to
contribute (first time reporting a bug) but I think it'd be better to let
someone else pick it up.
>
> I tried to by following along with
[https://docs.djangoproject.com/en/dev/intro/contributing/#writing-your-
first-patch-for-django]; however, I'm having some difficulty figuring out
how to just get the tests to run using MySQL 5.7 in the first place 😕.
>
> {{{
>
> File "/Users/maxwellfisco/django-
fork/django/django/db/backends/base/base.py", line 214, in
check_database_version_supported
> raise NotSupportedError(
> django.db.utils.NotSupportedError: MySQL 8 or later is required (found
5.7.40).
> }}}

Django 4.2 no longer supports MySQL < 8, so you need to use MySQL 8 to
test against the current `main` branch.

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:3>

Django

unread,
Dec 22, 2022, 1:11:24 PM12/22/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------

Comment (by Bhuvnesh):

Hi Max, if you are working on this issue please assign it to yourself, if
not, i would like to submit a patch. 🙂

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:4>

Django

unread,
Dec 22, 2022, 1:21:01 PM12/22/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------

Comment (by Max Fisco):

Replying to [comment:4 Bhuvnesh]:


> Hi Max, if you are working on this issue please assign it to yourself,
if not, i would like to submit a patch. 🙂

Hi Bhuvnesh, I apologize for leaving it ambiguous, go ahead and submit the
patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:5>

Django

unread,
Dec 22, 2022, 2:16:08 PM12/22/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: assigned

Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by Bhuvnesh):

* owner: nobody => Bhuvnesh
* status: new => assigned


Comment:

Okay ,Thanks !

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:6>

Django

unread,
Dec 25, 2022, 9:29:17 AM12/25/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: assigned
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by David Wobrock):

* cc: David Wobrock (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:7>

Django

unread,
Dec 25, 2022, 3:21:07 PM12/25/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+------------------------------------
Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: assigned
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------
Changes (by Jacob Walls):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16405 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:8>

Django

unread,
Dec 27, 2022, 1:13:30 AM12/27/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+---------------------------------------------

Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: assigned
Component: Migrations | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:9>

Django

unread,
Dec 27, 2022, 2:05:35 AM12/27/22
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+---------------------------------------------
Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"68ef274bc505cd44f305c03cbf84cf08826200a8" 68ef274b]:
{{{
#!CommitTicketReference repository=""
revision="68ef274bc505cd44f305c03cbf84cf08826200a8"
Fixed #34217 -- Fixed migration crash when removing check constraints on
MySQL < 8.0.16.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:10>

Django

unread,
Feb 23, 2023, 3:12:57 PM2/23/23
to django-...@googlegroups.com
#34217: Migration removing a CheckConstraint results in ProgrammingError using
MySQL < 8.0.16.
----------------------------+---------------------------------------------
Reporter: Max Fisco | Owner: Bhuvnesh
Type: Bug | Status: closed
Component: Migrations | Version: 4.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"16c966ff7fc9ce01e3afd87ef2af55859cadb587" 16c966ff]:
{{{
#!CommitTicketReference repository=""
revision="16c966ff7fc9ce01e3afd87ef2af55859cadb587"
Refs #30060, Refs #34217 -- Made SchemaEditor not generate SQL for
CheckConstraint if not supported.

The new logic mirrors the logic in SchemaEditor._delete_check_sql()
added in 68ef274bc505cd44f305c03cbf84cf08826200a8.

Thanks Tim Graham for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34217#comment:11>

Reply all
Reply to author
Forward
0 new messages