[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - dbaccess/source
Lionel Elie Mamane
lionel at mamane.lu
Fri Oct 30 04:22:56 PDT 2015
dbaccess/source/core/api/KeySet.cxx | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 11ce80e1e7085e2073850056e47e4e997905d286
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Tue Oct 20 19:14:29 2015 +0200
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 at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index b82e731..6b2400e 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
{
More information about the Libreoffice-commits
mailing list