jazzband/django-silk

SQL queries not ordered correctly w/ MySQL as db backend

Aperta

#130 aperta il 19 lug 2016

 (1 commento) (0 reazioni) (0 assegnatari)Python (319 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (3958 stelle)
Metriche merge PR
 (Merge medio 4h 49m) (1 PR mergiata in 30 g)

Descrizione

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.

Guida contributor