|Title:||StackOverflow exception from Median aggregate function|
|Last Modified:||2018-01-24 17:00:05|
|Version Found In:||1.0.88|
anonymous added on 2017-12-12 00:20:48:
I am grateful to have used SQLite. A stack overflow occurred with Median function when the number of row was 347,064. This error occurred when the data was arranged regularly. ex) gradually increase(10,20,30,,,,), gradually decrease(100,99,98,,,,), When I looked at the source code, seems to be caused by the map struct getting too deep. It occurred with recursion of the following function. dll:SQLite.Interop.dll (x64) function:node_insert(), node_iterate(), node_destroy() (extension-functions.c) In my debug environment, an error occurred approximately the following number of times. node_insert():15670 node_iterate():1740 node_destroy():1740
mistachkin added on 2018-01-24 16:31:07:
Given the recursive nature of these functions, it's very difficult to prevent stack overflows without completely redesigning them.