Skip to content

Commit

Permalink
MSSQL: Fix for the problem with the length of the numeric fields (#7249)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest committed Feb 27, 2013
1 parent 84db88b commit f5d81ae
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/providers/mssql/qgsmssqlprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,21 @@ void QgsMssqlProvider::loadFields()
{
pkCandidates << query.value( 3 ).toString();
}
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName,
query.value( 7 ).toInt(),
query.value( 6 ).toInt() ) );
if ( sqlType == QVariant::String )
{
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName,
query.value( 7 ).toInt() ) );
}
else
{
mAttributeFields.append(
QgsField(
query.value( 3 ).toString(), sqlType,
sqlTypeName ) );
}

if ( !query.value( 12 ).isNull() )
{
Expand Down

0 comments on commit f5d81ae

Please sign in to comment.