Skip to content

Commit

Permalink
[OGR provider] Field type declaration: update with more sensible valu…
Browse files Browse the repository at this point in the history
…es for min/max length

In particular put 0 as minimum length for integer, integer64, real and text fields,
so as to let OGR decide the default (and not limit text fields for format that
don't have limitations)
  • Loading branch information
rouault committed Oct 27, 2016
1 parent 8c7ca62 commit 2e63643
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
open( OpenModeInitial );
mNativeTypes
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), "integer", QVariant::Int, 1, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer)" ), "integer", QVariant::Int, 0, 11 )
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 2000000
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer 64 bit)" ), "integer64", QVariant::LongLong, 1, 10 )
<< QgsVectorDataProvider::NativeType( tr( "Whole number (integer 64 bit)" ), "integer64", QVariant::LongLong, 0, 21 )
#endif
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), "double", QVariant::Double, 1, 20, 0, 15 )
<< QgsVectorDataProvider::NativeType( tr( "Text (string)" ), "string", QVariant::String, 1, 255 )
<< QgsVectorDataProvider::NativeType( tr( "Decimal number (real)" ), "double", QVariant::Double, 0, 20, 0, 15 )
<< QgsVectorDataProvider::NativeType( tr( "Text (string)" ), "string", QVariant::String, 0, 65535 )
<< QgsVectorDataProvider::NativeType( tr( "Date" ), "date", QVariant::Date, 8, 8 );

// Some drivers do not support datetime type
Expand Down

0 comments on commit 2e63643

Please sign in to comment.