Skip to content

Commit

Permalink
mssql provider: make mapping of import fields case-insensitive
Browse files Browse the repository at this point in the history
(cherry picked from commit 6f7a999)
  • Loading branch information
jef-n committed Jun 30, 2016
1 parent 46d4042 commit a3dfd9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -1851,7 +1851,7 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer(
QgsField fld = fields[i];
if ( oldToNewAttrIdxMap && fld.name() == primaryKey )
{
oldToNewAttrIdxMap->insert( fields.indexFromName( fld.name() ), 0 );
oldToNewAttrIdxMap->insert( fields.fieldNameIndex( fld.name() ), 0 );
continue;
}

Expand All @@ -1872,7 +1872,7 @@ QgsVectorLayerImport::ImportError QgsMssqlProvider::createEmptyLayer(

flist.append( fld );
if ( oldToNewAttrIdxMap )
oldToNewAttrIdxMap->insert( fields.indexFromName( fld.name() ), offset++ );
oldToNewAttrIdxMap->insert( fields.fieldNameIndex( fld.name() ), offset++ );
}

if ( !provider->addAttributes( flist ) )
Expand Down

0 comments on commit a3dfd9d

Please sign in to comment.