home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 803773484

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/1268#issuecomment-803773484 https://api.github.com/repos/simonw/datasette/issues/1268 803773484 MDEyOklzc3VlQ29tbWVudDgwMzc3MzQ4NA== 9599 2021-03-22T05:32:29Z 2021-03-22T05:32:29Z OWNER

To figure out which SQL query triggers the problem I added this code to write to a log file: python with sqlite_timelimit(conn, time_limit_ms): try: cursor = conn.cursor() with open("/tmp/sql.log", "ab", buffering=0) as fp: fp.write(("{}: {}\n".format(sql, params)).encode("utf-8")) cursor.execute(sql, params if params is not None else {}) I had to use ab binary mode because Python doesn't allow buffering=0 for non-binary file operations.

With the log enabled, I used docker exec -it 589ae68de943 bash to attach to the running container and tail -f /tmp/sql.log to see the logs. Here's where it broke:

select count(*) from [idx_civici_geom_parent]: None select count(*) from [sqlite_stat1]: None select count(*) from [sqlite_stat3]: None select count(*) from [SpatialIndex]: None So attempting to run a count(*) against the SpatialIndex virtual table is the thing that triggers the bug.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
837308703  
Powered by Datasette · Queries took 40.877ms · About: github-to-sqlite