[Django] #33715: Prevent MySQL dbshell from exiting on Ctrl-C

1 view
Skip to first unread message

Django

unread,
May 17, 2022, 12:56:13 PM5/17/22
to django-...@googlegroups.com
#33715: Prevent MySQL dbshell from exiting on Ctrl-C
-------------------------------------+-------------------------------------
Reporter: andrew- | Owner: nobody
cybsafe |
Type: | Status: new
Cleanup/optimization |
Component: Core | Version: 4.0
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Currently, pressing Ctrl-C in a MySQL dbshell will exit the program with a
KeyboardInterrupt exception. In the mysql command line client, Ctrl-C will
cancel the current command or clear the current command buffer if a
command is not running. This is a similar issue to one that affected the
PostgreSQL dbshell - see: #27954.

To fix this, we can override the SIGINT handler in the same way as for the
PostgreSQL client. Or perhaps we can move this functionality from the
django.db.backends.postgresql.client to the django.db.backends.base.client
module, so that all db backends can benefit from Ctrl-C working as per the
underlying db command line client.

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

Django

unread,
May 18, 2022, 1:28:47 AM5/18/22
to django-...@googlegroups.com
#33715: Prevent MySQL dbshell from exiting on Ctrl-C
-------------------------------------+-------------------------------------
Reporter: Andrew Roberts | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Core (Management | Version: dev
commands) |
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 Mariusz Felisiak):

* version: 4.0 => dev
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/33715#comment:1>

Django

unread,
May 20, 2022, 1:02:41 AM5/20/22
to django-...@googlegroups.com
#33715: Prevent MySQL dbshell from exiting on Ctrl-C
-------------------------------------+-------------------------------------
Reporter: Andrew Roberts | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned

Component: Core (Management | Version: dev
commands) |
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 Mariusz Felisiak):

* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/33715#comment:2>

Django

unread,
May 20, 2022, 1:12:18 AM5/20/22
to django-...@googlegroups.com
#33715: Prevent MySQL dbshell from exiting on Ctrl-C
-------------------------------------+-------------------------------------
Reporter: Andrew Roberts | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed

Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed

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 GitHub <noreply@…>):

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


Comment:

In [changeset:"1a78ef2b85467a18ea6d7eaa4b27f67d11c87b9e" 1a78ef2]:
{{{
#!CommitTicketReference repository=""
revision="1a78ef2b85467a18ea6d7eaa4b27f67d11c87b9e"
Fixed #33715 -- Allowed keyboard interrupt to abort queries in MySQL
dbshell.
}}}

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

Reply all
Reply to author
Forward
0 new messages