jazzband/django-silk

SQL queries not ordered correctly w/ MySQL as db backend

Ouverte

#130 ouverte le 19 juil. 2016

 (1 commentaire) (0 réaction) (0 personne assignée)Python (319 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (3 958 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

In https://github.com/django-silk/silk/blob/master/silk/views/sql.py#L23 the queries are ordered by start_time, which on mysql is defined as start_time datetime DEFAULT NULL.

Datetime without further specification has no microsecond precision in MySQL. As a result, the queries do not order correctly.

In our fork, I implemented a quick hack to address this by using the auto incrementing primary key for ordering.

I'm not sure what the level of MySQL support is and if this sort of change is a good idea for other platforms. Therefore not opening a PR, just opening this issue to track the bug.

Guide contributeur