flightaware / speedtables

Speed tables is a high-performance memory-resident database. The speed table compiler reads a table definition and generates a set of C access routines to create, manipulate and search tables containing millions of rows. Currently oriented towards Tcl.
https://flightaware.github.io/speedtables/
BSD 3-Clause "New" or "Revised" License
66 stars 16 forks source link

stapi open_cached doesn't handle newlines in varchar fields #1

Closed nugget closed 15 years ago

nugget commented 15 years ago

I've got a table I'm caching with ::stapi::init_ctable and ::stapi::open_cached. One of the varchar fields in the backing database table contains a trailing newline.

If no .tsv exists in the ctables directory, open_cached reads everything in the first time without complaint, but if I restart the application and it attempts to use the cached .tsv data it crashes.

Inspecting the .tsv file I see that there's a literal ^M in the file, which breaks the record into two lines.

resuna commented 15 years ago

Added "-quote escape" to read_tabsep and write_tabsep in stapi/server/server.tcl