postgres provider: fix indexing of default values (fixes #12996; folloup 61f39d6f)

This commit is contained in:
Juergen E. Fischer 2015-06-30 17:44:46 +02:00
parent 79d37c1a8b
commit b1dac74f2b

View File

@ -1785,12 +1785,12 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
if ( value.isNull() )
{
const QgsField &fld = field( attrIdx );
v = paramValue( defaultValues[ attrIdx ], defaultValues[ attrIdx ] );
v = paramValue( defaultValues[ i ], defaultValues[ i ] );
features->setAttribute( attrIdx, convertValue( fld.type(), v ) );
}
else
{
v = paramValue( value.toString(), defaultValues[ attrIdx ] );
v = paramValue( value.toString(), defaultValues[ i ] );
if ( v != value.toString() )
{