SF #3567118: Fix Nullable handling in trunk

This commit is contained in:
Aleksandar Fabijanic
2012-09-13 04:04:55 +00:00
parent b6b95b8259
commit 5d93d2bba1
4 changed files with 16 additions and 4 deletions

View File

@@ -786,7 +786,8 @@ inline Extraction<T>* into(T& t, const Position& pos)
template <typename T>
inline Extraction<T>* into(T& t, const Position& pos, const T& def)
/// Convenience function to allow for a more compact creation of an extraction object with the given default
/// Convenience function to allow for a more compact creation of an extraction object
/// with multiple recordset support and the given default
{
return new Extraction<T>(t, def, pos);
}

View File

@@ -338,7 +338,7 @@ private:
{
C* pData = new C;
Column<C>* pCol = new Column<C>(mc, pData);
return new InternalExtraction<C>(*pData, pCol, static_cast<Poco::UInt32>(currentDataSet()));
return new InternalExtraction<C>(*pData, pCol, Position(currentDataSet()));
}
template <class C>
@@ -349,7 +349,7 @@ private:
return new InternalBulkExtraction<C>(*pData,
pCol,
static_cast<Poco::UInt32>(getExtractionLimit()),
static_cast<Poco::UInt32>(currentDataSet()));
Position(currentDataSet()));
}
template <class T>

View File

@@ -314,7 +314,7 @@ public:
if (pExt->extract(pos++, val))
{
obj.value(val);
obj = val;
}
else
{

View File

@@ -182,6 +182,17 @@ public:
return !(*this == other) && !(*this < other);
}
C& value()
/// Returns the Nullable's value.
///
/// Throws a NullValueException if the Nullable is empty.
{
if (!_isNull)
return _value;
else
throw NullValueException();
}
const C& value() const
/// Returns the Nullable's value.
///