2 records are inserted instead of 1 on sql error

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Mar 13, 2011, 7:41:29 AM3/13/11
to In-Portal Bugs
Class kDBConnection has nice method called doInsert, that allows to insert data into database. It also can work in collect-only mode, when values are collected and then inserted using single database query, like INSERT .. VALUES (...),(...),(...) to improve execution speed.

In case, when all sql errors doesn't cause fatal error (e.g. debugger is disabled), then this could happen:
  • you have 2 inserts into different tables to be executed one after another
  • first insert fails, since database table corruption
  • second insert tries to insert values from first insert and it's own values together resulting a failure, since column mismatch occurs.


Ready for testing.
preventing_bonus_db_insert_on_sql_error.patch
Reply all
Reply to author
Forward
0 new messages