Code

Opened 5 years ago

Closed 5 years ago

#10062 closed (wontfix)

inspectdb could use random field to inspect table

Reported by: phoebebright Owned by: nobody
Component: django-admin.py inspectdb Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Currently uses the first record SELECT * FROM %s LIMIT 1
If there is bad data in the first record it can fail
eg. Warning: Incorrect datetime value: '11437866' for function str_to_time
I know this is really a problem with the database and could potentially be confusing and slow - but how about picking a random record.

SELECT * FROM %s ORDER BY RAND() LIMIT 1

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

That wouldn't solve any problem, since, by the same logic, the random record could contain bad data as well. It's just as likely. You're right about this being a problem with the database (since it let the bad data in there in the first place). This isn't a problem Django should even attempt to solve.

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.