[Libreoffice-commits] core.git: dbaccess/source

Lionel Elie Mamane lionel at mamane.lu
Tue Oct 20 10:16:32 PDT 2015


 dbaccess/source/core/api/KeySet.cxx |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 17aaa3fed1fcb0319d76e51a39888b9216f8f16b
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

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 429ff30..0497ec3 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
         {


More information about the Libreoffice-commits mailing list