pv2b 0284c689c3 Fix per-link stats in extractstats
There was a bug where traffic would be attributed to the wrong links.
The root cause was that "values %knownlinks" was used to get a list
of keys corresponding to database columns, that was then used to
insert values into the database, in the same order.

The problem is that there's no guarantee that "values %knownlinks"
will always generate the tags in the same order. Indeed on my system,
it generates different order every time.

To make sure the order the column names is generated in is stable,
from now on, it will sort the column names. Also, it will check the
database schema to see if the column names are in the expected order,
and if required re-create the database if the column order has
changed.
2023-04-24 16:18:48 +02:00
..