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
65 stars 15 forks source link

stapi::refresh_ctable does not handle SQL generation errors #52

Closed mutability closed 8 years ago

mutability commented 8 years ago

If gen_refresh_ctable_sql returns 0 to indicate an error, refresh_ctable does not handle this and tries to execute it as SQL, which fails:

03/17/2016 12:05:15 speedtable refresh of airline_fleets failed: ERROR:  syntax error at or near "0"
LINE 1: 0
        ^
resuna commented 8 years ago

I've got a fix for this in the stapi-fixes branch.

What was the root cause of gen_refresh_ctable_sql returning zero? I'm not seeing how that could happen without a problem elsewhere.

mutability commented 8 years ago

The cause was #53

resuna commented 8 years ago

Ah, OK. This should make that kind of failure easier to debug anyway.

I'll get started on #53 - that's not a use case I had ever considered.

resuna commented 8 years ago

I have rebased the stapi-fixes branch up to master. Can you please verify that it fixes this problems so I can merge it back?

resuna commented 8 years ago

Fixed in stapi-fixes.