Skip to content
Permalink
Browse files
Fix unreported bug in ORACLE provider
Error in spatial index exists check.
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 7460e4f commit a3b9ced8ff754c8c23ea08c6fec2c63e6b5627e7
Showing with 13 additions and 2 deletions.
  1. +4 −0 src/providers/oracle/qgsoracleconn.cpp
  2. +9 −2 tests/src/python/test_qgsproviderconnection_base.py
@@ -1015,6 +1015,10 @@ QString QgsOracleConn::getSpatialIndexName( const QString &ownerName, const QStr
isValid = true;
}
}
else
{
isValid = false;
}
}
else
{
@@ -273,11 +273,18 @@ def _test_operations(self, md, conn):

# Test column names
res = conn.execSql(sql)
self.assertEqual(res.rowCount(), 1)

row_count = res.rowCount()
# Some providers do not support rowCount and return -1
if row_count != -1:
self.assertEqual(row_count, 1)

rows = res.rows()
self.assertEqual(rows, [['QGIS Rocks - \U0001f604', 666, 1.234, 1234, expected_date, QtCore.QDateTime(2019, 7, 8, 12, 0, 12)]])
self.assertEqual(res.columns(), ['string_t', 'long_t', 'double_t', 'integer_t', 'date_t', 'datetime_t'])

self.assertEqual(res.fetchedRowCount(), 1)

# Test iterator
old_rows = rows
res = conn.execSql(sql)
@@ -348,7 +355,7 @@ def _test_operations(self, md, conn):

# Spatial index
spatial_index_exists = False
# we don't initially know if a spatial index exists -- some formats may create them by default, others not
# we don't initially know if a spatial index exists -- some formats may create them by default, others don't
if capabilities & QgsAbstractDatabaseProviderConnection.SpatialIndexExists:
spatial_index_exists = conn.spatialIndexExists(schema, self.myNewTable, self.geometryColumnName)
if capabilities & QgsAbstractDatabaseProviderConnection.DeleteSpatialIndex:

0 comments on commit a3b9ced

Please sign in to comment.