File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ bool QgsVectorLayerEditBuffer::commitChanges( QStringList& commitErrors )
319
319
attributeChangesOk = false ; // don't try attribute updates - they'll fail.
320
320
}
321
321
322
- for ( int i = 0 ; i < oldFields.count (); ++i )
322
+ for ( int i = 0 ; i < qMin ( oldFields.count (), newFields. count () ); ++i )
323
323
{
324
324
const QgsField& oldField = oldFields[i];
325
325
const QgsField& newField = newFields[i];
Original file line number Diff line number Diff line change @@ -1452,7 +1452,7 @@ bool QgsOracleProvider::addAttributes( const QList<QgsField> &attributes )
1452
1452
1453
1453
for ( QList<QgsField>::const_iterator iter = attributes.begin (); iter != attributes.end (); ++iter )
1454
1454
{
1455
- QString type = iter->typeName ();
1455
+ QString type = iter->typeName (). toLower () ;
1456
1456
if ( type == " char" || type == " varchar2" )
1457
1457
{
1458
1458
type = QString ( " %1(%2 char)" ).arg ( type ).arg ( iter->length () );
@@ -1489,6 +1489,7 @@ bool QgsOracleProvider::addAttributes( const QList<QgsField> &attributes )
1489
1489
}
1490
1490
1491
1491
qry.finish ();
1492
+
1492
1493
}
1493
1494
1494
1495
if ( !db.commit () )
@@ -1504,6 +1505,11 @@ bool QgsOracleProvider::addAttributes( const QList<QgsField> &attributes )
1504
1505
returnvalue = false ;
1505
1506
}
1506
1507
1508
+ if ( !loadFields () )
1509
+ {
1510
+ QgsMessageLog::logMessage ( tr ( " Could not reload fields." ), tr ( " Oracle" ) );
1511
+ }
1512
+
1507
1513
return returnvalue;
1508
1514
}
1509
1515
@@ -1562,6 +1568,11 @@ bool QgsOracleProvider::deleteAttributes( const QgsAttributeIds& ids )
1562
1568
returnvalue = false ;
1563
1569
}
1564
1570
1571
+ if ( !loadFields () )
1572
+ {
1573
+ QgsMessageLog::logMessage ( tr ( " Could not reload fields." ), tr ( " Oracle" ) );
1574
+ }
1575
+
1565
1576
return returnvalue;
1566
1577
}
1567
1578
You can’t perform that action at this time.
0 commit comments