2 records are inserted instead of 1 on sql error
Components
Labels
None
Description
Context Information
None
Additional information (do not use)
None
Attachments
1
- 13 Mar 2011, 11:41 AM
Activity
Show:
Alex September 19, 2011 at 9:08 PM
Closing, since 5.1.3 release has been released.
Alex May 23, 2011 at 8:00 AM
Fix committed to [b]5.1.x branch/b. Commit Message:
Fixes #0001019: 2 records are inserted instead of 1 on sql error
Dmitry Andrejev May 23, 2011 at 3:26 AM
Thank you Alex, patch tested okay - please commit.
Fixed
Priority
Assignee
Reporter
Alex
AlexDeveloper
Alex
AlexChange Log Message
Fixed accidental database insert queries
Patch Instructions
Patches must be submitted through Phabricator.
To submit patch via Command Line use Patches Workflow (via Arcanist) tutorial.
To submit patch via Web Interface use Patches Workflow (via Web Interface) tutorial.
External issue ID
1019
External issue URL
Fix versions
Affects versions
Created March 13, 2011 at 11:41 AM
Updated December 29, 2024 at 9:13 PM
Resolved September 19, 2011 at 9:08 PM
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.