Skip to content

Commit

Permalink
FIX #34482, clear values for piecewise read mode (otherwise it concat…
Browse files Browse the repository at this point in the history
…enates current default value with default value of the previous row in result)

(cherry picked from commit 3f2fb5a)
  • Loading branch information
speillet authored and nyalldawson committed Jun 19, 2020
1 parent 7740861 commit f2b3f83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/oracle/ocispatial/qsql_ocispatial.cpp
Expand Up @@ -3476,7 +3476,10 @@ bool QOCISpatialResult::gotoNext( QSqlCachedResult::ValueCache &values, int inde

// need to read piecewise before assigning values
if ( r == OCI_SUCCESS && piecewise )
{
values.clear();
r = d->cols->readPiecewise( values, index );
}

if ( r == OCI_SUCCESS )
d->cols->getValues( values, index );
Expand Down
1 change: 1 addition & 0 deletions tests/src/python/test_provider_oracle.py
Expand Up @@ -220,6 +220,7 @@ def testDateInsertion(self):
def testDefaultValue(self):
self.assertEqual(self.source.defaultValue(1), NULL)
self.assertEqual(self.source.defaultValue(2), "'qgis'")
self.assertEqual(self.source.defaultValue(3), "'qgis'")

def testPoints(self):
vl = QgsVectorLayer('%s table="QGIS"."POINT_DATA" (GEOM) srid=4326 type=POINT sql=' %
Expand Down

0 comments on commit f2b3f83

Please sign in to comment.