You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling ST_Read_Meta('my.shp') against a vanilla shapefile; subsequent calls to ST_Read_Meta() for the same or different shapefiles regularly throw a type mismatch error:
Mismatch Type Error: Type STRUCT("name" VARCHAR, "type" VARCHAR, nullable BOOLEAN) does not match with STRUCT("name" VARCHAR, "type" VARCHAR, nullable BOOLEAN, crs STRUCT("name" VARCHAR, auth_name VARCHAR, auth_code VARCHAR, wkt VARCHAR, proj4 VARCHAR, projjson VARCHAR)). Cannot cast STRUCTs of different size
Sometimes it'll work several times in a row, then fail one or more times, then work again.
Running a debug build yields some different information:
root@5e913d8be5fa:/src# yes "select * from st_read_meta('/mnt/osm_buildings_a.shp');" | $DUCKDB -json -echo -cmd 'load spatial' | cut -c "1-$(tput cols)"
load spatial
select * from st_read_meta('/mnt/osm_buildings_a.shp');
[{"file_name":"/mnt/osm_buildings_a.shp","driver_short_name":"ESRI Shapefile","driver_long_name":"ESRI Shap
select * from st_read_meta('/mnt/osm_buildings_a.shp');
[{"file_name":"/mnt/osm_buildings_a.shp","driver_short_name":"ESRI Shapefile","driver_long_name":"ESRI Shap
select * from st_read_meta('/mnt/osm_buildings_a.shp');
[{"file_name":"/mnt/osm_buildings_a.shp","driver_short_name":"ESRI Shapefile","driver_long_name":"ESRI Shap
/src/spatial/src/spatial/gdal/file_handler.cpp:87:10: runtime error: load of value 32, which is not a valid value for type 'bool'
(with a similar pattern of successes/failures as in the SQL errors above)
And this patch seems to fix it in some limited testing: I can see an undefined behaviour path by calling DuckDBFileHandle::Eof() before any calls to DuckDBFileHandle::Seek().
Calling
ST_Read_Meta('my.shp')
against a vanilla shapefile; subsequent calls toST_Read_Meta()
for the same or different shapefiles regularly throw a type mismatch error:Mismatch Type Error: Type STRUCT("name" VARCHAR, "type" VARCHAR, nullable BOOLEAN) does not match with STRUCT("name" VARCHAR, "type" VARCHAR, nullable BOOLEAN, crs STRUCT("name" VARCHAR, auth_name VARCHAR, auth_code VARCHAR, wkt VARCHAR, proj4 VARCHAR, projjson VARCHAR)). Cannot cast STRUCTs of different size
Sometimes it'll work several times in a row, then fail one or more times, then work again.
CLI Reproducer
ogrinfo
output for the shapefileSoftware/OS details
Reproducing
The text was updated successfully, but these errors were encountered: