Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ogr2ogr SQL Server bulk driver crash #203

Open
heder opened this issue Dec 1, 2022 · 0 comments
Open

ogr2ogr SQL Server bulk driver crash #203

heder opened this issue Dec 1, 2022 · 0 comments

Comments

@heder
Copy link

heder commented Dec 1, 2022

I have noticed an odd issue with the bulk load functionality in the ogr2ogr SQL Server Spatial driver.

When performing bulk load, my datasets crashes with the progress bar showing a single "0" followed by a silent exit of ogr2ogr.
The event viewer shows an access violation in sqlncli11.dll.
The table is created in the database, but for some reason the load itself fails.

Workaround:
I realised that if i used -select to specify just a few attributes, things seemed to work, BUT when I added the last attribute of the source it crashes.
I also realised that swapping the order of the two last attributes also made the bulk load work. Bug?

SQL Server 2019, SQL Native Client v11.0.7462.6 and ogr2ogr 3.5.3. Tested both x86 and x64 versions.

Repro:

Using this dataset:
https://geodpags.skogsstyrelsen.se/geodataport/data/sksFjallnaragr.zip

This fails:
ogr2ogr -overwrite -progress -f MSSQLSpatial --config MSSQLSPATIAL_USE_BCP TRUE -lco OVERWRITE=YES -lco SCHEMA=dbo "MSSQL:server=localhost;database=Geodata;Trusted_Connection=yes;driver=SQL Server Native Client 11.0" sksFjallnaragr.shp

But this works (note -select swapping columns)
ogr2ogr -overwrite -progress -f MSSQLSpatial --config MSSQLSPATIAL_USE_BCP TRUE -lco OVERWRITE=YES -lco SCHEMA=dbo "MSSQL:server=localhost;database=Geodata;Trusted_Connection=yes;driver=SQL Server Native Client 11.0" sksFjallnaragr.shp -select beskrivnin,objectid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant