From e15b677a9b03562ab019baed28d0b538a52ae22e Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 10 Nov 2008 08:16:36 +0000 Subject: [PATCH] SqlArray problem git-svn-id: svn://ultimatepp.org/upp/trunk@627 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/SqlCtrl/SqlArray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uppsrc/SqlCtrl/SqlArray.cpp b/uppsrc/SqlCtrl/SqlArray.cpp index 9bd1a31cf..5b85cb37b 100644 --- a/uppsrc/SqlCtrl/SqlArray.cpp +++ b/uppsrc/SqlCtrl/SqlArray.cpp @@ -30,7 +30,7 @@ bool SqlArray::PerformInsert() { ASSERT(IsCursor()); SqlInsert insert(table); for(int i = 0; i < GetIndexCount(); i++) - if(!GetId(i).IsNull()) + if(!GetId(i).IsNull() && (i || !IsNull(GetKey()))) insert(GetId(i), Get(i)); if(!fk.IsNull()) insert(fk, fkv); @@ -69,7 +69,7 @@ bool SqlArray::UpdateRow() { else { SqlUpdate update(table); for(int i = 0; i < GetIndexCount(); i++) - if(!GetId(i).IsNull() && IsModified(i)) + if(!GetId(i).IsNull() && IsModified(i) && (i || lateinsert)) update(GetId(i), Get(i)); if(update) { Session().ClearError();