Skip to content
Permalink
Browse files

[OGR provider] Field type declaration: update with more sensible valu…

…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 2e636432965d1da1b950750fb2928bf92d3c0a3d
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/providers/ogr/qgsogrprovider.cpp
@@ -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

0 comments on commit 2e63643

Please sign in to comment.
You can’t perform that action at this time.