jazzband/django-silk

SQL queries not ordered correctly w/ MySQL as db backend

Open

#130 建立於 2016年7月19日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)Python (3,958 star) (319 fork)batch import
enhancementhelp wanted

描述

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.

貢獻者指南