Navigation Menu

Skip to content

Commit

Permalink
[oracle] Fix handling of NULL values when add features to provider
Browse files Browse the repository at this point in the history
Fixes NULL attribute values are incorrectly converted to empty
strings or 0 numeric values instead of NULL.

(cherry-picked from 3a3b0fe)
  • Loading branch information
nyalldawson committed May 24, 2018
1 parent a4e2e8a commit 32ba752
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/src/python/test_provider_oracle.py
Expand Up @@ -67,7 +67,7 @@ def execSQLCommand(self, sql, ignore_errors=False):
def disabled_getSource(self):
# create temporary table for edit tests
self.execSQLCommand('DROP TABLE "QGIS"."EDIT_DATA"', ignore_errors=True)
self.execSQLCommand("""CREATE TABLE QGIS.EDIT_DATA ("pk" INTEGER PRIMARY KEY, "cnt" INTEGER, "name" VARCHAR2(100), "name2" VARCHAR2(100), "num_char" VARCHAR2(100), GEOM SDO_GEOMETRY)""")
self.execSQLCommand("""CREATE TABLE QGIS.EDIT_DATA ("pk" INTEGER GENERATED by default ON null as IDENTITY(START WITH 1 INCREMENT BY 1) PRIMARY KEY, "cnt" INTEGER, "name" VARCHAR2(100), "name2" VARCHAR2(100), "num_char" VARCHAR2(100), GEOM SDO_GEOMETRY)""")
self.execSQLCommand("""INSERT INTO QGIS.EDIT_DATA ("pk", "cnt", "name", "name2", "num_char", GEOM)
SELECT 5, -200, NULL, 'NuLl', '5', SDO_GEOMETRY( 2001,4326,SDO_POINT_TYPE(-71.123, 78.23, NULL), NULL, NULL) from dual
UNION ALL SELECT 3, 300, 'Pear', 'PEaR', '3', NULL from dual
Expand Down

0 comments on commit 32ba752

Please sign in to comment.