In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1019 [In-Portal CMS] Database bug report always 2011-03-13 06:41 2011-09-19 16:08
alex  
alex  
normal  
closed 5.1.2-B2  
fixed  
 
none 5.1.3-B1  
https://groups.google.com/d/topic/in-portal-bugs/sRdwqOAzm3g/discussion
Fixed accidental database insert queries
0
0001019: 2 records are inserted instead of 1 on sql error
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.
patch preventing_bonus_db_insert_on_sql_error.patch (570) 2011-03-13 06:41
http://tracker.in-portal.org/file_download.php?file_id=968&type=bug
Issue History
2011-09-19 16:08 alex Note Added: 0003847
2011-09-19 16:08 alex Status resolved => closed
2011-05-23 03:00 alex Note Added: 0003489
2011-05-23 03:00 alex Status reviewed and tested => resolved
2011-05-23 03:00 alex Fixed in Version => 5.1.3-B1
2011-05-23 03:00 alex Resolution open => fixed
2011-05-23 03:00 alex Changeset attached 5.1.x r14347
2011-05-22 22:26 Dmitry Note Added: 0003469
2011-05-22 22:26 Dmitry Assigned To !COMMUNITY => alex
2011-05-22 22:26 Dmitry Status needs testing => reviewed and tested
2011-04-04 11:49 Dmitry Target Version Icebox => 5.1.3
2011-03-13 06:43 alex Assigned To => !COMMUNITY
2011-03-13 06:43 alex Developer => alex
2011-03-13 06:43 alex Status active => needs testing
2011-03-13 06:43 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/sRdwqOAzm3g/discussion
2011-03-13 06:41 alex New Issue
2011-03-13 06:41 alex File Added: preventing_bonus_db_insert_on_sql_error.patch
2011-03-13 06:41 alex Change Log Message => Fixed accidental database insert queries

Notes
(0003469)
Dmitry   
2011-05-22 22:26   
Thank you Alex, patch tested okay - please commit.
(0003489)
alex   
2011-05-23 03:00   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0001019: 2 records are inserted instead of 1 on sql error
(0003847)
alex   
2011-09-19 16:08   
Closing, since 5.1.3 release has been released.