Skip to content
Permalink
Browse files

Code layout and revert default value for OGR

  • Loading branch information
elpaso committed Jan 28, 2020
1 parent f8e255e commit 439a3aa10469c0f817870bc0fa6904eb6d73bdd2
@@ -1385,7 +1385,7 @@ QVariant QgsOgrProvider::defaultValue( int fieldId ) const

QString defaultVal = mDefaultValues.value( fieldId, QString() );
if ( defaultVal.isEmpty() )
return defaultVal;
return QVariant();

QVariant resultVar = defaultVal;
if ( defaultVal == QStringLiteral( "CURRENT_TIMESTAMP" ) )
@@ -651,7 +651,7 @@ def testSpatialiteDefaultValues(self):
dp = vl.dataProvider()
#FIXME: should it be None?
self.assertTrue(dp.defaultValue(0).isNull())
self.assertTrue(dp.defaultValue(1).isNull())
self.assertIsNone(dp.defaultValue(1))
#FIXME: This fails because there is no backend-side evaluation in this provider
#self.assertTrue(dp.defaultValue(2).startswith(now.strftime('%Y-%m-%d')))
self.assertTrue(dp.defaultValue(3).startswith(now.strftime('%Y-%m-%d')))
@@ -1439,7 +1439,7 @@ def testIdentityPk(self):
self.assertTrue(vl.isValid())
feature = next(vl.getFeatures())
self.assertIsNotNone(feature.id())

def testDefaultValuesAndClauses(self):
"""Test whether default values like CURRENT_TIMESTAMP or
now() they are respected. See GH #33383"""

0 comments on commit 439a3aa

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