Skip to content

Commit 2fa7922

Browse files
troopa81nyalldawson
authored andcommittedApr 18, 2023
[Oracle] Fixes #52678 transaction creation
1 parent f6e1064 commit 2fa7922

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎src/providers/oracle/qgsoracleconn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ bool QgsOracleConn::execLogged( const QString &query, bool logError, QString *er
526526

527527
QSqlQuery qry( mDatabase );
528528

529-
const bool res { !exec( qry, query, QVariantList() ) };
529+
const bool res { exec( qry, query, QVariantList() ) };
530530

531531
logWrapper.setQuery( qry.lastQuery() );
532532

‎tests/src/python/test_provider_oracle.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,15 @@ def testNestedInsert(self):
734734
self.vl.addFeature(f) # Should not deadlock during an active iteration
735735
f = next(it)
736736

737+
def testTransactionEditing(self):
738+
tg = QgsTransactionGroup()
739+
tg.addLayer(self.vl)
740+
self.vl.startEditing()
741+
feat = QgsFeature(self.vl.fields())
742+
feat.setAttribute("pk", 6)
743+
self.assertTrue(self.vl.addFeature(feat))
744+
self.vl.rollBack()
745+
737746
def testTimeout(self):
738747
"""
739748
Asserts that we will not deadlock if more iterators are opened in parallel than

0 commit comments

Comments
 (0)
Please sign in to comment.