summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-10-20 19:14:29 +0200
committerAndras Timar <andras.timar@collabora.com>2015-11-03 18:10:21 +0100
commit80f705f0a5b07ac5249822ad5d24c641fa2f3a73 (patch)
treefe2285875ac2f1ebe4c77fdb8c64c705d2010404
parentf86ae4f5b052d22051f33481c1c6115175a186b8 (diff)
tdf#93724 KeySet insert: properly set default values: NULL & right type
Change-Id: I933eed918e18b6923d4e0d24748297cf0dd0088d Reviewed-on: https://gerrit.libreoffice.org/19651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 11ce80e1e7085e2073850056e47e4e997905d286)
-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 b82e7311d07a..6b2400efd826 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -797,7 +797,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 && aIter->second.sDefaultValue.isEmpty())
+ {
+ (_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
{