data.key passed as number leads to sqlite type affinity problems #20

Closed
springmeyer opened this Issue Apr 20, 2012 · 0 comments

Comments

Projects
None yet
1 participant
Member

springmeyer commented Apr 20, 2012

data.key can be passed as a number by tilelive at https://github.com/mapbox/node-mbtiles/blob/master/lib/mbtiles.js#L552.

This is the cause of https://github.com/mapbox/tilemill/issues/1368.

This can lead to floating point numbers being pushed into sqlite for the rows that reference duplicate tiles, leading to broken lookups:

sqlite> SELECT i.tile_id FROM images i WHERE NOT EXISTS (SELECT m.tile_id FROM map m WHERE m.tile_id = i.tile_id);
-3101615871
-4294967295
sqlite> SELECT i.tile_id FROM images i WHERE NOT EXISTS (SELECT m.tile_id FROM map m WHERE CAST(m.tile_id as string) = CAST(i.tile_id as string));
sqlite> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment