Code

Opened 2 years ago

Closed 2 years ago

#17300 closed Bug (fixed)

Creating an already existing cache table shouldn't crash

Reported by: claudep Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When you run ./manage.py createcachetable two times with the same table argument, the command crashes the second time. I think we should display a proper error message instead.

Attachments (3)

17300-1.diff (2.3 KB) - added by claudep 2 years ago.
Catch database error and display error message
17300-2.diff (3.0 KB) - added by claudep 2 years ago.
Same patch with mysql returning utils.DatabaseError
17300-3.diff (2.3 KB) - added by claudep 2 years ago.
New patch after 17513 resolution

Download all attachments as: .zip

Change History (8)

Changed 2 years ago by claudep

Catch database error and display error message

comment:1 Changed 2 years ago by claudep

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set

The attached patch is currently failing with MySQL as the error raised is MySQLdb.OperationalError instead of db.utils.DatabaseError.

comment:2 Changed 2 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

Changed 2 years ago by claudep

Same patch with mysql returning utils.DatabaseError

comment:3 Changed 2 years ago by claudep

  • Patch needs improvement unset

comment:4 Changed 2 years ago by claudep

The MySQL OperationalError issue has been filed separately in #17513

Changed 2 years ago by claudep

New patch after 17513 resolution

comment:5 Changed 2 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [17363]:

Fixed #17300 -- Prevented createcachetable from crashing when the cache table already exists. Thanks Claude Paroz.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.