summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-10-20 19:14:29 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2015-10-20 19:15:52 +0200
commit17aaa3fed1fcb0319d76e51a39888b9216f8f16b (patch)
treef9161b9b9bbeac3292ab307ecaad9820c80cd4cc /dbaccess
parenta5d273d66d222cdcaf6edb63c82a886e19963357 (diff)
tdf#93724 KeySet insert: properly set default values: NULL & right type
Change-Id: I933eed918e18b6923d4e0d24748297cf0dd0088d
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/KeySet.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 429ff3040cdf..0497ec322599 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -695,7 +695,18 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ
for(;aIter != aEnd;++aIter)
{
if ( !(_rInsertRow->get())[aIter->second.nPosition].isModified() )
- (_rInsertRow->get())[aIter->second.nPosition] = aIter->second.sDefaultValue;
+ {
+ if(aIter->second.bNullable)
+ {
+ (_rInsertRow->get())[aIter->second.nPosition].setTypeKind(aIter->second.nType);
+ (_rInsertRow->get())[aIter->second.nPosition].setNull();
+ }
+ else
+ {
+ (_rInsertRow->get())[aIter->second.nPosition] = aIter->second.sDefaultValue;
+ (_rInsertRow->get())[aIter->second.nPosition].setTypeKind(aIter->second.nType);
+ }
+ }
}
try
{