Add mode to update only changed fields (when temporary tables not used)

3 views
Skip to first unread message

Alexander Obuhovich

unread,
Jan 29, 2011, 6:05:54 AM1/29/11
to In-Portal Development
Currently when a few fields are changed the form, we update all of them. We are doing so, since MySQL will figure out that himself and won't break anything down.

But when:
  • user validates his email
  • admin approves that user
in the same time, then user can overwrite it's approved status OR admin can overwrite user email validation status.

To solve this problem I propose to add special parameter to kDBItem::Update method OR just do this always, when temporary tables are not used, that will:
  • call kDBItem::GetChangedFields() to get list of changed fields
  • only include that fields in UPDATE sql statement and not all database fields


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Jan 29, 2011, 4:45:45 PM1/29/11
to in-por...@googlegroups.com
Hi Alex,


I see your point and you must be right. I personally have NO problem with doing things in kDBItem::Update method, but we need check and check again that kDBItem::GetChangedFields() properly saves all the changes and Update works as expected.


DA

Alexander Obuhovich

unread,
Jan 29, 2011, 4:47:37 PM1/29/11
to in-por...@googlegroups.com

That is what you'll be doing after I attach the patch :)

Dmitry A.

unread,
Jan 29, 2011, 4:49:43 PM1/29/11
to in-por...@googlegroups.com
Sounds like a plan! ;)

DA
Reply all
Reply to author
Forward
0 new messages