Skip to content
Permalink
Browse files

[processing][gdal] Fix empty fid is passed if FID option is not set

Also add full range of unit tests for OgrToPostGis algorithm.

Fixes #19947
  • Loading branch information
nyalldawson committed Sep 25, 2018
1 parent 80723e8 commit 6e03253143e5fbc6bffef09e3e4c46535b7bdab0
@@ -288,9 +288,9 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(self.GEOMTYPE[self.parameterAsEnum(parameters, self.GTYPE, context)])
if len(geocolumn) > 0:
arguments.append(geocolumnstring)
if len(pk) > 0:
if pk:
arguments.append(pkstring)
elif primary_key is not None:
elif primary_key:
arguments.append("-lco FID=" + primary_key)
if len(table) == 0:
table = layername.lower()
@@ -277,9 +277,9 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(self.GEOMTYPE[self.parameterAsEnum(parameters, self.GTYPE, context)])
if len(geocolumn) > 0:
arguments.append(geocolumnstring)
if len(pk) > 0:
if pk:
arguments.append(pkstring)
elif primary_key is not None:
elif primary_key:
arguments.append("-lco FID=" + primary_key)
if len(table) == 0:
table = layername.lower()

0 comments on commit 6e03253

Please sign in to comment.
You can’t perform that action at this time.