Skip to content
Permalink
Browse files

[oracle] Fix handling of NULL values when add features to provider

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 Apr 25, 2018
1 parent a4e2e8a commit 32ba7524c3f149ef6b6f3973e4996f5fc7e5cffc
Showing with 1 addition and 1 deletion.
  1. +1 −1 tests/src/python/test_provider_oracle.py
@@ -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

0 comments on commit 32ba752

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