diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-10-20 19:14:29 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-30 11:22:34 +0000 |
commit | 11ce80e1e7085e2073850056e47e4e997905d286 (patch) | |
tree | c0db39c97352fefece1402ff6c047ff3865b5f1e /dbaccess | |
parent | tdf#93720: Interactive frame insertion is disabled if table is selected (diff) | |
download | core-11ce80e1e7085e2073850056e47e4e997905d286.tar.gz core-11ce80e1e7085e2073850056e47e4e997905d286.zip |
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>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 13 |
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 { |